/* ==========================================================================
   Stockatcom — motion layer
   Only transform / opacity / filter are animated (GPU-friendly, no layout work).
   Hidden "before reveal" states apply only when JS added .js-anim to <html>,
   so content is always visible if scripts fail. Everything is switched off
   for users who prefer reduced motion (bottom of file).
   ========================================================================== */

:root {
    --ease-out: cubic-bezier(.22, 1, .36, 1);
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
    --dur: .7s;
}

@keyframes fade-up { from { opacity: 0; transform: translate3d(0, 28px, 0); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes slide-in-start { from { opacity: 0; transform: translate3d(-40px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes slide-in-end { from { opacity: 0; transform: translate3d(40px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -12px, 0); } }
@keyframes float-sm { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -6px, 0); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 70% { transform: scale(.9); } 100% { transform: scale(1); } }
@keyframes heart-beat { 0% { transform: scale(1); } 30% { transform: scale(1.3); } 60% { transform: scale(.92); } 100% { transform: scale(1); } }
@keyframes ripple { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
@keyframes shine { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(220%) skewX(-20deg); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(25, 199, 160, .45); } 50% { box-shadow: 0 0 0 10px rgba(25, 199, 160, 0); } }
@keyframes dot-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.6); opacity: .4; } }
@keyframes gradient-shift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(.85); } }
@keyframes drop-in { from { opacity: 0; transform: translate3d(0, -8px, 0); } to { opacity: 1; transform: none; } }

/* ---------- Page to page ----------
   Same-site navigations cross-fade instead of flashing white (View Transitions; Chrome/Edge/Safari 18+,
   other browsers just navigate). The header has its own name, so it stays put while the page changes.
   No whole-page fade on load: a reload paints the content straight away. */
@view-transition { navigation: auto; }
.header { view-transition-name: site-header; }
::view-transition-old(root) { animation: vt-out .18s ease-in both; }
::view-transition-new(root) { animation: vt-in .32s var(--ease-out) both; }
::view-transition-group(site-header) { animation: none; }
@keyframes vt-out { to { opacity: 0; transform: translate3d(0, -6px, 0); } }
@keyframes vt-in { from { opacity: 0; transform: translate3d(0, 10px, 0); } }

/* Off-screen footer is laid out and painted only when scrolled near. */
.footer { content-visibility: auto; contain-intrinsic-size: auto 480px; }

/* ---------- Scroll reveal (data-reveal is added by animations.js) ---------- */
.js-anim [data-reveal] { opacity: 0; transform: translate3d(0, 28px, 0); }
.js-anim [data-reveal="scale"] { transform: scale(.94); }
.js-anim [data-reveal="start"] { transform: translate3d(-36px, 0, 0); }
.js-anim [data-reveal="end"] { transform: translate3d(36px, 0, 0); }
[dir="rtl"].js-anim [data-reveal="start"] { transform: translate3d(36px, 0, 0); }
[dir="rtl"].js-anim [data-reveal="end"] { transform: translate3d(-36px, 0, 0); }
.js-anim [data-reveal].is-visible {
    opacity: 1; transform: none;
    transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
    transition-delay: var(--d, 0ms);
}
/* will-change only while waiting to reveal, so finished elements give their GPU layer back. */
.js-anim [data-reveal]:not(.is-visible) { will-change: opacity, transform; }

/* ---------- Header ---------- */
.header { transition: box-shadow .3s ease, background-color .3s ease; }
.header.scrolled { box-shadow: 0 8px 24px rgba(15, 29, 69, .08); }
.nav > a, .nav .dropdown > button { position: relative; }
.nav > a::after, .nav .dropdown > button::after {
    content: ""; position: absolute; inset-inline: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--green);
    transform: scaleX(0); transform-origin: center; transition: transform .3s var(--ease-out);
}
.nav > a:hover::after, .nav .dropdown:hover > button::after { transform: scaleX(1); }
.nav > a.active::after { display: none; }
.logo svg { transition: transform .4s var(--ease-spring); }
.logo:hover svg { transform: rotate(-6deg) scale(1.06); }
.icon-btn svg, .login-link svg { transition: transform .25s var(--ease-spring); }
.icon-btn:hover svg { transform: translateY(-2px) scale(1.1); }
.icon-btn .count.pop { animation: pop .6s var(--ease-spring); }
.dropdown-menu { transition: opacity .2s ease, transform .25s var(--ease-out), visibility .2s; }
.dropdown:hover .dropdown-menu a, .dropdown.open .dropdown-menu a { animation: drop-in .3s var(--ease-out) both; }
.dropdown-menu a:nth-child(2) { animation-delay: .03s !important; }
.dropdown-menu a:nth-child(3) { animation-delay: .06s !important; }
.dropdown-menu a:nth-child(4) { animation-delay: .09s !important; }
.mega-panel.active .mega-subs li { animation: drop-in .35s var(--ease-out) both; }
.mega-panel.active .mega-subs li:nth-child(2) { animation-delay: .03s; }
.mega-panel.active .mega-subs li:nth-child(3) { animation-delay: .06s; }
.mega-panel.active .mega-subs li:nth-child(4) { animation-delay: .09s; }
.mega-panel.active .mega-subs li:nth-child(5) { animation-delay: .12s; }
.mega-panel.active .mega-subs li:nth-child(6) { animation-delay: .15s; }
.mega-menu .mega-list a { transition: background .2s, color .2s, padding .25s var(--ease-out); }
.mega-menu .mega-list a:hover { padding-inline-start: 26px; }
body.drawer-open .drawer-nav > * { animation: slide-in-start .4s var(--ease-out) both; }
body.drawer-open .drawer-nav > *:nth-child(2) { animation-delay: .04s; }
body.drawer-open .drawer-nav > *:nth-child(3) { animation-delay: .08s; }
body.drawer-open .drawer-nav > *:nth-child(4) { animation-delay: .12s; }
body.drawer-open .drawer-nav > *:nth-child(5) { animation-delay: .16s; }
body.drawer-open .drawer-nav > *:nth-child(6) { animation-delay: .2s; }
body.drawer-open .drawer-nav > *:nth-child(n+7) { animation-delay: .24s; }

