* 🤖 caek.shop — main stylesheet */ @font-face {
  font-family: "Maple Mono";
  src: url("fonts/MapleMono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* =====================================================================
   1. TOKENS
   ===================================================================== */

:root {
  /* ---------- Gruvbox Dark ---------- */

  /* Darker background */
  --gruvD-bg: #282828;
  --gruvD-bg0: #282828;
  --gruvD-bg0_h: #1d2021; /* slightly darker */
  --gruvD-bg0_s: #32302f; /* slightly lighter */
  --gruvD-bg1: #3c3836;
  --gruvD-bg2: #504945;

  /* Lighter background */
  --gruvD-bg3: #665c54;
  --gruvD-bg4: #7c6f64;

  /* Foreground */
  --gruvD-fg: #ebdbb2;
  --gruvD-fg0: #fbf1c7;
  --gruvD-fg1: #ebdbb2;
  --gruvD-fg2: #d5c4a1;
  --gruvD-fg3: #bdae93;
  --gruvD-fg4: #a89984;

  /* Bright colours */
  --gruv-red: #fb4934;
  --gruv-green: #b8bb26;
  --gruv-yellow: #fabd2f;
  --gruv-blue: #83a598;
  --gruv-purple: #d3869b;
  --gruv-aqua: #8ec07c;
  --gruv-orange: #fe8019;
  --gruv-gray: #a89984;

  /* Alt colours */
  --gruvD-red-alt: #cc241d;
  --gruvD-green-alt: #98971a;
  --gruvD-yellow-alt: #d79921;
  --gruvD-blue-alt: #458588;
  --gruvD-purple-alt: #b16286;
  --gruvD-aqua-alt: #689d6a;
  --gruvD-orange-alt: #d65d0e;
  --gruvD-gray-alt: #928374;

  /* ---------- Gruvbox Light ---------- */

  /* Lighter background */
  --gruvL-bg: #fbf1c7;
  --gruvL-bg0: #fbf1c7;
  --gruvL-bg0_h: #f9f5d7; /* slightly lighter */
  --gruvL-bg0_s: #f2e5bc; /* slightly darker */
  --gruvL-bg1: #ebdbb2;
  --gruvL-bg2: #d5c4a1;

  /* Darker background */
  --gruvL-bg3: #bdae93;
  --gruvL-bg4: #a89984;

  /* Foreground */
  --gruvL-fg: #3c3836;
  --gruvL-fg0: #282828;
  --gruvL-fg1: #3c3836;
  --gruvL-fg2: #504945;
  --gruvL-fg3: #665c54;
  --gruvL-fg4: #7c6f64;

  /* Alt colours (the darker versions gruvbox uses on light backgrounds) */
  --gruvL-red-alt: #9d0006;
  --gruvL-green-alt: #79740e;
  --gruvL-yellow-alt: #b57614;
  --gruvL-blue-alt: #076678;
  --gruvL-purple-alt: #8f3f71;
  --gruvL-aqua-alt: #427b58;
  --gruvL-orange-alt: #af3a03;
  --gruvL-gray-alt: #928374;
}

/* ---------- Theme ----------
   Follows the visitor's system setting by default.
   <html data-theme="light"> or <html data-theme="dark"> forces one.
   light-dark(LIGHT, DARK) picks a value based on color-scheme. */

:root {
  color-scheme: light dark;
}
:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}

:root {
  /* ---------- Roles: use these in components ---------- */
  --page: light-dark(
    var(--gruvL-bg0_h),
    var(--gruvD-bg0_h)
  ); /* page background */
  --surface: light-dark(var(--gruvL-bg), var(--gruvD-bg)); /* cards, panels */
  --surface-2: light-dark(
    var(--gruvL-bg1),
    var(--gruvD-bg1)
  ); /* inputs, raised */
  --line: light-dark(var(--gruvL-bg1), var(--gruvD-bg1)); /* quiet borders */
  --line-strong: light-dark(
    var(--gruvL-bg2),
    var(--gruvD-bg2)
  ); /* inputs, outlined buttons */
  --line-hover: light-dark(var(--gruvL-bg3), var(--gruvD-bg3));
  --text: light-dark(var(--gruvL-fg1), var(--gruvD-fg1));
  --text-2: light-dark(var(--gruvL-fg2), var(--gruvD-fg2)); /* body copy */
  --text-3: light-dark(var(--gruvL-fg4), var(--gruvD-fg4)); /* captions, meta */
  --text-strip: light-dark(
    var(--gruvL-fg3),
    var(--gruvD-fg3)
  ); /* top strip, small notes */

  /* Colours that stay readable in both themes: bright on dark, deep on light */
  --red: light-dark(var(--gruvL-red-alt), var(--gruv-red));
  --green: light-dark(var(--gruvL-green-alt), var(--gruv-green));
  --yellow: light-dark(var(--gruvL-yellow-alt), var(--gruv-yellow));
  --blue: light-dark(var(--gruvL-blue-alt), var(--gruv-blue));
  --purple: light-dark(var(--gruvL-purple-alt), var(--gruv-purple));
  --aqua: light-dark(var(--gruvL-aqua-alt), var(--gruv-aqua));
  --orange: light-dark(var(--gruvL-orange-alt), var(--gruv-orange));
  --gray: light-dark(var(--gruvL-gray-alt), var(--gruv-gray));

  --accent: var(--orange);
  --accent-hover: light-dark(var(--gruvL-red-alt), var(--gruv-yellow));
  --on-accent: light-dark(
    var(--gruvL-bg0_h),
    var(--gruvD-bg0_h)
  ); /* text on orange/green/etc. */

  /* ---------- Type ---------- */
  --font-sans:
    "Maple Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-mono: var(--font-sans); /* one font for the whole site */

  --text-xs: 0.75rem; /* 12px */
  --text-sm: 0.875rem; /* 14px */
  --text-base: 1rem; /* 16px */
  --text-md: 1.0625rem; /* 17px */
  --text-lg: 1.25rem; /* 20px */
  --text-xl: 1.5rem; /* 24px */
  --text-2xl: 1.75rem; /* 28px */
  --text-3xl: 2rem; /* 32px */
  --text-hero: clamp(2rem, 4.6vw, 3.5rem); /* 32px → 56px, mono runs wide */

  /* ---------- Spacing (4px steps, like Tailwind) ---------- */
  --space-1: 0.25rem; /*  4px */
  --space-2: 0.5rem; /*  8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem; /* 16px */
  --space-5: 1.25rem; /* 20px */
  --space-6: 1.5rem; /* 24px */
  --space-7: 1.75rem; /* 28px */
  --space-8: 2rem; /* 32px */
  --space-10: 2.5rem; /* 40px */
  --space-12: 3rem; /* 48px */
  --space-14: 3.5rem; /* 56px */
  --space-16: 4rem; /* 64px */

  /* ---------- Shape ---------- */
  --radius-sm: 6px; /* chips, badges */
  --radius: 10px; /* inputs, small buttons */
  --radius-md: 12px; /* buttons, images */
  --radius-lg: 14px; /* cards */
  --radius-xl: 18px; /* feature bands */

  --container: 1200px;
  --gutter: var(--space-4);
  --tap: 44px; /* minimum touch target */
  --ease: 150ms ease;
}

/* =====================================================================
   2. BASE
   ===================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  font-variant-ligatures: none; /* Maple ships coding ligatures; off for normal text */
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.15;
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-3xl);
}
h2 {
  font-size: var(--text-xl);
}
h3 {
  font-size: var(--text-lg);
}

