/* Amelia Event Tickets: wrapper around Amelia's own ticket panel. */

.aet-tickets,
.aet-tickets *,
.aet-tickets *::before,
.aet-tickets *::after {
    box-sizing: border-box;
}

.aet-tickets {
    width: 100%;
    background: transparent;
    line-height: 1.5;
}

/* Empty until Amelia's app mounts: keep the space so the page doesn't jump. */
.aet-tickets__panel:empty {
    min-height: 160px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(26, 44, 55, .04), rgba(26, 44, 55, .08), rgba(26, 44, 55, .04));
    background-size: 200% 100%;
    animation: aet-loading 1.2s ease-in-out infinite;
}

.aet-tickets__footer {
    margin-top: 16px;
}

.aet-tickets--sticky .aet-tickets__footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
}

/* Amelia's book bar already has its own background, shadow and padding. */
.aet-tickets__footer .wpa-events__book-button {
    width: 100%;
}

/*
 * Ticket grid: up to --aet-columns per row, never narrower than --aet-card-min
 * (so it drops to fewer columns on small screens by itself).
 * Selector is stronger than Amelia's scoped ".wpa-events__tickets-list[data-v-…]".
 */
.aet-tickets.amelia-wpa .wpa-events__tickets-list,
.aet-preview .aet-preview__list {
    display: grid;
    gap: 16px;
    padding-right: 0;
    grid-template-columns: repeat(
        auto-fill,
        minmax(
            min(100%, max(var(--aet-card-min, 230px), calc((100% - (var(--aet-columns, 1) - 1) * 16px) / var(--aet-columns, 1)))),
            1fr
        )
    );
    align-items: stretch;
}

.aet-tickets.amelia-wpa .wpa-events__ticket-card {
    height: 100%;
    margin: 0;
}

/* Narrow cards: keep the ticket name whole and move "N places left" to the next line. */
.aet-tickets.amelia-wpa .wpa-events__ticket-summary {
    flex-wrap: wrap;
    row-gap: 2px;
}

.aet-tickets.amelia-wpa .wpa-events__ticket-cat {
    word-break: normal;
    overflow-wrap: break-word;
    min-width: 0;
}

/* Optional scrolling box for long ticket lists. */
.aet-tickets--scroll .wpa-events__tickets-list {
    max-height: var(--aet-list-height);
    overflow-y: auto;
}

@keyframes aet-loading {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* Setup messages (only shown to editors) and the "unavailable" message. */
.aet-notice,
.aet-unavailable {
    padding: 16px 20px;
    border: 1px solid #d1d5d7;
    border-radius: 8px;
    background: #fff;
    color: #1a2c37;
    font-size: 15px;
}

.aet-notice {
    border-color: #cca20c;
    background: #fffbea;
}

.aet-unavailable p {
    margin: 4px 0 0;
    color: #667279;
}

/* Static preview inside the Elementor editor. */
.aet-preview {
    font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #1a2c37;
}

.aet-preview__title {
    font-size: 18px;
    font-weight: 500;
}

.aet-preview__sub {
    margin-top: 4px;
    font-size: 15px;
    color: #4d5b63;
}

.aet-preview__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.aet-preview__card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid #d1d5d7;
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
    line-height: 24px;
}

.aet-preview__info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2px 12px;
    padding: 12px 12px 8px;
}

.aet-preview__name {
    font-weight: 700;
}

.aet-preview__left {
    color: #1a2c37;
}

.aet-preview__buy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: auto;
    padding: 8px 12px 16px;
    border-top: 1px solid #d1d5d7;
}

.aet-preview__price {
    font-size: 14px;
    font-weight: 500;
    color: #1246d6;
    white-space: nowrap;
}

.aet-preview__qty {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 114px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #d1d5d7;
    border-radius: 6px;
}

.aet-preview__footer {
    margin-top: 16px;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 -4px 12px rgba(15, 23, 42, .08);
}

.aet-preview__btn {
    display: block;
    padding: 8px 24px;
    border-radius: 6px;
    background: #265cf2;
    color: #fff;
    font-weight: 500;
    text-align: center;
}

.aet-preview__hint {
    margin-top: 8px;
    font-size: 12px;
    color: #808a90;
}
