/* ============================================================
   MODERN FEATURES 2025 - ALMA Kids
   Tecnologías modernas: Intersection Observer, CSS :has(),
   content-visibility, prefers-reduced-motion, scroll progress
   ============================================================ */

/* ==================== SCROLL PROGRESS BAR ==================== */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #E91E63 0%, #FF6B9D 60%, #FFB347 100%);
    z-index: 99999;
    border-radius: 0 3px 3px 0;
    pointer-events: none;
}

/* ==================== SCROLL REVEAL ==================== */
[data-reveal] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-reveal="left"] {
    transform: translateX(-50px);
    opacity: 0;
}

[data-reveal="right"] {
    transform: translateX(50px);
    opacity: 0;
}

[data-reveal="scale"] {
    transform: scale(0.85);
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

[data-delay="100"] { transition-delay: 0.10s !important; }
[data-delay="200"] { transition-delay: 0.20s !important; }
[data-delay="300"] { transition-delay: 0.30s !important; }
[data-delay="400"] { transition-delay: 0.40s !important; }
[data-delay="500"] { transition-delay: 0.50s !important; }

/* ==================== STATS SECTION ==================== */
/* ==================== SECCIÓN ESTADÍSTICAS — REDISEÑO ==================== */

.stats-section {
    background: #fff !important;
    padding: 60px 0 !important;
    position: relative !important;
    overflow: visible !important;
    border-top: 1px solid #f0eaf5;
    border-bottom: 1px solid #f0eaf5;
}

.stats-section::before {
    display: none !important; /* quita el overlay gradient anterior */
}

.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.25rem !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Tarjetas: diseño de card blanca con acento de color en la parte superior */
.stat-item {
    text-align: center !important;
    background: #fff !important;
    border-radius: 22px !important;
    padding: 2rem 1rem 1.6rem !important;
    border: none !important;
    border-right: none !important;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08) !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

.stat-item:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 36px rgba(0,0,0,0.13) !important;
}

/* Acento de color arriba + fondo gradiente suave — 1 color por stat */
.stat-item:nth-child(1) {
    border-top: 4px solid #9C27B0 !important;
    background: linear-gradient(160deg, #F3E5F5 0%, #fff 55%) !important;
}
.stat-item:nth-child(2) {
    border-top: 4px solid #0097A7 !important;
    background: linear-gradient(160deg, #E0F7FA 0%, #fff 55%) !important;
}
.stat-item:nth-child(3) {
    border-top: 4px solid #F57C00 !important;
    background: linear-gradient(160deg, #FFF3E0 0%, #fff 55%) !important;
}
.stat-item:nth-child(4) {
    border-top: 4px solid #E91E63 !important;
    background: linear-gradient(160deg, #FCE4EC 0%, #fff 55%) !important;
}

/* Número animado — color según tarjeta */
.stat-item:nth-child(1) .stat-number,
.stat-item:nth-child(1) .stat-suffix { color: #7B1FA2 !important; }

.stat-item:nth-child(2) .stat-number,
.stat-item:nth-child(2) .stat-suffix { color: #006064 !important; }

.stat-item:nth-child(3) .stat-number,
.stat-item:nth-child(3) .stat-suffix { color: #E65100 !important; }

.stat-item:nth-child(4) .stat-number,
.stat-item:nth-child(4) .stat-suffix { color: #C2185B !important; }

.stat-number {
    font-size: clamp(2.4rem, 5vw, 3.8rem) !important;
    font-weight: 800 !important;
    font-family: 'Poppins', sans-serif !important;
    line-height: 1 !important;
}

.stat-suffix {
    font-size: clamp(1.5rem, 3vw, 2.4rem) !important;
    font-weight: 700 !important;
    font-family: 'Poppins', sans-serif !important;
}

.stat-number-wrap {
    display: flex !important;
    align-items: baseline !important;
    justify-content: center !important;
    gap: 2px !important;
    line-height: 1 !important;
    margin-bottom: 0.5rem !important;
}

/* Etiqueta: texto oscuro, bien legible */
.stat-label {
    display: block !important;
    font-size: clamp(0.8rem, 1.4vw, 0.92rem) !important;
    font-weight: 600 !important;
    color: #555 !important;
    opacity: 1 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
}

/* Emoji grande y visible sobre fondo claro */
.stat-icon {
    font-size: 2.2rem !important;
    margin-bottom: 0.7rem !important;
    display: block !important;
    filter: none !important;
    line-height: 1.2 !important;
}

/* Responsive: 2 columnas en móvil */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.9rem !important;
    }
    .stat-item {
        padding: 1.5rem 0.8rem 1.2rem !important;
        border-bottom: none !important;
    }
    .stat-icon {
        font-size: 1.9rem !important;
    }
}

/* ==================== CONTENT-VISIBILITY (perf) ==================== */
#nosotros,
#instagram-feed,
#plaza-blanda,
#resenas,
#cobertura,
#faq,
#palabras-clave-seo {
    content-visibility: auto;
    contain-intrinsic-size: 0 600px;
}

/* ==================== CSS :has() — HOVER MEJORADO EN CARDS ==================== */

/* Card de producto se ilumina cuando el mouse está sobre cualquier hijo */
.hero-image-item:has(img:hover) {
    transform: translateY(-8px) !important;
    box-shadow: 0 20px 50px rgba(233, 30, 99, 0.22) !important;
}

/* Reseña se eleva al hacer hover en cualquier parte */
.review-card:has(*:hover) {
    transform: translateY(-5px) !important;
    box-shadow: 0 16px 40px rgba(233, 30, 99, 0.18) !important;
    border-color: rgba(233, 30, 99, 0.25) !important;
}

/* Nav link activo tiene indicador cuando el padre está en hover */
.nav:has(.nav-link:hover) .nav-link:not(:hover) {
    opacity: 0.65;
    transition: opacity 0.2s ease;
}

/* ==================== VIEW TRANSITIONS API (Chrome 111+) ==================== */
@view-transition {
    navigation: auto;
}

/* ==================== SMOOTH SCROLL NATIVO ==================== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* compensa el header fijo */
}

/* ==================== PREFERS-REDUCED-MOTION ==================== */
/* Accesibilidad: respetar preferencia del sistema operativo */
@media (prefers-reduced-motion: reduce) {
    [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    [data-reveal].revealed {
        opacity: 1 !important;
        transform: none !important;
    }
    html {
        scroll-behavior: auto !important;
    }
    .hero-particle {
        animation: none !important;
    }
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== MODAL MEJORADO - MOBILE FIRST ==================== */

/* Spinner de carga */
#imageModal .modal-spinner {
    display: none;
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: modal-spin 0.7s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    pointer-events: none;
}
#imageModal.loading .modal-spinner {
    display: block;
}
@keyframes modal-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Fade suave en la imagen al cambiar */
#imageModal .modal-image {
    transition: opacity 0.2s ease !important;
}
#imageModal.loading .modal-image {
    opacity: 0 !important;
}

/* Indicadores de posición (dots) */
.modal-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    padding: 10px 0 2px;
    min-height: 24px;
}
.modal-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
    padding: 0;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.modal-dot.active {
    background: #fff;
    border-color: #fff;
    transform: scale(1.35);
}
.modal-dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.65);
}

