/* ============================================
   ANIMATIONS — PT. PUTRY DEFA FAUSIA
   ============================================ */

/* ---- Keyframes ---- */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-12px);
    }

    60% {
        transform: translateX(-50%) translateY(-6px);
    }
}

@keyframes wa-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ---- Scroll Reveal ---- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal--left {
    transform: translateX(-30px);
}

.reveal--left.active {
    transform: translateX(0);
}

.reveal--right {
    transform: translateX(30px);
}

.reveal--right.active {
    transform: translateX(0);
}

/* Stagger children */
.reveal:nth-child(1) {
    transition-delay: 0.05s;
}

.reveal:nth-child(2) {
    transition-delay: 0.12s;
}

.reveal:nth-child(3) {
    transition-delay: 0.19s;
}

.reveal:nth-child(4) {
    transition-delay: 0.26s;
}

.reveal:nth-child(5) {
    transition-delay: 0.33s;
}

.reveal:nth-child(6) {
    transition-delay: 0.40s;
}

/* ---- Hero Animations ---- */
.hero__badge {
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero__title {
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.hero__subtitle {
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

.hero__actions {
    animation: fadeInUp 0.8s ease-out 0.9s both;
}

.hero__trust {
    animation: fadeInUp 0.8s ease-out 1.1s both;
}

/* ---- Loading Spinner ---- */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ---- Card Glow Effect ---- */
.product-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, transparent 40%, var(--color-primary-glow) 50%, transparent 60%);
    background-size: 200% 200%;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.product-card:hover::after {
    opacity: 1;
    animation: gradientShift 3s ease infinite;
}

/* ---- Navbar Link Underline Animation ---- */
.navbar__link::after {
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---- Stat Counter Glow ---- */
.stat-card.counted .stat-card__number {
    animation: scaleIn 0.5s ease-out;
}

/* ---- Smooth Image Load ---- */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    html {
        scroll-behavior: auto;
    }
}