/*
 * Enter any custom CSS here.
 * This file will not be overwritten by theme updates.
 *
 * ── Semantic class hooks (sa-*) ────────────────────────────────────────────
 * Every section, snippet and key element carries a stable `sa-` class you can
 * target with plain CSS — no Tailwind rebuild needed. These classes ship with
 * NO styles of their own; they exist purely as selectors for you to hook onto.
 *
 * Page scope   body.sa-tpl-<template>      e.g. .sa-tpl-product, .sa-tpl-shop
 * Chrome       .sa-header .sa-navbar .sa-footer
 *              .sa-navbar-link .sa-navbar-logo .sa-navbar-cart .sa-footer-link
 * Sections     .sa-<component>             e.g. .sa-hero, .sa-features, .sa-faq
 *   variant    .sa-<component>--<variant>  e.g. .sa-hero--split-media
 *   inner      .sa-<component>-title / -subtitle / -eyebrow / -media /
 *              -items / -item / -actions / -link / -price / -badge / -icon
 * Primitives   .sa-btn (+ .sa-btn--<variant>), .sa-section-header
 *              (.sa-section-title / -eyebrow / -subtitle),
 *              .sa-product-card (+ .sa-product-card--<style>,
 *              .sa-product-card-title / -price / -stock / -status),
 *              .sa-product-form + .sa-add-to-cart, .sa-product-gallery,
 *              .sa-cart-panel + .sa-cart-item, .sa-searchbar, .sa-pagination,
 *              .sa-breadcrumbs, .sa-toasts + .sa-toast, .sa-feedback-card
 *
 * Example — bigger hero heading only on the product page:
 *   .sa-tpl-product .sa-hero-title { font-size: 3rem; }
 * ───────────────────────────────────────────────────────────────────────────
*/

/* ------------------------------------------------------------------ */
/* Global smoothness                                                   */
/* ------------------------------------------------------------------ */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Slim, accent-colored scrollbar */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--cl-accent), 0.5) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(var(--cl-accent), 0.45);
  border-radius: 9999px;
  border: 2px solid rgb(var(--cl-background));
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(var(--cl-accent), 0.7);
}

/* Text selection tinted with the accent color */
::selection {
  background-color: rgba(var(--cl-accent), 0.35);
  color: rgb(var(--cl-t-primary));
}

/* ------------------------------------------------------------------ */
/* Magnetic cursor-glow on primary buttons                             */
/* A soft light follows the cursor inside the button. Purely additive: */
/* falls back to the normal hover state if JS never sets the vars.     */
/* ------------------------------------------------------------------ */

.sa-btn {
  position: relative;
  overflow: hidden;
}

.sa-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    160px circle at var(--sa-mx, 50%) var(--sa-my, 50%),
    rgba(255, 255, 255, 0.25),
    transparent 70%
  );
  transition: opacity 0.25s ease;
}

.sa-btn:hover::after {
  opacity: 1;
}

/* ------------------------------------------------------------------ */
/* Back-to-top button (injected by custom.js)                          */
/* ------------------------------------------------------------------ */

.sa-back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgb(var(--cl-accent));
  color: rgb(var(--cl-on-accent));
  box-shadow: 0 10px 30px rgba(var(--cl-accent), 0.35);
  border: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.sa-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.sa-back-to-top:hover {
  transform: translateY(-3px) scale(1.05);
}

.sa-back-to-top:active {
  transform: translateY(0) scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  .sa-back-to-top {
    transition: opacity 0.15s ease, visibility 0.15s;
  }
}

/* ------------------------------------------------------------------ */
/* Bonfire ambience — calm animated flame background                   */
/* Two fixed, pointer-events-none layers sit behind ALL page content:  */
/*   ::before — slow-breathing warm glow low on the screen             */
/*   ::after  — tiny embers drifting upward, fading out near the top   */
/* Both are intentionally low-opacity: felt, not noticed. Respects     */
/* light scheme and prefers-reduced-motion.                            */
/* ------------------------------------------------------------------ */

body {
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background:
    radial-gradient(ellipse 62% 42% at 12% 102%, rgba(255, 96, 20, 0.16), transparent 70%),
    radial-gradient(ellipse 58% 46% at 88% 104%, rgba(255, 56, 0, 0.14), transparent 72%),
    radial-gradient(ellipse 75% 55% at 50% 108%, rgba(255, 150, 40, 0.13), transparent 75%),
    radial-gradient(ellipse 40% 30% at 50% -6%, rgba(255, 120, 40, 0.05), transparent 70%);
  animation: sa-flame-breathe 11s ease-in-out infinite alternate;
}

