/* ============================================
   SLIDER DE CARACTERÍSTICAS PARA MÓVILES
   Fecha: 2025-12-04
   Propósito: Mostrar features como slider en móviles
============================================ */

/* ============================================
   DESKTOP: Mostrar grid normal, ocultar slider
============================================ */
@media (min-width: 769px) {
    .features-desktop {
        display: block !important;
    }

    .features-slider-mobile {
        display: none !important;
    }
}

/* ============================================
   MÓVILES: Ocultar grid, mostrar slider
============================================ */
@media (max-width: 768px) {
    .features-desktop {
        display: none !important;
    }

    .features-slider-mobile {
        display: block !important;
    }

    /* Contenedor del slider */
    .features-slider-container {
        position: relative;
        width: 100%;
        max-width: 400px; /* Ancho máximo para centrar */
        margin: 0 auto; /* Centrar horizontalmente */
        overflow: hidden;
        padding: 20px 0;
    }

    /* Track que contiene todos los slides */
    .features-slider-track {
        display: flex;
        transition: transform 0.4s ease-in-out;
        width: 400%; /* 4 slides = 400% */
    }

    /* Cada slide individual */
    .feature-slide {
        min-width: calc(100% - 20px); /* Restar márgenes */
        padding: 30px 25px;
        text-align: center;
        background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        margin: 0 10px;
        transition: all 0.3s ease;
    }

    /* Icono del feature */
    .feature-slide .feature-icon {
        width: 70px;
        height: 70px;
        margin: 0 auto 15px auto;
        background: linear-gradient(135deg, #D4AF37, #F4E4BC);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    }

    .feature-slide .feature-icon i {
        font-size: 32px;
        color: #2C2C2C;
    }

    /* Título del feature */
    .feature-slide .feature-title {
        font-size: 1.1rem;
        font-weight: 700;
        color: #2C2C2C;
        margin-bottom: 8px;
        font-family: 'Playfair Display', serif;
    }

    /* Texto del feature */
    .feature-slide .feature-text {
        font-size: 0.9rem;
        color: #666;
        margin: 0;
        line-height: 1.4;
    }

    /* Indicadores (dots) */
    .features-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        margin-top: 20px;
        padding: 10px 0;
        width: 100%;
    }

    .features-dots .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #D0D0D0;
        cursor: pointer;
        transition: all 0.3s ease;
        display: inline-block;
    }

    .features-dots .dot.active {
        background: linear-gradient(135deg, #D4AF37, #F4E4BC);
        width: 30px;
        border-radius: 5px;
        box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
    }

    .features-dots .dot:hover {
        background: #B8B8B8;
    }

    .features-dots .dot.active:hover {
        background: linear-gradient(135deg, #D4AF37, #F4E4BC);
    }

    /* Ajuste del contenedor de features-bar */
    .features-bar {
        padding: 30px 0 !important;
        margin: 0 auto !important;
        background: transparent !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .features-bar .container {
        padding: 0 20px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
    }

    .features-slider-mobile {
        width: 100% !important;
        max-width: 420px !important;
        margin: 0 auto !important;
    }
}

/* ============================================
   ANIMACIÓN DE SWIPE TÁCTIL
============================================ */
@media (max-width: 768px) {
    .features-slider-track {
        touch-action: pan-y;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }

    .feature-slide {
        pointer-events: none;
    }

    .feature-slide * {
        pointer-events: auto;
    }
}

/* ============================================
   PANTALLAS MUY PEQUEÑAS (< 400px)
============================================ */
@media (max-width: 400px) {
    .features-slider-container {
        max-width: 320px; /* Más pequeño en pantallas chicas */
        padding: 15px 0;
    }

    .feature-slide {
        padding: 25px 20px;
        margin: 0 8px;
    }

    .feature-slide .feature-icon {
        width: 65px;
        height: 65px;
        margin-bottom: 12px;
    }

    .feature-slide .feature-icon i {
        font-size: 30px;
    }

    .feature-slide .feature-title {
        font-size: 1.05rem;
        margin-bottom: 6px;
    }

    .feature-slide .feature-text {
        font-size: 0.88rem;
    }

    .features-dots .dot {
        width: 8px;
        height: 8px;
    }

    .features-dots .dot.active {
        width: 24px;
    }

    .features-bar .container {
        padding: 0 15px !important;
    }
}

/* ============================================
   MEJORA VISUAL - EFECTOS DE PROFUNDIDAD
============================================ */
@media (max-width: 768px) {
    .feature-slide {
        position: relative;
        overflow: hidden;
    }

    .feature-slide::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .feature-slide:active::before {
        opacity: 1;
    }
}

/* ============================================
   ESTADO DE CARGA (SKELETON)
============================================ */
@media (max-width: 768px) {
    .features-slider-mobile.loading .feature-slide {
        animation: pulse 1.5s ease-in-out infinite;
    }

    @keyframes pulse {
        0%, 100% {
            opacity: 1;
        }
        50% {
            opacity: 0.6;
        }
    }
}

/* ============================================
   ACCESIBILIDAD
============================================ */
@media (max-width: 768px) {
    .features-dots .dot:focus {
        outline: 2px solid #D4AF37;
        outline-offset: 3px;
    }

    .feature-slide {
        scroll-snap-align: center;
    }

    .features-slider-container {
        scroll-snap-type: x mandatory;
    }
}