p {
  text-wrap: pretty;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent-hover);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

/* ---------- Checkbox ---------- */

input[type="checkbox"] {
  accent-color: var(--accent);
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}

/* =====================================================================
   3. LAYOUT
   ===================================================================== */

/* Centred page column with side gutters */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-wide {
  max-width: 1680px;
}

/* Vertical rhythm between sections */
.page {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
  padding-block: var(--space-10) var(--space-16);
}
@media (min-width: 1024px) {
  .page {
    gap: var(--space-14);
  }
}

/* Stack: children in a column with a gap */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.stack-sm {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.stack-lg {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Cluster: children in a wrapping row (buttons, chips, links) */
.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* Row with space between (section headings with a "See all" link) */
.split {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

/* Two columns from tablet up, stacked on phones (hero, feature bands) */
.halves {
  display: grid;
  gap: var(--space-8);
  align-items: stretch;
}
@media (min-width: 768px) {
  .halves {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Put this on the item that should come first on phones */
@media (max-width: 767px) {
  .first-on-phone {
    order: -1;
  }
}

/* Grids named by column count: phone → tablet → desktop */
.grid {
  display: grid;
  gap: var(--space-4);
}
.grid-tight {
  gap: var(--space-3);
}

.grid-1-3 {
  grid-template-columns: 1fr;
} /* trust row */
.grid-2-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
} /* products */

@media (min-width: 768px) {
  .grid-1-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .grid-2-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* 2 → 5 grid with the last row centred (category cards).
   Each item spans 2 half-columns, so a short last row can start half a
   card in and sit in the middle. */
.grid-2-5 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid-2-5 > * {
  grid-column: span 2;
}
.grid-2-5 > :nth-child(2n + 1):last-child {
  grid-column: 2 / span 2;
} /* lone last item on phones */

@media (min-width: 1024px) {
  .grid-2-5 {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
  .grid-2-5 > :nth-child(2n + 1):last-child {
    grid-column: span 2;
  }
  .grid-2-5 > :nth-child(5n + 1):nth-last-child(4) {
    grid-column: 2 / span 2;
  } /* 4 left over */
  .grid-2-5 > :nth-child(5n + 1):nth-last-child(3) {
    grid-column: 3 / span 2;
  } /* 3 left over */
  .grid-2-5 > :nth-child(5n + 1):nth-last-child(2) {
    grid-column: 4 / span 2;
  } /* 2 left over */
  .grid-2-5 > :nth-child(5n + 1):nth-last-child(1) {
    grid-column: 5 / span 2;
  } /* 1 left over */
}

/* Sidebar + content (browse page). Sidebar stacks above on phones. */
.with-sidebar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-7);
  align-items: flex-start;
}
.with-sidebar > :first-child {
  flex: 1 1 240px;
}
.with-sidebar > :last-child {
  flex: 999 1 560px;
  min-width: 0;
}
@media (min-width: 1024px) {
  .with-sidebar > :first-child {
    flex: 0 0 240px;
  }
}

/* =====================================================================
   4. COMPONENTS
   ===================================================================== */

/* ---------- Top strip ---------- */
.top-strip {
  padding: var(--space-2) var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-strip);
}

/* ---------- Nav ---------- */
.site-header {
  background: var(--page);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding-block: 14px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 1px;
  color: var(--text);
  text-decoration: none;
  font-size: 22px;
  font-weight: 700;
}
.logo span {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--accent);
}
.logo:hover {
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: var(--space-1);
}
.nav-links a {
  padding: 10px var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition:
    background-color var(--ease),
    color var(--ease);
}
.nav-links a:hover {
  background: var(--surface);
  color: var(--text);
}
.nav-links a[aria-current="page"] {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.nav-spacer {
  flex: 1 1 auto;
}

/* Things that only show on desktop / only on phones */
.only-phone {
  display: none !important;
}
@media (max-width: 767px) {
  .only-desktop {
    display: none !important;
  }
  .only-phone {
    display: flex !important;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50; /* above cards, badges and images */
}

.nav-search {
  width: 260px;
} /* desktop search box */

/* Phone menu: a <details> dropdown under the nav bar */
.nav-menu > summary {
  list-style: none;
} /* hide the ▸ marker */
.nav-menu > summary::-webkit-details-marker {
  display: none;
}

.nav-menu-panel {
  position: absolute;
  top: 100%; /* just under the header */
  left: 0;
  right: 0;
  padding: var(--space-4) var(--gutter) var(--space-6);
  background: var(--page);
  border-bottom: 1px solid var(--line);
}
.nav-menu-panel a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding-block: var(--space-2);
}

/* ---------- Icon button (cart, menu, search on phone) ---------- */
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  transition: background-color var(--ease);
}
.icon-btn:hover {
  background: var(--surface);
  color: var(--text);
}
.icon-btn svg {
  width: 22px;
  height: 22px;
}

/* Little count bubble on the cart icon */
.count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Theme toggle ----------
   Shows the moon in light mode and the sun in dark mode. */
.theme-toggle .icon-sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--ease),
    border-color var(--ease),
    color var(--ease),
    opacity var(--ease);
}
.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.btn-outline {
  border-color: var(--line-strong);
  color: var(--text);
  font-weight: 600;
}
.btn-outline:hover {
  background: var(--surface);
  color: var(--text);
}

