/* Seating Plan Renderer — buyer side.
   Always a single column: a big map on top, sidebar below. We don't try
   to put the sidebar next to the map because Pretix' event page puts the
   shop content into a ~700px column, so a two-column layout would squeeze
   the map down to ~300px. */
.pretix-seating-renderer {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin: 1.25rem 0 2.5rem;
    width: 100%;
    font-feature-settings: "ss01", "cv02";
}

.pretix-seating-renderer * {
    box-sizing: border-box;
}

/* Holds only the hidden ``item_<id>`` / ``seat_<id>`` cart inputs that
   seating.js injects on selection. It must never render a box: as a flex/grid
   child it would otherwise add a phantom gap (column layout) or an empty track
   (the West Live desktop grid, where the renderer is ``display: contents``).
   ``display: none`` does not stop the hidden inputs inside from submitting. */
.pretix-seating-renderer .seating-hidden-inputs {
    display: none;
}

.pretix-seating-renderer .seating-stage {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    width: 100%;
    min-height: 640px;
    height: 75vh;
    max-height: 900px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
}

.pretix-seating-renderer .seating-toolbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem .85rem;
    background: rgba(248, 250, 252, .9);
    backdrop-filter: saturate(1.1) blur(4px);
    border-bottom: 1px solid #eef2f7;
}

.pretix-seating-renderer .seating-toolbar .btn {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.pretix-seating-renderer .seating-toolbar .btn:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.pretix-seating-renderer .seating-toolbar .seating-hint {
    margin-left: auto;
    color: #6b7280;
    font-size: 12px;
}

.pretix-seating-renderer .seating-svg-wrapper {
    position: relative;
    flex: 1 1 auto;
    min-height: 560px;
    overflow: hidden;
    background: #ffffff;
    cursor: grab;
    /* The map is panned/zoomed by JS (seating.js touch handlers). Tell the
       browser not to treat touch-drags / pinches here as page scroll or zoom,
       so dragging the map pans the map instead of moving the whole page;
       overscroll-behavior stops any scroll-chaining to the page. */
    touch-action: none;
    overscroll-behavior: contain;
}

.pretix-seating-renderer .seating-svg-wrapper.is-panning {
    cursor: grabbing;
}

.pretix-seating-renderer #pretix-seating-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    user-select: none;
    -webkit-user-select: none;
}

.pretix-seating-renderer .seat--unavailable {
    opacity: .55;
    cursor: not-allowed;
}

.pretix-seating-renderer .plan-area {
    pointer-events: none;
}

.pretix-seating-renderer .plan-area--clickable {
    pointer-events: auto;
    cursor: pointer;
    transition: filter .15s ease, opacity .15s ease;
}

.pretix-seating-renderer .plan-area--clickable:hover,
.pretix-seating-renderer .plan-area--clickable:focus {
    filter: brightness(.9);
    outline: none;
}

.pretix-seating-renderer .plan-area-counter {
    pointer-events: none;
}

.pretix-seating-renderer .row-label {
    pointer-events: none;
}

.pretix-seating-renderer .seating-tooltip {
    position: absolute;
    display: none;
    pointer-events: none;
    background: rgba(15, 23, 42, .92);
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    z-index: 20;
    max-width: 220px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

/* Sidebar — horizontal grid on desktop, stacks on narrow screens */
.pretix-seating-renderer .seating-sidebar {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1.2fr) minmax(220px, 1fr);
    gap: 1.5rem;
    padding: 1.35rem 1.5rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    align-items: start;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
}

