/**
 * Menú hamburguesa unificado (mismo aspecto que presentacion.php)
 * GastroChat — cargar en todas las páginas con menú móvil
 */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.6rem;
    z-index: 1001;
    background: linear-gradient(135deg, #ff8c42, #ff6b35);
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(255, 107, 53, 0.28);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mobile-menu-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.mobile-menu-toggle:hover {
    transform: scale(1.03);
    box-shadow: 0 5px 18px rgba(255, 107, 53, 0.36);
}

.mobile-menu-toggle:hover::before {
    left: 100%;
}

.mobile-menu-toggle span {
    width: 28px;
    height: 4px;
    background: #fff;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.mobile-menu-toggle span:nth-child(1) {
    background: linear-gradient(90deg, #8B4513, #D2691E);
}

.mobile-menu-toggle span:nth-child(2) {
    background: linear-gradient(90deg, #228B22, #32CD32);
    height: 3px;
}

.mobile-menu-toggle span:nth-child(3) {
    background: linear-gradient(90deg, #8B4513, #D2691E);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 7px);
    background: #fff;
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-6px, -7px);
    background: #fff;
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg,
            rgba(139, 69, 19, 0.95) 0%,
            rgba(160, 82, 45, 0.98) 25%,
            rgba(210, 105, 30, 0.95) 50%,
            rgba(255, 140, 66, 0.98) 75%,
            rgba(255, 248, 240, 0.95) 100%);
    backdrop-filter: blur(25px);
    z-index: 10000 !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 100px 20px 80px;
}

.mobile-nav::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="gastronomic-pattern" patternUnits="userSpaceOnUse" width="40" height="40"><circle cx="20" cy="20" r="1" fill="rgba(255,140,66,0.1)"/><path d="M10,15 Q20,10 30,15 Q20,20 10,15" fill="rgba(255,107,53,0.08)"/><rect x="15" y="25" width="10" height="0.5" fill="rgba(255,140,66,0.06)"/><circle cx="5" cy="5" r="0.5" fill="rgba(255,140,66,0.1)"/><circle cx="35" cy="35" r="0.5" fill="rgba(255,140,66,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23gastronomic-pattern)"/></svg>') repeat;
    opacity: 0.3;
    pointer-events: none;
}

.mobile-nav.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.mobile-menu-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    overflow: hidden;
}

.mobile-menu-close::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.mobile-menu-close:hover {
    transform: scale(1.1) rotate(90deg);
    background: linear-gradient(135deg, #ff8c42, #ff6b35);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.6);
}

.mobile-menu-close:hover::before {
    left: 100%;
}

.mobile-menu-close:active {
    transform: scale(0.95) rotate(90deg);
}

.close-icon {
    font-size: 1.8rem;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.mobile-menu-close:hover .close-icon {
    transform: scale(1.2);
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.mobile-nav-content {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
    align-items: center;
    width: 100%;
    max-width: 400px;
    padding: 0;
    position: relative;
    z-index: 1;
}

.mobile-nav-link {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
    padding: 1.1rem 1.8rem;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 240px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 248, 240, 0.98) 50%,
            rgba(255, 235, 205, 0.95) 100%);
    border: 3px solid transparent;
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.2),
        0 4px 15px rgba(210, 105, 30, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    overflow: hidden;
    gap: 0.8rem;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 140, 66, 0.1),
            transparent);
    transition: left 0.6s ease;
}