/* ---------- Navigation progress bar ---------- */
.nav-progress {
    position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 200; pointer-events: none;
    background: linear-gradient(90deg, var(--green), var(--teal)); transform-origin: left; transform: scaleX(0); opacity: 0;
}
[dir="rtl"] .nav-progress { transform-origin: right; }
.nav-progress.loading { opacity: 1; animation: progress 2.5s cubic-bezier(.1, .7, .2, 1) forwards; }

/* ---------- Buttons ---------- */
.btn { position: relative; overflow: hidden; isolation: isolate; transition: background .2s, color .2s, border-color .2s, transform .15s var(--ease-out), box-shadow .25s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-green:hover, .btn-teal:hover { box-shadow: 0 10px 24px rgba(0, 194, 85, .28); }
.btn-navy:hover { box-shadow: 0 10px 24px rgba(19, 38, 92, .25); }
.btn-green::after, .btn-teal::after, .sahl-search button::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; z-index: -1; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); transform: translateX(-120%) skewX(-20deg);
}
.btn-green:hover::after, .btn-teal:hover::after, .sahl-search button:hover::after { animation: shine .8s ease; }
.sahl-search button { position: relative; overflow: hidden; transition: background .2s, transform .15s; }
.sahl-search button:active { transform: scale(.97); }
.ripple {
    position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .25;
    transform: translate(-50%, -50%) scale(0); animation: ripple .6s ease-out forwards;
}
.btn.is-busy { pointer-events: none; }
.btn.is-busy .icon { animation: pop .6s var(--ease-spring) infinite; }

