/* --- 1. Reseteo y Estilos Globales --- */
:root {
    --color-primario: #333;
    --color-secundario: #007bff; /* Azul para botones */
    --color-texto: #495058; 
    --color-fondo: #F9F9F9; 
    --color-fondo-seccion: #ffffff; 
    --color-amarillo: #fcc400; /* Para las barras */
    --color-gris-borde: #e0e0e0;
    
    /* --- NUEVAS VARIABLES (CORREGIDAS) --- */
    /* Ahora el color del título es el mismo gris #495056 del index */
    --color-titulo: #495056; 
    --color-boton: #495056;
    --color-tag-bg: #EAEAEA;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    font-size: 16px;
    line-height: 1.3 !important;
    color: var(--color-texto); 
    background-color: var(--color-fondo); 
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    color: #495056;
}

section {
    padding: 60px 0;
}

h1, h2, h3 {
    color: var(--color-primario);
    margin-bottom: 20px;
    font-weight: 600;
}

h4 {
    color: var(--color-primario);
}

h2 {
    font-size: 2.2rem;
    text-align: center;
}

/* --- Estilo unificado para H2 de secciones --- */
section h2 {
    color: #495056; /* Gris del index */
    margin-bottom: 40px;
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 15px;
}

a {
    text-decoration: none;
    color: var(--color-primario);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #495056; 
    color: white;
    border-radius: 20px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    font-size: 0.9rem;
}

.btn:hover {
    background-color: #555;
}

/* --- 2. Header y Navegación --- */
header {
    padding: 15px 0; 
    border-bottom: 1px solid var(--color-gris-borde);
    background-color: var(--color-fondo); 
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    flex: 1; 
    text-align: left;
}

.logo img {
    height: 40px; 
    width: auto;
    display: block; 
}

header nav {
    flex: 2; 
    text-align: center;
}

header nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
}

header nav li {
    margin: 0 5px; 
}

header nav a {
    font-weight: 600; 
    color: var(--color-texto); 
    font-size: 0.9rem;
    padding: 8px 15px; 
    border-radius: 20px; 
    transition: color 0.3s ease, background-color 0.3s ease; 
    white-space: nowrap; 
}

header nav a:hover {
    color: #ffffff; 
    background-color: #495056; 
}

.header-right-spacer {
    flex: 1;
}

.hamburger-menu {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    background: none;
    border: none;
}

/* --- 3. Home (Banner) --- */
#home {
    width: 100%;
    padding: 0;
    margin: 0;
}

#home img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* --- 4. Google Reviews Widget --- */
#elfsight-widget {
    border: none;
    width: 100%;
    height: 380px; 
}

@media (max-width: 768px) {
    #elfsight-widget {
        height: 380px; 
    }
}

/* --- 5. Marquee (Cinta deslizante) --- */
.marquee {
    overflow: hidden;
    white-space: nowrap;
    background-color: var(--color-amarillo);
    color: var(--color-texto);
    padding: 12px 0;
    font-weight: 800;
    font-size: 24px;
}

.marquee div {
    display: inline-block;
    padding-left: 0%;
    animation: marquee 120s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* --- 6. Sobre Nosotros --- */
.about {
    background-color: var(--color-fondo-seccion); 
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-content h2 {
    text-align: left;
}

.about-grid img {
    width: 100%;    
    height: auto;   
    display: block; 
    border-radius: 8px; 
}


/* --- 7. CTA (Call to Action) --- */
.cta {
    background-color: var(--color-fondo); 
}

.cta .container {
    display: flex;
    justify-content: space-between; 
    align-items: center;            
    flex-wrap: wrap;                
}

.cta .container h2 {
    color: #495058;
    font-size: 48px;
    margin: 0; 
    font-weight: 700;
    line-height: 1.2;
}

.cta .btn {
    font-size: 1.1rem;
    padding: 15px 30px;
}

/* --- 9. FAQ (Estructura Index) --- */
.faq {
    background-color: var(--color-fondo); 
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
    color: #495056;
}

.faq-item {
    margin-bottom: 15px; 
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    color: #495056;
}

.faq-item summary {
    background: var(--color-fondo-seccion); 
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
    padding: 20px 25px;
    font-size: 1.1rem;
    font-weight: 600; 
    cursor: pointer;
    list-style: none; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-primario);
    transition: box-shadow 0.3s ease;
}

.faq-item summary:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.faq-item summary::-webkit-details-marker {
    display: none; 
}

.faq-item summary .icon-toggle {
    font-size: 1rem;
    color: var(--color-texto);
}

.faq-item summary .icon-toggle .fa-chevron-up {
    display: none; 
}

.faq-item[open] summary .icon-toggle .fa-chevron-down {
    display: none; 
}

.faq-item[open] summary .icon-toggle .fa-chevron-up {
    display: inline-block; 
}

.faq-content {
    background: var(--color-fondo-seccion); 
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
    padding: 20px 25px; 
    margin-top: 15px; 
    line-height: 1.3;
}

.faq-content h4 {
    font-weight: 700;
    font-size: 1rem;
    margin-top: 15px;
    margin-bottom: 10px;
    color: var(--color-primario);
}

.faq-content > *:first-child {
    margin-top: 0;
}

.faq-content ul {
    list-style-position: inside;
    padding-left: 0; 
    list-style-type: disc; 
}

.faq-content ul li {
    margin-bottom: 8px;
}


/* --- 10. Footer --- */
footer {
    background-color: var(--color-fondo); 
    padding: 40px 0;
    border-top: 1px solid var(--color-gris-borde);
    text-align: center;
}

.footer-logo {
    margin-bottom: 15px;
}

.footer-logo img {
    height: 45px; 
    width: auto;
}

footer nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; 
    gap: 5px; 
    list-style: none;
    margin-bottom: 25px; 
}

