/* BUYSOFTO — Enhanced Design v2 | Glassmorphism + Motion-Driven */

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  --primary: #1d4ed8;
  --primary-light: #3b82f6;
  --accent: #ea580c;
  --accent-glow: rgba(234,88,12,.35);
  --primary-glow: rgba(29,78,216,.35);
  --glass-bg: rgba(255,255,255,.08);
  --glass-border: rgba(255,255,255,.15);
  --glass-blur: blur(16px);
  --card-shadow: 0 8px 32px rgba(0,0,0,.12);
  --card-shadow-hover: 0 24px 64px rgba(29,78,216,.22);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --ease-smooth: cubic-bezier(.4,0,.2,1);
  --dur-fast: 150ms;
  --dur-mid: 300ms;
  --dur-slow: 500ms;
}

/* ─── Prefers Reduced Motion ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Scroll Reveal Base ────────────────────────────────────── */
/* Content is always visible: no hide-until-scrolled reveals (they left whole
   sections blank when JS was slow/blocked and hid content from crawlers). */
.sr, .sr-left, .sr-right, .sr-scale { opacity: 1; transform: none; }

/* Stagger children */
.stagger > *:nth-child(1) { transition-delay: 0ms; }
.stagger > *:nth-child(2) { transition-delay: 80ms; }
.stagger > *:nth-child(3) { transition-delay: 160ms; }
.stagger > *:nth-child(4) { transition-delay: 240ms; }
.stagger > *:nth-child(5) { transition-delay: 320ms; }
.stagger > *:nth-child(6) { transition-delay: 400ms; }
.stagger > *:nth-child(7) { transition-delay: 480ms; }
.stagger > *:nth-child(8) { transition-delay: 560ms; }

/* ─── 3D Card Tilt ──────────────────────────────────────────── */
.card-3d {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform var(--dur-mid) var(--ease-smooth), box-shadow var(--dur-mid) var(--ease-smooth);
  transform-origin: center center;
}
.card-3d:hover {
  box-shadow: var(--card-shadow-hover);
}
.card-3d .card-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-mid) ease;
  z-index: 2;
}
.card-3d:hover .card-shine { opacity: 1; }

/* ─── Glassmorphism ─────────────────────────────────────────── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}
.glass-card {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 8px 32px rgba(29,78,216,.08), inset 0 1px 0 rgba(255,255,255,.6);
}

/* ─── Glow Effects ──────────────────────────────────────────── */
.glow-primary { box-shadow: 0 0 24px var(--primary-glow), 0 0 8px var(--primary-glow); }
.glow-accent  { box-shadow: 0 0 24px var(--accent-glow),  0 0 8px var(--accent-glow);  }
.btn-glow-primary:hover { box-shadow: 0 0 32px var(--primary-glow), 0 8px 24px rgba(29,78,216,.3); transform: translateY(-2px); }
.btn-glow-accent:hover  { box-shadow: 0 0 32px var(--accent-glow),  0 8px 24px rgba(234,88,12,.3); transform: translateY(-2px); }
.btn-glow-primary, .btn-glow-accent { transition: box-shadow var(--dur-mid) ease, transform var(--dur-mid) var(--ease-spring); }

/* ─── Animated Gradient Hero ────────────────────────────────── */
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.hero-gradient {
  background: linear-gradient(-45deg, #0f172a, #1e3a8a, #1e40af, #0c1445, #ea580c22, #1d4ed8);
  background-size: 400% 400%;
  animation: gradient-shift 12s ease infinite;
}

/* ─── Floating Orbs ─────────────────────────────────────────── */
@keyframes float-up-down {
  0%,100% { transform: translateY(0) scale(1); }
  50%     { transform: translateY(-20px) scale(1.05); }
}
@keyframes float-side {
  0%,100% { transform: translateX(0) rotate(0deg); }
  50%     { transform: translateX(12px) rotate(3deg); }
}
.orb { animation: float-up-down 6s ease-in-out infinite; pointer-events: none; }
.orb-2 { animation: float-up-down 8s ease-in-out infinite 2s; }
.orb-3 { animation: float-side 10s ease-in-out infinite 1s; }

/* ─── Particle Dots ─────────────────────────────────────────── */
@keyframes particle-float {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity:.6; }
  33%  { transform: translateY(-30px) translateX(10px) scale(1.2); opacity:1; }
  66%  { transform: translateY(-15px) translateX(-8px) scale(.9); opacity:.8; }
  100% { transform: translateY(0) translateX(0) scale(1); opacity:.6; }
}
.particle { animation: particle-float var(--dur, 6s) ease-in-out infinite var(--delay, 0s); border-radius: 50%; position: absolute; pointer-events: none; }