/* Mejoras de tamaño táctil en móvil */
@media (max-width: 768px) {
    #imageModal .modal-nav {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        font-size: 1rem !important;
    }
    #imageModal .modal-control-btn,
    #imageModal .close-modal {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }
    #imageModal .modal-image {
        max-height: 58vh !important;
        max-width: 98vw !important;
    }
    #imageModal .modal-caption h3 {
        font-size: 0.95rem !important;
    }
    #imageModal .modal-caption p {
        font-size: 0.82rem !important;
    }
    .modal-dot {
        width: 10px !important;
        height: 10px !important;
    }
    /* Área de toque ampliada para dots */
    .modal-dot::before {
        content: '';
        display: block;
        position: absolute;
        inset: -8px;
    }
    .modal-dot { position: relative; }
}

/* iPad / tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    #imageModal .modal-image {
        max-height: 70vh !important;
        max-width: 90vw !important;
    }
    #imageModal .modal-nav {
        width: 48px !important;
        height: 48px !important;
    }
}

/* ==================== FAQ MEJORADO — TEXTO Y BOTÓN WS ==================== */

/* Botón WhatsApp estilo FAB en hero FAQ */
.btn-wsp-fab {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
    background: #25D366 !important;
    color: white !important;
    padding: 0.85rem 2rem !important;
    border-radius: 50px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    font-family: 'Poppins', sans-serif !important;
    letter-spacing: 0.01em !important;
}
.btn-wsp-fab i {
    font-size: 1.3rem !important;
}
.btn-wsp-fab:hover {
    transform: translateY(-3px) scale(1.03) !important;
    box-shadow: 0 10px 32px rgba(37, 211, 102, 0.55) !important;
    color: white !important;
    text-decoration: none !important;
}