.btn-ghost {
  color: var(--text-3);
  font-weight: 600;
}
.btn-ghost:hover {
  color: var(--text);
}

.btn-green {
  background: var(--green);
  color: var(--on-accent);
}
.btn-green:hover {
  background: var(--aqua);
  color: var(--on-accent);
}

.btn-sm {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-size: var(--text-sm);
}
.btn-block {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- Card ---------- */
.card {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}
a.card {
  display: block;
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--ease);
}
a.card:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.card-lg {
  padding: var(--space-7);
  border-radius: var(--radius-xl);
  border-color: var(--line-strong);
}

/* ---------- Section heading row ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}
.section-head h2 {
  font-size: var(--text-xl);
}
.section-head a {
  font-size: var(--text-sm);
  font-weight: 600;
}

/* ---------- Eyebrow (small mono label above a heading) ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Hero ---------- */
.hero-title {
  font-size: var(--text-hero);
  line-height: 1.04;
  letter-spacing: -0.01em;
}
.lead {
  max-width: 46ch;
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--text-2);
}

/* ---------- Trust item (icon + text) ---------- */
.feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.feature-icon {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-icon svg {
  width: 30px;
  height: 30px;
}
.feature strong {
  display: block;
  font-size: 15px;
}
.feature span {
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text-strip);
}

