/* ===== VARIABLES CSS OPTIMIZADAS ===== */
:root {
    /* Modo Claro */
    --primary-color: #381d09;
    --secondary-color: #D2691E;
    --accent-color: #FFD700;
    --text-color: #333333;
    --background-color: #F5F5DC;
    --menu-bg: #FFFFFF;
    --card-bg: #FFFFFF;
    --shadow: 0 4px 8px rgba(0,0,0,0.1);
    --overlay-bg: rgba(0,0,0,0.8);
    --modal-bg: #F5F5DC;
    --border-color: #DDDDDD;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    /* Modo Oscuro */
    --primary-color: #D2691E;
    --secondary-color: #FF8C00;
    --accent-color: #FFD700;
    --text-color: #E0E0E0;
    --background-color: #1A1A1A;
    --menu-bg: #2D2D2D;
    --card-bg: #3D3D3D;
    --shadow: 0 4px 8px rgba(0,0,0,0.3);
    --overlay-bg: rgba(0,0,0,0.9);
    --modal-bg: #2D2D2D;
    --border-color: #555555;
}

/* ===== RESET OPTIMIZADO ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Transiciones agrupadas para mejor performance */
body, .dish-item, .nav-btn, .theme-toggle, .modal-content,
.category-btn, .suggestion-card, .carousel-arrow {
    transition: var(--transition);
}

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    color: var(--text-color);
}

/* ===== LAYOUT CORREGIDO - ESTRUCTURA PRINCIPAL ===== */
.main-content {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    flex: 1;
}

/* ===== CORRECCIÓN: UNIFICAR COLORES DE FONDO ===== */
.menu-section, 
.chef-suggestions, 
.reservations-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    color: white !important;
}

.menu-section {
    order: 1;
    display: block;
    position: relative;
    width: 100%;
}

.chef-suggestions {
    order: 2;
    margin: 0 !important;
    display: block;
    position: relative;
    width: 100%;
}

.reservations-section {
    order: 3;
    margin: 0 !important;
    display: block;
    position: relative;
    width: 100%;
}

/* ===== CONTENEDOR PRINCIPAL OPTIMIZADO ===== */
.menu-container {
    perspective: 1200px;
    width: 100%;
    margin-bottom: 0 !important;
}

/* ===== CORRECCIÓN: ELIMINAR SCROLL DOBLE ===== */
.menu-book {
    position: relative;
    width: 100%;
    height: auto !important;
    min-height: 850px;
    overflow: visible !important;
    max-height: none !important;
    transform-style: preserve-3d;
}

.page {
    position: absolute;
    width: 100%;
    height: auto !important;
    min-height: 800px;
    background: var(--menu-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 30px;
    display: none;
    background-image: url('../assets/images/backgrounds/textura-papel.jpg');
    background-size: cover;
    color: var(--text-color);
    will-change: transform;
    overflow: visible !important;
}

.page.active {
    display: block;
}

.page-content h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 2em;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

/* ===== BARRA DE CATEGORÍAS DESLIZABLE ===== */
.categories-scroll-container {
    position: sticky !important;
    top: 0;
    background: var(--menu-bg);
    z-index: 100;
    padding: 15px 40px;
    margin: 20px 0 30px 0;
    border-bottom: 2px solid var(--border-color);
}

.categories-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 5px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-btn {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 20px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    box-shadow: var(--shadow);
    color: var(--text-color);
}

.category-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.category-icon {
    font-size: 1.5em;
    line-height: 1;
}

.category-name {
    font-size: 0.85em;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}

/* Flechas de navegación */
.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    z-index: 10;
}

.scroll-arrow:hover {
    background: var(--secondary-color);
    transform: translateY(-50%) scale(1.1);
}

.scroll-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.scroll-left {
    left: 0;
}

.scroll-right {
    right: 0;
}

.scroll-arrow.hidden {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%) scale(0.8);
}

/* ===== GRID DE PLATILLOS OPTIMIZADO ===== */
.dishes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    height: auto !important;
    min-height: 350px;
    overflow: visible !important;
    max-height: none !important;
}

