/* --- Variables y Estilos Globales --- */
:root {
    --primary-color: #FF00B8; /* Magenta fluorescente */
    --secondary-color: #CC0092; /* Tono más oscuro para hovers */
    --background-color: #0A0A0A; /* Negro profundo */
    --card-bg: #16161D; /* Neutro ink/surface */
    --text-color: #e0e0e0;
    --text-muted: #C9C9D1; /* Texto secundario */
    --border-color: rgba(255, 255, 255, 0.06);
    --font-family: 'Inter', sans-serif;
    /* Colores para las partículas del menú */
    --gooey-color-1: var(--primary-color);
    --gooey-color-2: #00f0ff;
    --gooey-color-3: #a855f7;
    --gooey-color-4: var(--secondary-color);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-top: 80px; /* Aumentado para acomodar la nueva altura del header */
    overflow-x: hidden; /* Previene el scroll horizontal indeseado en móviles */
}

/* --- Barra de Navegación --- */
.header {
    background-color: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    min-height: 80px;
    display: flex;
    align-items: center;
    z-index: 1000;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Alinea logo a la izq. y el resto a la der. */
    width: 100%; /* Ocupa todo el ancho del header */
    padding: 0 2rem;
}

.nav-logo {
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px; /* Espacio entre el menú y el botón de contacto */
}

.nav-cta {
    background-color: var(--primary-color);
    color: #121212;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.nav-cta:hover {
    background-color: var(--secondary-color);
}

.nav-item {
    position: relative;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
    /* Promueve el elemento a su propia capa de composición para
       prevenir glitches de renderizado durante el scroll y las transiciones. */
    transform: translateZ(0);
}

.nav-link:hover {
    color: var(--text-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.nav-link.active {
    color: var(--text-color);
}

.nav-link.active::after {
    transform: scaleX(1);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-color);
}

/* --- Secciones --- */
.content-section {
    padding: 5rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    opacity: 0; /* Oculto por defecto para la animación */
    transform: translateY(20px); /* Desplazado para la animación */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    scroll-margin-top: 80px; /* Espacio para la barra de navegación fija */
}

.content-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-subtitle {
    color: var(--text-muted);
    max-width: 700px;
    margin: -1.5rem auto 3rem auto;
    line-height: 1.7;
}

.section-title {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 2rem;
}

/* --- Sección Hero (Bienvenida) --- */
.hero-section {
    position: relative;
    overflow: hidden;
    color: var(--text-color);
    padding: 0; /* Remove padding to make slider full height */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Full viewport height */
    height: 100vh;
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden; /* Contiene el fondo que se agranda */
}

.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.hero-slide.active .slide-bg {
    /* Animación sutil de zoom (efecto Ken Burns) */
    animation: ken-burns 20s ease-in-out infinite alternate;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Add a dark overlay for better text readability */
.hero-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1; /* Se asegura que el overlay esté sobre el fondo y debajo del contenido */
}

.slide-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem;
    animation: slide-up 1s ease-out forwards;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-content h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.slide-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

/* New button style */
.light-border-btn {
    position: relative;
    padding: 1rem 2.5rem;
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--primary-color);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.light-border-btn:hover {
    color: #0A0A0A;
    background-color: var(--primary-color);
    box-shadow: 0 0 25px rgba(255, 0, 184, 0.5);
}

.light-border-btn span {
    position: absolute;
    display: block;
}

/* Top line */
.light-border-btn span:nth-child(1) {
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color));
    animation: animate1 2s linear infinite;
}

/* Right line */
.light-border-btn span:nth-child(2) {
    top: -100%;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--primary-color));
    animation: animate2 2s linear infinite;
    animation-delay: 0.5s;
}

/* Bottom line */
.light-border-btn span:nth-child(3) {
    bottom: 0;
    right: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(270deg, transparent, var(--primary-color));
    animation: animate3 2s linear infinite;
    animation-delay: 1s;
}

/* Left line */
.light-border-btn span:nth-child(4) {
    bottom: -100%;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(360deg, transparent, var(--primary-color));
    animation: animate4 2s linear infinite;
    animation-delay: 1.5s;
}

/* Slider Controls */
.slider-controls {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    opacity: 0; /* Oculto por defecto */
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.hero-section:hover .slider-controls {
    opacity: 1; /* Visible al pasar el cursor sobre el hero */
    visibility: visible;
}

.slider-arrow {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.slider-arrow:hover {
    background-color: var(--primary-color);
    color: #0A0A0A;
}

.slider-dots {
    display: flex;
    gap: 1rem;
}

.slider-dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.slider-dot.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

@keyframes ken-burns {
    from {
        transform: scale(1) rotate(0.001deg);
    }
    to {
        transform: scale(1.1) rotate(0.001deg);
    }
}

/* --- Tecnologías --- */
.tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.tech-item img {
    height: 24px;
    width: 24px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.tech-item:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(255, 0, 184, 0.25);
}

.tech-item:hover img {
    color: var(--primary-color);
}

/* --- Partners Scroller --- */
.scroller {
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    -webkit-mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent);
    mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent);
}