.pretix-seating-renderer .seating-sidebar-col + .seating-sidebar-col {
    position: relative;
}
@media (min-width: 721px) {
    .pretix-seating-renderer .seating-sidebar-col + .seating-sidebar-col::before {
        content: "";
        position: absolute;
        left: -.75rem;
        top: .25rem;
        bottom: .25rem;
        width: 1px;
        background: linear-gradient(180deg, transparent, #e5e7eb 25%, #e5e7eb 75%, transparent);
    }
}

@media (max-width: 720px) {
    .pretix-seating-renderer .seating-sidebar {
        grid-template-columns: 1fr;
    }
}

.pretix-seating-renderer .seating-sidebar-title {
    margin: 0 0 .5rem;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.pretix-seating-renderer .seating-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

/* Price-pill strip — populated by seating.js (renderPricePills), shown only on
   the West Live mobile seat page (kvit-ui.css). Hidden in every other context. */
.pretix-seating-renderer .seating-pricepills { display: none; }

.pretix-seating-renderer .seating-legend,
.pretix-seating-renderer .seating-categories,
.pretix-seating-renderer .seating-selection {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pretix-seating-renderer .seating-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .9rem;
    font-size: 12px;
    color: #4b5563;
}

.pretix-seating-renderer .seating-legend li {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.pretix-seating-renderer .legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e1;
}
.pretix-seating-renderer .legend-swatch--available { background: #22c55e; }
.pretix-seating-renderer .legend-swatch--selected { background: #0f172a; }
.pretix-seating-renderer .legend-swatch--unavailable { background: #cbd5e1; }

.pretix-seating-renderer .seating-categories li {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem .1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13.5px;
}
.pretix-seating-renderer .seating-categories li:last-child { border-bottom: 0; }
.pretix-seating-renderer .seating-categories .legend-swatch {
    width: 16px;
    height: 16px;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px rgba(15, 23, 42, .06);
}
.pretix-seating-renderer .seating-categories .legend-label {
    flex: 1 1 auto;
    color: #0f172a;
    font-weight: 500;
}
.pretix-seating-renderer .seating-categories .legend-price {
    color: #475569;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.pretix-seating-renderer .seating-selection {
    max-height: 220px;
    overflow-y: auto;
}

.pretix-seating-renderer .seating-selection-empty {
    color: #9ca3af;
    font-size: 13px;
    padding: .5rem 0;
}

.pretix-seating-renderer .seating-selection-item {
    display: grid;
    grid-template-columns: 14px 1fr auto auto;
    gap: .5rem;
    align-items: center;
    padding: .35rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}

.pretix-seating-renderer .seating-selection-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.pretix-seating-renderer .seating-selection-info {
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pretix-seating-renderer .seating-selection-price {
    color: #1f2937;
    font-variant-numeric: tabular-nums;
}

.pretix-seating-renderer .seating-selection-remove {
    background: transparent;
    border: 0;
    cursor: pointer;
    color: #9ca3af;
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
}
.pretix-seating-renderer .seating-selection-remove:hover { color: #ef4444; }

/* Area/GA selection line with a quantity stepper gets a 5th column. */
.pretix-seating-renderer .seating-selection-item--stepper {
    grid-template-columns: 14px 1fr auto auto auto;
}
.pretix-seating-renderer .seating-selection-stepper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.pretix-seating-renderer .seating-selection-step {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}
.pretix-seating-renderer .seating-selection-step:hover { border-color: #9ca3af; }
.pretix-seating-renderer .seating-selection-qty {
    min-width: 16px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.pretix-seating-renderer .seating-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: .75rem .9rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-weight: 600;
    margin-top: .25rem;
}

.pretix-seating-renderer .seating-total-label {
    color: #64748b;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.pretix-seating-renderer .seating-total-value {
    font-size: 20px;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.pretix-seating-renderer .seating-submit {
    width: 100%;
    border-radius: 10px;
    padding: .75rem 1rem;
    font-weight: 600;
    letter-spacing: .01em;
    box-shadow: 0 6px 16px rgba(20, 184, 166, .25);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.pretix-seating-renderer .seating-submit:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(20, 184, 166, .32);
}
.pretix-seating-renderer .seating-submit:disabled {
    box-shadow: none;
    opacity: .55;
}

/* Mobile fine-tuning */
@media (max-width: 600px) {
    .pretix-seating-renderer .seating-stage {
        min-height: 520px;
        height: 70vh;
    }
    .pretix-seating-renderer .seating-svg-wrapper {
        min-height: 440px;
    }
}

/* Fullscreen seatingframe variant — make it fill the viewport */
body.full-screen-seating .pretix-seating-renderer {
    margin: 0;
    height: 100vh;
    min-height: 0;
}
body.full-screen-seating .pretix-seating-renderer .seating-stage {
    height: calc(100vh - 180px);
    max-height: none;
}

body.full-screen-seating .pretix-seating-frame-cta {
    padding: 0 1rem 1.25rem;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Mobile / narrow iframe: keep "Add to cart" visible above the thumb zone */
@media (max-width: 900px) {
    /* Let map + sidebar define document height so the bar can stick while scrolling */
    body.full-screen-seating .pretix-seating-renderer {
        height: auto;
        min-height: 0;
    }

    body.full-screen-seating .pretix-seating-frame-cta {
        position: sticky;
        bottom: 0;
        z-index: 200;
        margin-top: 0.5rem;
        padding: 0.75rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(
            to top,
            rgba(255, 255, 255, 0.98) 55%,
            rgba(255, 255, 255, 0.88) 85%,
            rgba(255, 255, 255, 0)
        );
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.08);
    }

    body.full-screen-seating .pretix-seating-frame-cta .btn-lg {
        min-height: 48px;
        font-size: 16px;
    }
}

/* Buyer notice on the seat-selection sidebar: the shown total excludes the
   service charge (added later in the cart). Rendered in map.html only when
   prices are displayed net (gated on event.settings.display_net_prices), so
   it never appears on events whose prices already include the fee. */
.seating-fee-note {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    margin: 12px 0 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: #475569;
}

.seating-fee-note .fa {
    margin-top: 1px;
    color: #dc2626;
    flex: 0 0 auto;
}
