/* ========================================================================
   🍽️ CARTA — estilos específicos de la vista carta.blade.php
   🔒 CSP FASE 1 (item 21 auditoria): extraido de un <style> inline para que
   style-src no necesite 'unsafe-inline' en esta pagina. La unica regla que
   dependia de datos por-restaurante (justify-content de #servicios-scroll-container
   segun el numero de servicios) se resolvio con las clases modificadoras
   .servicios-centrado / .servicios-izquierda de theme_unified.css, que
   menu-servicios.blade.php aplica segun corresponda.
   ======================================================================== */

.carta-sin-servicios-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 2rem;
    background: #000;
}

/* 🎨 ESTILOS CARTA MINIMALISTA - HARD RESET COMPLETO */

/* Reset y Base */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: #000;
    color: #ffffff;
}

body.mode-carta {
    background-color: #000;
    padding-bottom: 0;
}

/* 🎯 CONTENEDOR PRINCIPAL */
.carta-wrapper {
    position: relative;
    min-height: 100vh;
    background-color: #000;
    display: flex;
    flex-direction: column;
    padding-top: 70px; /* Espacio para el header fijo (70px) */
}

/* En móvil no necesitamos min-height: el footer es fixed y siempre
   queda en el borde inferior del viewport. Sin este reset, la carta-wrapper
   crece hasta 100vh aunque el contenido sea corto, dejando espacio negro. */
@media (max-width: 767px) {
    .carta-wrapper { min-height: 0; }
}

/* ==========================================
   BLOQUE SUPERIOR: STICKY TOP (Z-INDEX 50)
   ========================================== */

.bloque-superior {
    position: sticky;
    top: 70px; /* Posicionado debajo del header fijo (70px de altura) */
    z-index: 40; /* Debajo del header (z-50) */
    background: #000000; /* Fondo negro sólido */
    padding-top: 0px; /* Sin separación superior */
    border-top: 1px solid rgba(255,255,255,0.15); /* Línea horizontal de separación */
}

/* 🎯 SCROLL HORIZONTAL DE CATEGORÍAS */
#categorias-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 15px 20px 15px 20px; /* Padding uniforme */
    border-bottom: 1px solid rgba(255,255,255,0.15);
    scrollbar-width: none;
    background: #000000; /* Fondo negro sólido */
}

#categorias-scroll-container::-webkit-scrollbar {
    display: none;
}

.btn-categoria {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.05rem; /* Igualado al carrusel */
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    white-space: nowrap;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    line-height: 1;
}

.btn-categoria.activa {
    color: #ffffff;
    font-weight: 600;
}

.btn-categoria:hover {
    color: #ffffff;
}

/* ==========================================
   BLOQUE CENTRAL: SWIPER HORIZONTAL
   ========================================== */

.platos-listado {
    width: 100%;
    max-width: 100%;
    padding-top: 0.5rem; /* Espacio reducido en móvil */
}


.swiper.swiperCarta {
    width: 100%;
}

.swiper-slide {
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    padding: 0 20px;
    box-sizing: border-box;
}

/* 🎯 TÍTULO GIGANTE DE CATEGORÍA (SOLO DESKTOP) */
.titulo-categoria-desktop { display: none; }

/* 🎯 SECCIÓN DE CATEGORÍA (Sin título repetido) */
.categoria-section {
    width: 100%;
}

/* 🎯 ITEM DE PLATO (LISTA MINIMALISTA - SIN TARJETAS) */
.plato-item {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: background 0.2s ease;
    align-items: flex-start;
}

.plato-item:hover {
    background: rgba(255,255,255,0.02);
}

.plato-item:last-child {
    border-bottom: none;
}


/* Bloque Izquierdo: Miniatura (Imagen o Vídeo) */
.plato-miniatura {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #1a1a1a;
}


