/* Variables de colores */
:root {
    --rosa-rabano: #ff5387;
    --crema-tostada: #ffebc2;
    --tostada: #ffddb1; /* nuevo tono cálido para overlays */
}

/* Estabiliza el espacio del scrollbar para evitar reflow/zoom del fondo */
html {
    scrollbar-gutter: stable; /* navegadores modernos */
}

@supports not (scrollbar-gutter: stable) {
    html { overflow-y: scroll; } /* fallback amplio soporte */
}

/* Fuente personalizada */
@font-face {
    font-family: 'Pigzoleria';
    src: url('../font/pigzoleria.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Fondo estable en toda la app */
html, body { height: 100%; }

body {
    position: relative;
    color: var(--crema-tostada);
    line-height: 1.6;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh; /* fallback */
    background-image: url('../img/Fondo-Pigzoleria.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

@supports (height: 100lvh) {
    body::before { height: 100lvh; }
}

/* Contenedor principal */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header principal */
.main-header {
    text-align: center;
    padding: 20px;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 150px;
    height: auto;
    border-radius: 0;
    border: none;
}

.main-header h1 {
    font-family: 'Pigzoleria', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.5rem;
    color: var(--rosa-rabano);
    /* Contorno blanco */
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8), 2px 2px 4px rgba(0,0,0,0.15);
}

/* Botón de WhatsApp (FAB) */
.whatsapp-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    display: grid;
    place-items: center;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: pulse 2s infinite;
}

.whatsapp-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

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

/* Navegación por categorías */
.categories-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    background-color: rgba(58, 47, 40, 0.55); /* antes: rgba(0,0,0,0.8) */
    border-top: 1px solid rgba(255, 235, 194, 0.25);
    border-bottom: 1px solid rgba(255, 235, 194, 0.25);
    position: sticky;
    top: 0;
    z-index: 100;
}

.category-btn {
    background-color: var(--tostada);
    border: 2px solid var(--rosa-rabano);
    color: var(--rosa-rabano);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.category-btn:hover, .category-btn.active {
    background-color: var(--rosa-rabano);
    color: white;
}

/* Contenido del menú */
.menu-content {
    width: 100%;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    flex-grow: 1;
}

.category-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.category-section.active {
    display: block;
}

.category-section h2 {
    font-family: 'Pigzoleria', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--rosa-rabano);
    font-size: 2rem;
    margin: 24px 0 24px; /* más espacio arriba y abajo */
    text-align: center;
    /* Contorno blanco */
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.9);
    text-shadow:
        1px 0 0 rgba(255,255,255,0.9),
        -1px 0 0 rgba(255,255,255,0.9),
        0 1px 0 rgba(255,255,255,0.9),
        0 -1px 0 rgba(255,255,255,0.9),
        2px 2px 4px rgba(0,0,0,0.15);
}

.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
    gap: 20px;
    justify-content: center;
    place-items: center;
}

.menu-item {
    position: relative;
    background: var(--rosa-rabano);
    border-radius: 16px;
    padding: 20px 20px 18px 24px;
    border: 1px solid rgba(255, 235, 194, 0.35);
    box-shadow: 0 10px 24px rgba(58, 47, 40, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    backdrop-filter: saturate(120%) blur(4px);
    width: 100%;
    max-width: 320px;
}

.menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--crema-tostada));
}

.menu-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(58, 47, 40, 0.28);
    border-color: rgba(255, 235, 194, 0.55);
}

.menu-item h3 {
    color: var(--tostada);
    margin: 0 0 10px 8px;
    font-size: 1.15rem;
    font-weight: 700;
}

.menu-item p {
    color: rgba(58, 47, 40, 0.85);
    margin: 0 0 14px 8px;
    font-size: 0.95rem;
}

.price {
    display: inline-block;
    padding: 6px 12px;
    margin-left: 8px;
    border-radius: 999px;
    background-color: var(--crema-tostada);
    color: var(--rosa-rabano);
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 6px 14px rgba(255, 83, 135, 0.35);
}

/* Footer */
.main-footer {
    position: relative;
    text-align: center;
    padding: 64px 20px 20px;
    background-color: rgba(58, 47, 40, 0.55); /* antes: rgba(0,0,0,0.8) */
    border-top: 1px solid rgba(255, 235, 194, 0.25);
    margin-top: 60px;
}

.footer-logo {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid var(--rosa-rabano);
    overflow: hidden;
    background: radial-gradient(circle, rgba(80, 65, 55, 0.9) 0%, rgba(58, 47, 40, 0.9) 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

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

.footer-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.footer-icons a {
    color: var(--crema-tostada);
    transition: color 0.3s ease;
}

.footer-icons a:hover {
    color: var(--rosa-rabano);
}

.footer-icons svg {
    width: 28px;
    height: 28px;
}

.main-footer p {
    margin-bottom: 10px;
    color: var(--crema-tostada);
}

.main-footer a {
    color: var(--rosa-rabano);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.main-footer a:hover {
    color: var(--crema-tostada);
    text-decoration: none;
}

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

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .main-header h1 {
        font-size: 2rem;
    }
    
    .categories-nav {
        padding: 10px;
    }
    
    .category-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .menu-items {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .whatsapp-btn {
        width: 52px;
        height: 52px;
        bottom: 16px;
        right: 16px;
    }

    /* Evita cambios por barra del navegador en móviles */
    .container {
        min-height: 100svh;
    }

    .category-section h2 {
        margin: 20px 0 20px;
    }
}

@media (max-width: 480px) {
    .logo {
        width: 120px;
        height: auto;
    }
    
    .main-header h1 {
        font-size: 1.8rem;
    }
    
    .category-section h2 {
        font-size: 1.5rem;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    background-color: var(--tostada);
    color: var(--rosa-rabano); /* Changed to pink */
    padding: 40px;
    border-radius: 16px;
    max-width: 90%;
    width: 400px;
    text-align: center;
    font-size: 1.5rem; /* Increased font size */
    font-weight: bold;
    border: 2px solid var(--rosa-rabano);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    background-image: url('../img/pigzolin-2.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-blend-mode: overlay;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8), 2px 2px 4px rgba(0,0,0,0.15);
}

.modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    background: var(--rosa-rabano);
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.modal-close:hover {
    transform: scale(1.1);
    background-color: #d1426f; /* Darker pink */
}

#closed-modal .modal-content p {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: normal; /* The main style has bold, let's make sub-text normal */
}

#closed-modal .modal-content p:first-of-type {
    font-size: 1.5rem;
    font-weight: bold;
}

.modal-close-closed {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    background: var(--rosa-rabano);
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.modal-close-closed:hover {
    transform: scale(1.1);
    background-color: #d1426f; /* Darker pink */
}