/* =================================================================
   SHUBH SUPPLIES — REFINE LAYER  ·  v1
   Premium, on-brand polish. Loads AFTER style.css + enhancements.css.
   100% additive & reversible — remove the <link> in header.php to undo.
   Theme-aware (uses existing CSS variables → works in dark & light).
   All keyframes prefixed  rf*  to avoid collisions.
   Fully disabled under prefers-reduced-motion (see bottom).
   ================================================================= */

/* ── 0. EXTRA TOKENS (luminous gold + depth) ──────────────────── */
:root,
:root[data-theme="dark"] {
  --rf-grain-opacity: 0.05;
  --rf-aura-1: rgba(122, 150, 101, 0.20);   /* sage  */
  --rf-aura-2: rgba(212, 172, 94, 0.16);    /* gold  */
  --rf-aura-3: rgba(217, 127, 86, 0.10);    /* terra */
  --rf-grid: rgba(245, 239, 225, 0.05);
  --rf-card-sheen: rgba(255, 255, 255, 0.06);
}
:root[data-theme="light"] {
  --rf-grain-opacity: 0.035;
  --rf-aura-1: rgba(122, 150, 101, 0.16);
  --rf-aura-2: rgba(184, 146, 62, 0.14);
  --rf-aura-3: rgba(184, 85, 48, 0.08);
  --rf-grid: rgba(42, 38, 32, 0.045);
  --rf-card-sheen: rgba(42, 38, 32, 0.03);
}

/* ── 1. ARTISANAL GRAIN — fine film texture over everything ───── */
/* Tiny static SVG noise → gives an earthy, hand-made, premium feel. */
body::after {
  content: '';
  position: fixed; inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: var(--rf-grain-opacity);
  /* No mix-blend-mode: a full-screen blended layer over -webkit-background-clip:text
     (morph word, stat numbers) can freeze their paint in Safari. Plain overlay is safe. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ── 2. HERO — breathing aurora + sacred-geometry dot grid ────── */
.hero { isolation: isolate; }

/* 2a. Slow breathing aurora wash (GPU: transform/opacity only) */
.hero::before {
  content: '';
  position: absolute; inset: -20%;
  z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 50% at 25% 30%, var(--rf-aura-1), transparent 70%),
    radial-gradient(45% 55% at 78% 68%, var(--rf-aura-2), transparent 70%),
    radial-gradient(35% 40% at 60% 20%, var(--rf-aura-3), transparent 70%);
  filter: blur(20px);
  animation: rfAuroraDrift 22s ease-in-out infinite;
}
@keyframes rfAuroraDrift {
  0%, 100% { transform: translate3d(0,0,0) scale(1); opacity: 0.9; }
  50%      { transform: translate3d(-2%, 2%, 0) scale(1.08); opacity: 1; }
}

/* 2b. Fine dot grid (Vedic geometry) — masked to fade out toward edges */
.hero::after {
  content: '';
  position: absolute; inset: 0;
  z-index: 0; pointer-events: none;
  background-image: radial-gradient(var(--rf-grid) 1px, transparent 1.4px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 0%, transparent 75%);
  opacity: 0.7;
}

/* Keep content above the new layers */
.hero-content, .hero-visual, .hero-orb, .hero-big-text,
.scroll-indicator { position: relative; z-index: 2; }
.hero-orb { z-index: 1; }

/* 2c. Eyebrow — add a soft living pulse dot before the text */
.hero-eyebrow { position: relative; }
.hero-eyebrow::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 var(--gold-glow);
  margin-right: 0.1rem;
  flex: 0 0 auto;
  animation: rfDotPulse 2.6s ease-out infinite;
}
@keyframes rfDotPulse {
  0%   { box-shadow: 0 0 0 0 var(--gold-glow); }
  70%  { box-shadow: 0 0 0 8px rgba(212,172,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(212,172,94,0); }
}

/* 2d. (removed) A title light-sweep used to live here, but an animating
   mix-blend-mode layer over the gradient-clipped morph word froze its
   paint in Safari. The morph word IS the hero's centerpiece — left clean. */

/* 2e. Hero primary CTA — gentle gold aura breathing (draws the eye) */
.hero-actions .btn-primary {
  animation: rfCtaAura 3.6s ease-in-out infinite;
}
@keyframes rfCtaAura {
  0%, 100% { box-shadow: 0 4px 20px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,0.2); }
  50%      { box-shadow: 0 6px 30px var(--gold-glow), 0 0 28px var(--gold-pale), inset 0 1px 0 rgba(255,255,255,0.28); }
}

/* ── 3. MARQUEE — soft fade edges instead of hard cut ─────────── */
.marquee-section {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
.marquee-section:hover .marquee-track { animation-play-state: paused; }

/* ── 4. SECTION LABEL + DIVIDER — living accents ──────────────── */
.section-label::after {
  content: '';
  display: inline-block;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold);
  margin-left: 0.5rem;
  vertical-align: middle;
  box-shadow: 0 0 8px var(--gold-glow);
}
/* animated shimmer travelling along the gold divider */
.divider { position: relative; overflow: hidden; }
.divider::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
  transform: translateX(-100%);
  animation: rfDividerShine 4.5s ease-in-out infinite;
}
@keyframes rfDividerShine {
  0%, 55% { transform: translateX(-100%); }
  85%, 100% { transform: translateX(200%); }
}

