/* ============================================
   ANIMATIONS.CSS
   Animações e micro-interações
   ============================================ */

/* ============================================
   REVEAL ANIMATIONS (Scroll)
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays para grids */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.10s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.15s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.20s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.25s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.30s; }
.reveal-stagger.visible > *:nth-child(7) { transition-delay: 0.35s; }
.reveal-stagger.visible > *:nth-child(8) { transition-delay: 0.40s; }

.reveal-stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   HERO ANIMATIONS
   ============================================ */
@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hero-content {
    animation: heroFadeIn 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes heroTagPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.9;
    }
}

.hero-tag {
    animation: heroTagPulse 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hero .btn-primary {
    animation: float 4s ease-in-out infinite;
}

/* ============================================
   CARD HOVER ANIMATIONS
   ============================================ */
.product-card {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: translateY(-12px) scale(1.01);
    box-shadow: var(--shadow-2xl);
}

.product-card .product-image img {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-card .btn-whatsapp {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.2s ease;
}

.product-card .btn-whatsapp:hover {
    transform: scale(1.04);
    background: #1DA851;
}

/* ============================================
   SMOOTH SCROLL INDICATOR
   ============================================ */
@keyframes scrollIndicator {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(20px);
        opacity: 0;
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: scrollIndicator 2s ease-in-out infinite;
}

.scroll-indicator .arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid rgba(255, 255, 255, 0.4);
    border-bottom: 2px solid rgba(255, 255, 255, 0.4);
    transform: rotate(45deg);
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-screen .loader {
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes loadingPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-screen h2 {
    animation: loadingPulse 1.5s ease-in-out infinite;
}

/* ============================================
   Skeleton Loading (para produtos)
   ============================================ */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: var(--gray-100);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 1.8s ease-in-out infinite;
    background-size: 200px 100%;
}

/* ============================================
   PULSE ANIMATIONS (WhatsApp)
   ============================================ */
@keyframes pulse-whatsapp {
    0%, 100% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 50px rgba(37, 211, 102, 0.6);
        transform: scale(1.05);
    }
}

.floating-whatsapp {
    animation: pulse-whatsapp 2.5s ease-in-out infinite;
}

.floating-whatsapp:hover {
    animation-play-state: paused;
}

/* ============================================
   NUMBER COUNT ANIMATION
   ============================================ */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.number-card {
    animation: countUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

.number-card:nth-child(1) { animation-delay: 0.1s; }
.number-card:nth-child(2) { animation-delay: 0.2s; }
.number-card:nth-child(3) { animation-delay: 0.3s; }
.number-card:nth-child(4) { animation-delay: 0.4s; }

/* ============================================
   SLIDE IN SECTIONS
   ============================================ */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

/* ============================================
   GLOW EFFECTS
   ============================================ */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(11, 60, 145, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(11, 60, 145, 0.4), 0 0 60px rgba(212, 27, 44, 0.2);
    }
}

.glow {
    animation: glow 3s ease-in-out infinite;
}

/* ============================================
   BADGE ENTRANCE
   ============================================ */
@keyframes badgePop {
    0% {
        transform: scale(0) rotate(-10deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.2) rotate(2deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.product-badge {
    animation: badgePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.product-badge.sold {
    animation-delay: 0.1s;
}

.product-badge.promotion {
    animation-delay: 0.2s;
}

/* ============================================
   STEP NUMBER ANIMATION
   ============================================ */
@keyframes stepNumber {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    60% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.step span {
    animation: stepNumber 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

.step:nth-child(1) span { animation-delay: 0.1s; }
.step:nth-child(2) span { animation-delay: 0.2s; }
.step:nth-child(3) span { animation-delay: 0.3s; }
.step:nth-child(4) span { animation-delay: 0.4s; }

/* ============================================
   TYPOGRAPHY ANIMATIONS
   ============================================ */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--primary);
    animation: typewriter 2s steps(40) 1s forwards;
    width: 0;
}

/* ============================================
   ZOOM IN ON SCROLL
   ============================================ */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-in {
    animation: zoomIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

/* ============================================
   REDUCE MOTION PREFERENCE
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .reveal-stagger > * {
        opacity: 1 !important;
        transform: none !important;
    }

    .floating-whatsapp {
        animation: none !important;
    }

    .hero-content {
        animation: none !important;
    }

    .hero-tag {
        animation: none !important;
    }

    .product-card:hover {
        transform: none !important;
    }

    .product-card:hover .product-image img {
        transform: none !important;
    }

    .scroll-indicator {
        animation: none !important;
    }
}