/*
 * 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
 *              body.sa-no-product-images / .sa-no-category-images when the
 *              matching theme setting is off
 * 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 / -badges),
 *              .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; }
 * ───────────────────────────────────────────────────────────────────────────
*/

/* ── Page background: Aurora + Stars (light and dark) ─────────────────────
   Two fixed layers behind the content (#app sits at z-index 1):
     body::before  aurora: accent + rocket-pink light drifting at the top
     body::after   stars rising at three speeds, with fine film grain
   Colors and strength per scheme come from the --bgfx-* tokens below.
   data-bgfx="none" on <html> turns it off and brings back the theme glow. */
[data-scheme="dark"] {
  --bgfx-aurora: 1;
  --bgfx-star: 255, 255, 255;
  --bgfx-star-blue: 190, 200, 255;
  --bgfx-star-pink: 255, 150, 200;
  --bgfx-star-k: 1;
}

[data-scheme="light"] {
  --bgfx-aurora: 1.4;
  --bgfx-star: 45, 52, 140;
  --bgfx-star-blue: 92, 105, 242;
  --bgfx-star-pink: 225, 70, 150;
  --bgfx-star-k: 1;
}

html:not([data-bgfx="none"]) .page-fx {
  display: none;
}

html:not([data-bgfx="none"]) body::before,
html:not([data-bgfx="none"]) body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
}

html:not([data-bgfx="none"]) body::before {
  inset: -20%;
  background:
    radial-gradient(38% 32% at 22% 18%, rgba(var(--cl-accent), calc(0.32 * var(--bgfx-aurora))), transparent 70%),
    radial-gradient(30% 26% at 78% 14%, rgba(255, 90, 165, calc(0.16 * var(--bgfx-aurora))), transparent 70%),
    radial-gradient(34% 30% at 55% 6%, rgba(56, 189, 248, calc(0.08 * var(--bgfx-aurora))), transparent 70%),
    radial-gradient(40% 30% at 50% 100%, rgba(var(--cl-accent), calc(0.10 * var(--bgfx-aurora))), transparent 70%);
  filter: blur(20px);
  will-change: transform;
  animation: bgfx-aurora 26s ease-in-out infinite alternate;
}

html:not([data-bgfx="none"]) body::after {
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(var(--bgfx-star), calc(0.55 * var(--bgfx-star-k))), transparent 100%),
    radial-gradient(1px 1px at 90px 80px, rgba(var(--bgfx-star), calc(0.35 * var(--bgfx-star-k))), transparent 100%),
    radial-gradient(1.5px 1.5px at 140px 150px, rgba(var(--bgfx-star), calc(0.7 * var(--bgfx-star-k))), transparent 100%),
    radial-gradient(1px 1px at 60px 190px, rgba(var(--bgfx-star-blue), calc(0.5 * var(--bgfx-star-k))), transparent 100%),
    radial-gradient(2px 2px at 250px 90px, rgba(var(--bgfx-star), calc(0.8 * var(--bgfx-star-k))), transparent 100%),
    radial-gradient(1.5px 1.5px at 40px 280px, rgba(var(--bgfx-star-pink), calc(0.6 * var(--bgfx-star-k))), transparent 100%),
    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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  background-size:
    120px 120px,
    120px 120px,
    210px 210px,
    210px 210px,
    330px 330px,
    330px 330px,
    160px 160px;
  animation: bgfx-stars 140s linear infinite, bgfx-twinkle 6s ease-in-out infinite alternate;
}

@keyframes bgfx-aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(4%, 2%, 0) scale(1.06); }
  100% { transform: translate3d(-4%, 1%, 0) scale(1.02); }
}

@keyframes bgfx-stars {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to   { background-position: 0 -240px, 0 -240px, 0 -420px, 0 -420px, 0 -660px, 0 -660px, 0 0; }
}

@keyframes bgfx-twinkle {
  from { opacity: 0.75; }
  to   { opacity: 1; }
}

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

/* ── Announcement bar: links made clickable by custom.js ──────────────── */
.sa-announcement-link {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity var(--dur) ease;
}

.sa-announcement-link:hover {
  opacity: 0.8;
}