/* ── 5. PRODUCT CARDS — gradient glow-ring on hover + sheen ───── */
.product-card { isolation: isolate; }
.product-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--gold), transparent 35%, transparent 65%, var(--sage-l));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
  pointer-events: none;
  z-index: 3;
}
.product-card:hover::before { opacity: 0.9; }
/* subtle top inner highlight for depth */
.product-card-body { position: relative; }
.product-card-body::before {
  content: '';
  position: absolute; top: 0; left: 1.4rem; right: 1.4rem; height: 1px;
  background: linear-gradient(90deg, transparent, var(--rf-card-sheen), transparent);
  pointer-events: none;
}

/* Category cards — same elegant glow ring */
.cat-card { isolation: isolate; }
.cat-card::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow 0.5s var(--ease-out);
  pointer-events: none; z-index: 3;
}
.cat-card:hover::after { box-shadow: inset 0 0 0 1px var(--border-strong); }

/* ── 6. STATS — gradient-clipped luminous numbers ─────────────── */
.stat-number {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── 7. USP ICONS — soft halo on hover ────────────────────────── */
.usp-item:hover .usp-icon {
  filter: drop-shadow(0 6px 16px var(--gold-pale));
}

/* ── 8. NEWSLETTER BAND — slow rotating conic shine ───────────── */
.newsletter-band { position: relative; overflow: hidden; isolation: isolate; }
.newsletter-band::after {
  content: '';
  position: absolute; inset: -50%;
  z-index: -1; pointer-events: none;
  background: conic-gradient(from 0deg,
      transparent 0deg, var(--gold-pale) 60deg,
      transparent 140deg, transparent 220deg,
      var(--sage-pale) 280deg, transparent 360deg);
  opacity: 0.5;
  animation: rfConicSpin 26s linear infinite;
}
@keyframes rfConicSpin { to { transform: rotate(360deg); } }

/* ── 9. INPUTS — softer, more premium focus glow ──────────────── */
.newsletter-form input:focus,
input[type="email"]:focus, input[type="text"]:focus {
  box-shadow: 0 0 0 3px var(--gold-pale), 0 0 18px var(--gold-pale);
  transition: box-shadow var(--t-base) var(--ease-out);
}

/* ── 10. SCROLLBAR — on-brand (WebKit) ────────────────────────── */
* { scrollbar-color: var(--sage-d) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--sage-d), var(--moss));
  border-radius: 999px;
  border: 2px solid var(--bg-soft);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(var(--sage), var(--sage-d)); }

/* ── 11. SELECTION colour ─────────────────────────────────────── */
::selection { background: var(--gold-pale); color: var(--text); }

/* ── 12. SMOOTHER SECTION RHYTHM (subtle hairline between bands) ─ */
section + section { position: relative; }

/* ── 13. ACCESSIBILITY — skip-to-content link (keyboard/screen reader) */
.skip-link {
  position: fixed; top: -100px; left: 16px; z-index: 10001;
  background: var(--gold); color: #1a1a1a;
  padding: 0.7rem 1.2rem; border-radius: var(--radius-sm, 8px);
  font-weight: 700; font-size: 0.85rem; letter-spacing: 0.04em;
  box-shadow: var(--shadow-lg);
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 16px; outline: 2px solid #1a1a1a; outline-offset: 2px; }

/* ── 14. NAVIGATION — make the Shop dropdown keyboard-accessible ─
   Previously hover-only (mouse users only). :focus-within lets keyboard
   users Tab into Shop and reach Herbs/Gems. Mirrors the :hover reveal. */
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ── 15. SVG ICONS (replacing emoji) — sizing & alignment ──────── */
.svg-icon { flex-shrink: 0; vertical-align: -0.18em; }

/* Mobile menu links: icon + label, gold accent */
.mobile-link { gap: 0.8rem; }
.mobile-link .svg-icon { color: var(--gold); }
.mobile-theme-toggle .svg-icon { color: var(--gold); margin-right: 0.4rem; }

/* Desktop dropdown: switch to flex so icon + text align cleanly */
.dropdown-link { display: flex; align-items: center; gap: 0.6rem; }

/* Footer social brand glyphs */
.social-btn .svg-icon { color: var(--text-soft); transition: color var(--t-base) var(--ease-out); }
.social-btn:hover .svg-icon { color: #1a1a1a; }

/* Footer contact icons */
.footer-contact-item > span:first-child { display: flex; align-items: flex-start; }
.footer-contact-item .svg-icon { color: var(--gold); display: block; margin-top: 1px; }

/* USP strip icons (large, gold) */
.usp-icon { display: inline-flex; }
.usp-icon .svg-icon { color: var(--gold); }

/* Cart empty-state icon */
.empty-icon .svg-icon { color: var(--sage-l); }

/* ════════════════════════════════════════════════════════════════
   REDUCED MOTION — calm everything down for sensitive users
   ════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .hero::before,
  .hero-eyebrow::before,
  .hero-actions .btn-primary,
  .divider::after,
  .newsletter-band::after {
    animation: none !important;
  }
  .divider::after { display: none !important; }
}
