:root {
    --borravino: #4a0404; /* Rojo Borravino Profundo */
    --rojo: #960018;          /* Rojo principal */
    --borravino: #4a0404;     /* Color vino profundo para fondos */
    --oscuro: #1a1a1a;
    --gris-suave: #f8f8f8;    /* Un gris casi blanco para no cansar la vista */
    --gris-suave: #f1f1f1;    /* Para el botón de mapas */
    --blanco: #ffffff;
    --dorado-suave: #c5a059;  /* Color opcional para resaltar sobre el borravino */
    --dorado-franquicia: #b38b45;
    /* Definimos las familias para fácil mantenimiento */
    --font-titulos: 'Montserrat', sans-serif;
    --font-textos: 'Roboto', sans-serif;
    --font-logo: 'Playfair Display', serif;
}

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
/* --- BASE --- */
body {
    font-family: var(--font-textos); /* Roboto por defecto para todo el cuerpo */
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    color: var(--oscuro);
}

/* --- TÍTULOS (Montserrat) --- */
h1, h2, h3, h4, .haimes-tag, .nav-links li a, .btn-whatsapp, .filter-btn, .status-badge {
    font-family: var(--font-titulos);
    font-weight: 700; /* Peso fuerte para jerarquía */
}
.container { max-width: 1200px; margin: auto; padding: 0 20px; }

.nav-links {
    display: flex;
    list-style: none;
    margin-left: auto; /* Empuja el menú hacia la derecha */
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
}

html, body {
    max-width: 100%;
    overflow-x: hidden; /* Corta cualquier contenido que intente salirse de lado */
    position: relative;
}

/* --- NAVBAR STICKY --- */
.navbar {
    height: 80px;
    background: var(--borravino); /* Fondo Borravino */
    display: flex;
    align-items: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 15px 0;
    padding: 0;
    border-bottom: 2px solid var(--rojo);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.flex-nav {
    display: flex;
    justify-content: space-between; /* LOGO A LA IZQUIERDA, MENÚ A LA DERECHA */
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* LOGO TEXTO */
.logo {
    font-weight: 700;
    font-size: 1.6rem;
    font-family: 'Playfair Display', serif;
    color: var(--blanco);

    /* Ajuste para que el contenedor del logo no tenga el estilo de texto anterior */
    text-decoration: none;
    display: flex;
    align-items: center;
}
.logo span { color: #ff4d4d; }

/* LOGO IMAGEN */
.navbar .logo img {
    height: 76px; /* Altura del header (80px) menos 4px */
    width: auto;  /* Mantiene la proporción original */
    display: block;
    padding: 2px 0; /* Asegura el margen de 2px arriba y abajo */
    transition: transform 0.3s ease;
    filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.2)); /* Le da un poco de profundidad */
}

.navbar .logo img:hover {
    transform: scale(1.05);
}

/* Ajustes específicos de Roboto para párrafos */
p, .haimes-description p, .footer-col p, .sucursal-info p {
    font-family: var(--font-textos);
    font-weight: 400;
    font-size: 1rem;
}

/* Los contadores de las estadísticas se ven mejor en Montserrat por su geometría */
.counter {
    font-family: var(--font-titulos);
    font-weight: 800;
}
.stat-card .fa-drumstick-bite {
    transform: rotate(-15deg); /* Le da un aspecto más dinámico al icono de carne */
}
/* --- MENÚ ESCRITORIO --- */
@media (min-width: 769px) {
    .menu-toggle, .close-modal, .modal-footer { display: none; }
    .nav-links { list-style: none; display: flex; align-items: center; }
    .nav-links li a {
        text-decoration: none;
        color: var(--blanco) !important;
        margin-left: 30px;
        font-weight: 600;
        transition: 0.3s;
        font-size: 0.95rem;
    }
    .nav-links li a:hover { color: var(--rojo); }
    .btn-contacto-modal {
        background: var(--rojo);
        color: white !important;
        padding: 10px 22px;
        border-radius: 5px;
    }
}

/* --- MENÚ MOBILE --- */
@media (max-width: 768px) {
    .menu-toggle { display: block; font-size: 1.6rem; color: var(--blanco); cursor: pointer; }
    .menu-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.85);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: 0.4s ease;
        z-index: 99999;
    }
    .menu-modal.open { opacity: 1; visibility: visible; }
    .modal-content {
        background: white;
        width: 85%;
        max-width: 380px;
        padding: 50px 30px;
        border-radius: 30px;
        text-align: center;
        position: relative;
        transform: translateY(0);
        margin-top: 0;
        max-height: 85vh;
        overflow-y: auto;
    }
    .close-modal {
        position: absolute;
        top: 15px;
        right: 20px;
        font-size: 2rem;
        color: var(--rojo);
        cursor: pointer;
    }
    .nav-links { 
        list-style: none; 
        padding: 0; 
        display: flex;         /* Aseguramos que sea flex */
        flex-direction: column; /* ¡ESTO es lo que los pone uno debajo del otro! */
        align-items: center; 
    }
    
    .nav-links li { 
        margin: 15px 0; 
        width: 100%; /* Para que el área de clic sea mayor */
    }

    .nav-links li a {
        text-decoration: none;
        color: var(--oscuro);
        font-size: 1.3rem; /* Un poco más pequeño para que entre todo bien */
        font-weight: 700;
        display: block;
    }
    
    /* Evitar que el margin-left: auto del escritorio afecte en mobile */
    .nav-links {
        margin-left: 0 !important; 
    }
    .modal-footer {
        margin-top: 30px;
        font-size: 0.8rem;
        color: #888;
        border-top: 1px solid #eee;
        padding-top: 20px;
    }

    .haimes-tilt-card img {
        height: 350px; /* Altura más cómoda para móviles */
    }

    .navbar {
        height: 65px;
    }
    .navbar .logo img {
        height: 61px; /* 65px - 4px */
    }
}