/* ===== CORRECCIÓN: SCROLL AUTOMÁTICO PARA TODAS LAS PÁGINAS ===== */
.page.active .dishes-grid:has(.dish-item:nth-child(4)) {
    max-height: 500px !important;
    overflow-y: auto !important;
    padding-right: 8px;
}

/* Estilizar scrollbar */
.page.active .dishes-grid::-webkit-scrollbar {
    width: 8px;
}

.page.active .dishes-grid::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

.page.active .dishes-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.page.active .dishes-grid::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.dish-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow);
    background: var(--card-bg);
    transform: translateZ(0);
}

.dish-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.dish-item:hover img {
    transform: scale(1.1);
}

.dish-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, var(--overlay-bg));
    color: white;
    padding: 10px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.dish-item:hover .dish-overlay {
    transform: translateY(0);
}

/* ===== BOTÓN DE TEMA OPTIMIZADO ===== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--secondary-color);
}

/* ===== CONTENEDOR DE MEDIA OPTIMIZADO ===== */
.media-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 15px;
    overflow: hidden;
    background: #000;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-color);
}

.media-element {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    display: none;
}

.media-element.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#modal-video {
    background: #000;
}

.media-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 10;
}

/* Estados de carga optimizados */
.media-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 100;
}

/* ===== MODALES OPTIMIZADOS ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--modal-bg);
    margin: 2% auto;
    padding: 20px;
    border-radius: 15px;
    width: 95%;
    max-width: 500px;
    position: relative;
    animation: modalAppear 0.3s ease;
    color: var(--text-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
    scroll-behavior: smooth;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 30px;
    cursor: pointer;
    color: var(--primary-color);
    background: none;
    border: none;
    z-index: 10001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(0,0,0,0.1);
}

/* ===== INFORMACIÓN DEL PLATILLO OPTIMIZADA ===== */
.dish-info {
    padding: 10px 0;
}

.dish-info h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.5em;
}

.dish-info p {
    color: var(--text-color);
    margin-bottom: 15px;
    line-height: 1.6;
}

.price {
    font-size: 1.5em;
    color: var(--secondary-color);
    font-weight: bold;
    display: block;
    margin-bottom: 15px;
}

/* ===== CONTROLES DE CANTIDAD OPTIMIZADOS ===== */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.quantity-btn {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.quantity-btn:hover {
    background: var(--secondary-color);
}

.quantity-display {
    font-size: 1.2em;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
    color: var(--text-color);
}

.add-to-order-btn {
    width: 100%;
    padding: 15px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.add-to-order-btn:hover {
    background: #1da851;
}

.add-to-order-btn.added {
    background: var(--secondary-color);
}

.current-order-info {
    background: var(--card-bg);
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    border-left: 4px solid #25D366;
    color: var(--text-color);
}

/* ===== WHATSAPP OPTIMIZADO ===== */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
}

.whatsapp-btn img {
    width: 35px;
    height: 35px;
}

.whatsapp-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.whatsapp-option {
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 16px;
}

.whatsapp-option:hover {
    background: var(--secondary-color);
}

.order-summary {
    margin-top: 20px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    color: var(--text-color);
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.item-name {
    flex: 1;
    color: var(--text-color);
}

.item-price {
    font-weight: bold;
    margin: 0 10px;
    color: var(--secondary-color);
}

.remove-item {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    color: var(--primary-color);
}

.order-total {
    text-align: right;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid var(--primary-color);
    color: var(--text-color);
}

.empty-cart {
    text-align: center;
    color: var(--text-color);
    font-style: italic;
}

/* ===== BADGES OPTIMIZADOS ===== */
.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.quantity-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 5;
}

/* ===== INDICADORES DE SELECCIÓN OPTIMIZADOS ===== */
.dish-item.selected {
    border: 3px solid #25D366;
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.5);
}

.dish-item.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #25D366;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 5;
}

/* ===== NAVEGACIÓN OPTIMIZADA ===== */
.navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.nav-btn {
    padding: 12px 25px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    box-shadow: var(--shadow);
    font-size: 16px;
    font-weight: bold;
}

.nav-btn:hover {
    background: var(--secondary-color);
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===== CARRUSEL SUGERENCIAS DEL CHEF ===== */
.chef-suggestions {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    padding: 30px 20px;
    border-radius: 20px;
    color: white !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.1);
}