/* ---------- Category card (sticker badge, square) ----------
   Set the colour with style="--dot: var(--purple)" */
.category-card {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 2px solid transparent; /* reserves the space so hover doesn't shift */
  background: var(--page);
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  transition:
    background-color var(--ease),
    border-color var(--ease),
    box-shadow var(--ease),
    transform var(--ease);
}
.category-card:hover,
.category-card:active,
.category-card:focus-visible {
  outline: none;
  color: var(--text);
  background: var(--surface);
  border-color: var(--dot);
  box-shadow: 0 16px 40px -8px
    light-dark(rgb(60 56 54 / 0.3), rgb(0 0 0 / 0.65));
  transform: translateY(-2px);
}

.category-card-badge {
  width: 56%;
  aspect-ratio: 1 / 1;
  margin-bottom: 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--dot);
  color: var(--on-accent);
  transition: transform var(--ease);
}
.category-card:hover .category-card-badge {
  transform: rotate(-8deg) scale(1.04);
}
.category-card-badge svg {
  width: 60%;
  height: auto;
}

.category-card strong {
  font-size: var(--text-lg);
  line-height: 1.2;
}
.category-card-sub {
  font-size: var(--text-sm);
  color: var(--text-3);
}

/* Coloured square before a label. Set the colour with style="--dot: var(--red)" */
.dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 3px;
  background: var(--dot, var(--text-3));
}

