/* Variables de Color (Inspiradas en el logo proporcionado) */
:root {
    --primary-blue: #0b3d91; /* Azul oscuro del borde */
    --secondary-blue: #1e81b0; /* Azul claro del texto inferior */
    --primary-green: #008f39; /* Verde de la silueta de la vaca */
    --text-dark: #333333;
    --text-light: #ffffff;
    --bg-light: #f4f7f6;
    --bg-white: #ffffff;
}

/* Reset Básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Utilidades */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-padding {
    padding: 80px 0;
}

.text-center {
    text-align: center;
}

.bg-light {
    background-color: var(--bg-light);
}

.divider {
    height: 4px;
    width: 60px;
    background-color: var(--primary-green);
    margin: 15px 0 25px 0;
}

.center-divider {
    margin: 15px auto 40px auto;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-green);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: #006b2b;
}

/* Encabezado y Navegación */
.header {
    background-color: var(--bg-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
}

.logo {
    height: 80px; /* Ajusta según el aspecto deseado */
    width: auto;
    padding-top: 5px;

}

.titulo{
     color: var(--primary-blue);
     text-align: center;
}

@media (max-width:996px) {
    .titulo{
        font-size: 10px;
}
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
}

.nav-links a {
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-green);
}

/* Ocultar menú móvil en escritorio */
.menu-toggle {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: var(--primary-blue);
}

/* --- Slider Hero --- */
.hero-slider {
    position: relative;
    height: 80vh;
    min-height: 500px;
    overflow: hidden; /* Oculta lo que sale del contenedor */
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(11, 61, 145, 0.6); /* Azul de tu logo con transparencia */
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 3;
    color: var(--text-light);
    max-width: 600px;
    /* Animación del texto subiendo al aparecer */
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.8s ease 0.4s; 
}

.slide.active .hero-content {
    transform: translateY(0);
    opacity: 1;
}

.hero-slider h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

.hero-slider p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
}

/* Controles de los puntos (dots) */
.slider-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 12px;
}

