/* Ticket purchase page (events/ticket/index.php, state=start) -- scaffolding layout */

/* Hidden on desktop -- <event-preview-panel> in the sidebar shows its own copy of the same event
   photos there (see TicketListController.js's buildEventPreviewMedia()/buildMobileMediaBanner()).
   Shown above the whole template on mobile, since .ticket-page-side-column below disappears
   entirely at the same breakpoint and would otherwise leave mobile visitors with no event photos
   at all. */
.ticket-mobile-media {
    display: none;
}

@media (max-width: 1192px) {
    .ticket-mobile-media {
        display: block;
        margin-bottom: 24px;
    }

    .ticket-mobile-media img {
        display: block;
        width: 100%;
        aspect-ratio: 16 / 9;
        object-fit: contain;
        border-radius: 8px;
        background: var(--bg-subtle, #F5F6F6);
    }

    .ticket-mobile-media carousel-element {
        display: block;
        width: 100%;
    }
}

/* 3/5 - 2/5 split with <application-list-template> and the sidebar as plain siblings (not
   nested) so the sidebar's top edge lines up with the template's own header/tabs row, not just
   with the search bar further down. */
.ticket-page-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 32px;
}

@media (min-width: 1600px) {
    .ticket-page-layout {
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }
}

.ticket-page-layout application-list-template {
    min-width: 0;
}

/* stacks the filter panel under the fixed #eventeny-navbar (z-index 100) */
.ticket-page-toolbar {
    display: flex;
    margin-bottom: 16px;
    position: relative;
    z-index: 99;
}

.ticket-cards-root {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ticket-page-toolbar search-bar-component {
    flex: 1 1 auto;
}

.ticket-search-filter-menu {
    background: var(--bg-default, #FFFFFF);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 400px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-row-inline {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.filter-row-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #222222);
}

.filter-divider {
    border: 0;
    border-top: 1px solid var(--border-default, #DCE0E0);
    width: 100%;
    margin: 0;
}

/*
 * Mobile filter modal (see wireMobileFilterModal() in ticket-purchase-page.js): the exact same
 * .ticket-search-filter-menu node gets moved into <modal-element id="ticket-filter-modal">'s body
 * on open, not cloned -- its own dropdown-panel chrome (border/shadow/background/min-width) would
 * just double up inside the modal's own box, so it's neutralized here. The embedded Reset button
 * moves along with it (it's the last child of the filter menu) but is redundant with the modal's
 * own footer Reset, so it's hidden rather than shown a second time.
 */
.ticket-search-filter-menu.in-modal {
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: 0;
}

.ticket-search-filter-menu.in-modal #ticket-filter-reset {
    display: none;
}

.ticket-filter-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* Matches <application-list-template>'s own internal padding (1rem top, 2rem right) so the
   panel's top/right edges line up with the template's header row instead of sitting flush
   against the viewport edge. */
.ticket-page-side-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    padding: 1rem 2rem 1rem 0;
}

@media (min-width: 1193px) {
    /* base-2017-05-15.css sets #body_wrapp{overflow:hidden} site-wide, which breaks
       .ticket-page-side-column's position:sticky below (same fix as
       css/legal-saas-2026-04-23.css's own #body_wrapp{overflow:visible} override). */
    #body_wrapp {
        overflow: visible;
    }

    .ticket-page-side-column {
        position: sticky;
        top: 80px;
        align-self: flex-start;
    }
}

/* Border/padding are shop-page-only (not owned by <cart-recap-panel> itself, since the checkout
   flow reuses that same component without this treatment). */
#cart-recap-panel {
    border-radius: 8px;
    border: 1px solid var(--border-default, #9DA6A5);
}

/* Persistent mobile summary bar (see CartSummaryController.js's mobile wiring) -- total + "View
   cart"/"Continue to checkout". Above the bottom-sheet's own default z-index (1000, see
   BottomSheet.js) so it stays visible whether the sheet is closed, peek, or full. Hidden on
   desktop (below), and hidden/shown by JS depending on whether the cart has items. */