.scroller__inner {
    display: flex;
    flex-wrap: nowrap;
    gap: 4rem;
    padding-block: 1rem;
    margin: 0;
    padding-inline-start: 0; /* Resetea el padding por defecto de la lista */
    list-style: none;
}

.scroller[data-animated="true"] {
    overflow: hidden;
}

.scroller[data-animated="true"] .scroller__inner {
    width: max-content;
    flex-wrap: nowrap;
    animation: scroll 30s linear infinite;
}

.scroller__inner li {
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroller__inner img {
    height: 40px;
    max-width: 150px;
    /* Usamos brightness en lugar de opacity para evitar conflictos con mix-blend-mode */
    filter: grayscale(1) brightness(0.7);
    transition: filter 0.4s ease, transform 0.4s ease;
    transform: scale(1);
}

/* 1. Aumenta el tamaño de logos específicos */
.scroller__inner img[alt="Nvidia"] {
    height: 65px; /* Aumentado para mayor visibilidad */
}
.scroller__inner img[alt="ESP32"] {
    height: 50px;
}

/* 2. Estilo para el logo que está en el centro */
.scroller__inner li.is-center img {
    /* Devolvemos el brillo completo y el color */
    filter: grayscale(0) brightness(1);
    transform: scale(1.15);
}

@keyframes scroll {
    to { transform: translate(calc(-50% - 2rem)); }
}

/* --- Productos --- */
.products-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.product-card {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    background: linear-gradient(180deg, #1B1B24 0%, #0A0A0A 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: left;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    box-shadow: 0 6px 30px rgba(0,0,0,0.35);
    position: relative;
    scroll-margin-top: 80px; /* Espacio para la barra de navegación fija */
}

.product-card:nth-child(even) {
    flex-direction: row-reverse;
}

.product-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 30px rgba(0,0,0,0.35), 0 0 20px rgba(255, 0, 184, 0.2);
}

.product-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle 300px at var(--mouse-x) var(--mouse-y), rgba(255, 0, 184, 0.1), transparent 80%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.product-card:hover::before {
    opacity: 1;
}

.product-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.product-icon {
    width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    mask-image: var(--icon-url);
    -webkit-mask-image: var(--icon-url);
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
}

.product-content {
    flex: 1;
    min-width: 50%;
    position: relative;
    z-index: 1;
}

.product-content h3 {
    font-size: 1.5rem;
    color: #FFFFFF;
    font-weight: 700;
    margin: 0;
}

.product-content h4 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 500;
}

.product-content > p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
    font-size: 0.95rem;
    font-weight: 400;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin-bottom: 2.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 2rem;
}

.feature-list li {
    color: var(--text-muted);
    position: relative;
    padding-left: 25px;
    font-size: 0.9rem;
    font-weight: 400;
}

.feature-list li::before {
    content: '●';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.product-content .cta-button {
    display: inline-block;
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.product-content .cta-button:hover {
    background-color: var(--primary-color);
    color: #0A0A0A;
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 0, 184, 0.5);
}

.product-image-container {
    flex: 0 0 40%;
    align-self: stretch;
    min-height: 350px;
    background-color: #23232E;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 1;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card:hover .product-image-container {
    transform: scale(1.05);
}

/* --- Servicios --- */
.services-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    scroll-margin-top: 80px; /* Espacio para la barra de navegación fija */
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 25px rgba(255, 0, 184, 0.3);
}

/* Staggered animation delays for each service card */
.services-container > .service-card:nth-child(1) { --animation-start-delay: 0s; }
.services-container > .service-card:nth-child(2) { --animation-start-delay: 0.4s; }
.services-container > .service-card:nth-child(3) { --animation-start-delay: 0.8s; }
.services-container > .service-card:nth-child(5) { --animation-start-delay: 0.2s; }
.services-container > .service-card:nth-child(6) { --animation-start-delay: 0.6s; }
.services-container > .service-card:nth-child(7) { --animation-start-delay: 1.0s; }

.service-card span {
    position: absolute;
    display: block;
}

/* Top line */
.service-card span:nth-child(1) {
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color));
    animation: animate1 2.5s linear infinite;
    animation-delay: calc(var(--animation-start-delay, 0s) + 0s);
}

/* Right line */
.service-card span:nth-child(2) {
    top: -100%;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--primary-color));
    animation: animate2 2.5s linear infinite;
    animation-delay: calc(var(--animation-start-delay, 0s) + 0.625s);
}