footer nav li {
    margin: 0; 
}

footer nav a {
    font-weight: 600; 
    color: var(--color-texto);
    font-size: 0.9rem;
    padding: 8px 15px; 
    border-radius: 20px; 
    transition: color 0.3s ease, background-color 0.3s ease;
    white-space: nowrap; 
    display: inline-flex;
    align-items: center;
    gap: 8px; 
}

footer nav a:hover {
    color: #ffffff; 
    background-color: #495056; 
}

.footer-socials {
    margin-bottom: 20px;
}

.footer-socials a {
    font-size: 1.5rem;
    margin: 0 10px;
    color: #777;
    transition: color 0.3s ease;
}

.footer-socials a:hover {
    color: var(--color-primario); 
}

/* --- 10.5. Botón Flotante WhatsApp --- */
.whatsapp-flotante {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #25D366; 
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 999; 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.whatsapp-flotante:hover {
    transform: scale(1.1); 
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* --- SECCIÓN PRODUCTOS DEL HOME (EXISTENTE) --- */
.productos-section {
    padding: 50px 20px;
    text-align: center;
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
   
    gap: 0px; 
}

@media (max-width: 768px) {
    .productos-grid {
        grid-template-columns: 1fr;
    }
}

.producto-card {
    position: relative;
    width: 100%;
    height: 100%; 
    
    transition: transform 0.3s ease; 
}

.producto-card:hover {
    transform: translateY(-8px);
}

.producto-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; 
}

.producto-info {
    position: absolute;
     margin: 5%;
    bottom: 60px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between; 
    color: #fff;
    transition: transform 0.3s ease;
}

.producto-card:hover .producto-info {
    transform: translateY(-6px);
}

.producto-info .producto-textos {
    text-align: left;
    max-width: 70%;
}

.producto-info h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #fff;
}

.producto-textos p {
    margin: 0; 
    font-size: 0.9rem;
    color: #fff; 
    opacity: 0;     
    max-height: 0;  
    overflow: hidden; 
    transition: opacity 0.3s ease-out, max-height 0.3s ease-out, margin-top 0.3s ease-out;
}

.producto-card:hover .producto-textos p {
    opacity: 0.9; 
    max-height: 100px;  
    margin-top: 5px;    
}

.btn-ver-mas {
    background: rgba(255,255,255,0.85);
    padding: 8px 16px;
    border-radius: 30px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: transform .25s ease, background .25s ease;
}

.btn-ver-mas:hover {
    background: #495056; 
    color: white;
    transform: scale(1.07);
}


/* ==========================================================================
   NUEVO: ESTILOS PARA PÁGINA PRODUCTOS.PHP (GRID 2-1-1)
   ========================================================================== */

.product-cards-section {
    padding: 80px 0;
    background-color: var(--color-fondo);
}

/* Título de la sección (CORREGIDO COLOR) */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--color-titulo); /* Ahora usa el gris #495056 */
    margin-bottom: 50px;
    font-weight: 700;
}

/* --- CONFIGURACIÓN DEL GRID (LAYOUT 2-1-1) --- */
.product-cards-grid {
    display: grid;
    grid-template-columns: 1fr; /* Móvil: 1 columna por defecto */
    gap: 30px;
    justify-items: center; /* Centra las tarjetas horizontalmente */
}

/* Tarjeta Individual */
.product-card {
    background-color: #fff;
    border-radius: 16px;
    overflow: hidden;
    /* Sombra gris más visible (según solicitud anterior) */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15); 
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    
    width: 100%; /* Ocupa el espacio de la celda */
    max-width: 440px; /* Pero no más de 380px */
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25); /* Sombra más fuerte al hover */
}

/* Imagen de la Tarjeta */
.product-card-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

/* Contenido de la Tarjeta */
.product-card-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: center; /* Texto centrado */
}

/* Cabecera de la tarjeta (Título y Tag) */
.product-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 10px;
    text-align: left; 
}

