/* --- RESET Y BASES --- */
body,
html {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    /* Asegúrate de cargar esta fuente en el header */
    overflow-x: hidden;
}

/* Bloqueo de scroll solo para el Home */
body.home-page {
    overflow: hidden;
}

/* --- SISTEMA DE SLIDER (CRÍTICO) --- */
#hero-slider-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -2;
    /* Detrás del contenido */
    background-color: #000;
    /* Fondo negro por si falla una imagen */
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    /* ESTADO INICIAL: INVISIBLE */
    opacity: 0;
    transform: scale(1);
    transition: opacity 1.5s ease-in-out, transform 6s linear;
}

/* ESTADO ACTIVO: VISIBLE (ESTO ES LO QUE FALTABA) */
.hero-slide.active {
    opacity: 1;
    transform: scale(1.1);
    /* Efecto Ken Burns */
    z-index: -1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 25, 50, 0.4) 0%, rgba(0, 10, 20, 0.9) 100%);
    z-index: 0;
}

/* --- CONTENIDO HERO --- */
.hero-content {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    max-width: 800px;
    /* Un poco más de ancho para el texto largo */
    margin: 0 auto 3rem auto;
    font-weight: 400;
    opacity: 0.9;
    min-height: 4rem;
    /* Altura fija para evitar saltos de diseño */
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4), 0 0 15px rgba(79, 172, 254, 0.3);
    /* Resplandor neón suave */
    line-height: 1.6;
}

/* Cursor de escritura */
.hero-subtitle::after {
    content: '|';
    animation: blinkCursor 0.8s infinite;
    margin-left: 3px;
    font-weight: bold;
    color: #4facfe;
}

@keyframes blinkCursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* --- CONTADORES --- */
.counters-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
}

.counter-item {
    text-align: center;
}

.counter-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: #4facfe;
    /* Azul cian médico */
}

.counter-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- BOTONES --- */
.btn-outline-light {
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background-color: #fff;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

/* Responsividad básica */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .counters-grid {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* FORZAR NAVBAR TRANSPARENTE EN HOME */
body.home-page .navbar {
    background-color: transparent !important;
    box-shadow: none !important;
    padding-top: 20px;
    /* Un poco más de aire arriba */
}

/* TEXTOS DEL NAVBAR */
body.home-page .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

body.home-page .nav-link:hover {
    color: #4facfe !important;
    /* Azul cyan al pasar el mouse */
}

/* ASEGURAR VISIBILIDAD DE SLIDE */
.hero-slide {
    background-color: #001529;
    /* Color de respaldo azul oscuro por si falla la imagen */
}

/* --- BOTÓN PERSONALIZADO (ESTILO "PULSAR") --- */
.btn-biotex {
    /* Gradiente de #c19fbe a #004aad */
    background: linear-gradient(135deg, #c19fbe 0%, #004aad 100%);
    border: none;
    /* Esquinas muy redondeadas (tipo píldora) */
    border-radius: 50px;
    /* Transición suave para el hover */
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 74, 173, 0.3);
    /* Sombra azulada sutil */
}

/* Efecto de brillo al pasar el mouse (Opcional) */
.btn-biotex:hover {
    /* Efecto al pasar el mouse: sube ligeramente y cambia el brillo */
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 74, 173, 0.5);
    background: linear-gradient(135deg, #d4b5d1 0%, #005bc4 100%);
    /* Un poco más claro */
    color: #fff !important;
}

/* Efecto de "Pulsar" al hacer clic */
.btn-biotex:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 2px 10px rgba(0, 21, 41, 0.2);
}

/* LOGO BLANCO EN HOME (Inversión de color por filtro) */
body.home-page .navbar-brand img {
    /* Convierte el logo a blanco puro */
    filter: brightness(0) invert(1);
    /* Añade una transición suave por si se hace scroll */
    transition: filter 0.3s ease;
}

/* Opcional: Si el usuario hace scroll y el menú se vuelve blanco (sticky), 
   el logo recupera su color original para que se vea sobre fondo blanco */
body.home-page .navbar.scrolled .navbar-brand img {
    filter: none;
}

/* --- ESTILOS DE PRODUCTOS (Dynamic Catalog) --- */

/* Card Base */
.card-producto {
    border: 1px solid #eee;
    border-radius: 20px;
    /* Esquinas muy redondeadas */
    background: #fff;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Efecto Hover (Levantamiento) */
.card-producto:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 74, 173, 0.15);
    border-color: #c19fbe;
}