/* Bottom line */
.service-card span:nth-child(3) {
    bottom: 0;
    right: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(270deg, transparent, var(--primary-color));
    animation: animate3 2.5s linear infinite;
    animation-delay: calc(var(--animation-start-delay, 0s) + 1.25s);
}

/* Left line */
.service-card span:nth-child(4) {
    bottom: -100%;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(360deg, transparent, var(--primary-color));
    animation: animate4 2.5s linear infinite;
    animation-delay: calc(var(--animation-start-delay, 0s) + 1.875s);
}

.service-icon {
    margin-bottom: 1rem;
    text-align: left;
    width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    mask-image: var(--icon-url);
    -webkit-mask-image: var(--icon-url);
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
}

.service-card h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    text-align: left;
}

.service-card p {
    text-align: left;
    color: var(--text-muted);
}

.service-feature-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
    text-align: left;
}

.service-feature-list li {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 20px;
}

.service-feature-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* --- Banner CTA en Servicios --- */
.service-cta-banner {
    grid-column: 1 / -1; /* Ocupa todas las columnas de la cuadrícula */
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    background: linear-gradient(90deg, rgba(255, 0, 184, 0.05) 0%, rgba(255, 0, 184, 0) 50%, rgba(255, 0, 184, 0.05) 100%), var(--card-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-cta-banner:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(255, 0, 184, 0.2);
}

.service-cta-banner h3 {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
    margin: 0;
    position: relative;
    z-index: 2;
}

.service-cta-banner h3 span {
    color: var(--primary-color);
    font-weight: 700;
}

.service-cta-banner .banner-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    background-color: var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.service-cta-banner:hover .banner-glow {
    animation: pulse-glow 1.5s ease-out;
}

/* --- Sobre Nosotros --- */
.about-card {
    background: linear-gradient(180deg, #1B1B24 0%, #0A0A0A 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.4s ease;
}

.about-card:hover {
    box-shadow: 0 0 30px rgba(255, 0, 184, 0.2);
}

.about-card-main p {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.about-card-main strong {
    color: var(--primary-color);
    font-weight: 600;
}

.about-card-expandable {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-card.open .about-card-expandable {
    max-height: 500px; /* A large enough value */
}

.mission-vision-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1.5rem;
}

.mission-vision-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.mission-vision-item p {
    color: var(--text-muted);
    line-height: 1.7;
}

.about-card-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem auto 0;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

.about-card-toggle:hover {
    color: var(--primary-color);
}

.about-card-toggle .arrow-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-card.open .about-card-toggle .arrow-icon {
    transform: rotate(180deg);
}

/* --- Formulario de Contacto --- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 2rem auto 0 auto;
    text-align: left;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 1rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: var(--font-family);
    font-size: 1rem;
    color: var(--text-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23C9C9D1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem; /* Make space for the arrow */
}

.contact-form optgroup {
    font-weight: bold;
    font-style: italic;
    background-color: var(--background-color);
    color: var(--primary-color);
}

.contact-form option {
    background-color: var(--card-bg);
    color: var(--text-color);
}

.contact-form option:hover {
    background-color: var(--primary-color);
    color: #0A0A0A; /* Texto oscuro para buen contraste */
}

.contact-form input:not(:focus):hover,
.contact-form textarea:not(:focus):hover,
.contact-form select:not(:focus):hover {
    border-color: rgba(255, 0, 184, 0.5);
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 0, 184, 0.2);
}

.contact-form .light-border-btn {
    align-self: center;
    cursor: pointer;
}

.contact-form .light-border-btn:disabled {
    background-color: #555;
    border-color: #555;
    cursor: not-allowed;
    opacity: 0.6;
    color: var(--text-muted);
    box-shadow: none;
}

.contact-form .light-border-btn:disabled:hover {
    background-color: #555;
    color: var(--text-muted);
}

#form-feedback {
    text-align: center;
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
    display: none; /* Oculto por defecto */
    font-weight: 500;
}

#form-feedback.success {
    display: block;
    background-color: rgba(25, 135, 84, 0.2);
    color: #52c41a;
    border: 1px solid #52c41a;
}

#form-feedback.error {
    display: block;
    background-color: rgba(220, 53, 69, 0.2);
    color: #ff4d4f;
    border: 1px solid #ff4d4f;
}