.dot {
    height: 14px;
    width: 14px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.dot.active, .dot:hover {
    background-color: var(--primary-green); /* Verde de tu logo */
    transform: scale(1.2); /* Se hace un poquito más grande el punto activo */
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* Nosotros */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text h2 {
    color: var(--primary-blue);
    font-size: 2.2rem;
}

.about-text p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.rounded-img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Servicios */
.services h2 {
    color: var(--primary-blue);
    font-size: 2.2rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--bg-white);
    padding: 40px 25px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-bottom: 4px solid var(--primary-green);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.service-card h3 {
    color: var(--primary-blue);
    margin-bottom: 15px;
}

/* Footer */
.footer {
    background-color: var(--primary-blue);
    color: var(--text-light);
    padding: 60px 0 20px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    width: 120px;
    background-color: white; /* Resalta el logo en el fondo oscuro */
    border-radius: 50%;
    padding: 5px;
    margin-bottom: 15px;
}

.footer h3 {
    color: var(--primary-green);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.footer p {
    margin-bottom: 10px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

/* --- Redes Sociales en Navegación --- */
.social-nav {
    display: flex;
    gap: 15px;
    align-items: center;
    border-left: 2px solid var(--bg-light); /* Una pequeña línea separadora */
    padding-left: 20px;
}

.social-nav a {
    font-size: 1.3rem;
    color: var(--primary-blue);
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-nav a:hover {
    color: var(--primary-green);
    transform: scale(1.1); /* Se agrandan un poquito al pasar el mouse */
}

@media (max-width: 768px) {
    .social-nav  {
       justify-content: center;
    }
}
    
/* --- Redes Sociales en el Footer --- */
.social-footer {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-footer .social-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1); /* Fondo semitransparente */
    color: var(--text-light);
    border-radius: 50%; /* Los hace circulares */
    text-decoration: none;
    font-size: 1.2rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.social-footer .social-icon:hover {
    background-color: var(--primary-green); /* Se pintan del verde del logo al pasar el mouse */
    transform: translateY(-3px); /* Efecto de saltito hacia arriba */
}

/* Diseño Responsivo (Media Queries) */
@media (max-width: 768px) {
    /* Ocultamos el menú original y lo preparamos para el efecto de deslizamiento */
    .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 90px; /* Altura del encabezado */
        left: -100%; /* Lo escondemos fuera de la pantalla a la izquierda */
        width: 100%;
        background-color: var(--bg-white);
        text-align: center;
        transition: left 0.3s ease-in-out;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
        padding: 20px 0;
    }

    /* Esta clase '.active' es la que agrega el JavaScript al hacer clic */
    .nav-links.active {
        left: 0; /* Trae el menú a la pantalla */
    }

    .nav-links li {
        padding: 15px 0;
    }

    .menu-toggle {
        display: flex;
        z-index: 1001;
    }

    /* Animación del botón hamburguesa para convertirse en una "X" */
    .menu-toggle .bar {
        transition: all 0.3s ease;
    }
    
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    /* Ajuste del botón de WhatsApp para móviles */
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 30px;
    }
}

/* --- Botón Flotante de WhatsApp --- */
.whatsapp-float {
    position: fixed; /* Mantiene el botón fijo en la pantalla */
    width: 60px;
    height: 60px;
    bottom: 40px; /* Distancia desde abajo */
    right: 40px;  /* Distancia desde la derecha */
    background-color: #25d366; /* Verde oficial de WhatsApp */
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 35px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3); /* Sombra para el efecto flotante */
    z-index: 1000; /* Asegura que siempre esté por encima del resto del contenido */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #128C7E; /* Verde más oscuro al pasar el mouse */
    transform: scale(1.1); /* Hace que el botón crezca un poco */
    color: #FFF;
    box-shadow: 2px 2px 15px rgba(0,0,0,0.4);
}

/* --- BOTÓN FLOTANTE "VOLVER ARRIBA" (Y WHATSAPP) --- */

/* Primero, estilos para que el botón de WhatsApp flote */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    text-align: center;
    line-height: 50px;
    box-shadow: 2px 2px 3px #999;
    z-index: 1000;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    color: #FFF;
}

/* Segundo, estilos para el nuevo botón "Volver arriba" (Flecha) */
.back-to-top {
    position: fixed;
    bottom: 80px; /* Posicionamiento encima del de WhatsApp */
    right: 20px;
    background-color: #3498db;
    color: #FFF;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    text-align: center;
    line-height: 50px;
    box-shadow: 2px 2px 3px #999;
    z-index: 1001; /* Asegura que esté por encima de otros elementos */
    transition: all 0.3s ease;
    opacity: 0; /* Oculto por defecto, el JS lo mostrará */
    visibility: hidden;
}

.back-to-top:hover {
    background-color: #2980b9;
    color: #FFF;
}

/* Clase para mostrar el botón con animación de desvanecimiento (aparece/desaparece) */
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* =========================================
   ESTILOS DEL CARRITO DE COMPRAS
   ========================================= */

/* Ícono del carrito en el menú */
.cart-nav {
    position: relative;
    display: flex;
    align-items: center;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: #28a745; /* Puedes cambiarlo al color primario de tu tema */
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
}

/* Panel lateral del carrito */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px; /* Oculto fuera de la pantalla por defecto */
    width: 350px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    z-index: 2000; /* Asegura que esté por encima del header */
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

/* Clase que se agrega con JS para abrir el carrito */
.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eeeeee;
}

.cart-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-cart {
    background: none;
    border: none;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.close-cart:hover {
    color: #ff0000;
}

.cart-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto; /* Scroll si hay muchos productos */
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eeeeee;
    background-color: #f9f9f9;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

/* Fondo oscuro (Overlay) */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 1999; /* Justo debajo del panel del carrito */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Clase que activa el fondo oscuro */
.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Diseño Responsive para móviles */
@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}