/* ==========================================================================
   SERVICES.CSS
   Estilos de la sección interactiva de servicios (Paneles dinámicos).
   Diseño de Alta Gama / Enfoque Industrial.
   Empresa: MercoSurLTDA
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CONTENEDORES PRINCIPALES
   -------------------------------------------------------------------------- */
.services-section {
    padding: 80px 4vw;
    background-color: #f5f7fa; /* Fondo gris tecnológico muy limpio */
}

/* El bloque maestro unificado (Grid/Flexbox) */
.services-interactive-wrapper {
    display: flex;
    max-width: 1140px;
    margin: 80px auto 0;
    background: #ffffff; /* Reemplazado var(--color-white) por compatibilidad directa si falla la variable */
    border-radius: 24px;
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.06), 0 10px 30px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    align-items: stretch;
}

/* --------------------------------------------------------------------------
   2. COLUMNA IZQUIERDA: NAVEGACIÓN INDUSTRIAL
   -------------------------------------------------------------------------- */
.services-nav {
    flex: 0 0 38%;
    /* Fondo con textura sutil estilo fibra/tecnológico usando degradados CSS cruzados */
    background: radial-gradient(black 15%, transparent 16%) 0 0,
        radial-gradient(black 15%, transparent 16%) 8px 8px,
        radial-gradient(rgba(255, 255, 255, .1) 15%, transparent 20%) 0 1px,
        radial-gradient(rgba(255, 255, 255, .1) 15%, transparent 20%) 8px 9px;
    background-color: #141414; /* Negro industrial de base */
    background-size: 16px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0;
    position: relative;
    border-right: 1px solid #222222;
}

/* --- Botones (Pestañas) Inactivos --- */
.service-tab {
    background: transparent !important;
    border: none !important;
    padding: 24px 40px;
    text-align: left;
    color: #777777;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    outline: none; /* Reset para accesibilidad custom */
}

.service-tab:hover,
.service-tab:focus-visible {
    color: #cccccc;
    background: rgba(255, 255, 255, 0.01) !important;
}

/* --- Botones (Pestañas) Activos --- */
.service-tab.active {
    background: rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   3. ICONOS DE NAVEGACIÓN (RELIEVES Y ESTADOS)
   -------------------------------------------------------------------------- */
.tab-icon-wrapper {
    width: 50px;
    height: 50px;
    background: #1e1e1e;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.05), 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    flex-shrink: 0;
}

.tab-icon {
    width: 24px;
    height: 24px;
}

.tab-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.4;
    transition: all 0.3s ease;
}

/* --- Icono en Estado Activo --- */
.service-tab.active .tab-icon-wrapper {
    background: var(--color-red, #e20613);
    transform: scale(1.12) translateX(6px);
    box-shadow: 0 10px 25px rgba(226, 6, 19, 0.4), 0 2px 5px rgba(255, 255, 255, 0.2);
}

.service-tab.active .tab-icon img {
    opacity: 1;
    filter: brightness(0) invert(1); /* Fuerza el SVG a blanco puro */
}

/* --- Indicador visual (Línea roja lateral izquierda) --- */
.service-tab::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 4px;
    height: 40%;
    background-color: var(--color-red, #e20613);
    transition: all 0.3s ease;
    border-radius: 0 4px 4px 0;
}

.service-tab.active::before {
    transform: translateY(-50%) scaleY(1);
    height: 60%;
}

/* --------------------------------------------------------------------------
   4. COLUMNA DERECHA: PANELES DE CONTENIDO TIPOGRÁFICO
   -------------------------------------------------------------------------- */
.services-content-area {
    flex: 0 0 62%;
    display: grid;
    background: #ffffff;
}

/* Paneles ocultos por defecto */
.service-panel {
    grid-column: 1;
    grid-row: 1;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1),
        transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    align-items: center;
}

/* Panel visible (Controlado por JavaScript) */
.service-panel.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
    z-index: 2;
}

/* --- Tipografía del Panel --- */
.service-panel-info {
    padding: 60px 70px;
    width: 100%;
}

