/* ============================================
   SEAT MAP FRONTEND – HYBRID SVG OVERLAY
   ============================================ */

/* ===== OVERLAY PRINCIPAL ===== */
.bt-zone-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

.bt-zone-overlay.active {
    display: block;
}

.bt-zone-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.bt-zone-overlay-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    background: #111;
    border-radius: 24px;
    border: 1px solid #d4af37;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
}

/* ===== HEADER COMPACTO ===== */
.bt-zone-overlay-header {
    padding: 12px 20px;
    border-bottom: 1px solid #333;
    position: relative;
    display: flex;
    align-items: center;
}

.bt-header-info {
    display: flex;
    align-items: baseline;
    gap: 20px;
    flex-wrap: wrap;
}

.bt-zone-overlay-close {
    position: absolute;
    top: 8px;
    right: 15px;
    background: none;
    border: none;
    color: #d4af37;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
}

.bt-event-title {
    font-size: 1.3rem;
    color: #fff;
    margin: 0;
}

.bt-zone-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d4af37;
    font-size: 1rem;
}

/* ===== BOTÓN VOLVER AL MAPA GENERAL ===== */
.bt-zone-back-btn {
    background: transparent;
    border: 1px solid #d4af37;
    color: #d4af37;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    margin-left: auto;
}

.bt-zone-back-btn:hover {
    background: #d4af37;
    color: #000;
}

/* ===== BODY (MAPA) ===== */
.bt-zone-overlay-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    min-height: 200px;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.bt-zone-map-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== NUEVO: CONTENEDOR HÍBRIDO ===== */
.bt-map-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    overflow: hidden;
}

.bt-map-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
}

.bt-zone-map-svg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.bt-zone-map-svg-container svg {
    width: 100%;
    height: 100%;
    background: transparent !important;
    pointer-events: none;     /* los eventos pasan a los grupos hijos */
}

/* ===== GRUPOS DE ZONA ===== */
.bt-zone-group {
    pointer-events: all;
    cursor: pointer;
}

/* ===== PATHS (INVISIBLES POR DEFECTO) ===== */
.bt-zone-path {
    fill: transparent;
    stroke: transparent;
    stroke-width: 1;
    transition: fill 0.15s ease, opacity 0.15s ease, stroke 0.15s ease;
    pointer-events: all;
}