/* Avatar Circular */
.avatar-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem auto;
    background: linear-gradient(135deg, #c19fbe 0%, #004aad 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(0, 74, 173, 0.3);
}

.card-title {
    font-weight: 700;
    color: #001529;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.card-text {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* --- PAGE BANNER STYLES --- */
.page-banner {
    position: relative;
    height: 450px;
    /* Altura elegante para un banner interno */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    /* Efecto parallax sutil al hacer scroll */
    margin-bottom: 3rem;
    /* Separación con el grid de productos */
    padding-top: 60px;
    /* Compensar el navbar fijo si es necesario */
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradiente elegante de azul oscuro a transparente */
    background: linear-gradient(to bottom, rgba(0, 21, 41, 0.9) 0%, rgba(0, 74, 173, 0.6) 100%);
    z-index: 1;
}

/* Ajuste para móviles */
@media (max-width: 768px) {
    .page-banner {
        height: 300px;
    }

    .page-banner h1 {
        font-size: 2.5rem;
    }
}

/* Separador decorativo */
.separator-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #c19fbe, #004aad);
    border-radius: 2px;
}

/* Espaciado de letras para etiquetas pequeñas */
.tracking-widest {
    letter-spacing: 2px;
}

/* --- SEPARADORES PARALLAX Y ACORDEONES --- */
.separator-banner,
.separator-banner-large {
    background-attachment: fixed;
    /* Efecto Parallax */
    background-position: center;
    background-size: cover;
    position: relative;
    width: 100%;
}

.separator-banner {
    height: 350px;
}

.separator-banner-large {
    height: 600px;
}

.separator-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 21, 41, 0.5);
    /* Filtro azul oscuro */
}

/* Asegura que los acordeones tengan estilo limpio */
.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0, 0, 0, .125);
}

