/* === Variables y Reset === */
:root {
    --color-primary: #335d82; /* Azul oscuro */
    --color-secondary: #f4b400; /* Amarillo vibrante */
    --color-accent: #6cb66f; /* Verde para detalles */
    --color-text-dark: #333;
    --color-text-light: #f9f9f9;
    --color-bg-light: #fdfdfd;
    --color-bg-gray: #f0f2f5;

    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth; 
}

body {
    font-family: var(--font-body);
    color: var(--color-text-dark);
    background-color: var(--color-bg-gray);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 5rem; 
}

/* === Contenedor General === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* === Tipografía === */
h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    line-height: 1.2;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.6rem; margin-bottom: 1rem; }

p {
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* === Botones === */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--color-secondary);
    color: var(--color-text-dark);
    border: 2px solid var(--color-secondary);
    box-shadow: 0 4px 10px rgba(244, 180, 0, 0.3);
}

.btn-primary:hover {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(244, 180, 0, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    transform: translateY(-3px);
}

/* === Header === */
header {
    background-color: #7ba8d4;
    color: var(--color-text-light);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-img {
    width: 180px;
    height: auto;
}

header nav a {
    color: #000000;
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

header nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--color-secondary);
    transition: width 0.3s ease;
}

header nav a:hover::after {
    width: 100%;
}

/* === Hero Section === */
#hero {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--color-text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding-top: 4rem;
    padding-bottom: 4rem;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

#hero .hero-content {
    max-width: 500px;
    width: 90%;
    margin: 0 auto;
}

#hero h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-light);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

#hero p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

/* === Secciones Generales === */
section {
    padding: 5rem 0;
    margin-top: 0; 
    margin-bottom: 2rem; 
    background-color: var(--color-bg-light);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    opacity: 1;
    transform: translateY(0);
    transition: none;
}

section.animate-on-scroll {
    opacity: 0; 
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    margin-top: 0;
}

section.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Sección Sobre Nosotros === */
#sobre-nosotros {
    margin-bottom: 0;
}

#sobre-nosotros .about-content {
    display: flex;
    gap: 3rem;
    align-items: center;
    flex-wrap: wrap;
}

#sobre-nosotros .about-text {
    flex: 1;
    min-width: 300px;
}

.image-gallery {
    flex: 1;
    min-width: 300px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    height: 300px;
}

.image-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

/* === Sección Contacto con mapa === */
#contacto {
    margin-top: 2rem; 
    margin-bottom: 2rem;
}

#contacto .contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* columnas iguales para info y mapa */
    gap: 3rem;
    align-items: start;
}