.product-card-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-titulo); /* Ahora usa el gris #495056 */
    margin: 0;
    line-height: 1.3;
}

.product-card-tag {
    background-color: var(--color-tag-bg);
    color: var(--color-texto);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 50px;
    white-space: nowrap;
}

/* Descripción */
.product-card-description {
    color: var(--color-texto);
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 25px;
    flex-grow: 1;
    text-align: left; 
}

.product-card-description ul {
    margin-top: 10px;
    padding-left: 20px;
    list-style-type: disc;
    text-align: left;
}

.product-card-description li {
    margin-bottom: 5px;
}

/* Botón */
.product-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; 
    background-color: var(--color-boton);
    color: #fff;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    align-self: center; /* Centrado horizontalmente */
    transition: background-color 0.3s ease;
    margin-top: auto;
}

.product-card-btn:hover {
    background-color: #333;
}

.arrow-icon {
    font-size: 1.1rem; 
    line-height: 1;
}

/* --- MEDIA QUERY EXTRA PARA EL GRID 2-1-1 --- */
@media (min-width: 900px) {
    .product-cards-grid {
        /* Definimos 2 columnas */
        grid-template-columns: repeat(2, 1fr); 
        max-width: 800px; /* Restringimos el ancho total para que se vea compacto */
        margin: 0 auto; /* Centramos la grilla en la página */
    }

    /* Tarjeta 3: Ocupa toda la fila (Fila 2) */
    .product-card:nth-child(3) {
        grid-column: 1 / -1; 
    }

    /* Tarjeta 4: Ocupa toda la fila (Fila 3) */
    .product-card:nth-child(4) {
        grid-column: 1 / -1; 
    }
}


/* --- 11. Media Queries Globales (Responsive General) --- */

/* Tablets (y aplica a móviles) */
@media (max-width: 992px) {
    
    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-content {
        text-align: center; 
    }
    
    .about-content h2 {
        text-align: center; 
    }
}

/* Móviles */
@media (max-width: 768px) {
    /* --- Header Móvil --- */
    .hamburger-menu {
        display: block;
        order: 3; 
        z-index: 101;
        color: var(--color-texto);
    }
    
    .logo {
        flex: 0 1 auto; 
        z-index: 101;
        text-align: left; 
    }
    
    .logo img {
        height: 35px; 
    }

    header nav {
        display: none; 
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 1000; 
    }
    
    header nav.active {
        display: flex;
    }

    header nav ul {
        flex-direction: column;
        width: 100%;
    }

    header nav li {
        margin: 15px 0;
    }
    
    header nav a {
        font-size: 1.5rem;
        padding: 10px 20px; 
        white-space: nowrap; 
    }
    
    header nav a:hover {
        color: #ffffff;
        background-color: #495056; 
    }

    .header-right-spacer {
        display: none; 
    }
    
    /* --- FIX Productos Home Movil --- */
    .product-grid {
        grid-template-columns: 1fr; 
    }

    .producto-info {
        bottom: 25px;
        left: 25px;
        right: 25px;
        align-items: flex-end; 
    }

    .producto-info .producto-textos {
        max-width: 65%; 
    }
    
    .producto-info h3 {
        font-size: 1.1rem; 
    }

    .producto-textos p {
        opacity: 0.9; 
        max-height: 100px; 
        margin-top: 5px;   
        font-size: 0.85rem; 
        line-height: 1.3;   
    }

    .producto-info .btn-ver-mas {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .producto-card:hover {
        transform: none;
    }
    .producto-card:hover .producto-info {
        transform: none;
    }

    /* --- FIX Productos Página productos.php Movil --- */
    .section-title {
        font-size: 2rem;
    }
    .product-cards-grid {
        padding: 0 10px;
    }
    .product-card {
        max-width: 100%; 
    }
    
    /* --- CTA en móvil --- */
    .cta .container {
        flex-direction: column; 
        gap: 25px; 
        align-items: center; 
    }

    .cta .container h2 { 
        font-size: 2.2rem; 
        line-height: 1.3;
        text-align: center; 
    }

    .cta .btn {
        font-size: 1rem; 
    }

    /* Footer en móvil */
    footer nav ul {
        flex-direction: column; 
        gap: 10px;
    }
}

/* ==========================================================================
   NUEVO: ESTILOS PARA PRELOADER (Efecto de Carga)
   ========================================================================== */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-fondo); /* Fondo gris claro */
    z-index: 9999; /* Asegura que esté sobre todo */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

#preloader img {
    /* Estilo para el logo de carga */
    width: auto;
    height: 80px;
    margin-bottom: 20px;
    animation: pulse 1.5s infinite; /* Pequeño efecto de pulsación en el logo */
}

/* Animación simple de pulsación */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Opcional: Si quieres un spinner debajo del logo (quitar si no lo usas) */
.loader {
    border: 4px solid var(--color-gris-borde);
    border-top: 4px solid var(--color-primario);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}