:root {
    --bg: #0b0c10;
    --panel: #16181d;
    --ink: #e6e8ef;
    --muted: #9aa3b2;
    --brand: #b20d5d;
    --brand-2: #530aac;
    --accent: #6ee7b7;
    --danger: #ff6b6b;
    --warning: #ffd166;
    --border: #2a2e35;
    --seat-size: 38px;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.app {
    display: grid;
    grid-template-columns: minmax(0, 2.5fr) minmax(340px, 0.95fr);
    grid-template-rows: auto;
    gap: 24px;
    min-height: auto;
    padding: 0;
    width: 100%;
}

.ticket-selection-layout {
    align-items: stretch;
}

.ticket-selection-layout .map-card {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-width: 0;
}

.ticket-selection-layout .ticket-summary-wrap {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-width: 0;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.ticket-summary-card {
    border: none;
}

.map-card header,
.seats-card header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.map-card header h1,
.seats-card header h2 {
    font-size: 16px;
    margin: 0;
    letter-spacing: 0.25px;
}

.map-wrap {
    position: relative;
    padding: 14px;
    overflow: hidden;
}

.stage-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.zoom-bar {
    display: flex;
    gap: 8px;
}

.btn-map {
    background: #1e2229;
    border: 1px solid var(--border);
    color: var(--ink);
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    transition: transform 0.05s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-map:hover {
    background: #232833;
}

.btn-map:active {
    transform: translateY(1px);
}

.btn-map.primary {
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    border-color: transparent;
}

.btn-map.ghost {
    background: transparent;
}

.legend {
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
    padding: 8px 16px 14px;
    border-bottom: 1px dashed var(--border);
}

.map-selection-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px dashed var(--border);
}

.map-selection-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.map-selection-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.map-selection-actions form {
    margin: 0;
}

.legend .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}

.svg-stage {
    position: relative;
    min-height: 560px;
    max-height: 680px;
    overflow: auto;
    border-radius: 0 0 var(--radius) var(--radius);
}

.seat-stage {
    background: #12151b;
    border: 1px solid var(--border);
}

#seat-stage-content {
    padding: 12px;
}

.seat-stage .seats-container {
    min-height: 500px;
    max-height: none;
    padding: 10px 0;
}

.svg-stage svg {
    width: 100%;
    height: auto;
}

.section-label {
    user-select: none;
    font-weight: bold;
    paint-order: stroke;
    stroke-width: 4;
}

.section-label.available {
    fill: #4f7cff;
    cursor: pointer;
}

.section-label.available:hover {
    fill: #002cbd;
}

.section-label.unavailable {
    cursor: not-allowed;
}

.seats-container {
    min-height: 240px;
    max-height: 360px;
    padding: 8px 0;
    overflow: auto;
}

.seat-grid {
    display: grid;
    grid-template-columns: repeat(20, var(--seat-size));
    gap: 10px;
    justify-content: start;
    align-content: start;
    margin-bottom: 10px;
}

.seat {
    min-width: var(--seat-size);
    min-height: var(--seat-size);
    border-radius: 10px;
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    font-size: 12px;
    background: #1b1f26;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.2s ease,
        border-color 0.2s ease, background 0.2s ease;
}

.seat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.seat.selected {
    background: linear-gradient(180deg, var(--brand), var(--brand-2));
    color: #fff;
}

.seat.sold {
    background: linear-gradient(180deg, #2a5ae6, var(--brand-2));
    color: #fff;
    cursor: not-allowed;
}

.seat .tiny {
    font-size: 10px;
    color: var(--muted);
}

.summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
    min-height: 38px;
}

.pill {
    background: #1b1f26;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--ink);
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.cart {
    font-size: 13px;
    color: var(--muted);
}

.tag {
    color: var(--ink);
    font-weight: 600;
}

.ticket-summary-wrap {
    margin-top: 0;
    display: flex;
}

.ticket-summary-wrap .ticket-summary-card,
.ticket-summary-card.ticket-content-2 {
    width: 100%;
    max-width: none;
    border: none;
}

.ticket-summary-card .ticket-content-2-inner {
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
}

.ticket-summary-card .ticket-swiper,
.ticket-summary-card .swiper-wrapper,
.ticket-summary-card .swiper-slide {
    height: 100%;
}

@media (max-width: 1399.98px) and (min-width: 1200px) {
    .ticket-selection-layout {
        grid-template-columns: minmax(0, 2fr) minmax(300px, 0.9fr);
    }
}

@media (max-width: 1199.98px) {
    .ticket-selection-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    .ticket-selection-layout .map-card {
        grid-column: 1;
        grid-row: 1;
    }

    .ticket-selection-layout .ticket-summary-wrap {
        grid-column: 1;
        grid-row: 2;
    }

    .svg-stage {
        min-height: 380px;
        max-height: 52vh;
    }

    .seat-stage .seats-container {
        min-height: 320px;
    }

    .ticket-summary-card .ticket-content-2-inner {
        max-height: none;
    }
}

@media (max-width: 767.98px) {
    .ticket-selection-layout {
        grid-template-columns: 1fr;
    }

    .ticket-selection-layout .map-card,
    .ticket-selection-layout .ticket-summary-wrap {
        grid-column: 1;
    }

    .ticket-summary-card .ticket-content-2-inner {
        max-height: none;
    }

    .seat-stage .seats-container {
        min-height: 260px;
    }
}

@media (max-width: 575.98px) {
    .map-card header,
    .seats-card header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .legend {
        gap: 8px;
        flex-wrap: wrap;
    }

    .map-selection-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}