.mobile-nav .nav-icon {
    font-size: 1.8rem;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.mobile-nav .nav-text {
    font-weight: 700;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: linear-gradient(135deg,
            rgba(139, 69, 19, 0.95) 0%,
            rgba(160, 82, 45, 0.98) 25%,
            rgba(210, 105, 30, 0.95) 50%,
            rgba(255, 140, 66, 0.98) 75%,
            rgba(255, 165, 0, 0.95) 100%);
    color: #fff;
    transform: translateY(-6px) scale(1.03);
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 20px 40px rgba(139, 69, 19, 0.5),
        0 10px 25px rgba(210, 105, 30, 0.4),
        0 5px 15px rgba(255, 140, 66, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mobile-nav-link:hover::before,
.mobile-nav-link.active::before {
    left: 100%;
}

.mobile-nav-link:hover .nav-icon,
.mobile-nav-link.active .nav-icon {
    transform: scale(1.3) rotate(10deg);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.mobile-nav-link:hover .nav-text,
.mobile-nav-link.active .nav-text {
    transform: translateX(5px);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mobile-nav-link:active {
    transform: translateY(-3px) scale(1.01);
}

/* Fondo principal atenuado al abrir menú */
body.menu-open {
    overflow: hidden;
}

body.menu-open .hero-presentation {
    pointer-events: none;
}

body.menu-open .hero-presentation .container {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

body.menu-open .hero .container {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.menu-open .hero {
    pointer-events: none;
}

body.menu-open .hero-contact .container {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.menu-open .hero-contact {
    pointer-events: none;
}

body.menu-open .hero-plataforma .container {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.menu-open .hero-plataforma {
    pointer-events: none;
}

body.menu-open .hero-services .container,
body.menu-open .hero-restaurants .container {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.menu-open .hero-services,
body.menu-open .hero-restaurants {
    pointer-events: none;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        min-width: 46px;
        min-height: 46px;
        padding: 0.8rem;
        box-shadow: 0 5px 18px rgba(255, 107, 53, 0.36);
    }

    .mobile-nav {
        gap: 1.6rem;
        padding: 90px 15px 70px;
    }

    .mobile-nav-content {
        gap: 1.1rem;
    }

    .mobile-nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding: 1.25rem 1.6rem;
        font-size: 1.3rem;
        min-width: 180px;
    }

    .mobile-nav .nav-icon {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .mobile-menu-toggle {
        padding: 0.7rem;
    }

    .mobile-menu-toggle span {
        width: 22px;
        height: 3px;
    }

    .mobile-menu-toggle span:nth-child(2) {
        height: 2px;
    }

    /* Bottom sheet en móvil pequeño */
    .mobile-nav {
        padding: 70px 10px calc(46px + env(safe-area-inset-bottom));
        justify-content: flex-end;
        align-items: center;
        gap: 1rem;
    }

    .mobile-nav-content {
        gap: 0.9rem;
        width: 100%;
        max-width: 420px;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(12px);
        border-radius: 26px 26px 18px 18px;
        padding: 1.1rem 1rem 1.15rem;
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
        transform: translateY(18px);
        opacity: 0;
        transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            opacity 0.35s ease;
    }

    .mobile-nav-content::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 78px;
        height: 5px;
        border-radius: 999px;
        background: rgba(255, 140, 66, 0.45);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
    }

    .mobile-nav.active .mobile-nav-content {
        transform: translateY(0);
        opacity: 1;
    }

    .mobile-nav-link {
        padding: 1.05rem 1.15rem;
        font-size: 1.05rem;
        min-width: 165px;
    }

    .mobile-menu-close {
        width: 50px;
        height: 50px;
        top: auto;
        right: 1.2rem;
        bottom: 1.2rem;
        font-size: 1.3rem;
    }

    .close-icon {
        font-size: 1.5rem;
    }
}

/* Tabletas y móviles grandes: side drawer (entra desde la derecha) */
@media (max-width: 1024px) and (min-width: 481px) {
    .mobile-nav {
        padding: 0;
        justify-content: flex-start;
        align-items: flex-end;
        gap: 0;
    }

    .mobile-nav-content {
        width: min(420px, 92vw);
        height: 100vh;
        max-width: 420px;
        /* Padding inferior reducido para evitar hueco tras el último enlace */
        padding: 7.5rem 1.2rem 1.2rem;
        border-radius: 22px 0 0 22px;
        overflow-y: auto;
        transform: translateX(110%);
        opacity: 0;
        transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.35s ease;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(14px);
        box-shadow: -30px 0 80px rgba(0, 0, 0, 0.25);
    }

    .mobile-nav.active .mobile-nav-content {
        transform: translateX(0);
        opacity: 1;
    }

    .mobile-menu-close {
        top: 1.25rem;
        right: 1.25rem;
        bottom: auto;
        width: 54px;
        height: 54px;
        font-size: 1.25rem;
    }

    .mobile-nav-link {
        width: 100%;
        min-width: 0;
        justify-content: flex-start;
        opacity: 0;
        transform: translateY(12px) scale(0.985);
        transition:
            opacity 0.25s ease,
            transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            background 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .mobile-nav-link.active {
        opacity: 1; /* el activo mantiene su estilo destacado */
        transform: translateY(-6px) scale(1.03);
    }

    .mobile-nav.active .mobile-nav-link {
        opacity: 1;
    }

    .mobile-nav.active .mobile-nav-link:not(.active) {
        transform: translateY(0) scale(1);
    }

    /* Stagger animado para enlaces */
    .mobile-nav-content > .mobile-nav-link:nth-child(1) { transition-delay: 0.05s; }
    .mobile-nav-content > .mobile-nav-link:nth-child(2) { transition-delay: 0.10s; }
    .mobile-nav-content > .mobile-nav-link:nth-child(3) { transition-delay: 0.15s; }
    .mobile-nav-content > .mobile-nav-link:nth-child(4) { transition-delay: 0.20s; }
    .mobile-nav-content > .mobile-nav-link:nth-child(5) { transition-delay: 0.25s; }
    .mobile-nav-content > .mobile-nav-link:nth-child(6) { transition-delay: 0.30s; }
}

/* Dispositivos móviles muy pequeños (pantallas estrechas) */
@media (max-width: 360px) {
    .mobile-menu-toggle {
        min-width: 42px;
        min-height: 42px;
        padding: 0.65rem;
    }

    .mobile-menu-toggle span {
        width: 20px;
        height: 3px;
    }

    .mobile-menu-toggle span:nth-child(2) {
        height: 2px;
    }

    .mobile-nav {
        padding: 65px 8px calc(44px + env(safe-area-inset-bottom));
        gap: 1.2rem;
    }

    .mobile-nav-content {
        gap: 0.8rem;
        max-width: 340px;
        padding: 1rem 0.85rem 1.05rem;
    }

    .mobile-nav-link {
        min-height: 40px;
        padding: 0.95rem 1.15rem;
        font-size: 1rem;
        min-width: 145px;
        border-radius: 16px;
        gap: 0.7rem;
    }

    .mobile-nav .nav-icon {
        font-size: 1.35rem;
    }

    .mobile-menu-close {
        width: 44px;
        height: 44px;
        top: auto;
        right: 1rem;
        bottom: 1.05rem;
        font-size: 1.2rem;
        box-shadow: 0 6px 18px rgba(255, 107, 53, 0.4);
    }

    .close-icon {
        font-size: 1.35rem;
    }
}

.mobile-menu-toggle:focus-visible,
.mobile-nav-link:focus-visible,
.mobile-menu-close:focus-visible {
    outline: 2px solid #ff8c42;
    outline-offset: 2px;
}

/* Hasta 1024px: barra desktop oculta, icono hamburguesa visible (después del display:none base) */
@media (max-width: 1024px) {
    header nav > .nav-links {
        display: none !important;
    }

    .mobile-menu-toggle {
        display: flex !important;
    }
}