.plato-miniatura img,
.plato-miniatura video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Bloque Derecho: Contenido */
.plato-contenido {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.plato-nombre {
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.2px;
    font-family: 'Montserrat', sans-serif;
}

.plato-descripcion {
    font-size: 0.875rem;
    font-weight: 300;
    color: rgba(255,255,255,0.7);
    line-height: 1.4;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
}

.plato-precio {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    letter-spacing: 0.3px;
    font-family: 'Montserrat', sans-serif;
    margin-top: 4px;
}

/* Precios Múltiples */
.plato-precios-multiples {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.precio-badge {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    font-family: 'Montserrat', sans-serif;
}

/* Alérgenos */
.plato-alergenos {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

/* Precios + alérgenos en línea (≤2 precios sin nombres, o precio único) */
.plato-precio-alergenos-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.plato-precio-alergenos-row .plato-alergenos {
    margin-top: 0;
}

.plato-precio-alergenos-row .plato-precios-multiples {
    margin-top: 0;
}

/* ===== LIGHTBOX ===== */
.lb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
    -webkit-overflow-scrolling: touch;
}

.lb-overlay.activo {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.25s ease, visibility 0s linear 0s;
}

.lb-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 1.1rem;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.lb-close:hover { background: rgba(255, 255, 255, 0.25); }

.lb-container {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lb-media {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.lb-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lb-info {
    color: white;
    font-family: 'Montserrat', sans-serif;
    padding-bottom: 8px;
}

.lb-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 6px 0;
}

.lb-info p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.lb-precio {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 10px;
}

.lb-alergenos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lightbox-trigger { cursor: pointer; }

.lb-media-wrap {
    position: relative;
    width: 100%;
}

.lb-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.6rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    line-height: 1;
    transition: background 0.15s;
}

.lb-nav-btn:active { background: rgba(255, 255, 255, 0.15); }

.lb-prev { left: 8px; }
.lb-next { right: 8px; }

.alergeno-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* ==========================================
   BLOQUE INFERIOR: STICKY BOTTOM (Z-INDEX 50)
   ========================================== */

.bloque-inferior {
    position: sticky;
    bottom: 0;
    z-index: 50;
    background: #000000; /* Fondo sólido estricto */
}

/* 📱 SOLO MÓVIL: el footer de navegación (Visitar Perfil/Reservar/Carta
   Interactiva) es position:fixed con z-index altísimo (ver
   footer-navegacion.blade.php) y solo existe en móvil — sin esto, tapaba
   por completo al selector de servicios porque ambos terminaban en
   bottom:0. Se saca del flujo y se ancla justo encima del footer
   (~50px de alto, mismo valor que ya usa el Carrusel para su fila de
   botones inferior) para que convivan sin solaparse. En escritorio no
   hace falta: el footer se oculta (display:none) y .bloque-inferior
   sigue sticky/bottom:0 sin competencia. */
@media (max-width: 767px) {
    .bloque-inferior {
        position: fixed;
        left: 0;
        width: 100%;
        bottom: 50px;
    }

    /* Al sacar .bloque-inferior del flujo, el último plato de cada
       servicio podía quedar tapado detrás del selector de servicios +
       el footer fijo. Se reserva ese espacio al final del scroll. */
    .swiper-slide {
        padding-bottom: 110px;
    }
}

/* 🎯 SCROLL HORIZONTAL DE SERVICIOS */
#seccion-servicios {
    padding: 0;
    box-sizing: border-box;
}

/* Rama "carta" de menu-servicios.blade.php — antes style="" inline en el
   propio componente. */
.ms-seccion-servicios-carta {
    padding: 0 20px 0 0;
}

.ms-servicios-scroll-carta {
    padding-left: 20px;
    padding-right: 20px;
    scroll-padding-right: 20px;
}

#servicios-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 10px 20px 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    scrollbar-width: none;
    align-items: center;
    /* justify-content ya no va aqui: depende del numero de servicios del
       restaurante, lo resuelven las clases .servicios-centrado /
       .servicios-izquierda de theme_unified.css (ver menu-servicios.blade.php) */
    gap: 40px !important;
}

@media (min-width: 768px) {
    #servicios-scroll-container {
        height: 70px !important; /* 👈 Altura exacta idéntica al carrusel */
        padding: 0 15px !important; /* 👈 Quitamos las "esponjas" verticales */
        display: flex !important;
        align-items: center !important; /* 👈 Centrado vertical matemático */
        justify-content: center !important;
    }
}

#servicios-scroll-container::-webkit-scrollbar {
    display: none;
}


.btn-servicio {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.05rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    white-space: nowrap;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    line-height: 1;
    flex-shrink: 0;
}

.btn-servicio.activo {
    color: #ffffff;
    font-weight: 600;
}

