/* ============================================
   TICKETERA MAPA CSS - VERSIÓN UNIFICADA
   ============================================ */

body.single-product {
    background: #0a0a0a !important;
    color: #ffffff !important;
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.ticketera-mapa-container {
    max-width: 100%;
    padding: 15px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    margin: 15px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   SELECTOR DE SECTOR
   ============================================ */
.ticketera-sector-selector {
    margin-bottom: 20px;
}

.ticketera-sector-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #FF6B00;
}

.ticketera-sector-selector select {
    width: 100%;
    max-width: 400px;
    padding: 15px;
    font-size: 16px;
    border: 0.5px solid #FF6B00;
    background: #0a0a0a;
    color: #FFF;
    border-radius: 8px;
    -webkit-appearance: none;
    appearance: none;
}

/* ============================================
   MAPA DE BUTACAS
   ============================================ */
#ticketera-mapa-content {
    min-height: 200px;
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid #333;
    padding: 15px;
    margin: 20px 0;
    background: #0a0a0a;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}

/* Butacas */
.ticketera-butaca {
    width: 34px;
    height: 28px;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0 !important;
    line-height: 1 !important;
    border: 2px solid #ddd;
    background: #4CAF50;
    color: #fff;
    border-radius: 8px 8px 3px 3px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    margin: 2px;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.ticketera-butaca.vendido,
.ticketera-butaca[disabled] {
    background: #dc3545 !important;
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

.ticketera-butaca.seleccionado {
    background: #FF6B00 !important;
    color: #000 !important;
    transform: scale(1.15);
    border-color: #FF6B00 !important;
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.8) !important;
}

.ticketera-butaca:hover:not(.vendido):not(.seleccionado) {
    transform: scale(1.1);
    border-color: #FF6B00;
}

/* ============================================
   LEYENDA
   ============================================ */
#ticketera-leyenda {
    margin: 20px auto;
    padding: 10px;
    background: #1a1a1a;
    border: 1px solid #FF6B00;
    border-radius: 4px;
    text-align: center;
    max-width: 600px;
    display: none; /* JS lo muestra cuando corresponde */
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

#ticketera-leyenda.visible {
    display: flex !important;
}

#ticketera-leyenda span {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    color: #fff !important;
}

.leyenda-color {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin: 0 8px;
    border-radius: 4px;
    vertical-align: middle;
    border: 2px solid #ddd;
}

.leyenda-color.disponible { background: #4CAF50; }
.leyenda-color.seleccionado { background: #FF6B00; }
.leyenda-color.vendido { background: #dc3545; }

/* ============================================
   LISTA DE SELECCIÓN
   ============================================ */
#ticketera-lista-seleccion {
    margin: 20px 0;
    padding: 15px;
    background: #1a1a1a !important;
    border: 1px solid #FF6B00 !important;
    border-radius: 8px;
}

#ticketera-lista-seleccion h4 {
    color: #FF6B00 !important;
    margin-bottom: 15px !important;
}

#ticketera-butacas-seleccionadas {
    list-style: none;
    padding: 0;
    margin: 0;
}

#ticketera-butacas-seleccionadas li {
    background: #2a2a2a !important;
    color: #ffffff !important;
    padding: 8px;
    margin: 5px 0;
    border-radius: 4px;
    border-left: 3px solid #FF6B00;
}

#ticketera-contador {
    color: #FF6B00;
    font-weight: bold;
}

/* ============================================
   CONTROL DE CANTIDAD - UNIFICADO PC/MOBILE
   ============================================ */
#ticketera-cantidad-container {
    margin: 20px 0;
    text-align: center;
    display: none; /* JS lo muestra cuando corresponde */
}

#ticketera-cantidad-container.visible {
    display: block !important;
}

#ticketera-cantidad-container label {
    display: block;
    margin-bottom: 10px;
    color: #fff;
    font-size: 14px;
}

.cantidad-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

#ticketera-cantidad-input {
    width: 60px;
    height: 44px;
    text-align: center;
    padding: 0;
    font-size: 18px;
    font-weight: bold;
    background: #0a0a0a;
    border: 2px solid #444;
    color: #fff;
    border-radius: 6px;
    -moz-appearance: textfield;
}

#ticketera-cantidad-input::-webkit-outer-spin-button,
#ticketera-cantidad-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-cantidad {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 8px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.btn-menos {
    background: #333;
    color: #fff;
}

.btn-mas {
    background: linear-gradient(135deg, #FF6B00 0%, #FF8533 100%);
    color: #000;
}

.btn-cantidad:hover {
    transform: scale(1.1);
}

.btn-cantidad:active {
    transform: scale(0.95);
}

/* ============================================
   BOTÓN COMPRAR
   ============================================ */
#ticketera-agregar-carrito {
    width: 100%;
    max-width: 400px;
    padding: 15px;
    background: linear-gradient(135deg, #FF6B00, #FF8C00);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 20px;
    display: none; /* JS lo muestra cuando corresponde */
}

#ticketera-agregar-carrito.visible {
    display: block !important;
}

#ticketera-agregar-carrito:disabled {
    background: #555;
    cursor: not-allowed;
}

/* ============================================
   RESPONSIVE MÓVIL
   ============================================ */
@media (max-width: 768px) {
    .ticketera-mapa-container {
        padding: 10px;
        margin: 10px 0;
    }

    .ticketera-butaca {
        width: 30px !important;
        height: 24px !important;
        font-size: 9px !important;
        margin: 1px !important;
    }

    #ticketera-leyenda {
        font-size: 12px !important;
        padding: 8px !important;
        gap: 10px !important;
    }

    .leyenda-color {
        width: 16px !important;
        height: 16px !important;
    }

    .ticketera-mapa-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .ticketera-fila-grid {
        display: inline-flex !important;
        flex-wrap: wrap !important;
        gap: 2px !important;
    }

    #ticketera-agregar-carrito {
        position: sticky !important;
        bottom: 10px;
        max-width: 100% !important;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
    }
}

/* ============================================
   EXTRAS
   ============================================ */
.butaca-panel-bloqueo.bloqueado {
    background: #ffc107 !important;
    border-color: #ff9800 !important;
}

.butaca-panel-bloqueo.disponible:hover {
    border-color: #FF6B00 !important;
    transform: scale(1.1);
}

.butaca-publica.vendido,
.butaca-publica.no-disponible {
    opacity: 0.6;
    cursor: not-allowed;
}

.ticketera-butaca.disponible {
    cursor: pointer;
}

@media (max-width: 768px) {
    .floating-cart,
    .cart-floating,
    [class*="floating"][class*="cart"],
    #floating-cart {
        display: none !important;
    }
}