.chef-suggestions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../assets/images/backgrounds/chef-pattern.png') repeat;
    opacity: 0.1;
    pointer-events: none;
}

.suggestions-header {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
    z-index: 2;
}

.suggestions-header h2 {
    font-size: 1.8em;
    margin-bottom: 8px;
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.suggestions-header p {
    font-size: 1em;
    opacity: 0.9;
    font-style: italic;
    color: white !important;
}

.carousel-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.carousel-track {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 5px;
    flex: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
}

.carousel-track:active {
    cursor: grabbing;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-slide {
    flex: 0 0 280px;
}

.suggestion-card {
    background: var(--menu-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    color: var(--text-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
}

.suggestion-card:hover,
.suggestion-card:focus {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-color: var(--accent-color);
}

.suggestion-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.suggestion-card:hover img {
    transform: scale(1.05);
}

.suggestion-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.suggestion-info h4 {
    color: var(--primary-color);
    margin-bottom: 6px;
    font-size: 1.1em;
    line-height: 1.3;
}

.suggestion-info p {
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 0.85em;
    line-height: 1.4;
    flex: 1;
    opacity: 0.9;
}

.suggestion-info .price {
    color: var(--secondary-color);
    font-size: 1.2em;
    font-weight: bold;
    margin-top: auto;
}

.chef-badge {
    position: absolute;
    top: -12px;
    right: 12px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #333;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(187, 124, 8, 0.3);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.carousel-arrow {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
    z-index: 10;
    flex-shrink: 0;
}

.carousel-arrow:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.carousel-arrow:active {
    transform: scale(0.95);
}

.carousel-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    position: relative;
    z-index: 2;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: white;
    transform: scale(1.3);
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

/* ===== CORRECCIONES ESPECÍFICAS DE LAYOUT ===== */
/* Prevenir que elementos se salgan del flujo */
.menu-book, .chef-suggestions, .reservations-section {
    position: relative;
    z-index: 1;
}

/* Garantizar orden de apilamiento correcto */
.theme-toggle {
    z-index: 1000;
}

.whatsapp-btn {
    z-index: 1000;
}

.modal {
    z-index: 10000;
}

/* ===== RESPONSIVE DESIGN OPTIMIZADO ===== */
@media (max-width: 768px) {
    body {
        padding: 0;
        justify-content: flex-start;
    }
    
    .main-content {
        padding: 10px;
        gap: 20px;
        overflow: visible !important;
    }
    
    .menu-container {
        max-width: 100%;
        height: auto;
    }
    
    .menu-book {
        height: auto !important;
        min-height: 700px;
        overflow: visible !important;
    }
    
    .page {
        padding: 15px;
        height: auto !important;
        min-height: 650px;
        overflow: visible !important;
    }
    
    .page-content h2 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }
    
    .dishes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        height: auto !important;
        min-height: 400px;
        overflow: visible !important;
    }
    
    /* ===== CORRECCIÓN: SCROLL EN MÓVILES ===== */
    .page.active .dishes-grid:has(.dish-item:nth-child(3)) {
        max-height: 400px !important;
        overflow-y: auto !important;
    }
    
    .dish-item img {
        height: 120px;
    }

    /* Eliminar el indicador de scroll ya que no es necesario */
    .scroll-indicator {
        display: none !important;
    }
    
    /* 🔥 NAVEGACIÓN CENTRADA OPTIMIZADA */
    .navigation {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(139, 69, 19, 0.95);
        padding: 15px;
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 0;
        z-index: 999;
        border-radius: 50px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        width: auto;
        min-width: 280px;
    }
    
    .nav-btn {
        padding: 15px 20px;
        font-size: 14px;
        flex: 1;
        margin: 0;
        border-radius: 25px;
        min-width: 120px;
        text-align: center;
    }
    
    /* Ajustar posición del botón de WhatsApp */
    .whatsapp-btn {
        bottom: 90px;
        right: 20px;
        width: 60px;
        height: 60px;
    }
    
    .whatsapp-btn img {
        width: 30px;
        height: 30px;
    }
    
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    /* Modal móvil optimizado */
    .modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
        padding: 60px 20px 20px 20px;
        max-height: none;
    }
    
    .close-btn {
        top: 15px;
        right: 15px;
        font-size: 35px;
        width: 50px;
        height: 50px;
        background: rgba(0,0,0,0.7);
        color: white;
    }
    
    /* Media container en móviles optimizado */
    .media-container {
        min-height: 200px;
    }
    
    .media-element {
        height: 35vh;
        min-height: 200px;
        max-height: 300px;
    }
    
    .media-indicator {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .quantity-controls {
        gap: 20px;
        margin: 25px 0;
    }
    
    .quantity-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .quantity-display {
        font-size: 1.5em;
        min-width: 40px;
    }
    
    .add-to-order-btn {
        padding: 18px;
        font-size: 18px;
        margin: 20px 0;
    }
    
    /* BARRA DE CATEGORÍAS RESPONSIVE */
    .categories-scroll-container {
        position: sticky !important;
        top: 0;
        background: var(--menu-bg);
        z-index: 100;
        padding: 10px 35px;
        margin: 15px 0 25px 0;
        border-bottom: 2px solid var(--border-color);
    }
    
    .category-btn {
        padding: 10px 15px;
        min-width: 85px;
    }
    
    .category-icon {
        font-size: 1.3em;
    }
    
    .category-name {
        font-size: 0.75em;
    }
    
    .scroll-arrow {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    /* CARRUSEL RESPONSIVE */
    .chef-suggestions {
        padding: 25px 15px;
        border-radius: 15px;
    }
    
    .suggestions-header h2 {
        font-size: 1.6em;
    }
    
    .suggestions-header p {
        font-size: 0.9em;
    }
    
    .carousel-container {
        gap: 8px;
    }
    
    .carousel-slide {
        flex: 0 0 260px;
    }
    
    .carousel-arrow {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .suggestion-card img {
        height: 140px;
    }
    
    .suggestion-info {
        padding: 12px;
    }
    
    .suggestion-info h4 {
        font-size: 1em;
    }
    
    .suggestion-info p {
        font-size: 0.8em;
    }
    
    .chef-badge {
        font-size: 0.7em;
        padding: 3px 8px;
        top: -10px;
        right: 10px;
    }
    
    .carousel-indicators {
        margin-top: 15px;
    }
}

@media (max-width: 480px) {
    .dishes-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .dish-item img {
        height: 150px;
    }
    
    .modal-content {
        padding: 50px 15px 15px 15px;
    }
    
    .media-element {
        height: 30vh;
        min-height: 180px;
        max-height: 250px;
    }
    
    .close-btn {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 30px;
    }
    
    .nav-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    /* 🔥 AJUSTES PARA MÓVILES PEQUEÑOS OPTIMIZADOS */
    .navigation {
        bottom: 15px;
        padding: 12px;
        min-width: 250px;
        border-radius: 40px;
    }
    
    .nav-btn {
        padding: 12px 15px;
        font-size: 13px;
        min-width: 110px;
    }
    
    .whatsapp-btn {
        bottom: 85px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
    
    .whatsapp-btn img {
        width: 28px;
        height: 28px;
    }
    
   
    /* CATEGORÍAS MÓVILES PEQUEÑOS */
    .categories-scroll-container {
        padding: 0 30px;
    }
    
    .category-btn {
        padding: 8px 12px;
        min-width: 75px;
        gap: 3px;
    }
    
    .category-icon {
        font-size: 1.2em;
    }
    
    .category-name {
        font-size: 0.7em;
    }
    
    .scroll-arrow {
        width: 25px;
        height: 25px;
        font-size: 14px;
    }
    
    /* CARRUSEL MÓVILES PEQUEÑOS */
    .chef-suggestions {
        padding: 20px 12px;
    }
    
    .carousel-slide {
        flex: 0 0 240px;
    }
    
    .suggestion-card img {
        height: 130px;
    }
    
    .suggestion-info {
        padding: 10px;
    }
    
    .suggestion-info h4 {
        font-size: 0.9em;
        margin-bottom: 4px;
    }
    
    .suggestion-info p {
        font-size: 0.75em;
        margin-bottom: 6px;
    }
}

/* 🔥 SOPORTE PARA TABLETAS OPTIMIZADO */
@media (min-width: 769px) and (max-width: 1024px) {
    .navigation {
        position: fixed;
        bottom: 25px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(139, 69, 19, 0.95);
        padding: 15px 25px;
        border-radius: 50px;
        gap: 15px;
        z-index: 999;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    }
    
    .nav-btn {
        padding: 15px 25px;
        font-size: 16px;
        min-width: 130px;
        border-radius: 25px;
    }
    
    .whatsapp-btn {
        bottom: 100px;
       
        right: 20px;
        width: 60px;
        height: 60px;
    }
    
    .whatsapp-btn img {
        width: 30px;
        height: 30px;
    }
    
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    /* Modal móvil optimizado */
    .modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
        padding: 60px 20px 20px 20px;
        max-height: none;
    }
    
    .close-btn {
        top: 15px;
        right: 15px;
        font-size: 35px;
        width: 50px;
        height: 50px;
        background: rgba(0,0,0,0.7);
        color: white;
    }
    
    /* Media container en móviles optimizado */
    .media-container {
        min-height: 200px;
    }
    
    .media-element {
        height: 35vh;
        min-height: 200px;
        max-height: 300px;
    }
    
    .media-indicator {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .quantity-controls {
        gap: 20px;
        margin: 25px 0;
    }
    
    .quantity-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .quantity-display {
        font-size: 1.5em;
        min-width: 40px;
    }
    
    .add-to-order-btn {
        padding: 18px;
        font-size: 18px;
        margin: 20px 0;
    }
    
    /* BARRA DE CATEGORÍAS RESPONSIVE */
    .categories-scroll-container {
        padding: 0 35px;
        margin: 15px 0 25px 0;
    }
    
    .category-btn {
        padding: 10px 15px;
        min-width: 85px;
    }
    
    .category-icon {
        font-size: 1.3em;
    }
    
    .category-name {
        font-size: 0.75em;
    }
    
    .scroll-arrow {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    /* CARRUSEL RESPONSIVE */
    .chef-suggestions {
        margin: 15px auto 0 auto;
        padding: 25px 15px;
        width: calc(100% - 30px);
        border-radius: 15px;
    }
    
    .suggestions-header h2 {
        font-size: 1.6em;
    }
    
    .suggestions-header p {
        font-size: 0.9em;
    }
    
    .carousel-container {
        gap: 8px;
    }
    
    .carousel-slide {
        flex: 0 0 260px;
    }
    
    .carousel-arrow {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    /* Ocultar flechas en móviles muy pequeños */
    @media (max-width: 360px) {
        .carousel-arrow {
            display: none;
        }
        
        .carousel-container {
            gap: 0;
        }
    }
    
    .suggestion-card img {
        height: 140px;
    }
    
    .suggestion-info {
        padding: 12px;
    }
    
    .suggestion-info h4 {
        font-size: 1em;
    }
    
    .suggestion-info p {
        font-size: 0.8em;
    }
    
    .chef-badge {
        font-size: 0.7em;
        padding: 3px 8px;
        top: -10px;
        right: 10px;
    }
    
    .carousel-indicators {
        margin-top: 15px;
    }
}

@media (max-width: 480px) {
    .dishes-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .dish-item img {
        height: 150px;
    }
    
    .modal-content {
        padding: 50px 15px 15px 15px;
    }
    
    .media-element {
        height: 30vh;
        min-height: 180px;
        max-height: 250px;
    }
    
    .close-btn {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 30px;
    }
    
    .nav-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    /* 🔥 AJUSTES PARA MÓVILES PEQUEÑOS OPTIMIZADOS */
    .navigation {
        bottom: 15px;
        padding: 12px;
        min-width: 250px;
        border-radius: 40px;
    }
    
    .nav-btn {
        padding: 12px 15px;
        font-size: 13px;
        min-width: 110px;
    }
    
    .whatsapp-btn {
        bottom: 85px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
    
    .whatsapp-btn img {
        width: 28px;
        height: 28px;
    }
    
    /* CATEGORÍAS MÓVILES PEQUEÑOS */
    .categories-scroll-container {
        padding: 0 30px;
    }
    
    .category-btn {
        padding: 8px 12px;
        min-width: 75px;
        gap: 3px;
    }
    
    .category-icon {
        font-size: 1.2em;
    }
    
    .category-name {
        font-size: 0.7em;
    }
    
    .scroll-arrow {
        width: 25px;
        height: 25px;
        font-size: 14px;
    }
    
    /* CARRUSEL MÓVILES PEQUEÑOS */
    .chef-suggestions {
        padding: 20px 12px;
        margin: 10px auto 0 auto;
        width: calc(100% - 24px);
    }
    
    .carousel-slide {
        flex: 0 0 240px;
    }
    
    .suggestion-card img {
        height: 130px;
    }
    
    .suggestion-info {
        padding: 10px;
    }
}

/* 🔥 SOPORTE PARA TABLETAS OPTIMIZADO */
@media (min-width: 769px) and (max-width: 1024px) {
    .navigation {
        position: fixed;
        bottom: 25px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(139, 69, 19, 0.95);
        padding: 15px 25px;
        border-radius: 50px;
        gap: 15px;
        z-index: 999;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    }
    
    .nav-btn {
        padding: 15px 25px;
        font-size: 16px;
        min-width: 130px;
        border-radius: 25px;
    }
    
    .whatsapp-btn {
        bottom: 100px;
        right: 25px;
    }
    
    /* CARRUSEL TABLET */
    .carousel-slide {
        flex: 0 0 calc(50% - 10px);
        min-width: 280px;
    }
}

/* 🔥 MEJORAS DE ACCESIBILIDAD OPTIMIZADAS */
@media (max-width: 768px) {
    .nav-btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    /* Prevenir solapamiento en orientación landscape */
    @media (max-height: 500px) {
        .navigation {
            bottom: 10px;
            padding: 10px;
        }
        
        .whatsapp-btn {
            bottom: 70px;
        }
        
        /* CARRUSEL LANDSCAPE */
        .chef-suggestions {
            padding: 15px 20px;
            margin: 10px auto 0 auto;
        }
        
        .suggestion-card img {
            height: 100px;
        }
        
        .suggestion-info {
            padding: 8px;
        }
        
        .suggestion-info h4 {
            font-size: 0.9em;
            margin-bottom: 4px;
        }
        
        .suggestion-info p {
            font-size: 0.75em;
            margin-bottom: 6px;
        }
    }
}

/* 🔥 EFECTO DE GLASS MORPHISM OPTIMIZADO */
@media (max-width: 768px) {
    .navigation {
        background: rgba(139, 69, 19, 0.85);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    [data-theme="dark"] .navigation {
        background: rgba(45, 45, 45, 0.85);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Soporte para dispositivos con notch optimizado */
@supports (padding: max(0px)) {
    .modal-content {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    
    #whatsapp-modal .modal-content {
        padding-top: max(60px, env(safe-area-inset-top));
    }
}

/* Mejoras de usabilidad táctil optimizadas */
@media (max-width: 768px) {
    .dish-item:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    .nav-btn:active,
    .whatsapp-option:active,
    .quantity-btn:active,
    .add-to-order-btn:active,
    .category-btn:active,
    .suggestion-card:active {
        transform: scale(0.95);
    }

    /* Prevenir selección de texto accidental */
    .modal-content {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* Estados hover para dispositivos con mouse optimizados */
@media (hover: hover) {
    .dish-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    }
}

/* ===== OPTIMIZACIONES DE PERFORMANCE ===== */
.dish-item, .suggestion-card {
    transform: translateZ(0); /* Force hardware acceleration */
    backface-visibility: hidden;
}

.media-element {
    transform: translateZ(0);
}

/* Reduce repaints en animaciones */
.menu-book {
    contain: layout style paint;
}

.dishes-grid {
    contain: layout;
}

/* Efecto de pulso para categoría activa */
@keyframes categoryPulse {
    0% { box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4); }
    50% { box-shadow: 0 6px 25px rgba(139, 69, 19, 0.6); }
    100% { box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4); }
}

.category-btn.active {
    animation: categoryPulse 2s infinite;
}

/* Ajustes específicos para pantallas muy pequeñas */
@media (max-width: 320px) {
    .carousel-slide {
        flex: 0 0 220px;
    }
    
    .suggestion-card img {
        height: 120px;
    }
    
    .suggestion-info h4 {
        font-size: 0.95em;
    }
    
    .suggestion-info p {
        font-size: 0.75em;
    }
}

/* Mejoras de accesibilidad */
.category-btn:focus,
.scroll-arrow:focus,
.carousel-arrow:focus,
.indicator:focus,
.suggestion-card:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Scroll suave para toda la aplicación */
html {
    scroll-behavior: smooth;
}

/* Prevenir flash de contenido no estilizado */
body {
    opacity: 1;
    transition: opacity 0.3s ease;
}

body.loading {
    opacity: 0;
}
/* 🔥 TRANSICIÓN SUAVE PARA SCROLL */
.menu-book {
    scroll-behavior: smooth;
}

/* 🔥 EFECTO DE DESENFOQUE EN BORDES (OPCIONAL) */
.menu-book::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, var(--menu-bg));
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-book.has-scroll-content::before {
    opacity: 1;
}

/* 🔥 ESTILOS PARA ITEMS DE PLATILLOS EN SCROLL */
.dish-item {
    transition: transform 0.2s ease;
}

.dish-item:hover {
    transform: translateY(-2px);
}

/* 🔥 MEJORA VISUAL CUANDO HAY MUCHOS PLATILLOS */
.dishes-grid {
    padding-bottom: 10px; /* Espacio extra al final */
}
/* ===== CORRECCIONES ESPECÍFICAS DE POSICIONAMIENTO ===== */

/* Asegurar que el menú no tenga márgenes conflictivos */
.menu-container {
    margin-bottom: 0 !important;
}

/* Chef suggestions sin márgenes conflictivos */
.chef-suggestions {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Prevenir que elementos se salgan del flujo */
.menu-book, .chef-suggestions, .reservations-section {
    position: relative;
    z-index: 1;
}

/* Garantizar orden de apilamiento correcto */
.theme-toggle {
    z-index: 1000;
}

.whatsapp-btn {
    z-index: 1000;
}

.modal {
    z-index: 10000;
}

/* ===== CORRECCIONES DE LAYOUT ===== */
.main-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.menu-section {
    order: 1;
}

.chef-suggestions {
    order: 2;
    margin: 0 !important; /* Eliminar márgenes conflictivos */
}

.reservations-section {
    order: 3;
    margin: 0 !important; /* Eliminar márgenes conflictivos */
}

/* Garantizar que las secciones sean bloques independientes */
.menu-section,
.chef-suggestions,
.reservations-section {
    display: block;
    position: relative;
    width: 100%;
}

/* Prevenir superposición en móviles */
@media (max-width: 768px) {
    .main-content {
        padding: 10px;
        gap: 20px;
    }
    
    .menu-container {
        margin-bottom: 0 !important;
    }
    
    .chef-suggestions,
    .reservations-section {
        margin-top: 0 !important;
    }
}

/* Asegurar que el body tenga layout correcto */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* Contenedor del menú específico */
.menu-container {
    width: 100%;
    margin: 0 auto;
    position: relative;
}


/* Layout para pantallas muy pequeñas */
@media (max-height: 600px) and (max-width: 768px) {
    .main-content {
        gap: 15px;
    }
    
    .menu-book {
        height: 550px !important;
    }
    
    .reservations-section {
        padding: 15px 10px;
    }
}
/* ===== HEADER CON LOGO DERECHA Y NOMBRE IZQUIERDA ===== */
.restaurant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    margin: 20px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 15px;
    box-shadow: var(--shadow);
}

/* Nombre del restaurante a la izquierda */
.restaurant-name {
    color: white;
    font-size: 2.2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin: 0;
    font-family: 'Georgia', serif;
    text-align: left;
    flex: 1;
}

/* Logo a la derecha */
.restaurant-logo-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.restaurant-logo {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .restaurant-header {
        padding: 15px 20px;
        margin: 15px 0;
    }
    
    .restaurant-name {
        font-size: 1.8em;
    }
    
    .restaurant-logo {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .restaurant-header {
        padding: 12px 15px;
        margin: 10px 0;
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .restaurant-name {
        font-size: 1.6em;
        text-align: center;
        order: 2;
    }
    
    .restaurant-logo-container {
        justify-content: center;
        order: 1;
    }
    
    .restaurant-logo {
        width: 70px;
        height: 70px;
    }
}