body::after {
  z-index: -1;
  opacity: 0.8;
  background-image:
    radial-gradient(1.6px 1.6px at 20% 92%, rgba(255, 189, 110, 0.85), transparent 60%),
    radial-gradient(1.2px 1.2px at 68% 88%, rgba(255, 140, 60, 0.75), transparent 60%),
    radial-gradient(1.8px 1.8px at 42% 96%, rgba(255, 205, 130, 0.65), transparent 60%),
    radial-gradient(1.3px 1.3px at 85% 90%, rgba(255, 110, 30, 0.8), transparent 60%),
    radial-gradient(1.5px 1.5px at 8% 85%, rgba(255, 170, 80, 0.7), transparent 60%),
    radial-gradient(1.4px 1.4px at 55% 90%, rgba(255, 130, 40, 0.75), transparent 60%);
  background-size: 190px 240px, 150px 280px, 210px 200px, 170px 260px, 200px 230px, 160px 250px;
  background-repeat: repeat;
  -webkit-mask-image: linear-gradient(to top, black 0%, transparent 78%);
  mask-image: linear-gradient(to top, black 0%, transparent 78%);
  animation: sa-embers-rise 16s linear infinite;
}

@keyframes sa-flame-breathe {
  0% { opacity: 0.8; }
  100% { opacity: 1; }
}

@keyframes sa-embers-rise {
  from {
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
  }
  to {
    background-position:
      0 -240px, 0 -280px, 0 -200px,
      0 -260px, 0 -230px, 0 -250px;
  }
}

[data-scheme="light"] body::before {
  opacity: 0.55;
}

[data-scheme="light"] body::after {
  opacity: 0.4;
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none !important;
  }
}

/* ------------------------------------------------------------------ */
/* Product card — warm glow + gentle tilt on hover                     */
/* Works with every card_style variant. custom.js sets --card-rx /     */
/* --card-ry (tilt angle) and --card-mx / --card-my (glow position) on */
/* pointermove; without JS (or with reduced motion) it still gets a    */
/* clean lift + glow, just without the tilt/cursor-follow.             */
/* ------------------------------------------------------------------ */

.sa-product-card {
  --card-rx: 0deg;
  --card-ry: 0deg;
  --card-mx: 50%;
  --card-my: 50%;
  position: relative;
  overflow: hidden;
  transform: perspective(900px) rotateX(var(--card-rx)) rotateY(var(--card-ry)) translateY(0) scale(1);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
  will-change: transform;
}

.sa-product-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(240px circle at var(--card-mx) var(--card-my), rgba(255, 150, 60, 0.28), transparent 65%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.sa-product-card:hover {
  transform: perspective(900px) rotateX(var(--card-rx)) rotateY(var(--card-ry)) translateY(-6px) scale(1.015);
  border-color: rgba(255, 130, 40, 0.5);
  box-shadow:
    0 0 0 1px rgba(255, 130, 40, 0.25),
    0 22px 44px -14px rgba(255, 90, 20, 0.45),
    0 0 42px -6px rgba(255, 140, 50, 0.4);
}

.sa-product-card:hover::after {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .sa-product-card {
    transition: box-shadow 0.35s ease, border-color 0.35s ease;
    transform: none !important;
  }
}

/* ------------------------------------------------------------------ */
/* Stats — minimal, no-background variant (sa-stats--minimal)          */
/* Big gradient numbers, a small icon, and a bar that grows on hover.  */
/* No card, no border, no fill — just clean modern type.               */
/* ------------------------------------------------------------------ */

.sa-stats-minimal .sa-stat-min-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.85rem;
  border-radius: 9999px;
  font-size: 1.05rem;
  color: rgb(var(--cl-accent));
  background: rgba(var(--cl-accent), 0.12);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.35s ease;
}

.sa-stat-min:hover .sa-stat-min-icon {
  transform: scale(1.12) rotate(-6deg);
  background: rgba(var(--cl-accent), 0.2);
}

.sa-stat-min-value {
  display: block;
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, rgb(var(--cl-accent)) 0%, rgb(var(--cl-t-primary)) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sa-stat-min-label {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--cl-t-muted));
}

.sa-stat-min-bar {
  display: block;
  margin-top: 0.9rem;
  width: 2rem;
  height: 3px;
  border-radius: 9999px;
  background: rgba(var(--cl-accent), 0.4);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.35s ease;
}

.sa-stat-min:hover .sa-stat-min-bar {
  width: 3.5rem;
  background: rgb(var(--cl-accent));
}

@media (prefers-reduced-motion: reduce) {
  .sa-stat-min-icon,
  .sa-stat-min-bar {
    transition: none;
  }
}