/* ─── Shimmer Skeleton ──────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* ─── Product Card Enhancements ─────────────────────────────── */
.product-card {
  transition: transform var(--dur-mid) var(--ease-spring), box-shadow var(--dur-mid) ease;
  position: relative;
  overflow: hidden;
}
.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(29,78,216,.05) 0%, rgba(234,88,12,.05) 100%);
  opacity: 0;
  transition: opacity var(--dur-mid) ease;
  pointer-events: none;
  z-index: 1;
}
.product-card:hover::before { opacity: 1; }
.product-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: 0 24px 48px rgba(29,78,216,.18), 0 8px 16px rgba(0,0,0,.08);
}
.product-card:hover .product-img { transform: scale(1.08); }

/* ─── Button Ripple ─────────────────────────────────────────── */
.btn-ripple { position: relative; overflow: hidden; }
.btn-ripple .ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  transform: scale(0);
  animation: ripple-anim .6s linear;
  pointer-events: none;
}
@keyframes ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

/* ─── Gradient Text ─────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, #3b82f6, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-warm {
  background: linear-gradient(135deg, #f97316, #ea580c, #dc2626);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Counter Animation ─────────────────────────────────────── */
.counter-num { transition: all var(--dur-slow) ease; }

/* ─── Animated Border ───────────────────────────────────────── */
@keyframes border-spin {
  to { --angle: 360deg; }
}
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
.animated-border {
  --angle: 0deg;
  border: 2px solid transparent;
  background: linear-gradient(white, white) padding-box,
              linear-gradient(var(--angle), #1d4ed8, #6366f1, #ea580c, #1d4ed8) border-box;
  animation: border-spin 4s linear infinite;
}

/* ─── Badge Pulse ───────────────────────────────────────────── */
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(234,88,12,.5); }
  50%       { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(234,88,12,0); }
}
.badge-live { animation: badge-pulse 2s ease-in-out infinite; }

/* ─── Navbar Glass ──────────────────────────────────────────── */
header.sticky {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(15,23,42,.85) !important;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
}

/* ─── Category Card 3D ──────────────────────────────────────── */
.cat-card {
  transition: transform var(--dur-mid) var(--ease-spring), box-shadow var(--dur-mid) ease;
  will-change: transform;
}
.cat-card:hover {
  transform: translateY(-12px) rotateX(4deg);
  box-shadow: 0 32px 64px rgba(29,78,216,.2);
}
.cat-card .cat-icon-wrap {
  transition: transform var(--dur-mid) var(--ease-spring);
}
.cat-card:hover .cat-icon-wrap {
  transform: scale(1.15) rotate(-3deg);
}

/* ─── Hero Text Animation ───────────────────────────────────── */
@keyframes text-reveal {
  from { opacity: 0; transform: translateY(40px) skewY(2deg); }
  to   { opacity: 1; transform: translateY(0) skewY(0deg); }
}
.hero-title-1 { animation: text-reveal .7s var(--ease-spring) .2s both; }
.hero-title-2 { animation: text-reveal .7s var(--ease-spring) .35s both; }
.hero-sub     { animation: text-reveal .6s var(--ease-smooth) .5s both; }
.hero-btns    { animation: text-reveal .6s var(--ease-smooth) .65s both; }
.hero-stats   { animation: text-reveal .6s var(--ease-smooth) .8s both; }

/* ─── Scroll Progress Bar ───────────────────────────────────── */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; z-index: 9999;
  background: linear-gradient(90deg, #1d4ed8, #6366f1, #ea580c);
  width: 0%; transition: width .1s linear;
  box-shadow: 0 0 8px rgba(99,102,241,.6);
}

/* ─── Trust Badge Shine ─────────────────────────────────────── */
@keyframes shine-sweep {
  0%   { left: -100%; }
  100% { left: 200%; }
}
.trust-card {
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-mid) var(--ease-spring), box-shadow var(--dur-mid) ease;
}
.trust-card::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  transform: skewX(-20deg);
}
.trust-card:hover::after { animation: shine-sweep .6s ease-in-out; }
.trust-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(29,78,216,.15); }

