/* =========================================================================
   Sarah Business Inc. — enamel-pin storefront design system
   Signature: enamel-pin cards (metal ring + glossy shine) on pegboard dot-grid
   ========================================================================= */
:root {
  --brand:   #6C4AB6;   /* enamel violet */
  --brand-d: #573a97;
  --brand-2: #F25F7C;   /* enamel coral */
  --accent:  #F4B740;   /* metal / amber gold */
  --mint:    #2FB8A6;
  --ink:     #241C2E;   /* deep aubergine text */
  --muted:   #6d6478;
  --bg:      #FAF6F1;   /* warm porcelain */
  --card:    #FFFFFF;
  --line:    #E9E1D7;
  --line-2:  #d9cfc2;
  --danger:  #d64550;
  --ok:      #2f9e6f;

  --radius:   20px;
  --radius-sm:12px;
  --radius-pill:999px;
  --shadow:   0 6px 22px rgba(36,28,46,.10);
  --shadow-lg:0 18px 50px rgba(36,28,46,.16);
  --ring:     0 0 0 3px rgba(108,74,182,.35);

  --font-display: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;

  --maxw: 1120px;
  --gap: 22px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1rem; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--tight { padding-block: 2rem; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.center { text-align: center; }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .18em;
  font-size: .72rem; color: var(--brand); font-weight: 700; }
.grid { display: grid; gap: var(--gap); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.hide { display: none !important; }

/* ---------- header / nav (built by layout.js) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,246,241,.86); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 18px; height: 68px; position: relative; }
.header-collapse { display: flex; align-items: center; gap: 10px; flex: 1; }
.brand-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display);
  font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand-logo:hover { text-decoration: none; }
.brand-logo__mark { width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff6, transparent 42%),
    conic-gradient(from 210deg, var(--brand), var(--brand-2), var(--accent), var(--brand));
  box-shadow: inset 0 0 0 3px #fff, 0 2px 6px rgba(0,0,0,.18); }
.nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.auth-area { display: flex; align-items: center; gap: 8px; }
.nav a { color: var(--ink); padding: 8px 12px; border-radius: var(--radius-pill); font-weight: 600; }
.nav a:hover { background: #efe7f7; text-decoration: none; }
.nav a.is-active { color: var(--brand-d); background: #efe7f7; }
.header-spacer { flex: 1; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--radius-pill); font-weight: 600; color: var(--ink); }
.cart-link:hover { background: #efe7f7; text-decoration: none; }
.cart-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill);
  background: var(--brand-2); color: #fff; font-size: .72rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; }
.nav-toggle { display: none; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #efe9f2; margin-top: 3rem; }
.site-footer a { color: #d9cbef; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between;
  padding-block: 2.4rem; }
.site-footer small { color: #b7acc4; }

/* ---------- buttons ---------- */
.btn { --b: var(--brand); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: .95rem; line-height: 1;
  padding: 12px 20px; border-radius: var(--radius-pill); border: 1px solid transparent;
  background: #fff; color: var(--ink); cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn--primary { background: linear-gradient(180deg, #7a57c6, var(--brand)); color: #fff;
  box-shadow: 0 8px 18px rgba(108,74,182,.32), inset 0 1px 0 rgba(255,255,255,.35); }
.btn--primary:hover { box-shadow: 0 12px 24px rgba(108,74,182,.4), inset 0 1px 0 rgba(255,255,255,.4); }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand-d); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- enamel-pin card (signature) ---------- */
.pin-card { position: relative; background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .16s ease, box-shadow .16s ease; }
.pin-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pin-card__imgwrap { position: relative; aspect-ratio: 1/1; background:
  radial-gradient(circle at 30% 25%, #fff, #f3eee7 70%); overflow: hidden; }
.pin-card__imgwrap::after { /* enamel shine */ content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 45%, rgba(255,255,255,.55) 50%, transparent 56%);
  opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.pin-card:hover .pin-card__imgwrap::after { opacity: 1; }
.pin-card__img { width: 100%; height: 100%; object-fit: cover; }
.pin-card__fav { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px;
  border-radius: 50%; border: none; background: rgba(255,255,255,.9); color: var(--brand-2);
  font-size: 1.05rem; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow);
  transition: transform .12s ease; }
.pin-card__fav:hover { transform: scale(1.08); }
.pin-card__fav.is-active { background: var(--brand-2); color: #fff; }
.pin-card__body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pin-card__cat { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand); }
.pin-card__title { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; margin: 0; }
.pin-card__title a { color: var(--ink); }
.pin-card__price { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.pin-card__foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 8px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: var(--radius-pill); background: #efe7f7; color: var(--brand-d);
  font-size: .74rem; font-weight: 700; }
.badge--soldout { background: #f3e2e4; color: var(--danger); }
.badge--stock { background: #e4f5ee; color: var(--ok); }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: .9rem; }
.input, .textarea, .select { font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 11px 13px; width: 100%; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.textarea { min-height: 110px; resize: vertical; }
.form-note { font-size: .85rem; color: var(--muted); }
.form-error { color: var(--danger); font-size: .88rem; font-weight: 600; min-height: 1em; }

/* ---------- feedback ---------- */
.alert { border-radius: var(--radius-sm); padding: 12px 16px; font-weight: 600; border: 1px solid transparent; }
.alert--error { background: #fbe9ea; color: #a3282f; border-color: #f2c9cc; }
.alert--success { background: #e4f5ee; color: #1c6b46; border-color: #bfe6d3; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty h3 { color: var(--ink); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-2);
  border-top-color: var(--brand); animation: spin .8s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex;
  flex-direction: column; gap: 10px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-weight: 600; max-width: 320px; animation: toast-in .2s ease; }
.toast--success { background: #1f7a52; }
.toast--error { background: #b23540; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- hero / pegboard ---------- */
.hero { position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 1.5px 1.5px, rgba(108,74,182,.16) 1.5px, transparent 0) 0 0 / 26px 26px,
    linear-gradient(160deg, #f3ecff 0%, var(--bg) 46%, #ffeef1 100%); }
.hero__inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.1fr .9fr;
  gap: 40px; align-items: center; padding-block: clamp(2.5rem, 7vw, 5.5rem); }
.hero__art { position: relative; min-height: 300px; }
.hero h1 span { color: var(--brand); }
@media (max-width: 820px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { min-height: 220px; }
}

/* decorative floating pin (used on hero) */
.pin-dot { position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff8, transparent 45%),
    conic-gradient(from 200deg, var(--brand), var(--brand-2), var(--accent), var(--brand));
  box-shadow: inset 0 0 0 4px #fff, var(--shadow-lg); }

/* ---------- responsive nav ---------- */
@media (max-width: 760px) {
  /* Collapse nav + auth into a toggle-revealed dropdown; cart + toggle stay visible. */
  .header-collapse { display: none; }
  .header-collapse.is-open {
    display: flex; flex-direction: column; align-items: stretch; gap: 6px;
    position: absolute; top: 68px; left: 0; right: 0; z-index: 60;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 14px 20px; box-shadow: var(--shadow);
  }
  .header-collapse.is-open .nav { flex-direction: column; align-items: stretch; margin: 0; gap: 2px; }
  .header-collapse.is-open .nav a { padding: 10px 12px; }
  .header-collapse.is-open .auth-area { flex-wrap: wrap; gap: 8px; margin-top: 6px; }
  .header-collapse.is-open .auth-area .btn { flex: 1; }
  .nav-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px;
    border-radius: 12px; border: 1px solid var(--line-2); background: #fff; cursor: pointer;
    margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
