/* ==========================================================================
   MÓDULO: SECCIÓN SERVICIOS / BENTO GRID PREMIUM (VIEWPORT EXACTO)
   ========================================================================== */

.services-section {
    background-color: var(--color-bg-light);
    /* Se quita el alto forzado a viewport: junto con el header fijo (y el
       scroll-padding-top global) hacía que el contenido se pasara del
       viewport visible. Ahora respeta su alto natural. */
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 25px 0 60px 0;
    overflow: hidden;
}

/* --- ENCABEZADO COMPACTO --- */
.services-header {
    text-align: center;
    margin-bottom: 25px; 
    width: 100%;
    margin-top: 15px !important;
}

.services-title {
    font-family: var(--font-primary);
    font-size: 1.85rem; 
    color: var(--color-primary-dark);
    margin: 0 auto 8px auto;
    letter-spacing: -0.5px;
    display: block;
}

.services-subtitle {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--color-text-muted);
    max-width: 750px;
    margin: 0 auto;
    line-height: 1.6;
    display: block;
}

/* --- GRILLA BENTO PREMIUM --- */
.bento-grid {
    display: flex;
    gap: 18px; 
    align-items: stretch;
    width: 100%;
}

.bento-card {
    border-radius: 14px; 
    padding: 26px; 
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: cardFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                filter 0.5s ease, 
                opacity 0.5s ease;
    will-change: transform, filter, opacity;
}

/* --- EFECTO PREMIUM: DESENFOQUE CRUZADO (VENTANAS INACTIVAS) --- */
.bento-grid:hover .bento-card {
    opacity: 0.5;
    filter: blur(3px); 
}

/* --- HOVER ACTIVO: ZOOM IN FLUIDO Y NATURAL --- */
.bento-grid .bento-card:hover {
    opacity: 1 !important;
    filter: blur(0) !important;
    transform: scale(1.02) !important; 
    box-shadow: 0 25px 50px rgba(33, 79, 80, 0.12) !important;
    z-index: 5; 
}

/* --- TARJETA MINVU (DISEÑO CORPORATIVO) --- */
.minvu-card {
    background: linear-gradient(145deg, var(--color-primary-dark) 0%, #163536 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 25px rgba(33, 79, 80, 0.15);
    width: 33%;
    flex-shrink: 0;
    animation-delay: 0.1s; 
    position: relative; /* Base para el posicionamiento absoluto del ícono */
}

.minvu-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
}

/* Corrección de tamaño para forzar el título a una sola línea limpia */
.minvu-card .card-title.minvu-title-adjusted {
    font-size: 1.05rem !important;
    letter-spacing: -0.2px;
    white-space: nowrap;
    margin-bottom: 15px;
    margin-top: 0;
}

.text-white {
    color: var(--color-white) !important;
}

.minvu-text {
    font-size: 0.85rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 18px;
    text-align: justify;
    text-justify: inter-word;
}

.minvu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--color-white);
}

.minvu-list li {
    font-family: var(--font-primary);
    font-size: 0.8rem;
    margin-bottom: 12px;
    line-height: 1.4;
    opacity: 0.95;
    text-align: left;
}

.minvu-list li:last-child {
    margin-bottom: 0;
}

.minvu-list strong {
    color: var(--color-accent, #9bc7c1); 
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    display: inline-block;
    margin-bottom: 2px;
}

/* --- SUB-GRILLA DE SERVICIOS (TARJETAS BLANCAS) --- */
.services-subgrid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    width: 67%;
}

.service-card {
    background-color: var(--color-white); 
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

.services-subgrid .service-card:nth-child(1) { animation-delay: 0.2s; }
.services-subgrid .service-card:nth-child(2) { animation-delay: 0.3s; }
.services-subgrid .service-card:nth-child(3) { animation-delay: 0.4s; }

.full-width {
    width: 100%;
}

.half-width {
    width: calc(50% - 9px); 
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-title {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    color: var(--color-primary-dark);
    margin-bottom: 10px;
    font-weight: 700;
}

.card-text {
    font-size: 0.85rem;
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
    text-align: justify;
    text-justify: inter-word;
}

/* --- CONTENEDORES DE ICONOS INTERNOS GENERALES (Tarjetas Blancas) --- */
.icon-container {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; 
    border-radius: 8px;
}

.zoom-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card:hover .zoom-icon {
    transform: scale(1.1); 
}

/* --- ETIQUETAS (BADGES) --- */
.badge {
    font-family: var(--font-primary);
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-white);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.badge-light {
    font-family: var(--font-primary);
    background-color: var(--color-bg-light);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--color-primary);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap !important;
}

/* --- ANIMACIONES DE ENTRADA --- */
@keyframes cardFadeUp {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   DISPOSITIVOS MÓVILES (BREAKPOINT DE SEGURIDAD)
   ========================================================================== */
@media (max-width: 992px) {
    .services-section {
        height: auto;
        min-height: auto;
        padding: 20px 0 50px 0; 
        overflow: visible;
    }

    .services-header {
        margin-top: 5px !important;
    }

    /* Ajuste de seguridad: Margen superior extra para que el ícono gigante no choque en móvil */
    .minvu-card {
        margin-top: 45px; 
    }

    .bento-grid:hover .bento-card {
        opacity: 1;
        filter: none;
    }

    .bento-grid .bento-card:hover {
        transform: none !important;
    }

    .minvu-card .card-title.minvu-title-adjusted,
    .badge-light {
        white-space: normal !important; 
    }

    .bento-grid {
        flex-direction: column;
        gap: 20px;
    }
    
    .minvu-card {
        width: 100%;
        order: -1;
    }
    
    .services-subgrid {
        width: 100%;
        gap: 18px;
    }
    
    .half-width {
        width: 100%;
    }
}