/* ─── Sale Banner Animated ──────────────────────────────────── */
@keyframes sale-bg {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}
.sale-banner {
  background: linear-gradient(-45deg, #ea580c, #dc2626, #f97316, #ea580c);
  background-size: 300% 300%;
  animation: sale-bg 5s ease infinite;
}

/* ─── Image Lazy Fade-In ────────────────────────────────────── */
img.lazy-fade { opacity: 0; transition: opacity .4s ease; }
img.lazy-fade.loaded { opacity: 1; }

/* ─── Floating Action Button ────────────────────────────────── */
@keyframes float-fab {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}
.fab-float { animation: float-fab 3s ease-in-out infinite; }

/* ─── Toast Notification ────────────────────────────────────── */
@keyframes toast-in  { from { transform: translateX(110%); opacity:0; } to { transform: translateX(0); opacity:1; } }
@keyframes toast-out { from { transform: translateX(0);    opacity:1; } to { transform: translateX(110%); opacity:0; } }
.toast { position: fixed; bottom: 24px; right: 24px; z-index: 9998; pointer-events: none; }
.toast.show { animation: toast-in .4s var(--ease-spring) forwards; pointer-events: auto; }
.toast.hide { animation: toast-out .3s ease forwards; }

/* ─── Hover Link Underline Animation ───────────────────────── */
.link-underline {
  position: relative;
  text-decoration: none;
}
.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--primary-light);
  transition: width var(--dur-mid) var(--ease-smooth);
}
.link-underline:hover::after { width: 100%; }

/* ─── Focus Ring ────────────────────────────────────────────── */
*:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─── Smooth Scroll ─────────────────────────────────────────── */
html { scroll-behavior: smooth; }

/* ─── Number Ticker ─────────────────────────────────────────── */
@keyframes tick-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.ticker-num { display: inline-block; animation: tick-up .5s var(--ease-spring); }

/* ─── Back To Top ───────────────────────────────────────────── */
#back-to-top {
  position: fixed; bottom: 28px; right: 28px; z-index: 999;
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #6366f1);
  color: white; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(20px) scale(.8);
  transition: opacity .3s ease, transform .3s var(--ease-spring), box-shadow .3s ease;
  box-shadow: 0 4px 16px rgba(29,78,216,.4);
}
#back-to-top.visible {
  opacity: 1; transform: translateY(0) scale(1);
}
#back-to-top:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 24px rgba(29,78,216,.5);
}

/* Lift back-to-top above the mobile sticky buy bar on product pages */
@media (max-width: 767px) {
  body:has(#sticky-buy:not(.translate-y-full)) #back-to-top { bottom: 96px; }
}

/* ═══════════ Design refresh (2026-11) ═══════════ */
/* Hero: deep navy with a soft brand-blue glow; no floating particles */
.hero-v2 {
  background:
    radial-gradient(60rem 30rem at 85% 10%, rgba(37,99,235,.35), transparent 60%),
    radial-gradient(40rem 24rem at 0% 100%, rgba(8,145,178,.22), transparent 60%),
    #0b1220;
}
/* Brand gradient = the logo's blue → teal (never violet) */
.text-brand-gradient {
  background: linear-gradient(90deg, #60a5fa 0%, #22d3ee 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* Hero enters once on load */
@keyframes hero-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-enter   { animation: hero-in .6s cubic-bezier(.2,.7,.2,1) both; }
.hero-enter-2 { animation-delay: .12s; }

/* Hover layer: lift cards 2px, zoom photos slightly, buttons step + press */
.lift, .pcard { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.lift:hover, .pcard:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -12px rgba(15,23,42,.18); }
.pcard-img { transition: transform .35s ease; }
.pcard:hover .pcard-img { transform: scale(1.03); }
.btn-press { transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease; }
.btn-press:hover { transform: translateY(-1px); }
.btn-press:active { transform: translateY(1px) scale(.98); }
.btn-press:disabled { opacity: .85; cursor: progress; transform: none; }
.btn-press.is-added { background-color: #059669 !important; }
.arrow-nudge { transition: transform .2s ease; }
.group:hover .arrow-nudge { transform: translateX(3px); }
.link-arrow span { display: inline-block; transition: transform .2s ease; }
.link-arrow:hover span { transform: translateX(3px); }
.deal-row { transition: background-color .15s ease; }
.deal-row:hover { background: #f8fafc; }
details > summary::-webkit-details-marker { display: none; }

@media (prefers-reduced-motion: reduce) {
  .hero-enter, .hero-enter-2 { animation: none; }
  .lift:hover, .pcard:hover, .btn-press:hover, .btn-press:active,
  .pcard:hover .pcard-img, .group:hover .arrow-nudge { transform: none; }
}
