/* ============================================================
   ANIMACIONES AVANZADAS - Disfruta Saludable
   Mejora experiencia de usuario y tiempo de permanencia en página
   ============================================================ */

/* ── 1. Keyframes base ────────────────────────────────────── */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-14px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes floatSlow {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(3deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }

    50% {
        transform: scale(1.04);
        box-shadow: 0 0 0 12px rgba(76, 175, 80, 0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes gradientText {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spinSlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.15);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.1);
    }

    70% {
        transform: scale(1);
    }
}

/* ── 2. Clases de utilidad para animaciones de entrada ─────── */

.anim-fade-up {
    animation: fadeInUp 0.7s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

.anim-fade-left {
    animation: fadeInLeft 0.7s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

.anim-fade-right {
    animation: fadeInRight 0.7s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

.anim-scale {
    animation: scaleIn 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

/* Delays en cascada */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

.delay-6 {
    animation-delay: 0.6s;
}

.delay-7 {
    animation-delay: 0.7s;
}

/* ── 3. Imagen hero flotante ─────────────────────────────── */

.hero-image .image-wrapper {
    animation: floatSlow 6s ease-in-out infinite;
}

/* ── 4. Badge experiencia con pulso ──────────────────────── */

.experience-badge {
    animation: pulse 3s ease-in-out infinite;
}

/* ── 5. Botones con efecto ripple ────────────────────────── */

.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 50% 50%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    transition: none;
    pointer-events: none;
}

.btn:active::after {
    inset: -50%;
    animation: ripple 0.6s ease-out forwards;
}

/* ── 6. Título hero con gradiente animado ────────────────── */

.hero-title {
    background: linear-gradient(270deg, #2e7d32, #558b2f, #1b5e20, #4caf50, #2e7d32);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 6s ease infinite;
}

/* ── 7. Cards con hover premium ──────────────────────────── */

.service-card,
.recipe-card,
.product-card,
.day-card {
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform;
}

.service-card:hover,
.day-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.recipe-card:hover,
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}

/* ── 8. Shimmer en imágenes al cargar ────────────────────── */

.img-responsive {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    transition: opacity 0.4s ease;
}

.img-responsive.loaded {
    animation: none;
    background: none;
}

/* ── 9. Número de stats / contadores ─────────────────────── */

.stat-number,
.result-number {
    animation: countUp 0.5s ease both;
}

/* ── 10. Íconos flotantes en sección misión ──────────────── */

.mission-icon {
    display: inline-block;
    animation: float 4s ease-in-out infinite;
    font-size: 2rem;
}

.mission-item:nth-child(2) .mission-icon {
    animation-delay: 1.5s;
}

/* ── 11. Header scroll shadow ────────────────────────────── */

.header {
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.header.scrolled {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    background-color: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
}

/* ── 12. Links de navegación con underline animado ────────── */

.nav-link {
    position: relative;
}

.nav-link:not(.btn-cta-outline)::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color, #4caf50);
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-link:not(.btn-cta-outline):hover::after,
.nav-link:not(.btn-cta-outline).active::after {
    width: 100%;
}

/* ── 13. Sección de filtros con animación al cambiar ─────── */

.filter-btn {
    transition: background-color 0.25s ease, color 0.25s ease,
        transform 0.2s ease, box-shadow 0.25s ease;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.filter-btn:active {
    transform: scale(0.96);
}

/* ── 14. Testimonios / FAQ entrada suave ──────────────────── */

.faq-item {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.faq-item:hover {
    transform: translateX(6px);
    box-shadow: -4px 0 0 0 var(--primary-color, #4caf50), 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* ── 15. Inputs animados al hacer foco ────────────────────── */

input:focus,
select:focus,
textarea:focus {
    animation: scaleIn 0.2s ease;
    border-color: var(--primary-color, #4caf50) !important;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
    outline: none;
    transform: none;
}

/* ── 16. Sección hero: línea decorativa animada ───────────── */

.hero-subtitle::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 2px;
    background: var(--primary-color, #4caf50);
    vertical-align: middle;
    margin-right: 0.5rem;
    animation: none;
    transition: width 0.6s ease 0.5s;
}

/* ── 17. Imagen de calculadora flotante ───────────────────── */

.calc-img {
    animation: floatSlow 7s ease-in-out infinite;
    animation-delay: 1s;
}

/* ── 18. Footer links con hover ───────────────────────────── */

.footer-links a,
.footer-link {
    transition: color 0.25s ease, padding-left 0.25s ease;
}

.footer-links a:hover,
.footer-link:hover {
    padding-left: 6px;
    color: var(--primary-color, #4caf50) !important;
}

/* ── 19. Animaciones "enter-viewport" (clase JS) ─────────── */

.reveal-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.8, 0.25, 1),
        transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.reveal-hidden.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ── 20. Cursor parpadeante en el hero (typewriter) ─────────── */

#typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--primary-color, #4caf50);
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: blink 0.8s step-end infinite;
}

/* ── 21. Reduce motion (accesibilidad) ────────────────────── */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── 22. Nuevos keyframes para fondo oscuro ──────────────── */

@keyframes wave {
    0% {
        transform: translateX(0) scaleY(1);
    }

    50% {
        transform: translateX(-25%) scaleY(0.8);
    }

    100% {
        transform: translateX(-50%) scaleY(1);
    }
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(-20px) scale(1);
        opacity: 0;
    }
}

@keyframes orbGlow {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(76, 175, 80, 0.3), 0 0 60px rgba(76, 175, 80, 0.1);
    }

    50% {
        box-shadow: 0 0 60px rgba(76, 175, 80, 0.6), 0 0 120px rgba(76, 175, 80, 0.2);
    }
}

@keyframes glowPulse {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(76, 175, 80, 0.4);
    }

    50% {
        text-shadow: 0 0 30px rgba(76, 175, 80, 0.8), 0 0 60px rgba(76, 175, 80, 0.3);
    }
}

@keyframes borderFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ── 23. Partículas decorativas de fondo ─────────────────── */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse at 10% 20%, rgba(76, 175, 80, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 90% 80%, rgba(46, 125, 50, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 50%, rgba(13, 43, 15, 0.5) 0%, transparent 70%);
    animation: float 12s ease-in-out infinite;
}

/* ── 24. Orbes de luz flotantes en el hero ───────────────── */

.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(76, 175, 80, 0.15) 0%, transparent 70%);
    animation: orbGlow 6s ease-in-out infinite;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 125, 50, 0.12) 0%, transparent 70%);
    animation: orbGlow 8s ease-in-out infinite reverse;
    pointer-events: none;
}

.hero {
    position: relative;
    overflow: hidden;
}

/* ── 25. Cards dark mode – fondo semitransparente verde ──── */

.service-card,
.recipe-card,
.product-card,
.day-card,
.faq-item,
.tool-card,
.guide-card {
    background: rgba(21, 46, 23, 0.85) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(76, 175, 80, 0.15) !important;
    color: #E8F5E9 !important;
}

.service-card:hover,
.recipe-card:hover,
.product-card:hover,
.day-card:hover {
    border-color: rgba(76, 175, 80, 0.5) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(76, 175, 80, 0.15) !important;
}

/* ── 26. Botones con glow verde ──────────────────────────── */

.btn-primary {
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.2s ease !important;
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.5),
        0 0 0 1px rgba(76, 175, 80, 0.3) !important;
    transform: translateY(-2px);
}

