/* Features Styles */

/* ===== EFECTO GLASS PARA FEATURES MODULE ===== */
/*
 * Implementación completa del efecto glass para el módulo de features
 * 
 * Características implementadas:
 * - Efecto glass con backdrop-filter y transparencias
 * - Borde degradado (halo) con mask-composite
 * - Checkmarks personalizados con gradientes
 * - Animaciones suaves y transiciones optimizadas
 * - Fallbacks para compatibilidad de navegadores
 * - Optimizaciones de rendimiento con aceleración por hardware
 * - Diseño completamente responsive
 * 
 * Compatibilidad:
 * - Chrome/Edge: Soporte completo
 * - Firefox: Soporte completo (v103+)
 * - Safari: Soporte completo
 * - Navegadores antiguos: Fallbacks implementados
 * 
 * Autor: EvisioFront Theme
 * Versión: 1.0
 * Fecha: 2024
 */

/* Variables CSS para el efecto glass */
:root {
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-bg-fallback: rgba(255, 255, 255, 0.9);
    --glass-stroke: linear-gradient(135deg, #ffffffaa, #ffffff40 30%, #bfe7ff55 60%, #ffd6f855 100%);
    --glass-pill-bg: rgba(255, 255, 255, 0.6);
    --glass-pill-active: #ffffff;
    --glass-content-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.7));
    --glass-shadow: 0 10px 30px rgba(21, 31, 56, 0.08), 0 2px 6px rgba(21, 31, 56, 0.04);
    --glass-radius-outer: 28px;
    --glass-radius-inner: 20px;
}

/* Contenedor principal */
.features {
    width: 100%;
    padding: var(--spacing-2xl) 0;
    position: relative;
}

/* Contenedor de contenido */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Estilos cuando hay imagen de fondo */
.features[style*="background-image"] {
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* Asegurar que el contenido sea visible sobre la imagen de fondo */
.features[style*="background-image"] .section-container {
    position: relative;
    z-index: 2;
}

/* Contenedor del título principal */
.features-title-container {
    text-align: center;
}

/* Título principal */
.features-title {
    text-align: center;
    color: var(--green-front);
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 0;
}

/* Contenedor principal con efecto glass */
.features-container {
    position: relative;
    border-radius: var(--glass-radius-outer);
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    box-shadow: 0 10px 30px rgba(21, 31, 56, 0.08), 0 2px 6px rgba(21, 31, 56, 0.04);
    padding: 20px;
    margin: 2rem auto;
}

/* Borde degradado (halo) alrededor del contenedor */
.features-container::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, #ffffffaa, #ffffff40 30%, #bfe7ff55 60%, #ffd6f855 100%);
    padding: 1px;
    /* grosor del borde */
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Fallback para navegadores sin soporte de mask-composite */
@supports not (mask-composite: exclude) {
    .features-container::before {
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.4);
        padding: 0;
    }
}

/* Navegación de features */
.features-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: nowrap;
    padding: 16px 10px;
    gap: 5px;
    border-radius: var(--glass-radius-inner);
    background: var(--glass-content-bg);
}

.nav-item {
    font-size: 1rem;
    padding: 12px;
    white-space: normal !important;
    border-radius: 999px;
    color: #8987A1;
    font-weight: 600;
    letter-spacing: .2px;
    transition: transform .15s ease, background .15s ease;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    border: none;
    font-family: inherit;
    font-size: inherit;
    min-width: 0;
    flex: 1;
    /* Optimización de rendimiento */
    will-change: transform;
    transform: translateZ(0);
}

.nav-item:hover {
    transform: translateY(-1px);
}

.nav-item.active {
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06), 0 4px 14px rgba(15, 23, 42, 0.06);
}

.nav-item.active .nav-text {
    color: #E78B3D;
}

.nav-item .nav-text:hover {
    color: #E78B3D;
}

.nav-item:not(.active) {
    color: #344054;
}

.nav-item:not(.active):hover {
    color: #2C3E50;
}

.nav-text {
    display: block;
    line-height: 1.2;
    color: #8987A1;
}

/* Layout de contenido */
.features-content {
    border-radius: var(--glass-radius-inner);
    padding: 24px;
    background: var(--glass-content-bg);
}

.content-panel {
    /* Grid layout se define en .content-panel.active */
}

/* Columna izquierda - Descripción */
.features-description {
    padding-right: 2rem;
}

.description-title {
    color: #48A1A3;
    font-size: 1.5rem;
    font-weight: bold !important;
    line-height: 1.2;
    margin-bottom: 18px;
}

.benefits-list {
    list-style: none;
    display: grid;
    gap: 14px;
    margin-top: 18px;
    padding: 0 !important;
}

