/* ESTILOS CORPORATIVOS - UNITED Solutions • Enterprise 
   Basado en lineamientos de marca oficiales.
*/

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;700;900&display=swap');

:root {
    /* Paleta de Colores UNITED */
    --brand-navy: #263658;
    --brand-teal-dark: #03A091;
    --brand-teal-light: #3FC4C4;
    --brand-orange: #ED8057;
    
    /* Variables de Superficie y Texto */
    --surface-light: #F8FAFC;
    --surface-alt: #f1f5f9;
    --text-main: #263658; 
    --text-muted: #64748b;
    --border-light: #e2e8f0;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);

    /* --- ESCALA TIPOGRÁFICA UX (SISTEMA FLUIDO) --- */
    /* clamp(min, preferido, max) */
    --fs-h1: clamp(2.5rem, 6vw, 4rem);    /* Hero titles */
    --fs-h2: clamp(2rem, 4vw, 2.75rem);  /* Section titles */
    --fs-h3: clamp(1.5rem, 3vw, 2rem);    /* Large card titles */
    --fs-h4: clamp(1.25rem, 2vw, 1.5rem); /* Standard card titles */
    --fs-body: clamp(1rem, 1vw, 1.1rem);  /* Paragraphs */
    --fs-small: 0.875rem;                 /* Badges/Captions */
}