/* ── 27. Título hero con glow animado ────────────────────── */

.hero-title {
    background: linear-gradient(270deg, #81C784, #A5D6A7, #4CAF50, #66BB6A, #81C784);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 5s ease infinite;
    filter: drop-shadow(0 0 20px rgba(76, 175, 80, 0.4));
}

/* ── 28. Secciones alternas con color oscuro ─────────────── */

.about,
.calculator,
.weekly-plan {
    background: rgba(10, 32, 16, 0.6) !important;
}

.services,
.products,
.recipes {
    background: rgba(13, 43, 15, 0.4) !important;
}

/* ── 29. Header dark mode ────────────────────────────────── */

.header {
    background: rgba(10, 30, 12, 0.95) !important;
    border-bottom: 1px solid rgba(76, 175, 80, 0.2) !important;
    backdrop-filter: blur(16px) !important;
}

.header.scrolled {
    background: rgba(8, 24, 10, 0.98) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(76, 175, 80, 0.2) !important;
}

/* ── 30. Shimmer adaptado para dark mode ─────────────────── */

.img-responsive {
    background: linear-gradient(90deg,
            rgba(21, 46, 23, 0.8) 25%,
            rgba(30, 60, 32, 0.9) 50%,
            rgba(21, 46, 23, 0.8) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ── 31. Footer dark ──────────────────────────────────────── */

footer,
.footer {
    background: rgba(5, 18, 7, 0.98) !important;
    border-top: 1px solid rgba(76, 175, 80, 0.15) !important;
}

/* ── 32. Wave decorativo al final de secciones ───────────── */

.section-wave {
    width: 200%;
    height: 80px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 80'%3E%3Cpath d='M0,40 C150,80 350,0 600,40 C850,80 1050,0 1200,40 L1200,80 L0,80 Z' fill='rgba(76,175,80,0.06)'/%3E%3C/svg%3E") repeat-x;
    animation: wave 8s linear infinite;
}

/* ── 33. Efecto brillo en logos y badges dorados ─────────── */

.logo span,
.featured-badge,
.section-subtitle {
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* ── 34. Número badge con glow ───────────────────────────── */

.experience-badge .number {
    animation: glowPulse 3s ease-in-out infinite;
    color: #81C784;
}