/* Configuración general de desplazamiento suave y elegante */
html {
    scroll-behavior: smooth;
}

body {
    background-color: #09090b;
    color: #f4f4f5;
    font-family: 'Poppins', sans-serif;
}

/* Suavizar todas las transiciones del sitio para que no se sientan bruscas */
*, ::before, ::after {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sección Principal (Hero) con tu imagen de fondo y un velo oscuro profesional */
.hero-bg {
    background: linear-gradient(to bottom, rgba(9, 9, 11, 0.8), rgba(9, 9, 11, 0.92)), 
                url('https://res.cloudinary.com/nk01e0gr/image/upload/f_auto,q_auto/v1790903548/IMG_4649.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Barra de desplazamiento personalizada, discreta y limpia */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #09090b;
}

::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}

/* ==========================================================================
   Clases Consistentes para Enlaces y Botones
   ========================================================================== */

/* Enlaces de Navegación */
.nav-link {
    color: #d4d4d8;
    text-decoration: none;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    color: #ef4444;
}

/* Enlaces Telefónicos */
.phone-link {
    text-decoration: none;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.phone-link:hover {
    color: #ef4444;
}

/* Enlaces a Google Maps / Ubicaciones */
.map-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-link:hover {
    color: #ef4444;
    text-decoration: underline;
}

/* ==========================================================================
   Insignia Dinámica de Estado de Sucursal (Abierto / Cerrado)
   ========================================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem; /* 10px */
    font-weight: 600;
    line-height: 1.2;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

@media (min-width: 640px) {
    .status-badge {
        font-size: 0.75rem; /* 12px */
        padding: 0.2rem 0.65rem;
        gap: 0.4rem;
    }
}

/* Estado: Abierto */
.status-badge.status-open {
    background-color: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.status-badge.status-open .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
    display: inline-block;
    animation: status-pulse-green 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Estado: Cerrado */
.status-badge.status-closed {
    background-color: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.status-badge.status-closed .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #ef4444;
    display: inline-block;
}

@keyframes status-pulse-green {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.25);
    }
}


/* Enlaces directos a WhatsApp */
.whatsapp-link {
    color: #ef4444;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.whatsapp-link:hover {
    text-decoration: underline;
    color: #dc2626;
}

/* Enlaces de Redes Sociales y Footer */
.social-link {
    color: #71717a;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link:hover {
    color: #ef4444;
}

.footer-link {
    color: #a1a1aa;
    text-decoration: underline;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.footer-link:hover {
    color: #ef4444;
}

/* Botón Primario (Rojo Pizza Five) */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #dc2626;
    color: #ffffff;
    font-weight: 700;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 14px 20px -3px rgba(220, 38, 38, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Botón Secundario (Oscuro con borde) */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(24, 24, 27, 0.8);
    color: #ffffff;
    font-weight: 600;
    border-radius: 0.75rem;
    border: 1px solid #3f3f46;
    backdrop-filter: blur(4px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: #27272a;
    border-color: #52525b;
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Botón Icono del Carrito (Header) */
.btn-cart {
    position: relative;
    padding: 0.625rem;
    border-radius: 0.75rem;
    background-color: #18181b;
    border: 1px solid #27272a;
    color: #d4d4d8;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-cart:hover {
    border-color: #ef4444;
    color: #ffffff;
}

/* Botón de Cierre (Modales y Drawer) */
.btn-close {
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: #a1a1aa;
    background: transparent;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-close:hover {
    color: #ffffff;
    background-color: #27272a;
}

/* Pestañas de Filtro del Menú */
.menu-tab {
    cursor: pointer;
    border-radius: 0.75rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-tab-inactive {
    background-color: #18181b;
    color: #a1a1aa;
    border: 1px solid #27272a;
}

.menu-tab-inactive:hover {
    color: #ffffff;
    background-color: #27272a;
}

.menu-tab-active {
    background-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Carrusel de Fotos e Historia (#nosotros) - Compatibilidad Safari iOS
   ========================================================================== */

/* Contenedor con scroll horizontal en Safari */
.history-carousel,
#nosotros div[class*="overflow-x-auto"] {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overflow-x: auto;
    width: 100%;
}

/* Contenedor de la imagen de cada tarjeta */
.history-card,
#nosotros div[class*="snap-center"] {
    position: relative;
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    height: 360px;
    max-height: 360px;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 1.5rem; /* rounded-3xl: 24px */
    -webkit-border-radius: 1.5rem;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    isolation: isolate;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .history-card,
    #nosotros div[class*="snap-center"] {
        width: 340px;
        min-width: 340px;
        max-width: 340px;
        height: 360px;
        max-height: 360px;
        aspect-ratio: auto;
    }
}

/* Etiquetas <img> dentro de cada tarjeta - Posicionamiento absoluto para desacoplar del flujo flex de WebKit/iOS */
.history-card img,
.history-card-img,
#nosotros div[class*="snap-center"] > img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    -o-object-fit: cover;
    object-position: center;
    -o-object-position: center;
    border-radius: inherit;
    -webkit-border-radius: inherit;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: -webkit-transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* En dispositivos táctiles (iPhone/iPad/Android touch), evitar que el falso hover de iOS distorsione o agrande la imagen */
@media (hover: none) {
    .history-card img,
    .history-card-img,
    #nosotros div[class*="snap-center"] > img {
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
}

@media (hover: hover) and (pointer: fine) {
    .history-card:hover .history-card-img,
    .history-card:hover img {
        -webkit-transform: scale(1.05) translateZ(0);
        transform: scale(1.05) translateZ(0);
    }
}

/* ==========================================================================
   Espaciado Responsivo y Compacto en Pantallas Móviles (<= 768px)
   ========================================================================== */

/* Asegurar que el contenedor de productos no tenga min-height forzado */
#menu-grid {
    min-height: 0;
    height: auto;
}

#menu-grid:empty {
    display: none;
}

@media (max-width: 768px) {
    /* Ajuste fino de padding en la sección Menú */
    #menu {
        padding-top: 2.5rem !important;    /* 40px */
        padding-bottom: 1.5rem !important; /* 24px */
    }

    /* Reducir separación vertical entre botones de categoría y productos */
    #menu > div.text-center {
        margin-bottom: 1.5rem !important; /* 24px */
    }

    /* Reducir margen y padding de la sección Sucursales */
    #sucursales {
        margin-top: 1.5rem !important;     /* 24px */
        margin-bottom: 2rem !important;
        padding-top: 2rem !important;      /* 32px */
        padding-bottom: 2rem !important;
    }

    /* Reducir separación vertical del encabezado de Sucursales */
    #sucursales > div.text-center {
        margin-bottom: 1.5rem !important; /* 24px */
    }
}