.contact-info {
    background-color: var(--color-bg-gray);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.contact-info p {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: #555;
}

.contact-info i {
    color: var(--color-secondary);
    margin-right: 0.8rem;
    font-size: 1.3rem;
}

.social-links {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--color-primary);
    font-size: 1.8rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-links a:hover {
    color: var(--color-secondary);
    transform: translateY(-5px) scale(1.1);
}

/* === Footer === */
footer {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    text-align: center;
    padding: 2.5rem 0;
    margin-top: 4rem;
    font-size: 0.9rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

footer p {
    margin-bottom: 0.5rem;
}

/* === Responsive Design === */
@media (max-width: 992px) {
    body { padding-top: 7rem; }
    
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    #hero h2 { font-size: 2.8rem; }
    #hero p { font-size: 1.1rem; }

    .header-content {
        flex-direction: column;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    header nav {
        margin-top: 1rem;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    header nav a { margin-left: 0; }

    #sobre-nosotros .about-content { flex-direction: column; gap: 2rem; }
    .image-gallery { height: 250px; }

    #contacto .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 576px) {
    h1 { font-size: 1.8rem; }
    .logo-icon { font-size: 2rem; }
    #hero h2 { font-size: 2rem; }
    #hero p { font-size: 1rem; }
    .btn-primary, .btn-secondary { padding: 0.8rem 1.8rem; font-size: 0.9rem; }
    header nav a { font-size: 0.9rem; }
    section { padding: 3rem 0; }
}

/* === Animaciones para Sobre Nosotros === */
#sobre-nosotros .about-text,
#sobre-nosotros .image-gallery {
    opacity: 0;
    transform: translateX(0);
    transition: all 0.8s ease-out;
}

#sobre-nosotros .about-text.from-left { transform: translateX(-50px); }
#sobre-nosotros .image-gallery.from-right { transform: translateX(50px); }

#sobre-nosotros .about-text.is-visible,
#sobre-nosotros .image-gallery.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.contact-map {
    width: 100%;
    height: 100%;   /* altura igual a la columna */
    min-height: 400px; /* opcional para pantallas muy pequeñas */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* === Botones Flotantes === */
.floating-buttons {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 2000; /* siempre por encima del resto */
}

.fab-button {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.fab-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

/* Colores personalizados */
.fab-button.whatsapp {
    background-color: #25D366;
}

.fab-button.instagram {
    background: radial-gradient(circle at 30% 107%, 
        #fdf497 0%, #fdf497 5%, #fd5949 45%, 
        #d6249f 60%, #285AEB 90%);
}

/* --- Menú desplegable (Productos) --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    color: #000000;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

/* Subrayado animado igual que los otros enlaces */
.dropbtn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background-color: var(--color-secondary);
    transition: width 0.3s ease;
}

.dropbtn:hover::after {
    width: 100%;
}

.dropbtn i {
    margin-left: 6px;
    font-size: 0.8em;
}

/* --- Menú desplegable (Productos) --- */
.dropdown {
    position: relative;
    display: inline-block;
    margin: 0 15px; /* separa el botón de los otros */
}

.dropbtn {
    color: #000000;
    text-decoration: none;
    font-weight: 600;
    font-size: 1em; /* igual que los otros botones */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0; /* elimina exceso de espacio vertical */
    position: relative;
    transition: color 0.3s ease;
}

/* Subrayado animado igual que los otros enlaces */
.dropbtn::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0%;
    height: 3px;
    background-color: var(--color-secondary);
    transition: width 0.3s ease;
}

.dropbtn:hover::after {
    width: 100%;
}

.dropbtn i {
    margin-left: 6px;
    font-size: 0.8em;
}

/* Contenedor del menú desplegable */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--color-bg-light);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    overflow: hidden;
    top: 100%;
    left: 0;
    z-index: 1000;
}

/* Enlaces del submenú */
.dropdown-content a {
    color: var(--color-text-dark);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.dropdown-content a:hover {
    background-color: var(--color-secondary);
    color: var(--color-text-light);
    transform: translateX(5px);
}

/* Mostrar el menú al pasar el ratón */
.dropdown:hover .dropdown-content,
.dropdown.active .dropdown-content {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .dropdown {
        margin: 10px 0;
    }

    .dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
        background-color: transparent;
    }

    .dropdown-content a {
        padding: 10px 0;
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }

    .dropdown-content a:hover {
        background-color: transparent;
        color: var(--color-secondary);
        transform: none;
    }
}

/* === Sección de Cabecera del Producto === */
#product-hero {
    background-color: var(--color-bg-light); /* Fondo más claro para contraste */
    padding: 3rem 0;
    text-align: center;
    border-bottom: 3px solid var(--color-secondary); /* Separador sutil */
}

#product-hero h1 {
    font-size: 3rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

#product-hero .subtitle {
    font-size: 1.3rem;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
}

/* === Sección de Detalles y Especificaciones === */
#product-details {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr; /* Columna de info un poco más ancha */
    gap: 4rem;
    align-items: flex-start;
}

/* Galería de Imágenes */
.product-gallery {
    /* Sticky para que la galería se quede fija un rato al hacer scroll (opcional) */
    position: sticky; 
    top: 8rem; 
    padding: 1rem;
    background-color: var(--color-bg-light);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.product-gallery .main-image {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.thumbnails {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    padding: 0.5rem 0;
}

.thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.thumbnails img:hover, .thumbnails img.active {
    border-color: var(--color-secondary);
}

/* Información del Producto */
.product-info h2, .product-info h3 {
    color: var(--color-primary);
    margin-top: 1.5rem;
    border-bottom: 2px solid var(--color-accent);
    padding-bottom: 0.5rem;
}

.product-info ul {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
}

.product-info ul li {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: var(--color-text-dark);
}

.product-info ul li i {
    color: var(--color-accent); /* Utilizando tu color verde de acento */
    margin-right: 0.8rem;
    font-size: 1.3rem;
}

/* Llamada a la Acción del Producto (sección cta-product) */
#cta-product {
    padding: 4rem 0;
    border-top: 1px solid #e0e0e0;
}


/* === Responsive para la Página de Producto === */
@media (max-width: 992px) {
    .details-grid {
        grid-template-columns: 1fr; /* Una sola columna en móvil/tablet */
        gap: 2rem;
    }
    .product-gallery {
        position: static; /* Desactiva sticky en móvil */
        top: initial;
    }
}

/* === NUEVO CSS para Galería de Producto 3x2 (Carrusel) === */

/* Mantenemos el grid principal de 2 columnas */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr; 
    gap: 4rem;
    align-items: flex-start;
}