/* --- CONFIGURACIÓN BASE --- */
body {
    font-family: 'Raleway', sans-serif;
    font-size: var(--fs-body);
    color: var(--text-main);
    background-color: #ffffff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- JERARQUÍA DE TÍTULOS --- */
h1, .h1 {
    font-size: var(--fs-h1);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

h2, .h2 {
    font-size: var(--fs-h2);
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}

h3, .h3 {
    font-size: var(--fs-h3);
    font-weight: 900;
    line-height: 1.3;
}

h4, h5, .h4, .h5 {
    font-size: var(--fs-h4);
    font-weight: 700;
    line-height: 1.4;
}

.fw-bold { font-weight: 700 !important; }
.fw-black { font-weight: 900 !important; }

/* UX: Limitar ancho de párrafos lead para legibilidad */
.lead {
    font-size: clamp(1.1rem, 1.5vw, 1.25rem);
    /* max-width: 70ch;*/
    color: #fff;
}

.text-primary { color: var(--brand-teal-dark) !important; }
.text-orange { color: var(--brand-orange) !important; }

.text-gradient {
    background: linear-gradient(135deg, #ffffff 30%, var(--brand-teal-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- NAVEGACIÓN --- */
.glass-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--brand-teal-dark);
}

#logo-menu { max-width: 180px; }

/* --- BOTONES --- */
.btn-brand {
    background-color: var(--brand-teal-light);
    color: white;
    border-radius: 25px;
    padding: 14px 32px;
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: none;
    transition: var(--transition);
}

.btn-brand:hover {
    background-color: var(--brand-navy);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(38, 54, 88, 0.15);
}

/* --- HERO SECTION --- */
.hero-section {
    padding: clamp(100px, 15vh, 160px) 0 clamp(60px, 10vh, 120px);
    min-height: 85vh;
    display: flex;
    align-items: center;
    background: linear-gradient(rgba(38, 54, 88, 0.85), rgba(38, 54, 88, 0.85)), 
                url('../img/banner.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    color: white;
}

/* --- MARQUEE --- */
.marquee-container {
    width: 100%;
    overflow: hidden;
    padding: 30px 0;
    position: relative;
    display: flex;
    background: var(--surface-light);
}

.marquee-track {
    display: flex; /* Cambiado de inline-flex a flex */
    gap: 80px;
    width: max-content; /* Fuerza al contenedor a extenderse todo lo necesario */
    animation: marquee-infinite 40s linear infinite;
    will-change: transform; /* Optimización de rendimiento para animaciones */
}

@keyframes marquee-infinite {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-item {
    flex-shrink: 0; /* Evita que los logos se achiquen si hay poco espacio */
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--brand-navy);
}

.marquee-container:hover .marquee-track {
    animation-play-state: paused;
}

.client-logo {
    max-height: 110px; /* Ajusta según el diseño de tus logos */
    width: auto;
    transition: all 0.3s ease;
    padding: 0 10px;
}

.marquee-item:hover .client-logo {
    filter: grayscale(0%); /* Vuelve a su color original al pasar el mouse */
    opacity: 1;
    transform: scale(1.05);
}

/* --- GRID DE SERVICIOS --- */
.card-horizontal, .service-card {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: white;
    padding: 2rem;
    transition: var(--transition);
    height: 100%;
}

.card-horizontal:hover, .service-card:hover {
    border-color: var(--brand-teal-light);
    box-shadow: 0 20px 40px rgba(38, 54, 88, 0.08);
    transform: translateY(-5px);
}

.icon-circle, .service-icon {
    width: 64px;
    height: 64px;
    background: rgba(3, 160, 145, 0.1);
    color: var(--brand-teal-dark);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* Título de la tarjeta destacada (IA) */
.service-title-lg {
    font-size: var(--fs-h3); /* Basado en clamp para adaptabilidad */
    font-weight: 900 !important;
    line-height: 1.2;
}

/* Títulos de tarjetas estándar (Grid) */
.service-title {
    font-size: var(--fs-h4);
    font-weight: 900 !important; /* Raleway Black [cite: 34] */
    color: var(--brand-navy); /* HEX: 263658 [cite: 12] */
    margin-bottom: 1rem;
    min-height: 3rem; /* Alinea los títulos de 1 y 2 líneas */
    display: flex;
    align-items: center;
}

/* Textos de descripción */
.service-text {
    font-size: 0.95rem; 
    color: var(--text-muted); /* HEX: 64748b */
    line-height: 1.7; 
    margin-bottom: 2rem; 
    max-width: 55ch; 
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.01em;
}

/* Forzar altura igual en las tarjetas blancas */
.white-card {
    display: flex;
    flex-direction: column;
    padding: 2rem !important;
}

/* --- SOLUCIONES ESPECIALIZADAS (BENTO) --- */
.specialized-solutions-bg {
    background: radial-gradient(circle at 0% 0%, rgba(3, 160, 145, 0.05) 0%, transparent 70%),
                radial-gradient(circle at 100% 100%, rgba(38, 54, 88, 0.05) 0%, transparent 70%);
}

.card-adn {
    position: relative;
    border-radius: 24px;
    padding: clamp(1.5rem, 5vw, 3rem) !important;
    transition: var(--transition);
    border: 1px solid rgba(38, 54, 88, 0.1);
    background: #fff;
    overflow: hidden;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-adn.featured-card {
    background: var(--brand-navy);
    border: none;
    color: white;
}

.card-adn.featured-card::before {
    content: "";
    position: absolute;
    top: 0; right: 0;
    width: 200px; height: 200px;
    background-image: radial-gradient(rgba(63, 196, 196, 0.15) 1.5px, transparent 1.5px);
    background-size: 20px 20px;
    z-index: -1;
}

.card-glow {
    position: absolute;
    bottom: -100px; right: -100px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--brand-teal-dark) 0%, transparent 70%);
    opacity: 0.4;
    filter: blur(60px);
    z-index: -1;
}

/* --- ICON BOXES --- */
.icon-box-premium {
    background: var(--brand-orange);
    color: white;
    padding: 20px;
    border-radius: 18px;
    box-shadow: 0 15px 30px rgba(237, 128, 87, 0.3);
    display: inline-flex;
    margin-bottom: 1.5rem;
}

.icon-box-soft {
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 15px;
    background: var(--surface-light);
    color: var(--brand-navy);
    border: 1px solid #edf2f7;
    transition: 0.3s;
    margin-bottom: 1.25rem;
}

.icon-box-soft.teal { color: var(--brand-teal-dark); background: rgba(3, 160, 145, 0.1); }
.icon-box-soft.orange { color: var(--brand-orange); background: rgba(237, 128, 87, 0.1); }

/* --- HOVERS --- */
.card-adn:hover {
    transform: translateY(-12px);
    box-shadow: 0 30px 60px rgba(38, 54, 88, 0.15);
}

.border-hover-teal:hover { border-top: 6px solid var(--brand-teal-dark); }
.border-hover-orange:hover { border-top: 6px solid var(--brand-orange); }

/* --- BADGES --- */
.badge-tech {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--brand-teal-light);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: var(--fs-small);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- VALORES --- */
.value-item {
    background: white;
    border: 1px solid var(--border-light);
    border-left: 5px solid var(--brand-orange);
    border-radius: 12px;
    padding: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
}

.value-item:hover {
    transform: translateX(12px);
    box-shadow: 0 10px 25px rgba(38, 54, 88, 0.05);
}

/* --- FOOTER --- */
footer {
    background: var(--brand-navy);
    padding: 80px 0 40px;
    color: rgba(255, 255, 255, 0.7);
}

footer h6 {
    font-size: 1rem;
    color: var(--brand-teal-light);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem;
}

/* --- ANIMACIONES --- */
.animate-up {
    animation: fadeInUp 1s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* BOTÓN WHATSAPP UNITED SOLUTIONS */
.whatsapp-btn-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--brand-teal-dark); /* Color Teal Base */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(3, 160, 145, 0.4);
    z-index: 9999;
    transition: var(--transition); /* */
    text-decoration: none;
}

.whatsapp-btn-float:hover {
    background-color: var(--brand-navy); /* Cambio al Navy */
    transform: scale(1.1) rotate(0deg);
}

/* Tooltip (Ajuste de Centrado Crítico) */
.whatsapp-tooltip {
    position: absolute;
    right: 75px; 
    /* Forzamos el centrado vertical absoluto */
    top: 50%;
    transform: translateY(-50%) translateX(0); 
    
    background: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700; /* Raleway Bold */
    color: var(--brand-navy); /* */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    pointer-events: none;
}

/* Hover: El tooltip se desplaza desde la derecha y se queda fijo */
.whatsapp-btn-float:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    right: 80px; 
    /* Mantenemos el translateY para que no "salte" al escalar el botón */
    transform: translateY(-50%) translateX(-5px);
}

/* Flecha decorativa */
.whatsapp-tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent white;
}