.benefit-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: #3f4957;
    line-height: 1.5;
    padding: 0;
    border-radius: 0;
    transition: none;
    margin-bottom: 0;
    /* Optimización de rendimiento */
    will-change: transform, opacity;
    transform: translateZ(0);
}

.benefit-item:hover {
    background: none;
}

/* Checkmarks personalizados con efecto glass */
.benefit-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    transform: translateY(2px);
    position: relative;
}

.benefit-icon::after {
    content: "";
    width: 10px;
    height: 6px;
    border: 2px solid white;
    border-top: 0;
    border-left: 0;
    transform: rotate(45deg);
}

/* Ocultar la imagen original del checkmark */
.benefit-icon img {
    display: none;
}

.benefit-text {
    color: #3f4957;
    font-size: 1.1125rem;
    line-height: 1.5;
}

/* Columna derecha - Imagen */
.features-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    min-height: 400px;
    max-width: 100%;
    position: relative;
}

/* Inner shadow sutil en la imagen */
.features-image::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04), inset 0 0 40px rgba(0, 0, 0, 0.05);
    border-radius: inherit;
    pointer-events: none;
}

.feature-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 0.5rem;
    transition: transform 0.3s ease;
    /* Optimización de rendimiento */
    will-change: transform;
    transform: translateZ(0);
}

.feature-image:hover {
    transform: scale(1.02);
}

/* Paneles de contenido */
.content-panel {
    display: none;
}

.content-panel.active {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 32px;
    align-items: center;
    border-radius: var(--glass-radius-inner);
    padding: 24px;
    background: var(--glass-content-bg);
    animation: fadeIn 0.5s ease-out;
}

/* Responsive Design */
@media (max-width: 940px) {
    .content-panel.active {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .features-description {
        padding-right: 0;
    }
}

@media (max-width: 768px) {
    .section-container {
        padding: 0 var(--spacing-sm);
    }

    .features-container {
        margin: 1rem;
        padding: 16px;
    }

    .features-title {
        font-size: 2rem;
    }

    .features-nav {
        gap: 8px;
        padding: 12px;
    }

    .nav-item {
        padding: 10px 14px;
        font-size: 0.875rem;
    }

    .features-content {
        padding: 16px;
    }

    .content-panel.active {
        padding: 16px;
    }

    .features-image {
        min-height: 300px;
    }

    .features-nav {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 1rem;
        max-width: 100%;
    }

    .nav-item {
        font-size: 0.75rem;
        padding: 0.5rem;
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-text {
        font-size: 1rem;
        line-height: 1.1;
        text-align: center;
    }

    .features-image {
        min-height: 250px;
    }
}

@media (max-width: 575px) {
    .features-container {
        margin: 0.5rem;
        padding: 12px;
    }

    .features-nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        margin-bottom: 0rem;
    }

    .nav-item {
        padding: 8px 12px;
        font-size: 0.75rem;
        min-height: auto;
    }

    .nav-text {
        font-size: 11px;
        line-height: 1.1;
    }

    .features-image {
        min-height: 250px;
    }
}

/* Accesibilidad */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states mejorados para glass */
.nav-item:focus {
    outline: 2px solid var(--green-front);
    outline-offset: 2px;
}

/* Animaciones suaves para glass */
@keyframes glassFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.features-container {
    animation: glassFadeIn 0.6s ease-out;
}

.benefit-item {
    animation: glassFadeIn 0.4s ease-out;
}

.benefit-item:nth-child(1) {
    animation-delay: 0.1s;
}

.benefit-item:nth-child(2) {
    animation-delay: 0.2s;
}

.benefit-item:nth-child(3) {
    animation-delay: 0.3s;
}

.benefit-item:nth-child(4) {
    animation-delay: 0.4s;
}

/* ===== TESTING Y VERIFICACIÓN ===== */
/*
 * Para verificar el funcionamiento del efecto glass:
 * 
 * 1. Verificar que el backdrop-filter funciona:
 *    - El contenedor debe tener efecto de blur
 *    - El contenido de fondo debe verse difuminado
 * 
 * 2. Verificar fallbacks:
 *    - En navegadores sin soporte, debe verse el fallback
 *    - El borde debe ser visible en todos los navegadores
 * 
 * 3. Verificar animaciones:
 *    - Los elementos deben aparecer con animación suave
 *    - Los hovers deben funcionar correctamente
 * 
 * 4. Verificar responsive:
 *    - Probar en diferentes tamaños de pantalla
 *    - Verificar que el layout se adapta correctamente
 * 
 * 5. Verificar accesibilidad:
 *    - Los focus states deben ser visibles
 *    - La navegación por teclado debe funcionar
 */