/* Seatmap Bridge */

.seatmap-bridge {
    --seat-new-selection-color: #b7efc5;
    --seat-cart-color: #69d18a;
    border: 2px solid #2D89EF;
    padding: 16px;
    margin: 20px 0;
    background: #fff;
}

.seatmap-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 20px;
    align-items: start;
}

.seatmap-zone-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.seatmap-zone-tabs button {
    min-width: 120px;
    padding: 10px 18px;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff;
    color: #222;
    font-weight: bold;
    cursor: pointer;
}

.seatmap-zone-tabs button:hover,
.seatmap-zone-tabs button:focus,
.seatmap-zone-tabs button.active {
    border-color: #2D89EF;
    background: #2D89EF;
    color: #fff;
}

.seatmap-zone-element.is-hidden {
    display: none;
}

.seatmap-layout[hidden] {
    display: none;
}

.seatmap-map {
    position: relative;
    min-width: 0;
}

.seatmap-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    z-index: 2;
}

.seatmap-control {
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff;
    color: #222;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.seatmap-control:hover,
.seatmap-control:focus {
    background: #eee;
}

.seatmap-selection {
    position: sticky;
    top: 16px;
    padding: 16px;
    border: 1px solid #ccc;
    background: #fff;
}

.seatmap-selection h4 {
    margin: 0 0 12px;
}

.seatmap-selection-section + .seatmap-selection-section {
    margin-top: 18px;
}

.seatmap-selection-section h5 {
    margin: 0 0 8px;
}

.seatmap-selection-table {
    width: 100%;
    border-collapse: collapse;
}

.seatmap-selection-table th,
.seatmap-selection-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

.seatmap-selection-price {
    white-space: nowrap;
    text-align: right !important;
}

.seatmap-selection-empty {
    color: #666;
    text-align: center !important;
}

.seatmap-selection-total {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 12px;
    font-size: 1.1em;
}

.seatmap-selection-action .seatmap-bridge-submit {
    margin-top: 12px;
}

.seatmap-remove-confirmation {
    margin-top: 16px;
    padding: 12px;
    border: 1px solid #dc3545;
    border-radius: 4px;
    background: #fff5f5;
}

.seatmap-remove-confirmation-text {
    display: block;
}

.seatmap-remove-confirmation-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.seatmap-legend {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #ccc;
}

.seatmap-legend h5 {
    margin: 0 0 10px;
}

.seatmap-legend ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.seatmap-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 7px 0;
}

.seatmap-legend-swatch {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    border: 1px solid transparent;
    border-radius: 50%;
    box-sizing: border-box;
}

.seatmap-legend-swatch.selected {
    background: var(--seat-new-selection-color);
}

.seatmap-legend-swatch.in-cart {
    background: var(--seat-cart-color);
}

.seatmap-legend-swatch.unavailable {
    background: #bbb;
    opacity: 0.5;
}

@media (max-width: 900px) {
    .seatmap-layout {
        grid-template-columns: 1fr;
    }

    .seatmap-selection {
        position: static;
        order: -1;
    }
}

.seatmap-svg {
    width: 100%;
    height: auto;
    border: 1px solid #ccc;
    background: #f9f9f9;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.seatmap-svg.is-panning {
    cursor: grabbing;
}

.seatmap-area {
    pointer-events: none;
}

.seatmap-area-text {
    font-family: sans-serif;
    user-select: none;
}

.seat-hit-area {
    fill: transparent;
    stroke: transparent;
    stroke-width: 16px;
    vector-effect: non-scaling-stroke;
    pointer-events: all;
    cursor: crosshair;
}

.seat-hit-area.in-cart {
    cursor: pointer;
}

.seat-hit-area.disabled {
    cursor: not-allowed;
}

.seat {
    fill: var(--seat-category-color, #2D89EF);
    stroke: transparent;
    stroke-width: 0;
    cursor: crosshair;
    transition: filter 0.15s ease, stroke 0.15s ease, stroke-width 0.15s ease;
}
.seat:hover,
.seat.hit-hover {
    filter: brightness(1.12);
    stroke: #222;
    stroke-width: 2;
}

.seat.selected {
    fill: var(--seat-new-selection-color);
    stroke: transparent;
    stroke-width: 0;
}

.seat.in-cart {
    fill: var(--seat-cart-color);
    stroke: transparent;
    stroke-width: 0;
    cursor: pointer;
}

.seat.selected:hover,
.seat.selected.hit-hover,
.seat.in-cart:hover,
.seat.in-cart.hit-hover {
    filter: brightness(0.94);
    stroke: transparent;
    stroke-width: 0;
}

.seat.unmapped,
.seat.unavailable {
    fill: #bbb;
    stroke: transparent;
    filter: none;
    cursor: not-allowed;
    opacity: 0.5;
}

.seat.unmapped:hover,
.seat.unavailable:hover {
    fill: #bbb;
}