/* Línea de separación cuando solo hay un servicio */
#linea-separacion-unico {
    padding: 0 20px;
    box-sizing: border-box;
    display: none;
}



/* 🎯 ESTADO VACÍO */
.estado-vacio {
    text-align: center;
    padding: 4rem 1rem;
    color: rgba(255,255,255,0.5);
}

.estado-vacio svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.3;
}

.estado-vacio h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: 'Montserrat', sans-serif;
}

.estado-vacio p {
    color: rgba(255,255,255,0.4);
    font-family: 'Montserrat', sans-serif;
}

/* ==========================================
   ESCRITORIO (768px+) - CARTA PREMIUM CENTRADA
   ========================================== */
@media (min-width: 768px) {

    /* 0. LÍNEA SEPARADORA ELEGANTE (HEADER -> CATEGORÍAS) */
    #cabecera-moovint {
        border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
        background: #000000 !important;
    }

    .carta-wrapper {
        padding-top: 121px !important; /* Alto real de la cabecera */
        min-height: 100vh !important; /* Necesario en desktop para que el sticky service-selector quede al fondo */
    }

    /* 1. OVERRIDE CRÍTICO: Neutralizar el bug del 50% de theme_unified.css y Swiper */
    body.mode-carta .swiper,
    body.mode-carta .swiper.swiperCarta,
    body.mode-carta .swiper-wrapper,
    body.mode-carta .swiper-slide {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        position: relative !important;
        transform: none !important;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* 2. Mostrar y Centrar el Menú de Categorías Superior */
    .bloque-superior {
        position: -webkit-sticky !important; /* Safari fix */
        position: sticky !important; /* Obliga a que quede fijo */
        top: 121px !important; /* 👈 El tamaño exacto de la cabecera cuando se encoge */
        z-index: 90 !important; /* 👈 Asegura que quede justo por debajo de la cabecera (z-100) */
        border-top: none !important;
        background: #000000 !important;
    }

    #categorias-scroll-container {
        display: flex !important;
        justify-content: flex-start !important;
        width: 100% !important;
        max-width: 1280px !important;
        margin: 0 auto !important;

        /* 👇 CONTROL MANUAL DE ESPACIOS 👇 */
        padding-top: 30px !important;    /* 👈 AUMENTA este número para separar el texto de la línea superior */
        padding-bottom: 20px !important; /* 👈 Deja este intacto para respetar el espacio inferior */
        padding-left: 20px !important;
        padding-right: 20px !important;
        /* 👆 FIN CONTROL MANUAL 👆 */

        overflow-x: auto !important;
        scrollbar-width: none !important;
    }

    #categorias-scroll-container::-webkit-scrollbar {
        display: none !important;
    }

    /* Restaurar tamaños originales de categorías y servicios en desktop */
    .btn-categoria, .btn-servicio {
        font-size: 1.386rem !important;
    }

    /* 3. Centrar el Contenedor Principal (1280px) */
    .platos-listado, .contenedor-central-desktop {
        max-width: 1280px !important;
        margin: 0 auto !important;
        padding: 0 2rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 4. Título de Categoría alineado al Grid */
    .titulo-categoria-desktop {
        display: block !important;
        grid-column: 1 / -1 !important;
        font-size: 3rem !important;
        font-weight: 900 !important;
        color: white !important;
        margin: 4rem 0 0.5rem 0 !important;
        text-align: left !important;
        font-family: 'Montserrat', sans-serif !important;
    }

    /* 5. Grid de 3 Columnas */
    .categoria-section {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 3rem 2rem !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 0 4rem 0 !important;
    }

    /* 6. Estilos de Platos (Idéntico al Mockup) */
    .plato-item {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
    }
    .plato-contenido {
        width: 100% !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }
    .plato-nombre { font-size: 1.25rem !important; font-weight: 700 !important; margin: 0 !important; }
    .plato-descripcion { font-size: 1.14rem !important; color: rgba(255,255,255,0.6) !important; margin: 0 !important; line-height: 1.4 !important; }
    .plato-precio { font-size: 1.67rem !important; font-weight: 700 !important; margin: 0 !important; }

}

/* Media query para Tablet (2 columnas) */
@media (min-width: 768px) and (max-width: 1023px) {
    .categoria-section {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

