/* ===== OnlyFanHats design system ===== */
:root {
  --bg: #f6f4ef;
  --bg-warm: #fbeee1;
  --surface: #ffffff;
  --surface-2: #f1efe8;
  --surface-3: #e8e4d9;
  --line: #e5e0d3;
  --line-strong: #d8d1bf;
  --ink: #211d18;
  --ink-2: #5b544a;
  --ink-3: #938c7e;
  --accent: #e2572b;        /* sunbaked orange-red */
  --accent-dark: #c2451e;
  --accent-soft: #fce3d6;
  --accent-ink: #fff;
  --sun: #f2a03d;           /* solar-panel gold */
  --sky: #3d8fa6;           /* used sparingly for the solar badge */
  --ok: #2e9e6b;
  --dark: #201d1a;
  --dark-2: #2c2822;
  --shadow-sm: 0 1px 2px rgba(30,20,10,.06), 0 1px 3px rgba(30,20,10,.05);
  --shadow-md: 0 6px 18px rgba(30,20,10,.10), 0 2px 6px rgba(30,20,10,.06);
  --shadow-lg: 0 22px 60px rgba(30,20,10,.20), 0 8px 20px rgba(30,20,10,.12);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --display: 'Fraunces', Georgia, serif;
  --wrap: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.1; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }

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

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); transition: transform .1s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn--primary:hover { background: var(--accent-dark); }
.btn--dark { background: var(--dark); color: #fff; border-color: transparent; }
.btn--dark:hover { background: var(--dark-2); }
.btn--ghost { background: transparent; border-color: var(--line-strong); box-shadow: none; }
.btn--ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn--sm { height: 38px; padding: 0 16px; font-size: 13.5px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(246,244,239,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header__row { display: flex; align-items: center; gap: 20px; height: 74px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: .1px; }
.brand__mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--accent), var(--sun)); display: grid; place-items: center; box-shadow: var(--shadow-sm); flex: none; }
.brand__mark svg { width: 22px; height: 22px; color: #fff; }
.brand__mark.spin svg { animation: spin 2.4s linear infinite; }
.brand__fan { color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.site-nav { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.site-nav a { padding: 8px 12px; border-radius: 8px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); transition: background .12s, color .12s; }
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.header__spacer { flex: 1; }
.cart-btn { position: relative; display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 16px; border-radius: 999px; background: var(--dark); color: #fff; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-sm); transition: transform .1s, background .15s; }
.cart-btn:hover { background: var(--dark-2); transform: translateY(-1px); }
.cart-btn svg { width: 18px; height: 18px; }
.cart-btn__count { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); font-size: 11.5px; display: grid; place-items: center; }
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 10px; align-items: center; justify-content: center; }
.nav-toggle svg { width: 22px; height: 22px; }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; padding: 64px 0 40px; }
.hero__bg { position: absolute; inset: 0; z-index: -1; background: radial-gradient(1100px 520px at 82% -10%, var(--bg-warm), transparent 60%); }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5vw, 62px); font-weight: 600; letter-spacing: -.01em; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero__sub { margin-top: 20px; font-size: 18px; color: var(--ink-2); max-width: 480px; }
.hero__cta { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero__stats { margin-top: 38px; display: flex; gap: 28px; flex-wrap: wrap; }
.hero__stat b { display: block; font-family: var(--display); font-size: 26px; font-weight: 600; }
.hero__stat span { font-size: 12.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.hero__art { position: relative; display: grid; place-items: center; }
.hero__art-glow { position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 68%); z-index: 0; }
.hero__art img { position: relative; z-index: 1; width: 88%; height: auto; filter: drop-shadow(0 30px 40px rgba(30,20,10,.22)); }
.hero__art .float-badge { position: absolute; z-index: 2; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 12px 16px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.hero__art .float-badge svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.hero__art .float-badge--1 { top: 8%; left: -4%; animation: float 5s ease-in-out infinite; }
.hero__art .float-badge--2 { bottom: 10%; right: -6%; animation: float 5s ease-in-out infinite 1.4s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ===== Feature strip ===== */
.strip { padding: 30px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.strip__row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.strip__item { display: flex; align-items: center; gap: 12px; flex: 1 1 200px; min-width: 0; }
.strip__ico { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-dark); display: grid; place-items: center; flex: none; }
.strip__ico svg { width: 22px; height: 22px; }
.strip__item b { display: block; font-size: 14.5px; }
.strip__item span { font-size: 12.5px; color: var(--ink-3); }

/* ===== Section shell ===== */
.section { padding: 84px 0; }
.section-head { max-width: 640px; margin: 0 0 44px; }
.section-head .eyebrow { display: inline-block; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--accent-dark); margin-bottom: 10px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 600; }
.section-head p { margin-top: 14px; font-size: 16.5px; color: var(--ink-2); }

/* ===== Product family ===== */
.family { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: center; }
.family:nth-child(even) { direction: rtl; }
.family:nth-child(even) > * { direction: ltr; }
.family + .family { margin-top: 88px; padding-top: 88px; border-top: 1px solid var(--line); }
.family__stage { position: relative; border-radius: var(--radius-lg); background: var(--surface-2); aspect-ratio: 1.05; display: grid; place-items: center; overflow: hidden; }
.family__stage img { width: 78%; height: auto; transition: opacity .18s ease; filter: drop-shadow(0 22px 30px rgba(30,20,10,.16)); }
.family__badge { position: absolute; top: 18px; left: 18px; background: var(--dark); color: #fff; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; padding: 6px 12px; border-radius: 999px; }
.family__name { font-size: clamp(26px, 3vw, 34px); font-weight: 600; }
.family__tagline { margin-top: 10px; font-size: 16px; color: var(--ink-2); }
.family__desc { margin-top: 16px; font-size: 15px; color: var(--ink-2); line-height: 1.65; }
.family__features { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.family__features li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-2); }
.family__features svg { width: 16px; height: 16px; color: var(--ok); flex: none; }
.family__price-row { margin-top: 26px; display: flex; align-items: baseline; gap: 10px; }
.family__price { font-family: var(--display); font-size: 30px; font-weight: 600; }
.family__compare { font-size: 16px; color: var(--ink-3); text-decoration: line-through; }
.family__save { font-size: 12.5px; font-weight: 700; color: var(--accent-dark); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; }
.swatches { margin-top: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line-strong); cursor: pointer; position: relative; transition: box-shadow .12s, transform .12s; flex: none; }
.swatch:hover { transform: translateY(-1px); }
.swatch.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.swatch__label { font-size: 13px; color: var(--ink-2); margin-left: 4px; }
.family__buy { margin-top: 26px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; height: 48px; overflow: hidden; }
.qty button { width: 40px; height: 100%; font-size: 18px; font-weight: 600; color: var(--ink-2); }
.qty button:hover { background: var(--surface-2); }
.qty span { width: 32px; text-align: center; font-weight: 600; font-size: 15px; }

/* ===== Footer ===== */
.site-footer { background: var(--dark); color: #cfcac2; padding: 56px 0 28px; margin-top: 40px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer__brand .brand { color: #fff; }
.footer__brand p { margin-top: 14px; font-size: 14px; color: #a29c92; max-width: 320px; line-height: 1.6; }
.footer__col h4 { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #877f74; margin-bottom: 14px; }
.footer__col a, .footer__col span { display: block; font-size: 14px; color: #cfcac2; margin-bottom: 10px; }
.footer__col a:hover { color: #fff; }
.footer__bottom { margin-top: 44px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: #877f74; }

/* ===== Cart drawer ===== */
.cart-overlay { position: fixed; inset: 0; background: rgba(20,16,10,.42); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.cart-overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); z-index: 61; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .24s cubic-bezier(.4,0,.2,1); }
.cart-drawer.open { transform: translateX(0); }
.cart-drawer__head { display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.cart-drawer__head h3 { font-size: 19px; font-weight: 600; flex: 1; }
.cart-drawer__close { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2); }
.cart-drawer__close:hover { background: var(--surface-2); }
.cart-drawer__body { flex: 1; overflow-y: auto; padding: 8px 22px; }
.cart-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 60px 20px; color: var(--ink-3); }
.cart-empty svg { width: 46px; height: 46px; opacity: .5; }
.cart-line { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 68px; height: 68px; object-fit: contain; background: var(--surface-2); border-radius: var(--radius-sm); flex: none; padding: 6px; }
.cart-line__info { flex: 1; min-width: 0; }
.cart-line__name { font-size: 14.5px; font-weight: 600; }
.cart-line__variant { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.cart-line__row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 10px; }
.cart-line__price { font-size: 14px; font-weight: 600; }
.cart-line__remove { font-size: 12.5px; color: var(--ink-3); text-decoration: underline; }
.cart-line__remove:hover { color: var(--accent-dark); }
.qty--sm { height: 32px; }
.qty--sm button { width: 30px; font-size: 15px; }
.qty--sm span { width: 24px; font-size: 13.5px; }
.cart-drawer__foot { padding: 20px 22px 24px; border-top: 1px solid var(--line); }
.cart-subtotal { display: flex; justify-content: space-between; font-size: 15.5px; font-weight: 600; margin-bottom: 14px; }
.cart-note { font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 12px; }

/* ===== Toast ===== */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--dark); color: #fff; font-size: 14px; font-weight: 500; padding: 13px 20px; border-radius: 999px; box-shadow: var(--shadow-lg); z-index: 70; display: flex; align-items: center; gap: 10px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 18px; height: 18px; color: var(--ok); }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { order: -1; max-width: 420px; margin: 0 auto; }
  .family, .family:nth-child(even) { grid-template-columns: 1fr; direction: ltr; }
  .family__stage { max-width: 420px; margin: 0 auto; width: 100%; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .site-nav { position: fixed; top: 74px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 20px 16px; gap: 2px; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .16s, transform .16s; }
  .site-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .site-nav a { padding: 12px 10px; }
  .nav-toggle { display: inline-flex; }
  .header__cart-label { display: none; }
  .strip__row { justify-content: flex-start; }
  .strip__item { flex: 1 1 45%; }
  .family__features { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
}
@media (max-width: 480px) {
  .hero__stats { gap: 20px; }
  .hero__cta .btn { flex: 1 1 auto; }
  .cart-drawer { width: 100vw; }
}
