/* ============================================================
   Faith & Fire Creations — Polish & Motion Layer
   Restrained, purposeful additions on top of the existing
   navy / gold / ember / parchment fantasy identity.
   ============================================================ */

/* Respect users who prefer reduced motion, before anything else */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

html {
    scroll-behavior: smooth;
}

/* --- Custom scrollbar in the site's palette --- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--cream, #fbf9f4);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold, #d3a042), var(--rust, #bd4a34));
    border-radius: 999px;
    border: 2px solid var(--cream, #fbf9f4);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--rust, #bd4a34);
}

/* --- Page entrance --- */
body {
    animation: pageFadeIn 0.5s ease-out;
}
@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Accessible, on-brand focus state (keyboard navigation) --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--gold, #d3a042);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --- Buttons: gentle press feedback + shine sweep --- */
.btn, .cta-button, .btn-secondary {
    position: relative;
    overflow: hidden;
    will-change: transform;
}
.btn:active, .cta-button:active, .btn-secondary:active {
    transform: translateY(0) scale(0.97);
}
.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
    pointer-events: none;
}
.btn:hover::after {
    left: 130%;
}

/* --- Product cards: lift, deepen shadow, zoom the photo --- */
.product-card,
[class*="product-card"],
.collection-card {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}
.product-card:hover,
[class*="product-card"]:hover,
.collection-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 40px rgba(21, 30, 50, 0.18);
}
.product-card img,
[class*="product-card"] img,
.collection-card img {
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.product-card:hover img,
[class*="product-card"]:hover img,
.collection-card:hover img {
    transform: scale(1.06);
}

/* --- Links with a warm underline sweep (nav + inline text links) --- */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: var(--gold, #d3a042);
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}

/* --- Cart icon bump when an item is added --- */
@keyframes cartBump {
    0% { transform: scale(1); }
    30% { transform: scale(1.25); }
    55% { transform: scale(0.92); }
    100% { transform: scale(1); }
}
.cart-bump {
    animation: cartBump 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Scroll reveal helper (paired with a tiny IntersectionObserver in components/Shared.js) --- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Loading skeleton shimmer, for async states like checkout redirect --- */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.skeleton-shimmer {
    background: linear-gradient(90deg, rgba(21,30,50,0.06) 25%, rgba(21,30,50,0.12) 37%, rgba(21,30,50,0.06) 63%);
    background-size: 800px 100%;
    animation: shimmer 1.6s linear infinite;
}

/* --- Badges: a subtle pulse to draw the eye without being noisy --- */
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(211, 160, 66, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(211, 160, 66, 0); }
}
.badge-glow {
    animation: badgePulse 2.4s ease-in-out infinite;
}