/* ---------- Home hero ---------- */
.js-anim .hero .eyebrow-pill,
.js-anim .hero h1,
.js-anim .hero-lead,
.js-anim .sahl-search,
.js-anim .suggestions,
.js-anim .hero-stats { animation: fade-up .6s var(--ease-out) both; }
.js-anim .hero h1 { animation-delay: .06s; }
.js-anim .hero-lead { animation-delay: .12s; }
.js-anim .sahl-search { animation-delay: .18s; }
.js-anim .suggestions { animation-delay: .24s; }
.js-anim .hero-stats { animation-delay: .3s; }
.js-anim .hero-visual { animation: scale-in .8s var(--ease-out) .1s both; }
.hero-visual img { animation: float 6s ease-in-out 1.3s infinite; }
.hero-visual .float-card.one { animation: float-sm 5s ease-in-out 1.3s infinite; }
.hero-visual .float-card.two { animation: float-sm 5s ease-in-out 3.8s infinite; }
.hero h1 span {
    background: linear-gradient(90deg, var(--teal), #6ef0c8, var(--green), var(--teal)); background-size: 300% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent; animation: gradient-shift 8s ease infinite;
}
.eyebrow-pill::before { animation: dot-pulse 1.8s ease-in-out infinite; }
.sahl-search { transition: box-shadow .3s, transform .3s var(--ease-out); }
.sahl-search:focus-within { box-shadow: 0 16px 40px rgba(0, 0, 0, .25), 0 0 0 4px rgba(25, 199, 160, .25); transform: translateY(-2px); }
.sahl-search .icon { animation: glow 2.6s ease-in-out infinite; }
.sahl-search input.typing::placeholder { color: #4a5470; }
.suggestions a { transition: border-color .2s, color .2s, background .2s, transform .2s var(--ease-out); }
.suggestions a:hover { transform: translateY(-2px); background: rgba(25, 199, 160, .12); }
.hero-stats strong { font-variant-numeric: tabular-nums; }

/* ---------- Cards ---------- */
.product-card, .vendor-card, .cat-card, .value-card, .why-card, .wish-card {
    transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out), border-color .3s;
}
.product-card:hover, .vendor-card:hover, .wish-card:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgba(16, 24, 40, .12); }
.cat-card:hover { transform: translateY(-6px) scale(1.02); }
.cat-card .info { transition: transform .4s var(--ease-out); }
.cat-card:hover .info { transform: translateY(-4px); }
.value-card:hover, .why-card:hover { transform: translateY(-6px); box-shadow: 0 18px 36px rgba(16, 24, 40, .1); border-color: #c9efd9; }
.value-card .emoji, .why-card .emoji { display: inline-block; transition: transform .5s var(--ease-spring); }
.value-card:hover .emoji, .why-card:hover .emoji { transform: scale(1.2) rotate(-8deg); }
.product-media img, .vendor-cover img { transition: transform .7s var(--ease-out); }
.product-card:hover .product-media img, .vendor-card:hover .vendor-cover img { transform: scale(1.07); }
.product-card .badge, .vendor-card .badge { animation: scale-in .5s var(--ease-spring) both; }
.heart-btn { transition: color .15s, transform .25s var(--ease-spring), background .2s; }
.heart-btn:hover { transform: scale(1.12); }
.heart-btn.beat, .pd-wish.beat { animation: heart-beat .5s var(--ease-spring); }
.stat-box { transition: transform .4s var(--ease-out); }
.stat-box:hover { transform: translateY(-4px); }
.team-grid img { transition: transform .5s var(--ease-spring), border-color .3s; }
.team-grid > div:hover img { transform: scale(1.08) rotate(-3deg); border-color: var(--green); }
.chip { transition: border-color .2s, background .2s, color .2s, transform .2s var(--ease-out); }
.chip:hover { transform: translateY(-2px); }
.option-card { transition: border-color .2s, background .2s, transform .2s var(--ease-out); }
.option-card:hover { transform: translateX(4px); }
[dir="rtl"] .option-card:hover { transform: translateX(-4px); }
.subcats a, .side-nav a { transition: background .2s, color .2s, padding .25s var(--ease-out); }
.subcats a:not(.active):hover { padding-inline-start: 16px; }

/* ---------- Banners / heroes ---------- */
.page-hero h1, .cat-hero h1, .cat-hero .cat-crumbs, .cat-hero-desc, .cat-hero-meta, .page-hero p, .sahl-banner > div {
    animation: fade-up .55s var(--ease-out) both;
}
.cat-hero-desc, .page-hero p { animation-delay: .08s; }
.cat-hero-meta { animation-delay: .14s; }
/* Banners: a soft light sweeps across once on load. It moves with transform only — the old endless
   background-position shift repainted the whole banner every frame, which made pages feel heavy. */
.cat-hero, .page-hero, .vendor-cta, .sahl-banner { position: relative; isolation: isolate; overflow: hidden; }
.cat-hero::after, .page-hero::after, .vendor-cta::after, .sahl-banner::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .07) 50%, transparent 70%);
    transform: translateX(-100%); animation: sweep 1.6s var(--ease-out) .3s both;
}
@keyframes sweep { to { transform: translateX(100%); } }
.sahl-banner img, .sahl-card img { animation: float-sm 4s ease-in-out infinite; }
.sahl-banner .tag::before, .sahl-card .dot { animation: dot-pulse 1.8s ease-in-out infinite; }

/* ---------- Product page ---------- */
.pd-stage img { transition: opacity .35s ease, transform .6s var(--ease-out); }
.pd-stage img.swap { opacity: 0; transform: scale(.98); }
.pd-stage:hover img { transform: scale(1.04); }
.pd-thumbs button { transition: border-color .2s, transform .25s var(--ease-spring); }
.pd-thumbs button:hover { transform: translateY(-3px); }
.pd-color span { transition: border-color .15s, background .15s, color .15s, transform .2s var(--ease-spring); }
.pd-color input:checked + span { transform: scale(1.04); }
.rv-bar .fill { transform-origin: left; transition: transform 1.2s var(--ease-out); }
[dir="rtl"] .rv-bar .fill { transform-origin: right; }
.js-anim .rv-bars:not(.is-visible) .fill { transform: scaleX(0); }
.lightbox:not([hidden]) { animation: fade-in .25s ease; }
.lightbox:not([hidden]) img { animation: scale-in .35s var(--ease-out); }

/* ---------- Lists, accordions, forms ---------- */
.faq-item { transition: border-color .2s, box-shadow .3s; }
.faq-item:hover { box-shadow: 0 8px 20px rgba(16, 24, 40, .06); }
.faq-item[open] .answer { animation: fade-up .45s var(--ease-out); }
.faq-item .toggle { transition: transform .35s var(--ease-spring), background .2s, color .2s; }
.input, .select, .textarea { transition: border-color .2s, box-shadow .25s; }
.timeline li .dot { animation: scale-in .5s var(--ease-spring) both; }
.toast { animation: drop-in .45s var(--ease-spring); }
.qty-control button { transition: border-color .2s, transform .15s var(--ease-spring); }
.qty-control button:active { transform: scale(.85); }
.empty-state .emoji { display: inline-block; animation: float 3.5s ease-in-out infinite; }
.footer a { transition: color .2s, padding .25s var(--ease-out); }
.footer li a:hover { padding-inline-start: 6px; }

/* ---------- Reduced motion: keep everything static ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .js-anim [data-reveal] { opacity: 1 !important; transform: none !important; }
    .js-anim .rv-bars .fill { transform: none !important; }
}