/* ── Dark scheme: cards lifted off the background ─────────────────────────
   Background is near-black (#07080C); cards get a lighter top-to-bottom
   gradient, a hairline top highlight and a deep shadow so they stand out. */
[data-scheme="dark"] .sa-product-card {
  background-image: linear-gradient(180deg, rgb(var(--cl-surface-raised)) 0%, rgb(var(--cl-surface)) 100%);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 28px -14px rgba(0, 0, 0, 0.9);
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease, transform var(--dur) ease;
}

[data-scheme="dark"] .sa-product-card:hover {
  border-color: rgba(var(--cl-accent), 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 34px -14px rgba(var(--cl-accent), 0.45);
}

/* lighter accent for prices so they pass contrast on the dark cards */
[data-scheme="dark"] .sa-product-card-price.text-accent-500 {
  color: #8C96FF;
}

[data-scheme="dark"] .sa-product-card-media {
  background-color: rgba(0, 0, 0, 0.25);
}

/* ── Card badges over the image: dark glass chip so the colored text reads
   on any picture (the inline style only sets a faint tint). ───────────── */
.sa-product-card-media .sa-product-card-badges > span {
  background-color: rgba(9, 10, 16, 0.78) !important;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.625rem;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}

.sa-product-card-media .sa-product-card-badges > span i {
  font-size: 0.625rem;
}

/* ── Home: smaller product/category cards ─────────────────────────────── */
.sa-tpl-shop .sa-products-items {
  gap: 1rem;
}

.sa-tpl-shop .sa-product-card--padded-detail {
  padding: 0.5rem;
}

.sa-tpl-shop .sa-product-card--padded-detail > div:not(.sa-product-card-media) {
  padding: 0.625rem 0.375rem 0.25rem;
}

.sa-tpl-shop .sa-product-card-title {
  font-size: 0.9375rem;
}

.sa-tpl-shop .sa-product-card-stock {
  font-size: 0.8125rem;
}

.sa-tpl-shop .sa-product-card--padded-detail .mt-3 {
  margin-top: 0.625rem;
}

.sa-tpl-shop .sa-product-card--padded-detail .size-8 {
  width: 1.75rem;
  height: 1.75rem;
}

.sa-tpl-shop .sa-products .sa-section-header {
  margin-bottom: 1.75rem;
}

/* Two cards per row on phones instead of one full-width card */
@media (max-width: 639px) {
  .sa-tpl-shop .sa-products-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .sa-tpl-shop .sa-product-card--padded-detail .size-8 {
    display: none;
  }

  .sa-tpl-shop .sa-product-card-title {
    font-size: 0.875rem;
  }
}

/* ── Home: SOLD | CUSTOMERS bar ───────────────────────────────────────── */
.sa-tpl-shop .sa-stats {
  padding-top: 2.5rem;
  padding-bottom: 0;
}

.sa-tpl-shop:has(.sa-stats) .sa-products {
  padding-top: 2.25rem;
}

.sa-tpl-shop .sa-stats-items {
  width: fit-content;
  max-width: 100%;
  justify-content: flex-start;
  gap: 0.5rem 1.25rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--cl-border);
  border-radius: 9999px;
  background-color: rgb(var(--cl-surface));
}

[data-scheme="dark"] .sa-tpl-shop .sa-stats-items {
  background-image: linear-gradient(180deg, rgb(var(--cl-surface-raised)) 0%, rgb(var(--cl-surface)) 100%);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* live dot */
.sa-tpl-shop .sa-stats-items::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: rgb(var(--cl-success));
  box-shadow: 0 0 0 4px rgba(var(--cl-success), 0.18);
}

/* label first, then the number: "SOLD 1,234" */
.sa-tpl-shop .sa-stats-item {
  flex-direction: row-reverse;
  align-items: baseline;
  gap: 0.5rem;
}

.sa-tpl-shop .sa-stats-item .text-h2 {
  font-family: var(--ff-body);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.sa-tpl-shop .sa-stats-item > span:not(.text-h2) {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sa-tpl-shop .sa-stats-items > span[aria-hidden="true"] {
  height: 1.125rem;
}