/* Efecto de pulso */
.whatsapp-btn-float::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--brand-teal-dark);
    opacity: 0.5;
    z-index: -1;
    animation: whatsapp-pulse 2s infinite;
}

@keyframes whatsapp-pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Responsivo */
@media (max-width: 768px) {
    .whatsapp-btn-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    .whatsapp-tooltip { display: none; }
}

/* Contenedor circular con estilo United */

.social-icon-item svg {
    fill: currentColor; /* Esto hace que el SVG use el color blanco o teal del padre */
    width: 20px;
    height: 20px;
    display: block;
}

.social-icon-item {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transition: var(--transition); /* Transición de 0.3s */
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* Hover general: Teal Secundario */
.social-icon-item:hover {
    background-color: var(--brand-teal-light);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(63, 196, 196, 0.3);
    color: white !important;
}

/* Hover específico para Email: Naranja */
.social-icon-item[aria-label="Email"]:hover {
    background-color: var(--brand-orange);
    box-shadow: 0 10px 20px rgba(237, 128, 87, 0.3);
}

.social-icon-item span {
    font-size: 1.5rem; /* Tamaño optimizado para UX */
}


/* --- ESTILOS DEL FORMULARIO UNITED --- */
.bg-navy { background-color: var(--brand-navy); }

.form-label-united {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: white;
}

/* Asterisco naranja para campos obligatorios */
.form-label-united::after {
    content: " *";
    color: var(--brand-orange);
}

.form-control-united {
    width: 100%;
    background-color: white !important;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 15px;
    color: var(--brand-navy);
    font-family: 'Raleway', sans-serif;
    transition: var(--transition);
}

.form-control-united:focus {
    box-shadow: 0 0 0 4px rgba(3, 160, 145, 0.3);
    outline: none;
    border-color: var(--brand-teal-light);
}

/* --- BOTÓN DE ENVÍO UNITED --- */
#submitBtn {
    background-color: var(--brand-teal-light) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important; /* Coherente con tus inputs */
    padding: 14px 32px !important;
    font-size: 0.95rem !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    transition: var(--transition) !important;
    width: 100%; /* Para que ocupe todo el ancho del formulario */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#submitBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(38, 54, 88, 0.15);
}

#submitBtn:active {
    transform: translateY(-1px);
}

/* Estado cuando se está enviando (Disabled) */
#submitBtn:disabled {
    background-color: var(--text-muted) !important;
    opacity: 0.8;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Ajuste del Spinner para que no deforme el botón */
.spinner-border-sm {
    width: 1.2rem;
    height: 1.2rem;
    border-width: 0.2em;
}

/* --- ESTILOS UNITED PARA TOM SELECT --- */

/* Contenedor principal */
.ts-wrapper.select-buscador .ts-control {
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    padding: 10px 15px !important;
    min-height: 48px !important;
    background-color: white !important;
    font-family: 'Raleway', sans-serif !important;
    font-weight: 700;
    color: var(--brand-navy) !important;
    display: flex !important;
    align-items: center !important;
    transition: var(--transition) !important;
}

/* El input de búsqueda (cuando el usuario escribe) */
.ts-wrapper.select-buscador .ts-control input {
    color: var(--brand-navy) !important;
    font-family: 'Raleway', sans-serif !important;
    font-weight: 700 !important;
    background: transparent !important;
}

/* Foco: Brillo Teal (Igual que tus otros inputs) */
.ts-wrapper.select-buscador.focus .ts-control {
    box-shadow: 0 0 0 4px rgba(3, 160, 145, 0.3) !important;
    border-color: var(--brand-teal-light) !important;
}