.accordion-button:not(.collapsed) {
    background-color: #fff;
    color: #004aad;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

/* --- ESTILOS CORPORATIVOS (NOSOTROS) --- */

/* Gradiente para Textos (Títulos) */
.gradient-text {
    background: linear-gradient(135deg, #004aad, #c19fbe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Gradiente para Iconos (Bootstrap Icons) */
.gradient-icon {
    background: linear-gradient(135deg, #004aad, #c19fbe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Fondo Gradiente para Barras de Progreso */
.gradient-bg {
    background: linear-gradient(90deg, #004aad, #c19fbe);
}

/* Texto Justificado */
.text-justify {
    text-align: justify;
}

/* Badge Flotante en Imagen */
.experience-badge {
    position: absolute;
    bottom: -20px;
    left: -20px;
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    text-align: center;
    color: #004aad;
    border-left: 5px solid #c19fbe;
    z-index: 5;
}

.floating-anim {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.hover-lift {
    transition: transform 0.3s;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* --- ESTILOS DE CONTACTO (FORMULARIO) --- */

/* Inputs minimalistas */
.form-floating>.form-control:focus,
.form-floating>.form-control:not(:placeholder-shown) {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.form-control:focus {
    box-shadow: none;
    background-color: #fff !important;
    border: 1px solid #c19fbe !important;
}

/* Botón Gradiente Hover */
.gradient-btn-hover {
    background: #001529;
    border: none;
    transition: all 0.4s ease;
}

.gradient-btn-hover:hover {
    background: linear-gradient(135deg, #c19fbe 0%, #004aad 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 74, 173, 0.4);
    color: #fff !important;
}

/* =========================================
   CORRECCIONES RESPONSIVAS (MOBILE FIX)
   ========================================= */

@media (max-width: 991.98px) {

    /* 1. ARREGLO DEL NAVBAR / MENÚ */
    .navbar-toggler {
        border-color: rgba(255, 255, 255, 0.5);
        margin-top: 10px;
        /* Separar un poco del borde superior */
    }

    /* Cuando se abre el menú en móvil, ponerle fondo oscuro sólido */
    .navbar-collapse {
        background-color: #001529;
        /* Azul oscuro corporativo */
        padding: 20px;
        margin-top: 15px;
        border-radius: 10px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    /* Ajustar logo para que no sea gigante */
    .navbar-brand img {
        max-width: 140px;
        /* Reducir tamaño del logo */
        height: auto;
    }

    /* 2. ARREGLO DEL HOME (HERO SECTION) */
    .hero-content {
        /* Dar espacio arriba para que el texto no choque con el logo */
        padding-top: 120px;
        align-items: flex-start;
        /* Alinear al inicio, no centrado vertical total */
    }

    .hero-title {
        font-size: 2.5rem !important;
        /* Reducir de 4rem a 2.5rem */
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem !important;
        margin-bottom: 2rem !important;
    }

    /* Ajuste de Contadores en Home */
    .counters-grid {
        flex-direction: column;
        gap: 1.5rem;
    }

    /* 3. ARREGLO DE BANNERS INTERNOS (Servicios, Nosotros, Contacto) */
    .page-banner {
        height: 300px !important;
        /* Banner más bajo en móvil */
        padding-top: 80px;
    }

    .page-banner h1.display-3 {
        font-size: 2.2rem !important;
        /* Títulos internos más pequeños */
    }

    .page-banner p.lead {
        font-size: 1.1rem !important;
    }

    /* 4. ARREGLO DE PADDING GENERAL */
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Ajuste de tarjetas y textos grandes */
    .display-6 {
        font-size: 1.8rem !important;
    }

    /* En contacto, poner columnas en fila */
    .row.g-0.shadow-lg {
        border-radius: 15px !important;
        /* Menos borde redondeado */
        margin-bottom: 2rem;
    }

    .p-5 {
        padding: 2rem !important;
        /* Reducir paddings exagerados de p-5 a p-3/4 */
    }
}

/* Ajustes para móviles muy pequeños (iPhone SE, etc) */
@media (max-width: 380px) {
    .hero-title {
        font-size: 2rem !important;
    }

    .counter-number {
        font-size: 2.5rem !important;
    }
}

/* --- CORRECCIONES MÓVILES EXTREMAS (< 992px) --- */
@media (max-width: 991.98px) {

    /* 1. LOGO PEQUEÑO (50px) */
    .navbar-brand img {
        height: 50px !important;
        width: auto !important;
    }

    /* 2. TEXTOS PEQUEÑOS (12px) */
    body,
    p,
    .lead,
    .hero-subtitle,
    .btn {
        font-size: 12px !important;
        line-height: 1.4 !important;
    }

    /* 3. TÍTULOS REDUCIDOS */
    .hero-title {
        font-size: 2rem !important;
        /* Reducido drásticamente */
        margin-bottom: 0.5rem !important;
    }

    .display-3,
    .display-4,
    .display-6 {
        font-size: 1.8rem !important;
    }

    /* 4. NÚMEROS REDUCIDOS UN 40% (De 3rem a 1.8rem) */
    .counter-number {
        font-size: 1.8rem !important;
    }

    .counter-label {
        font-size: 10px !important;
        letter-spacing: 0.5px !important;
    }

    /* 5. ARREGLO DE COLISIÓN HEADER/CONTENIDO */
    .hero-content {
        /* Empujamos el contenido hacia abajo para que no choque con el logo */
        padding-top: 140px !important;
        align-items: flex-start !important;
        /* Alineación superior */
    }

    /* 6. FONDO DEL MENÚ MÓVIL */
    /* Fondo oscuro sólido para leer el menú sobre la imagen */
    .navbar-collapse {
        background-color: #001529;
        padding: 15px;
        margin-top: 10px;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Ajuste de márgenes laterales */
    .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* --- FIX: COLOR DE TEXTO EN MENÚ MÓVIL --- */
@media (max-width: 991.98px) {

    /* 1. Forzar enlaces a BLANCO siempre */
    .navbar-collapse .nav-link {
        color: #ffffff !important;
        font-weight: 500;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        /* Separador sutil */
        padding: 10px 0;
    }

    /* 2. Color al tocar (Hover/Focus/Active) */
    .navbar-collapse .nav-link:hover,
    .navbar-collapse .nav-link:focus,
    .navbar-collapse .nav-link.active {
        color: #4facfe !important;
        /* Azul Cian Brillante */
        background: transparent !important;
        /* Evitar fondos grises de Bootstrap */
        padding-left: 10px;
        /* Pequeña animación de desplazamiento */
        transition: all 0.3s ease;
    }

    /* 3. Botón hamburguesa: BLANCO solo en HOME, OSCURO en el resto */

    /* Por defecto (páginas internas con fondo blanco): Icono oscuro */
    .navbar-toggler {
        border-color: rgba(0, 0, 0, 0.1);
    }

    /* (No hace falta forzar el icono oscuro, Bootstrap lo hace solo con .navbar-light) */

    /* SOLO EN HOME-PAGE: Forzar icono y borde BLANCO */
    body.home-page .navbar-toggler {
        border-color: rgba(255, 255, 255, 0.5) !important;
    }

    body.home-page .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    }
}