/* HOJA DE ESTILOS UNIFICADA - INSURMED
  ---
  Este archivo centraliza todos los estilos del sitio.
  La animación de logo original (hover con esquinas) ha sido
  reemplazada por la animación de carga (fade-in con íconos).
*/

/* 1. ESTILOS GLOBALES Y FUENTES */
:root {
    /* Fuente principal para todo el sitio */
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

/* 2. ESTILO DE FONDO BASE (Común a todas las páginas) */
.bg-cover-fixed {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #fff; /* Color de texto base para fondos oscuros */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 3. ESTILOS DE CONTENIDO PRINCIPAL (Base) */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
    /* Añadimos un padding-top para compensar el navbar fijo */
    padding-top: 100px;
}

/* 4. IMÁGENES DE FONDO Y SUPERPOSICIONES (Específicos por página) */

/* Página: Index (Home) */
body.page-index {
    background-image: url(imgs/bg_insurmed.webp);
    color: #343a40; 
}
body.page-index .main-content {
    background-color: rgba(0, 0, 0, 0.4); /* Superposición oscura ligera */
}

/* Página: Contacto */
body.page-contacto {
    background-image: url(imgs/contacto_insurmed.webp);
}
body.page-contacto .main-content {
    background-color: rgba(0, 0, 0, 0.4);
}

/* Página: Instrumental */
body.page-instrumental {
    background-image: url(imgs/instrumental_insurmed.webp);
}
body.page-instrumental .main-content {
    background-color: rgba(0, 0, 0, 0.4);
}

/* Página: Prótesis */
body.page-protesis {
    background-image: url(imgs/protesis_insurmed.webp);
}
body.page-protesis .main-content {
    background-color: rgba(0, 0, 0, 0.4);
}

/* Página: Ortopedia */
body.page-ortopedia {
    background-image: url(imgs/ortopedia_insurmed.webp);
}
body.page-ortopedia .main-content {
    background-color: rgba(0, 0, 0, 0.4);
}

/* Página: Suplementos */
body.page-suplementos {
    background-image: url(imgs/suplementos_insurmed.webp);
}
body.page-suplementos .main-content {
    background-color: rgba(0, 0, 0, 0.4);
}

/* ======================================================
   5. NUEVA ANIMACIÓN DE LOGO Y ENLACES (Reemplazo)
  ====================================================== */

/* Contenedor del logo (simplificado) */
.logo-box {
    width: 320px;
    height: auto;
    border: none;
    background: none;
    backdrop-filter: none;
    margin-bottom: 1rem;
}

/* Estilo de logo unificado (de styles_respaldo) */
.logo-img {
    width: 320px; 
    height: auto;
    z-index: 10;
    /* Sombra del logo (de styles_respaldo) */
    filter: drop-shadow(0px 20px 20px rgba(0, 0, 0, 1)); 
    
    /* Estado inicial para la animación de carga (de new styles) */
    opacity: 0;
    transition: opacity 1.5s ease-out;
}

/* Clase individual para cada enlace (para animación de carga) */
.link-fade-in {
    position: relative; 
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;

    /* Estado inicial para la animación de aparición */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.link-circular-img {
            width: 100px; 
            height: 100px;
            object-fit: cover;
            border: 3px solid white;
            cursor: pointer;
            
            /* Aplicamos la animación:
               - Nombre: breathe-animation
               - Duración: 3.5 segundos (suficientemente lento para ser sutil)
               - Curva: ease-in-out (para que acelere y frene suavemente)
               - Repetición: infinite
            */
            animation: breathe-animation 3.5s ease-in-out infinite;

            /* Mantenemos una transición solo para el hover (ver abajo) */
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

 /* 3. MANEJO DEL ESTADO HOVER (¡IMPORTANTE!)
           ---------------------------------------
           Si no hiciéramos esto, el hover y la animación pelearían.
        */
        .link-circular-img:hover {
            /* ¡CLAVE! Pausamos la animación de respiración
               cuando el usuario pone el mouse encima.
            */
            animation-play-state: paused;
            
            /* Definimos un estado fijo para el hover (un poco más grande
               que la animación) y una sombra más marcada.
            */
            transform: scale(1.25); 
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
            z-index: 2;
        }

/* Estilo opcional para la tarjeta */
        .member-card {
            background: white;
            border-radius: 15px;
            padding: 2rem;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
            /* Importante: Evita que el 'scale' de la imagen se corte */
            overflow: visible; 
        }

 @keyframes breathe-animation {
            0%, 100% {
                transform: scale(1);
                box-shadow: 0 4px 10px rgba(0,0,0,0.1);
            }
            50% {
                transform: scale(1.1);
                box-shadow: 0 10px 25px rgba(0,0,0,0.2);
            }
        }

        
        @keyframes pulse-social {
            0%, 100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.15); /* Un pulso más sutil */
            }
        }

/* Clase 'is-visible' que activará JS para la animación de carga */
.logo-img.is-visible,
.link-fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ======================================================
   6. NUEVO EFECTO HOVER (Zoom + Texto)
  ====================================================== */

/* Efecto hover solo en la imagen (mantenemos el zoom) */
.link-fade-in:hover .link-circular-img {
    transform: scale(1.15); /* Efecto de zoom al pasar el mouse */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Estilo para el texto que aparece al hacer hover */
.hover-text {
    position: absolute;
    bottom: -30px; 
    left: 50%;
    transform: translateX(-50%) translateY(10px); 
    background-color: rgba(0, 0, 0, 0.75); 
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap; 
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 0.85rem;
    z-index: 20; 
    min-width: max-content; 
}

/* Se muestra al hacer hover en el contenedor 'a.link-fade-in' */
.link-fade-in:hover .hover-text {
    opacity: 1; 
    transform: translateX(-50%) translateY(0); 
}


/* 7. ESTILOS DE TEXTO Y TÍTULOS (de styles_respaldo) */

/* Nombre de la marca (Garamond) */
.logo-brand-name {
    font-family: Garamond, 'Times New Roman', Times, serif;
    font-size: 4rem;
    font-weight: 700 !important;
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 1);
    display: none; 
}
body.page-index .logo-brand-name {
    display: block;
    text-shadow: none;
    color: #343a40;
}

/* Subtítulo (Solo en index.html) */
.subtitle {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
}

/* Título de sección (Páginas internas) */
.section-title {
    font-family: 'Times New Roman', Times, serif;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px rgba(0, 0, 0, 1), 0 0 5px rgba(0, 0, 0, 1);
    color: #fff;
    margin-top: 1rem; 
}
/* Ajuste para index (sin sombra de texto, color oscuro) */
body.page-index .section-title {
    text-shadow: none;
    color: inherit; /* Hereda el color del body */
    margin-top: 0;
}

/* Logo sobre el título (Páginas internas) */
.logo-section-header {
    width: 150px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

/* Texto de descripción (Páginas internas) */
.description-text {
    max-width: 800px;
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    background-color: rgba(0, 0, 0, 0.4); 
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    border-left: 5px solid var(--bs-danger);
    color: #ffffff;
    text-align: left;
}

/* Mensaje de stock (Páginas internas) */
.stock-message {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--bs-warning);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.9);
}

