:root {
    --primary-color: #0b2d39;
    --accent-color: #00bcd4;
    --background-dark: #6F5F55;
    --font-heading: 'Bebas Neue', cursive;
    --font-body: 'Outfit', sans-serif;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--background-dark);
    font-family: var(--font-body);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* CONTENEDOR PRINCIPAL CON LA IMAGEN COMPLETA */
/* DISEÑO BASE (MODERN MOBILE FIRST) */
.menu-outer-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 10px; 
    margin: 0;
    background-image: url('../images/menu_main_bg.png'); /* Fondo completo en móvil */
    background-size: cover;          /* Cover por defecto para móvil */
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    position: relative;
    overflow-x: hidden;
}

/* SOLO PARA PC Y TABLET: Estilo Tabla sobre Madera */
@media (min-width: 850px) {
    body {
        background-image: url('../images/bg_rustic_wood.png'); 
        background-size: cover;
        background-attachment: fixed;
    }
    
    .menu-outer-container {
        background-image: none; /* Quitamos el fondo principal del body */
        padding: 50px 0;
    }
    
    .menu-outer-container::before {
        content: '';
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background-image: url('../images/menu_main_bg.png');
        background-size: contain;   /* El alto completo del menú sin aplastarlo */
        background-position: center;
        background-repeat: no-repeat;
        z-index: 1;
    }
    
    .modal-content {
        width: 450px;
    }
}

/* CONTENEDOR DE CONTENIDO (GLASSMORPHISM) */
.menu-content-area {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 
        "pescados carnes"
        "pescados sopas"
        "pescados acompanantes"
        "pescados bebidas";
    gap: 15px 30px;
    max-width: 620px;
    margin: 0 auto;
    
    /* EFECTO VIDRIO */
    background: rgba(255, 255, 255, 0.1); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ASIGNACIÓN DE AREAS */
.pescados { grid-area: pescados; }
.carnes   { grid-area: carnes; }
.sopas    { grid-area: sopas; }
.acompanantes { grid-area: acompanantes; }
.bebidas  { grid-area: bebidas; }

/* REGLAS DE RESPONSIVIDAD DEL GRID */
@media (max-width: 850px) {
    .menu-content-area {
        grid-template-columns: 1fr 1fr;
        grid-template-areas: 
            "pescados carnes"
            "pescados sopas"
            "pescados acompanantes"
            "pescados bebidas";
        gap: 10px 15px;
    }
}

.category-section {
    margin-bottom: 1rem;
}

/* Títulos de categorías (Burbujas cian como en la imagen) */
.category-title-bubble {
    background-color: var(--accent-color);
    color: white;
    display: inline-block;
    padding: 4px 25px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    margin-bottom: 1rem;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
}

.product-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
}

.product-item {
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px dotted rgba(0,0,0,0.1);
    padding-bottom: 0.6rem;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    border-radius: 8px;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.05);
}

.product-item:hover {
    transform: scale(1.02);
    background-color: rgba(0, 0, 0, 0.08);
}

.product-thumbnail {
    width: 65px;
    height: 65px;
    object-fit: cover;
    border-radius: 10px;
    background-color: rgba(0,0,0,0.05);
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.product-main-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 15px;
}

.product-side-info {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 90px;
}

.product-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: #343434;
    text-transform: uppercase;
    margin-bottom: 0.2rem; 
}

.product-price {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: #2b2b2b;
    line-height: 1;
}

.product-description {
    font-size: 0.85rem;
    color: #232323;
    font-style: italic;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nota importante / Aviso */
.product-note-item {
    padding: 10px;
    background: rgba(0, 188, 212, 0.1);
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
}

.product-note-text {
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
    font-style: italic;
}

/* MODAL STYLES */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
    padding: 60px 20px 20px;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    padding: 2.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
    margin: auto 0;
    position: relative;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: modalScale 0.3s ease-out;
}

@keyframes modalScale {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    font-weight: bold;
    color: #999;
    cursor: pointer;
}

.close-modal:hover { color: #333; }

#modal-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: .5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

#modal-product-name {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

#modal-product-description {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

#modal-product-price {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--accent-color);
}

@media (max-width: 600px) {
    .menu-content-area {
        grid-template-columns: 1fr 1fr; /* Ahora 2 columnas también en móvil */
        gap: 0 15px; /* Menos espacio entre columnas */
    }
    .category-title-bubble {
        font-size: 1.1rem; /* Letra más pequeña para categorías */
        padding: 2px 15px;
        margin-bottom: 0.8rem;
    }
    .product-name {
        font-size: 0.95rem; /* Letra de platos más pequeña */
    }
    .product-price {
        font-size: 1rem; /* Letra de precios más pequeña */
    }
    .product-description {
        font-size: 0.75rem; /* Letra de descripción más pequeña */
        line-height: 1.1;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .product-thumbnail {
        width: 50px;
        height: 50px;
    }
    .product-item {
        gap: 5px;
        padding: 5px;
    }
    .product-side-info {
        min-width: 65px;
        gap: 4px;
    }
    .product-main-info {
        padding-right: 5px;
    }
}

/* REGLAS PARA PANTALLAS MUY PEQUEÑAS (360px o menos) */
@media (max-width: 360px) {
    .menu-content-area {
        gap: 0 10px; /* Reducción de espacio entre columnas */
        padding: 10px;
        border-radius: 20px;
    }
    .category-title-bubble {
        font-size: 0.95rem; /* Títulos más pequeños */
        padding: 2px 10px;
    }
    .product-name {
        font-size: 0.85rem; /* Nombres más pequeños */
    }
    .product-price {
        font-size: 0.9rem; /* Precios más pequeños */
    }
    .product-description {
        font-size: 0.70rem; /* Descripción mínima */
    }
    .product-thumbnail {
        width: 45px; /* Foto más pequeña */
        height: 45px;
    }
    .product-side-info {
        min-width: 60px; /* Espacio para el precio y foto reducido */
        gap: 2px;
    }
    .product-list {
        gap: 0.8rem; /* Menos espacio entre productos */
    }
}

/* PANTALLA DE CARGA (LOADER) */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/loading_bg.png'); /* Fondo completo en móvil */
    background-size: cover;          /* Cover por defecto para móvil */
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease-out;
}

@media (min-width: 850px) {
    .loader-container {
        background-image: url('../images/bg_rustic_wood.png'); /* Madera de mesa para PC */
        background-size: cover;
    }
    
    .loader-container::before {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        background-image: url('../images/loading_bg.png');
        background-size: contain;   /* Mismo alto, ancho proporcional */
        background-position: center;
        background-repeat: no-repeat;
        z-index: 1;
    }
    
    .loader-spinner {
        z-index: 10;
        margin-top: 260px !important; /* Ajuste para que se vea bajo el logo en PC */
    }
}

/* Icono de carga con movimiento */
.loader-spinner {
    position: relative;
    z-index: 10;
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top: 6px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    margin-top: 100px; /* Posicionamos el spinner abajo para no tapar el centro en móvil */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-hidden {
    opacity: 0;
    pointer-events: none;
}