.ticket-cart-footer-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-default, #FFFFFF);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

.ticket-cart-footer-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 600;
}

.ticket-cart-footer-edit {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 400;
    color: var(--link-default, #026E80);
    text-decoration: underline;
    cursor: pointer;
}

.ticket-cart-footer-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    cursor: pointer;
}

/* the caret only -- the amount beside it keeps the row's own text color */
.ticket-cart-footer-toggle i {
    color: var(--link-default, #026E80);
}

.ticket-cart-footer-edit:focus-visible,
.ticket-cart-footer-toggle:focus-visible {
    outline: none;
    border-radius: 4px;
    box-shadow: 0 0 0 2px var(--brand-primary, #038580);
}

.ticket-cart-footer-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Same dim-and-spin treatment as #cart-recap-panel's own loading overlay (CartRecapPanel.js)
   while a calculate_totals request is in flight. */
.ticket-cart-footer-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

.ticket-cart-footer-loading-overlay[hidden] {
    display: none;
}

.ticket-cart-footer-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #C4CAC9;
    border-top-color: var(--secondary-2, #038580);
    animation: ticket-cart-footer-spin 0.8s linear infinite;
}

@keyframes ticket-cart-footer-spin {
    to { transform: rotate(360deg); }
}

/* The bottom-sheet already provides its own border-radius/framing -- this border is
   desktop-sidebar-only. */
bottom-sheet[mode="sheet"] #cart-recap-panel {
    border: none;
    border-radius: 0;
}

/* Below the breakpoint the side column drops out entirely (event-preview-panel/cart-recap-panel
   are a sidebar-only concept) and the cards column takes the full width on its own. Matches
   TicketListController.SIDEBAR_BREAKPOINT. */
@media (max-width: 1192px) {
    .ticket-page-layout {
        display: block;
    }

    .ticket-page-side-column {
        display: none;
    }

    body:has(.ticket-page-layout) .ticket-cart-footer-bar:not([hidden]) {
        display: flex;
    }
}

@media (max-width: 768px) {
    .ticket-cart-footer-bar:not([hidden]) {
        display: flex;
    }

    /* seat picker sheet: map ends above the fixed cart footer bar */
    body:has(#ticket-cart-footer-bar:not([hidden])) #seat-picker-sheet seat-picker-layout {
        box-sizing: border-box;
        padding-bottom: var(--cart-footer-clearance, 112px);
    }

    /* Tighter header/content padding than <application-list-template>'s own desktop default
       (1rem 2rem .5rem / .5rem 2rem 1rem) -- less horizontal breathing room needed once the page
       is single-column and edge-to-edge on mobile. See that component's own --template-header-padding/
       --template-content-padding custom properties (js/Layouts/SectionTemplates/ApplicationListTemplate.js). */
    .ticket-page-layout application-list-template {
        --template-header-padding: 1rem 1rem .5rem;
        --template-content-padding: .5rem 1rem 1rem;
    }
}

/*
 * Same breakpoint as TicketCard.js/TicketGroupSection.js's own mobile styles (640px, not this
 * file's 768px sidebar-collapse breakpoint) -- their edge-to-edge hairline borders only look
 * right once the container they're drawn in is itself edge-to-edge. <application-list-template>'s
 * own shadow-DOM .template-content padding is left/right 1rem here (640px is nested inside the
 * 768px block above, which already overrides --template-content-padding down from the component's
 * 2rem desktop default to 1rem) -- since that padding lives in a different component's shadow DOM,
 * it can't be targeted directly, so the negative margin here just cancels it out geometrically
 * instead. If --template-content-padding's mobile override above ever changes, this -1rem/+2rem
 * must change with it.
 */
@media (max-width: 640px) {
    /*
     * Flat (no-group) mode's cards sit directly here, so the container's own gap IS the
     * card-to-card gap -- always 0, since row spacing/the divider between cards comes from each
     * card's own ".ticket-row" wrapper below instead (see .ticket-row further down). Grouped
     * mode's 12px between groups is applied separately below, on the <ticket-group-section>s
     * themselves, since only they need it -- never the cards/rows.
     */
    .ticket-cards-root {
        gap: 0;
        margin-left: -1rem;
        margin-right: -1rem;
        width: calc(100% + 2rem);
    }

    .ticket-cards-root > ticket-group-section:not(:first-child) {
        margin-top: 12px;
    }

    /*
     * Plain wrapper TicketListController.js's appendTicket() puts around every card before
     * appending it (flat here, or into a <ticket-group-section> -- see that component's own
     * matching ::slotted(.ticket-row) rule, same declarations duplicated across the shadow
     * boundary) so the divider/row padding lives entirely outside the card, which stays unaware
     * of it. The card itself only grows a real border for selected/cart-added/error states
     * (js/Layouts/TicketPurchase/TicketCard.js's own mobile block).
     */
    .ticket-cards-root > .ticket-row {
        padding: 12px 8px !important;
        border-bottom: 0.5px solid var(--border-default, #C4CAC9) !important;
    }

    .ticket-cards-root > .ticket-row:last-child {
        border-bottom: none !important;
    }
}

/* Pairing drawer content (TicketListController.js) */
.pairing-companion-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--border-default, #EBEDED);
    border-bottom: 1px solid var(--border-default, #EBEDED);
}

.pairing-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #222222);
}

.pairing-section-subtitle {
    font-size: 14px;
    color: var(--text-secondary, #5E6463);
    margin-top: -12px;
}

.pairing-companion-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pairing-companion-section + .timeslot-selection-section {
    border-top: none;
}

/* collapsible section header (pairing + timeslots) */
.collapsible-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.collapsible-section-toggle {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    color: var(--text-primary, #222222);
    cursor: pointer;
}

.collapsible-section-toggle i {
    font-size: 24px;
    line-height: 1;
}

.collapsible-section-toggle:hover {
    background: var(--bg-subtle, #F5F6F6);
}

.collapsible-section-toggle:focus-visible {
    outline: 2px solid var(--border-focused, #026E80);
    outline-offset: 2px;
}

.collapsible-section-body[hidden] {
    display: none !important;
}

/* "Select seats" under a multi-type ticket's selection sections */
.seat-select-button {
    margin-top: 16px;
}

/* One allowed companion ticket, inside a pairing ticket's drawer content. */
.pairing-companion-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-subtle, #F5F6F6);
    border-radius: 8px;
    border: 1px solid transparent;
}

.pairing-companion-panel:hover {
    border-color: #3F4242;
}

/* White (not the panel's own #F5F6F6) so the placeholder box stays visible when there's no image. */
.pairing-companion-thumb {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    background: var(--bg-default, #FFFFFF);
    overflow: hidden;
}

.pairing-companion-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pairing-companion-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pairing-companion-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ticket-text-primary, #222222);
    overflow-wrap: anywhere;
}

.pairing-companion-date {
    font-size: 12px;
    color: var(--ticket-text-secondary, #5E6463);
}

/* Subtotal, per-unit, then the +/stepper control -- stacked, right-aligned. */
.pairing-companion-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.pairing-companion-total {
    font-weight: 600;
    color: var(--ticket-text-primary, #222222);
}

.pairing-companion-per-unit {
    font-size: 14px;
    color: var(--ticket-text-secondary, #5E6463);
}

/* Timeslot selection drawer content (TicketListController.js) */
.timeslot-selection-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--border-default, #EBEDED);
}

.timeslot-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #222222);
}

.timeslot-days-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.timeslot-day-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeslot-day-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, #5E6463);
}

/* "Date" label + date-picker-element, shown instead of a day list once there are at least
   TIMESLOT_DATE_PICKER_THRESHOLD days. */
.timeslot-date-picker-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeslot-date-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #222222);
}

/* Regular (non-compact) card: full-width row, icons at left, action at right. */
.timeslot-slot-card {
    border: 1px solid var(--border-default, #C4CAC9);
    border-radius: 8px;
    padding: 12px 16px;
}

.timeslot-slot-card:not(.timeslot-slot-card-compact) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.timeslot-slot-card:hover {
    border-color: #3F4242;
}

.timeslot-slot-card-selected,
.timeslot-slot-card-selected:hover {
    border-color: var(--brand-primary, #038580);
}

.timeslot-slot-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timeslot-slot-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ticket-text-primary, #222222);
}

.timeslot-slot-time i {
    font-size: 20px;
    color: var(--brand-primary, #038580);
}

.timeslot-slot-duration {
    /* Aligns with the time text above, not its icon (20px icon + 4px gap). */
    margin-left: 24px;
    font-size: 14px;
    color: var(--ticket-text-secondary, #5E6463);
}

.timeslot-slot-spots {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--ticket-text-secondary, #5E6463);
}

.timeslot-slot-spots i {
    font-size: 16px;
}

.timeslot-slot-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.timeslot-slot-surcharge {
    font-size: 12px;
    color: var(--ticket-text-secondary, #5E6463);
}

/* Compact card: square, no icons, stacked time/duration/action -- once a day has at least
   TIMESLOT_COMPACT_THRESHOLD slots. */
.timeslot-slot-grid {
    display: grid;
    grid-template-columns: repeat(4, 138px);
    gap: 12px;
}

@media (max-width: 768px) {
    .timeslot-slot-grid {
        grid-template-columns: repeat(3, 138px);
    }
}

/* 3 columns of 138px no longer fit true mobile widths -- drop to 2, keeping the same card size
   (shrinking the card itself breaks the stepper's own layout). */
@media (max-width: 480px) {
    .timeslot-slot-grid {
        grid-template-columns: repeat(2, 138px);
    }
}

.timeslot-slot-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* min-height (not height): content-driven, floored at the card's own width, and grid's default
   row-stretch then equalizes every card in the same row once one of them needs more room (e.g.
   only one has a surcharge line). */
.timeslot-slot-card-compact {
    width: 138px;
    min-height: 138px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    box-sizing: border-box;
}

.timeslot-slot-time-compact {
    font-size: 16px;
    font-weight: 400;
    color: var(--ticket-text-primary, #222222);
}

.timeslot-slot-duration-compact,
.timeslot-slot-surcharge-compact {
    font-size: 16px;
    font-weight: 400;
    color: var(--ticket-text-secondary, #5E6463);
}

/* compact slot card: max quantity message */
.timeslot-slot-card-compact stepper-layout {
    max-width: 100%;
    align-items: center;
}

.timeslot-slot-card-compact stepper-layout::part(max-message) {
    white-space: normal;
    text-align: center;
}

.timeslot-empty-message {
    font-size: 14px;
    color: var(--ticket-text-secondary, #5E6463);
}

/* Pairing removal modal/banner rows (TicketCardPairingCoordinator.js) */
.pairing-removal-group:not(:last-child) {
    margin-bottom: 20px;
}

.pairing-removal-group-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.pairing-removal-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.pairing-removal-row img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--bg-subtle, #F5F6F6);
}

.pairing-removal-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pairing-removal-row-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ticket-text-primary, #222222);
}

.pairing-removal-row-date {
    font-size: 12px;
    color: var(--ticket-text-secondary, #5E6463);
}

.pairing-removal-row-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.pairing-removal-row-total {
    font-size: 14px;
    font-weight: 600;
    color: var(--ticket-text-primary, #222222);
}

.pairing-removal-row-per-unit {
    font-size: 12px;
    color: var(--ticket-text-secondary, #5E6463);
}

.pairing-removal-banner {
    margin-top: 8px;
}

.pairing-removal-banner-label {
    font-weight: 600;
    margin-top: 8px;
}

.pairing-removal-banner-list {
    margin: 4px 0 0;
    padding-left: 20px;
}

.pairing-removal-banner-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}
