/* =============================================
   ANIMATIONS & INTERACTIONS
   ============================================= */

/* ── Fade-in animations ──────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Animation utility classes ────────────────── */
.animate-fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.33, 0.66, 0.66, 1) forwards;
    opacity: 0;
}

.animate-fade-in-up.visible {
    opacity: 1;
    animation-play-state: running;
}

/* Stagger delays for multiple elements */
.animate-fade-in-up:nth-child(1) { animation-delay: 0s; }
.animate-fade-in-up:nth-child(2) { animation-delay: 0.1s; }
.animate-fade-in-up:nth-child(3) { animation-delay: 0.2s; }
.animate-fade-in-up:nth-child(4) { animation-delay: 0.3s; }
.animate-fade-in-up:nth-child(n+5) { animation-delay: 0.4s; }

/* ── Product cards hover enhancement ──────────── */
.product-card {
    transition: all 0.3s cubic-bezier(0.33, 0.66, 0.66, 1);
}

.product-card:hover {
    transform: translateY(-8px);
}

.product-thumb img {
    transition: transform 0.5s cubic-bezier(0.33, 0.66, 0.66, 1);
}

.product-card:hover .product-thumb img {
    transform: scale(1.08);
}

/* ── Button interactions ────────────────────── */
.btn-dark,
.btn-wholesale-inquiry,
.btn-contact-wholesale,
.product-cta {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-dark::before,
.btn-wholesale-inquiry::before,
.btn-contact-wholesale::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-dark:active::before,
.btn-wholesale-inquiry:active::before,
.btn-contact-wholesale:active::before {
    width: 300px;
    height: 300px;
}

/* ── Smooth link transitions ────────────────── */
a {
    transition: color 0.2s ease;
}

/* ── Form focus states ──────────────────────── */
.form-field input:focus,
.form-field textarea:focus {
    box-shadow: 0 0 0 2px rgba(0,75,73,0.1);
    transition: all 0.2s ease;
}

/* ── Header scroll effect ─────────────────────– */
.site-header {
    transition: all 0.3s cubic-bezier(0.33, 0.66, 0.66, 1);
}

/* ── Carousel smooth transitions ─────────────── */
.carousel-track {
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Image skeleton/placeholder ──────────────── */
.product-thumb {
    background: linear-gradient(
        90deg,
        #e8e5e0 0%,
        #f0ede8 50%,
        #e8e5e0 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.product-thumb img {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Image loaded state - remove shimmer */
.product-thumb img[data-loaded="true"],
.product-thumb img.loaded {
    animation: fadeIn 0.6s ease-in-out;
}

/* ── Section entrance animations ─────────────– */
.home-showcase,
.about-hero,
.about-timeline,
.about-arrivals,
.policy-cta,
.policy-faq {
    animation: fadeInUp 0.8s cubic-bezier(0.33, 0.66, 0.66, 1) forwards;
    opacity: 0;
}

.home-showcase { animation-delay: 0s; }
.about-hero { animation-delay: 0.1s; }
.about-timeline { animation-delay: 0.2s; }
.about-arrivals { animation-delay: 0.3s; }

/* ── FAQ accordion animation ─────────────────– */
.faq-toggle {
    transition: background-color 0.2s ease;
}

.faq-toggle:focus,
.faq-toggle:active {
    background-color: rgba(0,75,73,0.08);
}

.faq-answer {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Link underline effect ──────────────────── */
.nav-list a::after,
.category-list a::after,
.footer-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

/* ── Subtle scale on hover ───────────────────– */
.showcase-item:hover img,
.timeline-media:hover {
    animation: scaleIn 0.4s ease-in-out forwards;
}

/* ── Badge/tag animations ────────────────────– */
.product-cta {
    transform: translateY(0);
    transition: all 0.3s ease;
}

.product-card:hover .product-cta {
    transform: translateY(-2px);
}

/* ── Responsive: reduce animations on mobile ─– */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    /* Lighter animations on mobile for better performance */
    .product-card:hover {
        transform: translateY(-4px);
    }

    .animate-fade-in-up {
        animation: fadeInUp 0.4s ease forwards;
    }
}