.service-badge {
    display: inline-block;
    color: var(--color-red, #e20613);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.service-panel-info h3 {
    color: var(--color-darker, #111111);
    font-size: 2.5rem;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 25px;
    letter-spacing: -0.5px;
}

.service-panel-info p {
    color: #4f5660;
    font-size: 1.15rem;
    line-height: 1.8;
    margin-top: 0;
    margin-bottom: 40px;
}

/* --- Botón de Acción Principal --- */
.service-cta-btn {
    display: inline-block;
    padding: 16px 36px;
    background-color: var(--color-darker, #111111);
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.service-cta-btn:hover,
.service-cta-btn:focus-visible {
    background-color: var(--color-red, #e20613);
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(226, 6, 19, 0.25);
    color: #ffffff;
    outline: none;
}

/* Flechas de navegación ocultas en escritorio */
.mobile-nav-arrow {
    display: none;
}

/* --------------------------------------------------------------------------
   5. NUEVO MÓDULO: BOTÓN "VER MÁS SERVICIOS" (Red de seguridad UX)
   -------------------------------------------------------------------------- */
.services-more-actions {
    margin-top: 50px; 
    margin-bottom: 20px;
}

.btn-load-more {
    padding: 14px 36px;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px;
    /* Sombra usando el RGB de tu color rojo corporativo */
    box-shadow: 0 4px 15px rgba(226, 6, 19, 0.15); 
}

.btn-load-more:hover,
.btn-load-more:focus-visible {
    box-shadow: 0 6px 20px rgba(226, 6, 19, 0.3);
    transform: translateY(-2px);
}


/* --------------------------------------------------------------------------
   6. RESPONSIVE DESIGN (MÓVILES Y TABLETAS)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .services-section {
        padding: 80px 4vw;
    }

    .services-interactive-wrapper {
        flex-direction: column;
    }

    /* El menú pasa a ser horizontal y alinea elementos al centro */
    .services-nav {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px 5px;
        border-right: none;
    }

    /* Ocultamos todas las pestañas por defecto para modo slider */
    .service-tab {
        display: none;
        padding: 15px 5px;
        width: 100%;
        text-align: center;
        justify-content: center;
        flex-direction: column;
        gap: 12px;
    }

    /* Mostramos únicamente la pestaña activa */
    .service-tab.active {
        display: flex;
        background: transparent !important;
    }

    /* Ajustes visuales para pestaña móvil */
    .service-tab::before {
        display: none !important;
    }

    .service-tab.active .tab-icon-wrapper {
        transform: scale(1.1); /* Mantiene el zoom, omite desplazamiento lateral */
    }

    /* Activación y estilos de flechas del slider (UX Mejorada) */
    .mobile-nav-arrow {
        display: flex;
        background: transparent;
        border: none;
        color: #ffffff;
        font-size: 1.8rem;
        padding: 15px 25px;
        cursor: pointer;
        transition: color 0.3s ease;
        z-index: 10;
        
        /* UX: Evita seleccionar texto al tocar repetidamente en móviles */
        user-select: none;
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent; 
    }

    .mobile-nav-arrow:hover,
    .mobile-nav-arrow:active {
        color: var(--color-red, #e20613);
    }

    /* Ajustes de tipografía para pantallas pequeñas */
    .service-panel-info {
        padding: 40px 25px;
    }

    .service-panel-info h3 {
        font-size: 1.8rem;
    }
}

/* Intermedios (Tabletas verticales y Móviles horizontales) */
@media screen and (max-width: 768px) {
    .services-more-actions {
        margin-top: 35px; /* Reducción de aire para no generar scroll innecesario */
        padding: 0 10px;
    }
}

/* Smartphones pequeños */
@media screen and (max-width: 480px) {
    /* UX Móvil: Botón de bloque completo para facilitar tap con el pulgar */
    .btn-load-more {
        display: block;
        width: 100%;
        box-sizing: border-box;
        padding: 15px 20px;
        font-size: 1rem;
    }
}