.dash-line {
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0 0.5rem,
    var(--purple) 0 2.5rem,
    transparent 0 3.5rem,
    var(--red) 0 5.5rem,
    transparent 0 6.5rem,
    var(--orange) 0 8.5rem,
    transparent 0 9.5rem,
    var(--yellow) 0 11.5rem,
    transparent 0 12.5rem,
    var(--green) 0 14.5rem,
    transparent 0 15.5rem,
    var(--aqua) 0 17.5rem,
    transparent 0 18.5rem,
    var(--blue) 0 20.5rem,
    transparent 0 21rem
  );
  background-size: 21rem 100%;
  background-repeat: repeat-x;
  background-position: center;
}
/* ---------- Product card ---------- */
.product {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.product:hover {
  color: var(--text);
}

/* Image well: a step off the page colour, so photos that don't fill the
   square still sit on a visible panel */
.product-img {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: light-dark(var(--gruvL-bg0_s), var(--gruvD-bg));
}
.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}
.product:hover .product-img img {
  transform: scale(1.03);
}

.product-img .badge {
  position: absolute;
  top: 10px;
  left: 10px;
}

.product-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
}
.product-name {
  display: block;
  font-weight: 600;
}
.price {
  font-weight: 700;
  color: var(--accent);
}

.product.sold-out .product-img {
  opacity: 0.45;
}

/* Product grid for browse: 2 columns on phones, then as many ~260px
   columns as fit, so cards stay a good size at any screen width */
.grid-products {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 768px) {
  .grid-products {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

/* Card text: the name takes the spare room in the bar and cuts off with … */
.product-bar > .min-w-0 {
  flex: 1 1 auto;
}
.product-title {
  display: block;
  font-weight: 600;
}

/* Phones: two narrow columns, so the price button goes under the name */
@media (max-width: 767px) {
  .grid-products .product-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .grid-products .product-bar .btn {
    width: 100%;
  }
}

.dots {
  position: relative;
  background: var(--surface-2);
}
.dots::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit; /* follow the container's corners */
  background: linear-gradient(
      135deg,
      var(--purple) 0% 3.57%,
      var(--red) 3.57% 10.71%,
      var(--orange) 10.71% 17.86%,
      var(--yellow) 17.86% 25%,
      var(--green) 25% 32.14%,
      var(--aqua) 32.14% 39.29%,
      var(--blue) 39.29% 46.43%,
      var(--purple) 46.43% 53.57%,
      var(--red) 53.57% 60.71%,
      var(--orange) 60.71% 67.86%,
      var(--yellow) 67.86% 75%,
      var(--green) 75% 82.14%,
      var(--aqua) 82.14% 89.29%,
      var(--blue) 89.29% 100%
    )
    0 0 / 154px 154px;
  -webkit-mask: radial-gradient(
      circle at 11px 11px,
      #000 2.2px,
      transparent 2.8px
    )
    0 0 / 22px 22px;
  mask: radial-gradient(circle at 11px 11px, #000 2.2px, transparent 2.8px) 0
    0 / 22px 22px;
}
.dots > img {
  position: relative;
}

/* Image on top, info bar underneath (two pieces of one card).
   Put .product-top on the <a>: it squares the image's bottom corners and
   gives the focus outline the same shape. */
.product-top,
.product-top .product-img {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* Info bar: lighter than the image well in dark mode, darker in light mode,
   so it reads as a label on the card. Text colours are picked to stay
   above 5:1 contrast on it. */
.product-bar {
  padding: 3px;
  background: light-dark(var(--gruvL-bg2), var(--gruvD-bg2));
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.product-bar .product-name {
  color: light-dark(var(--gruvL-fg0), var(--gruvD-fg0));
}
.product-bar .product-meta {
  color: light-dark(var(--gruvL-fg2), var(--gruvD-fg2));
}
.product-bar .price {
  color: light-dark(var(--gruvL-red-alt), var(--gruv-yellow));
}
/* ---------- Badge (Staff pick, New, Sold out) ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--page);
  color: var(--yellow);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
}
.badge-muted {
  color: var(--text-3);
}

/* ---------- Chip (filter tags) ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--ease),
    color var(--ease),
    border-color var(--ease);
}
.chip:hover {
  border-color: var(--line-hover);
  color: var(--text);
}
.chip[aria-pressed="true"],
.chip.is-on {
  background: var(--chip, var(--text));
  border-color: var(--chip, var(--text));
  color: var(--on-accent);
}

/* Horizontal scrolling row of chips on small screens */
.chip-row {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
  scrollbar-width: thin;
}

/* ---------- Forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
}

.input,
.select {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-base); /* 16px stops iOS zooming in */
  transition: border-color var(--ease);
}
.input::placeholder {
  color: var(--text-3);
}
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
}

textarea.input {
  min-height: 96px;
  padding-block: 10px;
  resize: vertical;
}

/* Search box with an icon inside */
.search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-3);
}
.search:focus-within {
  border-color: var(--accent);
}
.search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
}