/* FAQ accordion — texto más claro y legible */
.faq-answer {
    font-size: 0.97rem !important;
    line-height: 1.75 !important;
    color: #3a3a3a !important;
}
.faq-answer p {
    margin: 0 0 0.7rem !important;
    color: #3a3a3a !important;
}
.faq-answer ul {
    margin: 0.4rem 0 0.7rem 0 !important;
    padding-left: 1.2rem !important;
}
.faq-answer li {
    margin-bottom: 0.35rem !important;
    color: #3a3a3a !important;
    line-height: 1.6 !important;
}
.faq-answer strong {
    color: #222 !important;
    font-weight: 600 !important;
}
.faq-answer a {
    color: #E91E63 !important;
}

/* Título de pregunta más legible */
.faq-question h3 {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #2a2a2a !important;
    line-height: 1.4 !important;
}
.faq-question h3 i {
    color: #E91E63 !important;
    margin-right: 0.4rem !important;
    font-size: 0.9rem !important;
}

/* Aviso legal inferior */
.faq-legal-notice {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    background: #FFF9F0 !important;
    border: 1.5px solid #FFE0B2 !important;
    border-radius: 14px !important;
    padding: 1rem 1.4rem !important;
    margin: 2rem 0 !important;
    color: #7a5c20 !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
}
.faq-legal-notice i {
    color: #F57C00 !important;
    font-size: 1.2rem !important;
    flex-shrink: 0 !important;
}
.faq-legal-notice p {
    margin: 0 !important;
    line-height: 1.5 !important;
}

.faq-hero {
    background: linear-gradient(135deg, #F5EEFF 0%, #FFF0F8 50%, #EEF6FF 100%) !important;
    min-height: auto !important;
    padding: 90px 0 0 !important;
    text-align: center !important;
    position: relative !important;
}

.faq-hero-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1rem 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* Badge decorativo superior */
.faq-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1.5px solid #e8d5f8;
    border-radius: 50px;
    padding: 0.4rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #9C27B0;
    box-shadow: 0 2px 12px rgba(156, 39, 176, 0.1);
}
.faq-hero-badge i {
    color: #E91E63;
    font-size: 0.75rem;
}

/* Título principal */
.faq-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem) !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #E91E63 0%, #9C27B0 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    text-shadow: none !important;
}

/* Subtítulo */
.faq-hero .hero-subtitle {
    font-size: 1.05rem !important;
    color: #666 !important;
    max-width: 560px !important;
    margin: 0 auto !important;
    line-height: 1.65 !important;
}

/* Badges de características en fila */
.faq-hero .hero-features {
    display: flex !important;
    gap: 0.75rem !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    margin: 0 !important;
}

.faq-hero .hero-feature {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    background: white !important;
    border-radius: 50px !important;
    padding: 0.45rem 1rem !important;
    font-size: 0.83rem !important;
    font-weight: 500 !important;
    color: #444 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07) !important;
    border: 1px solid #f0e8f8 !important;
}

.faq-hero .hero-feature i {
    color: #E91E63 !important;
    font-size: 0.85rem !important;
}
.faq-hero .hero-feature .fab.fa-whatsapp {
    color: #25D366 !important;
}

/* Botones de acción */
.faq-hero .hero-actions {
    display: flex !important;
    gap: 1rem !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
}

.faq-hero .btn-hero {
    padding: 0.75rem 1.6rem !important;
    font-size: 0.9rem !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

/* Filtros rápidos */
.faq-hero .quick-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.quick-links-label {
    font-size: 0.82rem !important;
    color: #888 !important;
    font-weight: 500 !important;
    margin: 0 !important;
}

.faq-hero .quick-link-buttons {
    display: flex !important;
    gap: 0.5rem !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
}

.faq-hero .quick-link {
    background: white !important;
    border: 1.5px solid #e2d5f2 !important;
    color: #7B1FA2 !important;
    border-radius: 50px !important;
    padding: 0.4rem 1rem !important;
    cursor: pointer !important;
    font-size: 0.83rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    font-family: 'Poppins', sans-serif !important;
}

.faq-hero .quick-link:hover {
    background: #9C27B0 !important;
    color: white !important;
    border-color: #9C27B0 !important;
    transform: translateY(-1px) !important;
}

/* Ola inferior de la sección */
.hero-wave {
    position: relative;
    bottom: 0;
    width: 100%;
    line-height: 0;
    z-index: 2;
}
.hero-wave svg {
    display: block;
    width: 100%;
    height: 50px;
}

/* Responsive móvil */
@media (max-width: 600px) {
    .faq-hero {
        padding-top: 80px !important;
    }
    .faq-hero h1 {
        font-size: 1.8rem !important;
    }
    .faq-hero .hero-feature {
        font-size: 0.78rem !important;
        padding: 0.38rem 0.8rem !important;
    }
    .faq-hero .btn-hero {
        font-size: 0.83rem !important;
        padding: 0.65rem 1.2rem !important;
    }
}