/* --- HERO --- */
.hero { height: 70vh; background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://images.unsplash.com/photo-1558030006-450675393462?q=80&w=1200') center/cover; display: flex; align-items: center; justify-content: center; text-align: center; color: white; }
.hero h1 { font-family: 'Playfair Display', serif; font-size: 3.5rem; }
.btn-whatsapp { background: #25d366; color: white; text-decoration: none; padding: 15px 30px; border-radius: 50px; font-weight: bold; margin-top: 20px; display: inline-block; transition: 0.3s; }
.btn-whatsapp:hover { transform: scale(1.05); box-shadow: 0 5px 15px rgba(0,0,0,0.3); }

/* --- STATS --- */
.stats-section { padding: 80px 0; background: var(--gris); }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.stat-card { background: white; padding: 40px; border-radius: 15px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.stat-card i { font-size: 2.5rem; color: var(--rojo); margin-bottom: 10px; }

/* --- SECCIÓN HAIMES ESTRUCTURA --- */
.haimes-section { padding: 20px 0; background: white; }
.haimes-upper { display: flex; align-items: center; gap: 60px; margin-bottom: 80px; }

.haimes-text { flex: 1; }
.haimes-visual { flex: 1; perspective: 1500px; }

.haimes-tag { color: var(--rojo-light); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.haimes-main-title { font-size: 3.2rem; margin: 15px 0; font-weight: 800; line-height: 1.1; }

.haimes-link-btn {
    display: inline-flex; align-items: center; gap: 12px; background: var(--rojo);
    color: white !important; text-decoration: none; padding: 14px 28px;
    border-radius: 6px; font-weight: 700; transition: 0.3s;
    box-shadow: 0 5px 15px rgba(150, 0, 24, 0.25); margin-top: 15px;
}
.haimes-link-btn:hover { background: #7a0014; transform: translateY(-3px); }

.haimes-visual {
    flex: 1.2; /* Aumentamos el peso visual */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    perspective: 1500px;
}

.haimes-tilt-card {
width: 100%; /* Que ocupe todo el ancho de su columna ampliada */
    max-width: 550px; /* Aumentamos el tope de ancho */
    border-radius: 20px;
    background: transparent;
    padding: 0;
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    margin: 0 auto;
    overflow: hidden;
    line-height: 0; /* Elimina espacios residuales */
}

.haimes-description p {
    color: #444;
}

.haimes-tilt-card:hover {
    transform: scale(1.03);
    box-shadow: 0 40px 70px rgba(0,0,0,0.2);
}

.haimes-tilt-card img {
    width: 100%;
    height: 550px; /* Altura ideal para equilibrar 3 párrafos de texto */
    height: auto; /* Altura ideal para equilibrar 3 párrafos de texto */
    border-radius: 20px;
    display: block;
    object-fit: cover; /* Recorta la imagen para llenar el espacio sin deformarse */
}

/* --- SWIPER CARDS CORREGIDOS --- */
.haimes-carousel { padding: 40px 0; }

.swiper {
    padding-top: 30px !important;
    margin-top: -30px !important;
    overflow: visible !important;
    clip-path: inset(-100px 0 -100px 0);
}

.swiper-slide {
    height: auto !important; /* Permite que el slide tome la altura del contenedor */
    display: flex !important; /* Obliga al slide a actuar como contenedor flex */
}

.haimes-card {
    background: #fff;
    padding: 35px 25px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid #f0f0f0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);

    display: flex; /* Flex interno */
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%; /* AQUÍ: Forzamos que la card ocupe el 100% del alto del slide */

    backface-visibility: hidden;
}

.haimes-card:hover {
    transform: translateY(-15px);
    border-color: var(--rojo);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    z-index: 10;
}

.haimes-card img { width: 70px; height: 70px; margin-bottom: 20px; object-fit: contain; }

.haimes-card p {
    flex-grow: 1; /* Rellena el espacio vacío para que el borde inferior sea igual en todas */
    margin-bottom: 0;
    display: flex;
    align-items: center; /* Centra el texto verticalmente en el espacio restante */
}

/* Estilo para iconos */
.haimes-icon-wrapper {
    width: 85px;
    height: 85px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    flex-shrink: 0; /* Evita que el circulo del icono se aplaste */
}

.haimes-icon-wrapper i {
    font-size: 2.2rem;
    z-index: 2;
}

.tone-1 { background: #fff5f5; color: #960018; }
.tone-2 { background: #f8f9fa; color: #333; }
.tone-3 { background: #960018; color: #fff; }
.tone-4 { background: #eef2f7; color: #2c3e50; }
.tone-5 { background: #fff0f0; color: #d63031; }

.haimes-card:hover .haimes-icon-wrapper { transform: rotate(10deg) scale(1.1); }
.haimes-card:hover .tone-1, .haimes-card:hover .tone-2, .haimes-card:hover .tone-4, .haimes-card:hover .tone-5 {
    background: var(--rojo);
    color: #fff;
}
.haimes-card:hover .tone-3 { background: #1a1a1a; color: #fff; }

/* --- FOOTER --- */
.main-footer { background: var(--borravino); color: var(--blanco); padding: 80px 0 0 0; }
.grid-footer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    padding-bottom: 50px;
}
.footer-col h3 { font-size: 1.2rem; margin-bottom: 25px; position: relative; padding-bottom: 10px; }
.footer-col h3::after { content: ''; position: absolute; left: 0; bottom: 0; width: 40px; height: 2px; background: var(--rojo); }
.footer-col p { line-height: 1.6; margin-bottom: 15px; font-size: 0.9rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul li a { text-decoration: none; transition: 0.3s; }
.footer-col ul li a:hover { color: var(--rojo); padding-left: 5px; }
.footer-col p, .footer-col ul li a, .contact-item p {
    color: rgba(255, 255, 255, 0.8) !important;
}
.footer-col img {
    height: 120px; /* Tamaño generoso para el footer */
    width: auto;
    margin-bottom: 20px;
    display: block;
    filter: drop-shadow(0px 4px 8px rgba(0,0,0,0.3));
}

.contact-item { display: flex; align-items: center; margin-bottom: 20px; }
.contact-item i { font-size: 1.5rem; color: var(--rojo); margin-right: 15px; }
.contact-item span { display: block; font-size: 0.75rem; color: rgba(255, 255, 255, 0.5); text-transform: uppercase; }
.contact-item p { margin: 0; color: #fff; font-weight: 600; font-size: 0.95rem; }

.social-icons { display: flex; gap: 15px; margin-top: 20px; }
.social-icons .icon {
    width: 40px; height: 40px; background: #333;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; color: #fff; text-decoration: none; transition: 0.4s;
}
.icon.facebook:hover { background: #3b5998; transform: translateY(-5px); }
.icon.instagram:hover { background: #e1306c; transform: translateY(-5px); }
.footer-bottom { background: #330303; padding: 25px 0; text-align: center; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.8rem; color: #666; }
.logo-footer {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.6rem;
    margin-bottom: 20px;
    color: white;
}
.logo-footer span {
    color: var(--rojo);
}

@media (max-width: 768px) {
    .grid-footer { text-align: center; }
    .footer-col h3::after { left: 50%; transform: translateX(-50%); }
    .contact-item { justify-content: center; }
    .social-icons { justify-content: center; }

    .footer-col img {
        margin: 0 auto 20px auto;
        height: 100px;
    }
}

/* --- SUCURSALES --- */
.sucursales-section { padding: 100px 0; background: #fff; }
.section-header { text-align: center; margin-bottom: 50px; }
.filter-container { margin-top: 35px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.filter-btn {     
    /*padding: 10px 24px; 
    border: 2px solid var(--rojo); 
    background: transparent; 
    color: var(--rojo); 
    border-radius: 50px; 
    font-weight: 700; 
    font-size: 0.9rem; 
    cursor: pointer; 
    transition: all 0.3s ease; */

    padding: 10px 24px; 
    border: 2px solid var(--rojo); 
    background: transparent; 
    color: var(--rojo); 
    border-radius: 50px; 
    font-weight: 700; 
    font-size: 0.9rem; 
    cursor: pointer; 
    transition: all 0.3s ease;
}
.filter-btn.active, .filter-btn:hover { 
    background: var(--rojo); 
    color: white !important;
}

.grid-sucursales { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.sucursal-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: none; /* Quitamos el borde gris fino */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.sucursal-card.hidden { display: none; }
.sucursal-card:hover { transform: translateY(-10px); box-shadow: 0 15px 40px rgba(150, 0, 24, 0.12); }
.sucursal-img { position: relative; height: 210px; overflow: hidden; }
.sucursal-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.sucursal-card:hover .sucursal-img img { transform: scale(1.1); }

/* 1. Diferenciación de Colores solicitado */
.sucursal-card.exclusivo .badge-tipo {
    background: var(--rojo); /* Rojo para locales propios */
}

.sucursal-card.franquicia .badge-tipo {
    background: var(--dorado-franquicia); /* Dorado para franquicias */
}

.sucursal-card.supermercado .badge-tipo {
    background: var(--borravino); /* Borravino para reventa */
}

.status-badge { position: absolute; top: 15px; right: 15px; padding: 6px 14px; border-radius: 50px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; z-index: 5; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.status-badge.open { background: #25d366; color: white; }
.status-badge.closed { background: var(--rojo); color: white; }
.sucursal-info { padding: 25px; flex-grow: 1; }
.badge-tipo { 
    display: inline-block; 
    font-size: 0.65rem; 
    font-weight: 700; 
    text-transform: uppercase; 
    color: var(--rojo); 
    margin-bottom: 10px; 
    letter-spacing: 1px; 

    color: white;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: inline-block;
    letter-spacing: 0.5px;
}
.sucursal-info h3 { font-size: 1.4rem; margin-bottom: 15px; color: var(--oscuro); }
.sucursal-info p { font-size: 0.9rem; color: #666; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.sucursal-info i { color: var(--rojo); width: 16px; text-align: center; }
.sucursal-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-maps { flex: 1; text-align: center; padding: 12px; background: var(--gris); color: var(--oscuro); text-decoration: none; border-radius: 10px; font-weight: 700; font-size: 0.85rem; transition: 0.3s; }
.btn-maps:hover { background: var(--oscuro); color: white; }
.btn-tel { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: #25d366; color: white; text-decoration: none; border-radius: 10px; font-size: 1.3rem; transition: 0.3s; }
.btn-tel:hover { transform: scale(1.1) rotate(10deg); }

/* 2. Mejora del botón de mapa solicitado */
.btn-maps { 
    flex: 1; 
    text-align: center; 
    padding: 12px; 
    background: #f8f8f8; /* Gris muy claro de base */
    color: var(--oscuro); 
    border: 1px solid #ddd; /* Borde sutil para definir el botón */
    text-decoration: none; 
    border-radius: 10px; 
    font-weight: 700; 
    font-size: 0.85rem; 
    transition: 0.3s; 
}

.btn-maps:hover { 
    background: var(--oscuro); 
    color: white; 
    border-color: var(--oscuro);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Ajuste del botón de WhatsApp para que siempre resalte */
.btn-tel { 
    width: 48px; 
    height: 48px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: #25d366; 
    color: white !important; 
    border-radius: 10px; 
    font-size: 1.3rem; 
    transition: 0.3s; 
}

/* Etiqueta al pie de la imagen */
.badge-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(150, 0, 24, 0.9); /* Rojo institucional con transparencia */
    color: white;
    padding: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ajuste para que la imagen sea el contenedor de las etiquetas */
.sucursal-img {
    position: relative;
    overflow: hidden;
}

/* Badge de tipo para supermercados */
/*
.badge-tipo.retail {
    background: #f1f1f1;
    color: #555;
}*/
/* Color para las etiquetas de Franquicia */
.badge-tipo {
    background: var(--rojo); /* El nuevo rojo vibrante que extrajimos de tu logo */
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: inline-block;
}

/* Diferenciador para Punto de Venta (Supermercado) */
.badge-tipo.retail {
    background: var(--borravino); /* El color vino profundo para diferenciar reventa */
}



/* VOLVER ARRIBA */
.back-to-top { position: fixed; bottom: 25px; right: 25px; background: var(--rojo); color: white !important; width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration: none; z-index: 999; opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--oscuro); transform: scale(1.1); }
.back-to-top i { font-size: 1.2rem; }

@media (max-width: 480px) { .back-to-top { bottom: 15px; right: 15px; width: 40px; height: 40px; } }

/* --- NUESTRA HISTORIA / ESTRUCTURA --- */
#historia { background: var(--blanco); padding: 80px 0; }
#estructura-haimes { background: var(--gris); padding: 80px 0; }
#historia .haimes-upper, #estructura-haimes .haimes-upper { display: flex; align-items: center; gap: 60px; }

@media (max-width: 991px) {
    
    /* 1. Forzamos la alineación vertical (una columna) */
    #historia .haimes-upper, 
    #estructura-haimes .haimes-upper { 
        flex-direction: column !important; 
        text-align: center; 
        gap: 20px !important; /* Espacio corto entre texto e imagen */
        margin-bottom: 30px !important;
    }

    /* 2. Quitamos el aire excesivo de las secciones */
    #historia, #estructura-haimes {
        padding: 40px 0 !important;
    }

    /* 3. Aseguramos que la columna de la imagen use todo el ancho */
    .haimes-visual {
        width: 100%;
        padding: 0 !important;
    }

    /* 4. Ajustamos la altura de la imagen para que no sea infinita */
    .haimes-tilt-card {
        width: 100% !important;
        max-width: 100% !important;
    }

    .haimes-tilt-card img {
        height: 280px !important; /* Altura compacta para celular */
        width: 100%;
        object-fit: cover;
    }

    /* 5. Ajuste de títulos para que no ocupen tanto espacio */
    .haimes-main-title {
        font-size: 2.3rem !important;
        line-height: 1.2;
    }
}
#estructura-haimes .haimes-tilt-card {
    background: transparent;
    padding: 0;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}
