/* =======================================================
   1. VARIABLES DE COLOR Y CONFIGURACIÓN
   ======================================================= */
:root {
    --ips-primary: #0056b3; /* Azul médico principal */
    --ips-secondary: #004494; /* Azul más oscuro para hover */
    --ips-light: #f8f9fa; /* Gris muy claro de fondo */
}

/* =======================================================
   2. ESTILOS GENERALES
   ======================================================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--ips-light);
    color: #333;
}

.text-primary { color: var(--ips-primary) !important; }

/* =======================================================
   3. BOTONES Y NAVEGACIÓN
   ======================================================= */
.btn-primary {
    background-color: var(--ips-primary);
    border-color: var(--ips-primary);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--ips-secondary);
    border-color: var(--ips-secondary);
}
.btn-outline-primary {
    color: var(--ips-primary);
    border-color: var(--ips-primary);
}
.btn-outline-primary:hover {
    background-color: var(--ips-primary);
    border-color: var(--ips-primary);
    color: white;
}

/* Menú de Navegación */
.navbar-light .navbar-nav .nav-link {
    color: #4a5568;
    transition: color 0.3s ease;
}
.navbar-light .navbar-nav .nav-link:hover {
    color: var(--ips-primary) !important;
}
.navbar-light .navbar-nav .nav-link.active {
    color: var(--ips-primary) !important;
    font-weight: 700;
}

/* Tamaño del Logo en el menú */
.brand-logo {
    max-height: 55px;
    width: auto;
    object-fit: contain;
}

/* =======================================================
   4. SECCIÓN HERO Y CARRUSEL (Glassmorphism)
   ======================================================= */
.hero-section {
    background: linear-gradient(135deg, var(--ips-primary) 0%, var(--ips-secondary) 100%);
}

/* Imagen de fondo del carrusel */
.hero-bg-img {
    height: 85vh;
    min-height: 600px;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Capa oscura sobre la imagen para que el texto resalte */
.hero-bg-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
}

/* Tarjeta flotante con efecto de cristal */
.hero-floating-card {
    background: rgba(255, 255, 255, 0.9); /* Blanco con transparencia */
    backdrop-filter: blur(12px); /* Desenfoque del fondo */
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* =======================================================
   5. TARJETAS (Programas, Servicios, Noticias, Campañas)
   ======================================================= */
.service-card, .galeria-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 1rem;
    overflow: hidden;
}
.service-card:hover, .galeria-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;
}

/* Tarjetas de Noticias */
.news-card {
    border-radius: 1rem;
    overflow: hidden;
}
.news-card img {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.news-card:hover img {
    transform: scale(1.05);
}

/* Imágenes de Galería */
.galeria-img {
    transition: transform 0.3s ease;
}
.galeria-card:hover .galeria-img {
    transform: scale(1.03);
}

/* =======================================================
   6. ICONOS CIRCULARES (Fondos suaves)
   ======================================================= */
.icon-box {
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Colores de fondo suaves para los iconos */
.bg-primary-light { background-color: rgba(0, 86, 179, 0.1); }
.bg-success-light { background-color: rgba(25, 135, 84, 0.1); }
.bg-info-light { background-color: rgba(13, 202, 240, 0.1); }
.bg-warning-light { background-color: rgba(255, 193, 7, 0.1); }
.bg-danger-light { background-color: rgba(220, 53, 69, 0.1); }

/* =======================================================
   7. FORMULARIOS Y DETALLES
   ======================================================= */
/* Borde verde para los inputs del formulario de contacto */
.form-control:focus, .form-select:focus {
    border-color: #20c997;
    box-shadow: 0 0 0 0.25rem rgba(32, 201, 151, 0.25);
}

/* Tarjeta final de Laboratorio */
.cta-laboratorio {
    background-color: #ffffff;
    border-left: 5px solid var(--ips-primary) !important;
    border-radius: 1rem;
}

/* Utilidad para imágenes */
.object-fit-cover {
    object-fit: cover;
}

/* Botones de filtro de campañas */
#filtros button {
    border-radius: 50px;
    padding: 8px 20px;
    font-weight: 600;
}

/* =======================================================
   8. AJUSTES RESPONSIVE (Celulares y Tablets)
   ======================================================= */
@media (max-width: 991.98px) {
    .hero-section {
        text-align: center;
    }
    .hero-section .d-flex {
        justify-content: center;
    }
    .brand-logo {
        max-height: 45px; /* Logo más pequeño en móviles */
    }
    .navbar-collapse {
        background-color: #ffffff;
        padding: 1rem;
        border-radius: 0.5rem;
        margin-top: 10px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
}
/* =======================================================
   9. BOTONES FLOTANTES (WhatsApp y Volver Arriba)
   ======================================================= */
.btn-whatsapp {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.btn-whatsapp:hover {
    background-color: #128C7E;
    color: #FFF;
    transform: scale(1.1);
}

.btn-back-to-top {
    position: fixed;
    width: 45px;
    height: 45px;
    bottom: 100px; /* Encima del botón de WhatsApp */
    right: 38px; /* Centrado con el de WhatsApp */
    background-color: var(--ips-primary);
    color: #FFF;
    border: none;
    border-radius: 50px;
    font-size: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.btn-back-to-top.show {
    opacity: 1;
    visibility: visible;
}
.btn-back-to-top:hover {
    background-color: var(--ips-secondary);
    transform: translateY(-3px);
}