/* Checkbox + text in one clickable row (filter lists) */
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  cursor: pointer;
}
.check .count-text {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
}

/* ---------- Alerts / flash messages ---------- */
.alert {
  padding: var(--space-4);
  border: 1px solid currentColor;
  border-radius: var(--radius);
}
.alert-ok {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 10%, transparent);
}
.alert-error {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 10%, transparent);
}
.alert-info {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, transparent);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: var(--text-sm);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4) var(--space-8);
  padding-block: var(--space-7) var(--space-10);
}
.site-footer p {
  max-width: 60ch;
}
.site-footer a {
  color: var(--text-2);
}
.site-footer a:hover {
  color: var(--text);
}

/* =====================================================================
   5. UTILITIES
   ===================================================================== */

/* Text colour */
.text {
  color: var(--text);
}
.text-2 {
  color: var(--text-2);
}
.muted {
  color: var(--text-3);
}
.accent {
  color: var(--accent);
}
.c-red {
  color: var(--red);
}
.c-green {
  color: var(--green);
}
.c-yellow {
  color: var(--yellow);
}
.c-blue {
  color: var(--blue);
}
.c-purple {
  color: var(--purple);
}
.c-aqua {
  color: var(--aqua);
}
.c-orange {
  color: var(--orange);
}

/* Background */
.bg-page {
  background: var(--page);
}
.bg-surface {
  background: var(--surface);
}
.bg-raised {
  background: var(--surface-2);
}

/* Type */
.mono {
  font-family: var(--font-mono);
}
.text-xs {
  font-size: var(--text-xs);
}
.text-sm {
  font-size: var(--text-sm);
}
.text-base {
  font-size: var(--text-base);
}
.text-lg {
  font-size: var(--text-lg);
}
.text-xl {
  font-size: var(--text-xl);
}
.text-2xl {
  font-size: var(--text-2xl);
}
.bold {
  font-weight: 700;
}
.semibold {
  font-weight: 600;
}
.center {
  text-align: center;
}
.measure {
  max-width: 60ch;
} /* comfortable reading width */

/* One line, cut with … */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Gaps (pair with .stack / .cluster / .grid) */
.gap-1 {
  gap: var(--space-1);
}
.gap-2 {
  gap: var(--space-2);
}
.gap-3 {
  gap: var(--space-3);
}
.gap-4 {
  gap: var(--space-4);
}
.gap-6 {
  gap: var(--space-6);
}
.gap-8 {
  gap: var(--space-8);
}
.gap-16 {
  gap: var(--space-16);
}

/* Flex helpers */
.flex {
  display: flex;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.grow {
  flex: 1 1 auto;
}
.min-w-0 {
  min-width: 0;
}

/* Aspect ratios */
.ratio-square {
  aspect-ratio: 1 / 1;
}
.ratio-4-3 {
  aspect-ratio: 4 / 3;
}
.ratio-3-4 {
  aspect-ratio: 3 / 4;
}

/* Hidden visually, still read by screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}