/* Hover: color suave con opacidad */
.bt-zone-group:hover .bt-zone-path:not(.selected):not(.occupied) {
    fill: var(--zone-color, #d4af37);
    opacity: 0.5;
    stroke: var(--zone-color, #d4af37);
}

/* Seleccionada (JS añade la clase .selected al grupo) */
.bt-zone-group.selected .bt-zone-path,
.bt-zone-path.selected {
    fill: var(--zone-color, #d4af37);
    opacity: 0.85;
    stroke: #fff;
    stroke-width: 2;
}

/* Ocupada (llena) */
.bt-zone-path.occupied {
    fill: #666;
    opacity: 0.5;
    cursor: not-allowed;
    stroke: #999;
}

/* ===== ETIQUETAS MINIMALISTAS (SOLO TEXTO, SIN FONDO) ===== */
.bt-zone-group .zone-price-text,
.bt-zone-group .zone-capacity-text {
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none; /* para que no bloqueen los clics */
}

.bt-zone-group:hover .zone-price-text,
.bt-zone-group:hover .zone-capacity-text,
.bt-zone-group.selected .zone-price-text,
.bt-zone-group.selected .zone-capacity-text {
    opacity: 1;
}

/* ===== ASIENTOS EN VISTA DE ZONA (SIN MOVIMIENTO EN HOVER) ===== */
.bt-seat-group {
    cursor: pointer;
    pointer-events: all;
    /* Eliminado transition y transform para evitar temblor */
}
.bt-seat-group.occupied {
    cursor: not-allowed;
}
/* Indicamos hover SOLO cambiando el estilo del rect principal */
.bt-seat-group:hover:not(.occupied) rect:nth-child(2) {
    stroke: #d4af37;
    stroke-width: 2;
    filter: drop-shadow(0 0 3px rgba(212, 175, 55, 0.7));
}

/* ===== FOOTER (LISTA DE FILAS) ===== */
.bt-zone-overlay-footer {
    padding: 15px 20px;
    border-top: 1px solid #333;
    background: #111;
}

.bt-footer-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.bt-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bt-filter-group label {
    color: #aaa;
    font-size: 13px;
}

.bt-filter-group select {
    background: #1a1a1a;
    border: 1px solid #444;
    color: #fff;
    padding: 6px 25px 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

/* ===== CHECKBOX "SENTARSE JUNTOS" ===== */
.bt-together-group {
    display: flex;
    align-items: center;
}

.bt-together-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #d4af37;
    font-weight: 600;
    font-size: 13px;
    user-select: none;
}

.bt-together-group input[type="checkbox"] {
    accent-color: #d4af37;
    width: 16px;
    height: 16px;
    margin: 0;
}

.bt-footer-stats {
    color: #aaa;
    margin-bottom: 10px;
    font-size: 13px;
}

.bt-rows-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 5px;
}

.bt-row-card {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #333;
}

.bt-row-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.bt-row-name {
    color: #d4af37;
    font-weight: 600;
    font-size: 0.95rem;
}

.bt-row-price {
    color: #fff;
    font-weight: bold;
    font-size: 0.95rem;
}

.bt-row-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bt-row-available {
    color: #4caf50;
    font-size: 0.9rem;
}

.bt-row-available.low {
    color: #ff9800;
}

.bt-row-message {
    display: block;
    font-size: 0.8rem;
    color: #ff9800;
    margin-top: 4px;
    font-weight: 500;
}

.bt-row-qty-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bt-row-qty-selector button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #333;
    border: 1px solid #555;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.bt-qty-input {
    width: 35px;
    text-align: center;
    background: transparent;
    border: none;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}

/* ===== ASIENTOS ASIGNADOS (FEEDBACK) ===== */
.bt-row-allocated {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #d4af37;
    font-weight: 500;
    background: #222;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

/* ===== MENSAJE DE ADVERTENCIA ===== */
.bt-row-warning {
    color: #f44336;
    font-size: 0.8rem;
    margin-top: 6px;
    font-weight: bold;
}

/* ===== PAGINACIÓN "CARGAR MÁS" ===== */
.bt-footer-pagination {
    display: flex;
    justify-content: center;
    margin: 15px 0 10px;
}

.bt-load-more-btn {
    background: #222;
    border: 1px solid #d4af37;
    color: #d4af37;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.bt-load-more-btn:hover {
    background: #d4af37;
    color: #000;
}

/* ===== BOTÓN AÑADIR AL CARRITO ===== */
.bt-footer-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.bt-btn-add-to-cart {
    background: #d4af37;
    color: #000;
    border: none;
    padding: 12px 30px;
    border-radius: 40px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    flex: 1;
}

.bt-btn-add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bt-btn-clear-selection {
    background: transparent;
    border: 1px solid #f44336;
    color: #f44336;
    padding: 10px 16px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bt-btn-clear-selection:hover {
    background: #f44336;
    color: #fff;
}

/* ===== TOAST DE MENSAJES ===== */
.bt-seat-toast {
    position: fixed;
    background: linear-gradient(135deg, #1e1e1e, #0a0a0a);
    color: #d4af37;
    padding: 12px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7), 0 0 0 1px #d4af37 inset;
    z-index: 9999;
    pointer-events: none;
    max-width: 280px;
    text-align: center;
    border: 1px solid #d4af37;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== TABLA RESUMEN DE ZONAS ===== */
.bt-zone-summary-container {
    width: 100%;
    margin-top: 20px;
    display: none;
}

.bt-summary-title {
    color: #d4af37;
    font-size: 1.1rem;
    margin: 0 0 10px;
    text-align: left;
}

.bt-zone-summary-table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.9rem;
}

.bt-zone-summary-table th {
    background: #222;
    color: #d4af37;
    padding: 10px;
    text-align: left;
    font-weight: 600;
}

.bt-zone-summary-table td {
    padding: 10px;
    border-bottom: 1px solid #333;
    color: #fff;
}

.bt-zone-summary-table tr:last-child td {
    border-bottom: none;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .bt-zone-overlay-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    .bt-header-info {
        gap: 10px;
    }
    .bt-event-title {
        font-size: 1.1rem;
    }
    .bt-zone-info {
        font-size: 0.9rem;
    }
    .bt-zone-overlay-body {
        padding: 10px;
    }
    .bt-map-wrapper {
        max-height: 50vh;
    }
    .bt-zone-map-svg-container svg {
        max-height: 40vh;
    }
    .bt-footer-filters {
        gap: 10px;
    }
    .bt-rows-list {
        max-height: 200px;
    }
    .bt-row-card {
        padding: 10px;
    }
    .bt-btn-add-to-cart {
        padding: 12px 20px;
    }
    .bt-btn-clear-selection {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    .bt-load-more-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    .bt-seat-toast {
        font-size: 13px;
        padding: 10px 16px;
        max-width: 220px;
    }
    .bt-zone-back-btn {
        padding: 4px 12px;
        font-size: 0.85rem;
    }
    .bt-together-group label {
        font-size: 12px;
    }
    .bt-zone-summary-table {
        font-size: 0.8rem;
    }
}