.product-gallery-carrusel {
    position: relative; 
    overflow: hidden; 
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    background-color: var(--color-bg-light);
    padding: 10px;
}



/* === Imagenes productos === */

.product-gallery-carrusel {
    /* El contenedor ahora solo define el estilo base y padding */
    position: relative; 
    overflow: visible; /* Asegura que todo el contenido sea visible */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    background-color: var(--color-bg-light);
    padding: 10px;
    /* Para que el grid interno determine la altura total */
    height: auto; 
}

.gallery-track-3x2 {
    display: grid;
    /* Definición del grid 2 columnas de ancho igual */
    grid-template-columns: repeat(2, 1fr); 
    grid-template-rows: auto; /* Las filas crecen según el contenido */
    grid-auto-flow: row; /* Las imágenes se colocan de izquierda a derecha, luego a la siguiente fila */
    gap: 15px; /* Aumento el gap para mejor separación */
    
    /* Elimina cualquier transformación de carrusel */
    transition: none; 
    width: 100%; 
    height: auto;
}

.gallery-track-3x2 img {
    width: 100%;
    /* Mantiene las imágenes con una altura visualmente agradable */
    height: 250px; 
    object-fit: cover; 
    border-radius: 4px;
}

/* Flechas de Navegación */
/* Como no hay desplazamiento, las ocultamos de la vista */
.carrusel-nav {
    display: none !important;
}

/* Media Query: En móvil, que se muestre una imagen por fila (1xN) */
@media (max-width: 992px) {
    .gallery-track-3x2 {
        /* Una sola columna para que las imágenes sean más grandes y legibles */
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .gallery-track-3x2 img {
        height: 200px;
    }
}

/* ======================================================= */
/* === Animaciones de Deslizamiento Específicas para Producto === */
/* ======================================================= */

/* 1. Definición del Estado Inicial y Transición */
.product-gallery-carrusel, 
.product-info {
    opacity: 0;
    /* TRANSICIÓN GLOBAL: Necesaria para que el movimiento sea visible */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* 2. Estado Inicial Desplazado (usando las clases del JS) */

/* Galería (viene de la izquierda) */
.product-gallery-carrusel.from-left {
    transform: translateX(-50px); 
}

/* Información (viene de la derecha) */
.product-info.from-right {
    transform: translateX(50px); 
}

/* 3. Estado Final (Visible y en posición) */

/* Esta regla se aplica a ambos elementos cuando el JS añade la clase */
.product-gallery-carrusel.is-visible,
.product-info.is-visible {
    opacity: 1;
    /* Vuelve a la posición original (cero desplazamiento) */
    transform: translateX(0) !important; 
}

/* === Corrección del desplazamiento en versión móvil === */
@media (max-width: 768px) {
    header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
    }

    /* Aumenta el padding del body según el tamaño del header */
    body {
        padding-top: 11rem; /* ajusta si el header sigue tapando algo */
    }

    /* Evita que el header se estire demasiado */
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    header nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .logo-img {
        width: 140px;
    }
}

/* === Ajuste de orden SOLO para móviles === */
@media (max-width: 768px) {
    /* Cambia el orden de los elementos dentro del grid */
    .details-grid {
        display: flex;
        flex-direction: column;
    }

    /* Hace que primero aparezca el texto */
    .product-info {
        order: 1;
    }

    /* Luego las imágenes */
    .product-gallery-carrusel {
        order: 2;
    }

    /* Ajustes visuales extra para que se vea más limpio */
    .product-info, .product-gallery-carrusel {
        width: 100%;
    }

    .gallery-track-3x2 img {
        height: auto;
        max-height: 250px;
        object-fit: cover;
    }
}