header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 2rem 0;
    transition: var(--transition);
}

header.hero-header {
    background: transparent;
    box-shadow: none;
}

header.header-standard {
    background: white;
    box-shadow: var(--shadow-sm);
    /* Removido position: relative para permitir que siga siendo fixed */
}

header.scrolled {
    background: white;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
}

/* On standard pages or scrolled header, use dark blue text */
header .nav-links a,
header.scrolled .nav-links a,
header .lang-switcher {
    color: var(--primary-blue);
}

/* Only on hero header at the top, use white text */
header.hero-header:not(.scrolled) .nav-links a,
header.hero-header:not(.scrolled) .lang-switcher,
header.hero-header:not(.scrolled) .logo {
    color: white;
}

header.hero-header:not(.scrolled) .logo img {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); /* Sombra para que resalte si la foto es clara */
}

header.scrolled .logo img,
header.header-standard .logo img {
    filter: brightness(0) !important; /* Fuerza el logo a negro sobre fondo blanco */
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo img {
    height: 40px; /* Un poco más sutil */
}

.nav-links {
    display: flex;
    gap: 3rem; /* Más separación = más lujo */
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: inherit;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    transition: var(--transition-fast);
    position: relative;
    opacity: 0.85;
}

.nav-links a:hover {
    opacity: 1;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gold); /* Toque dorado al hacer hover */
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.lang-switcher {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-switcher a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
    opacity: 0.5;
}

.lang-switcher a.active,
.lang-switcher a:hover {
    opacity: 1;
}

/* --- TRUST BAR TICKER --- */
@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.trust-bar {
    background: var(--primary-blue);
    color: rgba(255, 255, 255, 0.75);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
}

.trust-ticker-wrapper {
    overflow: hidden;
    width: 100%;
}

.trust-ticker {
    display: flex;
    width: max-content;
    animation: ticker-scroll 18s linear infinite;
    gap: 4rem;
    padding: 0 2rem;
}

.trust-ticker:hover {
    animation-play-state: paused; /* Pausa al hacer hover en desktop */
}

.trust-item {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    white-space: nowrap;
    opacity: 0.85;
}


/* --- CARDS --- */
.product-card {
    background: white;
    border-radius: 8px; /* Bordes menos redondeados, más sobrios */
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-light);
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0,0,0,0.1);
}

.product-image {
    height: 320px;
    background: #F8F9FA; /* Gris más limpio */
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    transition: var(--transition-slow);
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.08));
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 3rem 2.5rem;
    flex-grow: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.product-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.5rem;
}

.badge-premium {
    background: rgba(58, 120, 196, 0.1);
    color: var(--accent-blue);
}

.badge-legacy {
    background: rgba(35, 75, 31, 0.1);
    color: var(--primary-green);
}

.badge-science {
    background: rgba(7, 18, 32, 0.05);
    color: var(--primary-blue);
}

/* --- GRIDS --- */
.portfolio-grid,
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
}

.feature-card {
    background: white;
    padding: 4rem 3rem;
    border-radius: 8px;
    transition: var(--transition);
    text-align: center; /* Centrado global */
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: var(--accent-gold);
    transition: var(--transition);
}

.feature-card:hover::before {
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(0,0,0,0.1);
}

.feature-card .icon {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    display: block;
    opacity: 0.9;
}

.feature-card h3 {
    font-size: 1.6rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.8;
}

/* --- FOOTER --- */
footer {
    background: var(--primary-blue);
    color: white;
    padding: 6rem 0 3rem;
    border-top: 5px solid var(--accent-gold);
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 3rem !important;
    }
    .footer-brand {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr !important;
    }
    .footer-brand {
        grid-column: span 1;
    }
    .trust-container {
        flex-direction: column;
        gap: 1.5rem;
    }
    .trust-logos {
        flex-wrap: wrap;
        gap: 2rem;
        justify-content: center;
    }
}

/* --- WHATSAPP FLOAT --- */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 2px 2px 15px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 2px 2px 20px rgba(37, 211, 102, 0.4);
}

@media (max-width: 600px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    .whatsapp-float img {
        width: 30px !important;
        height: 30px !important;
    }
}

/* --- MOBILE MENU --- */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 1100;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--primary-blue);
    transition: var(--transition-fast);
}

header.hero-header:not(.scrolled) .mobile-menu-toggle span {
    background: white;
}

@media (max-width: 900px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        gap: 1.5rem;
        padding: 2rem;
        box-shadow: var(--shadow-md);
        transform: translateY(-20px);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
        z-index: 1000;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links a {
        color: var(--primary-blue) !important; /* Force dark text in mobile menu */
    }

    header.hero-header:not(.scrolled) .nav-links a,
    header.hero-header:not(.scrolled) .lang-switcher {
        color: var(--primary-blue); /* Fix colors for hero menu */
    }

    /* Change toggle icon when active */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    
    header.hero-header:not(.scrolled) .mobile-menu-toggle.active span {
        background: var(--primary-blue);
    }
    
    /* Hide CTA button in header on mobile to prevent layout breaking */
    nav > .btn-cta {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .feature-card {
        padding: 2.5rem 1.5rem; /* Menos padding en móvil */
    }
    
    .product-info {
        padding: 2rem 1.5rem;
    }
    
    .product-image {
        height: 220px;
    }

    .portfolio-grid,
    .features-grid {
        grid-template-columns: 1fr; /* Forzar una columna en móvil */
        gap: 2rem;
    }
}