/* La caja desplegable de países */
.ts-dropdown.select-buscador {
    border-radius: 12px !important;
    border: 2px solid var(--brand-teal-dark) !important;
    margin-top: 8px !important;
    box-shadow: 0 10px 30px rgba(38, 54, 88, 0.2) !important;
    z-index: 9999 !important;
    background: white !important;
    overflow: hidden; /* Para que el redondeado corte las opciones */
}

/* Opciones de la lista */
.ts-dropdown.select-buscador .option {
    padding: 12px 15px !important;
    color: var(--brand-navy) !important;
    font-family: 'Raleway', sans-serif !important;
    font-weight: 400;
    transition: background 0.2s ease;
}

/* Hover en la lista */
.ts-dropdown.select-buscador .active {
    background-color: var(--brand-teal-dark) !important;
    color: white !important;
}

/* Estilo para el divisor (────────────────────) */
.ts-dropdown.select-buscador .option[data-value=""] {
    opacity: 0.4;
    font-size: 0.8rem;
    pointer-events: none;
    border-bottom: 1px solid var(--border-light);
}

/* --- AJUSTE DE SENSACIÓN SELECT UNITED --- */

/* Por defecto, que parezca un botón (mano) */
.ts-wrapper.select-buscador .ts-control, 
.ts-wrapper.select-buscador .ts-control input {
    cursor: pointer !important;
}

/* Ocultar el cursor de texto (palito parpadeante) por defecto */
.ts-wrapper.select-buscador .ts-control input {
    caret-color: transparent !important;
}

/* Mostrar el cursor de texto SOLO cuando el buscador esté abierto para escribir */
.ts-wrapper.select-buscador.dropdown-active .ts-control input {
    caret-color: var(--brand-navy) !important;
    cursor: text !important;
}

/* Evitar que el texto seleccionado se vea azul/sombreado al hacer clic */
.ts-wrapper.select-buscador .ts-control input::selection {
    background: transparent !important;
}

/* Añadir una flechita (Chevron) para que el usuario sepa que es un select */
.ts-wrapper.select-buscador::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 10px;
    height: 6px;
    background-color: var(--brand-navy);
    clip-path: polygon(100% 0%, 0 0%, 50% 100%); /* Flecha hacia abajo */
    pointer-events: none;
    transition: var(--transition);
}

/* Rotar la flechita cuando se abre */
.ts-wrapper.select-buscador.dropdown-active::after {
    transform: translateY(-50%) rotate(180deg);
}

.ts-wrapper.single.select-buscador .ts-control .item {
    padding-right: 20px !important; /* Espacio para la flechita */
}

/* Evita que el cursor de texto parpadee al hacer clic si ya está cerrado */
.ts-wrapper.select-buscador .ts-control input:read-only {
    caret-color: transparent !important;
    cursor: pointer !important;
}
.letter-spacing-1 { letter-spacing: 1px; }

/* --- RESPONSIVE DESIGN: UNITED MOBILE --- */

@media (max-width: 768px) {
    /* 1. Tipografía Fluida (Ajuste manual para mayor control) */
    :root {
        --fs-h1: 2.2rem;
        --fs-h2: 1.8rem;
        --fs-body: 1rem;
    }

    /* 2. Secciones y Contenedores */
    .hero-section {
        padding: 80px 0 60px;
        text-align: center;
        min-height: auto; /* Evita que sea demasiado largo en móviles */
    }

    /* 3. Marquee (Ajuste de Logos) */
    .marquee-container {
        padding: 20px 0;
    }

    .client-logo {
        height: 45px; /* Logos un poco más pequeños en móvil */
    }

    .marquee-track {
        gap: 40px; /* Reducimos el espacio para que se vean más logos a la vez */
    }

    .marquee-item {
        font-size: 1rem;
    }

    /* 4. Formulario United */
    .form-group-united {
        margin-bottom: 1.5rem;
    }

    .form-control-united, 
    .ts-control {
        height: 45px !important; /* Un poco más compacto */
        font-size: 16px !important; /* Evita el zoom automático en iOS al hacer clic */
    }

    /* 5. Botones */
    .btn-brand {
        width: 100%; /* Botones de ancho completo para mejor UX táctil */
        padding: 12px 20px;
        font-size: 0.85rem;
    }

    /* 6. Tarjetas y Grids */
    .card-adn, .service-card {
        padding: 1.5rem !important;
        margin-bottom: 1rem;
    }

    /* 7. Navegación */
    #logo-menu {
        max-width: 140px; /* Logo más pequeño en la barra */
    }
}

/* 8. Ajustes para teléfonos muy pequeños (iPhone SE, etc.) */
@media (max-width: 480px) {
    :root {
        --fs-h1: 1.8rem;
    }
    
    .marquee-group {
        gap: 30px;
        padding-right: 30px;
    }
}