/* 8. BOTONES Y FORMULARIO (de styles_respaldo) */

/* Botón de Llamada a la Acción (CTA) */
.cta-button {
    margin-top: 1rem; 
    transition: all 0.3s ease;
}

/* Estilos de Formulario (Página de Contacto) */
.form-container {
    max-width: 500px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    text-align: left;
}
.form-container h2 {
    color: #343a40;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #dc3545;
    padding-bottom: 0.5rem;
}
.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.75rem 1rem;
}
.btn-submit {
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    border-radius: 8px;
    margin-top: 1rem;
}
.conversion-message {
    font-size: 1.1rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 2rem;
}


/* 9. ENLACES SOCIALES (Footer) (de styles_respaldo) */
.social-link {
    transition: transform 0.2s ease-in-out;
}

body.page-index .social-link {
    color: rgb(255, 255, 255);
}
body.page-index .social-link:hover {
    transform: scale(1.1);
    color: green !important;
}
body:not(.page-index) .social-link {
    color: white;
}
body:not(.page-index) .social-link:hover {
    transform: scale(1.1);
    color:  green !important;
}


/* 10. REGLAS RESPONSIVAS (Media Queries) */

/* Breakpoint unificado para tablets y móviles grandes */
@media (max-width: 768px) {
    .main-content {
        padding-top: 80px; 
    }
    .section-title {
        font-size: 2rem;
    }
    .description-text {
        font-size: 1rem;
    }
    .stock-message {
        font-size: 1.2rem;
    }
    .form-container {
        padding: 1.5rem;
    }
}

/* Breakpoint para móviles pequeños */
@media (max-width: 576px) {
    .logo-brand-name {
        font-size: 2.5rem;
    }
    .subtitle {
        font-size: 1.2rem;
    }
    
    /* REGLAS RESPONSIVAS DE LA NUEVA ANIMACIÓN (Fusionadas) */
    .logo-img {
        width: 220px;
    }
    .link-circular-img {
        width: 60px; /* Más pequeño en móviles */
        height: 60px;
    }
    .hover-text {
        font-size: 0.75rem;
        bottom: -25px; /* Ajustar posición en móviles */
    }
}

/* ======================================================
   11. Estilos para la Barra de Navegación Responsiva
  ======================================================
*/
header.container-fluid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; 
}

.navbar {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.navbar.navbar-light {
    border-bottom-color: rgba(0,0,0,0.1);
}

.navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.navbar.navbar-dark .nav-link {
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
    color: rgba(255,255,255,0.7); 
}

.navbar .nav-link {
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

.navbar .nav-link:hover {
    color: #198754 !important; 
}

.navbar .nav-link.active {
    color: #20c997 !important; 
    font-weight: 700;
}

.navbar.navbar-dark .nav-link.fw-bold {
    color: #fff !important;
}
.navbar .nav-link.fw-bold:hover {
    color: #20c997 !important;
}

/* Ajuste para el menú colapsado en móviles */
@media (max-width: 991px) {
    
    /* Fondo oscuro para menú hamburguesa en páginas internas */
    .navbar.navbar-dark .navbar-collapse {
        background-color: rgba(0, 0, 0, 0.8);
        border-radius: 8px;
        padding: 1rem;
        margin-top: 0.5rem;
    }
    
    /* Fondo claro para menú hamburguesa en index */
    .navbar.navbar-light .navbar-collapse {
        background-color: rgba(255, 255, 255, 0.9);
        border-radius: 8px;
        padding: 1rem;
        margin-top: 0.5rem;
        border: 1px solid rgba(0,0,0,0.1);
    }
}