/* --- Pie de Página --- */
.footer {
    background-color: #0A0A0A;
    color: var(--text-muted);
    padding: 4rem 2rem 2rem 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto 3rem auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-column {
    flex: 1;
    min-width: 200px;
}

.footer-column.brand {
    flex: 1.5;
    min-width: 250px;
    padding-right: 2rem;
}

.footer-logo {
    height: 40px;
    margin-bottom: 1rem;
}

.footer-column.brand p {
    line-height: 1.7;
    font-size: 0.9rem;
}

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

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.social-icon img {
    height: 20px;
    width: 20px;
    /* Se cambia el filtro para que el icono sea blanco por defecto y visible */
    filter: brightness(0) invert(1);
    transition: filter 0.3s ease;
}

.social-icon:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

.social-icon:hover img {
    /* El icono se vuelve negro para contrastar con el fondo magenta */
    filter: brightness(0);
}

.footer-column h4 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column ul li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.footer-column ul li a,
.footer-column ul li span {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-contact-icon {
    width: 18px;
    height: 18px;
    background-color: var(--text-muted);
    mask-image: var(--icon-url);
    -webkit-mask-image: var(--icon-url);
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.footer-column ul li:hover {
    transform: translateX(5px);
}

.footer-column ul li:hover a,
.footer-column ul li:hover span {
    color: var(--primary-color);
}

.footer-column ul li:hover .footer-contact-icon {
    background-color: var(--primary-color);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-legal a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer-legal a:hover {
    color: var(--primary-color);
}

@keyframes reveal-line {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes animate1 {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

@keyframes animate2 {
  0% { top: -100%; }
  50%, 100% { top: 100%; }
}

@keyframes animate3 {
  0% { right: -100%; }
  50%, 100% { right: 100%; }
}

@keyframes animate4 {
  0% { bottom: -100%; }
  50%, 100% { bottom: 100%; }
}

/* --- Responsividad (Móviles) --- */
@media (max-width: 1024px) {
    .services-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-card {
        gap: 1.5rem;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-right {
        gap: 0; /* Resetea el gap en móvil, el hamburger es el único elemento visible */
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-right .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px; /* Nueva altura de la barra de navegación */
        gap: 0;
        flex-direction: column;
        background-color: var(--background-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    }

    .nav-right .nav-cta {
        display: none;
    }

    .nav-right .nav-menu.active {
        left: 0;
    }

    .nav-item {
        padding: 1rem 0;
    }

    .services-container {
        grid-template-columns: 1fr;
    }

    .hero-section {
        flex-direction: column;
        padding-top: 6rem;
        padding-bottom: 4rem;
    }

    .hero-title-animated {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .feature-list {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .mission-vision-container {
        grid-template-columns: 1fr;
    }

@keyframes pulse-glow {
    0% {
        width: 0;
        height: 0;
        opacity: 0.3;
    }
    100% {
        width: 400%;
        height: 400%;
        opacity: 0;
    }
}

    .product-card,
    .product-card:nth-child(even) {
        flex-direction: column;
        padding: 1.5rem;
    }

    .product-image-container {
        width: 100%;
        margin-top: 2rem;
        min-height: 250px;
    }

    .hero-stats {
        position: relative;
        bottom: auto;
        transform: none;
        left: auto;
        margin: 4rem auto 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }

    .footer-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .footer-bottom {
        flex-direction: column-reverse;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .footer-container {
        grid-template-columns: 1fr;
    }
}

/* --- AI Chat Widget --- */
#chat-widget-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1001;
}

.chat-trigger-btn {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 0, 184, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chat-trigger-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 0, 184, 0.6);
}

.chat-trigger-btn img {
    width: 32px;
    height: 32px;
    filter: brightness(0);
}

.chat-widget {
    position: absolute;
    bottom: calc(100% + 1rem);
    right: 0;
    width: 350px;
    max-width: 90vw;
    height: 500px; /* Altura fija para evitar reajustes con el teclado virtual */
    max-height: 70vh; /* Se asegura que no sea más alto que el 70% de la pantalla en dispositivos pequeños */
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s;
}

.chat-widget.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: rgba(10, 10, 10, 0.5);
    border-bottom: 1px solid var(--border-color);
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.chat-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.chat-messages {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    line-height: 1.5;
}

.bot-message {
    background-color: #2a2a33;
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.user-message {
    background-color: var(--primary-color);
    color: #0A0A0A;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0.75rem 1rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

.chat-input-form {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    gap: 0.5rem;
}

#chat-input {
    flex-grow: 1;
    background-color: #2a2a33;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    outline: none;
    font-size: 16px; /* Previene el zoom automático en iOS (debe ser >= 16px) */
    transition: border-color 0.3s ease;
}

#chat-input:focus {
    border-color: var(--primary-color);
}

#chat-send-btn {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    background-color: var(--primary-color);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#chat-send-btn:hover {
    background-color: var(--secondary-color);
}

#chat-send-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0);
}

@media (max-width: 768px) {
    #chat-widget-container {
        bottom: 1rem;
        right: 1rem;
    }
}
