@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Inter:wght@400;500;600&display=swap');

:root {
  --ink: #191727;
  --ink-soft: #56536E;
  --ink-faint: #8B88A0;
  --paper: #FFFFFF;
  --wash: #F1EFF5;
  --line: #DFDCE8;
  --gold: #D98A0B;
  --gold-deep: #A96806;
  --teal: #0F6157;
  --rose: #B23A2F;

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;

  /* The fixed sidebar hangs off this, so both must agree. Guaranteed by
     min-height on .topbar-inner below rather than left to content size. */
  --topbar-h: 66px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Sticky footer: on short pages (an empty catalogue, a single search result)
   the main area stretches so the footer sits at the bottom of the viewport
   rather than floating halfway down it. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  /* Wide tables scroll inside .table-wrap; the page itself never should. */
  overflow-x: hidden;
}

body > main {
  flex: 1 0 auto;
  /* width:100% is required, not optional: .shell centres itself with
     `margin: 0 auto`, and in a column flex container those become cross-axis
     auto margins, which override `stretch` and shrink the item to fit its
     content. Without this the whole page collapses into a narrow column. */
  width: 100%;
}

.site-footer {
  flex: 0 0 auto;
  margin-top: auto;
}

h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

a { color: inherit; }

button {
  font-family: var(--body);
  font-size: 1rem;
  cursor: pointer;
  border: none;
  background: none;
}

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

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------------- structure */

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ink);
  color: var(--paper);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  min-height: var(--topbar-h);
  box-sizing: border-box;
  max-width: 1180px;
  margin: 0 auto;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* Three-line menu button. Turns into a cross while the menu is open. */
.menu-btn {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-content: center;
  gap: 5px;
  flex: 0 0 auto;
}

.menu-btn:hover { background: rgba(255, 255, 255, 0.12); }

.menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--paper);
  transition: transform 0.22s ease, opacity 0.18s ease;
}

.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.wordmark span { color: var(--gold); }

.topbar nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.9rem;
}

.topbar nav a { text-decoration: none; opacity: 0.85; }
.topbar nav a:hover { opacity: 1; }

.cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
}

.cart-pill b {
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
}

/* -------------------------------------------------------------- intro */

.intro {
  padding: 44px 0 26px;
}

.intro h1 {
  font-size: clamp(2rem, 7vw, 3.1rem);
  font-weight: 800;
  max-width: 15ch;
}

.intro p {
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 14px 0 0;
}

/* ------------------------------------------------------------ filters */

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0 20px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
  white-space: nowrap;
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* --------------------------------------------------------------- grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  padding-bottom: 40px;
}

.card {
  background: var(--paper);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  border: 1px solid transparent;
}

.card:hover { border-color: var(--line); }

.card-img {
  aspect-ratio: 4 / 5;
  background: var(--wash);
  width: 100%;
  object-fit: cover;
  display: block;
}

.card-img-blank {
  aspect-ratio: 4 / 5;
  background: var(--wash);
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

.card-body { padding: 14px 16px 18px; }

.card-cat {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.card h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 3px 0 8px;
}

.card-price {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
}

.stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 6px;
}

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.dot.low { background: var(--gold); }
.dot.out { background: var(--ink-faint); }

/* ------------------------------------------------------------- drawer */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(25, 23, 39, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 50;
}

.scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(460px, 100%);
  background: var(--paper);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
}

.drawer.open { transform: translateX(0); }

/* Category menu slides in from the left, mirroring the cart on the right. */
.drawer-left {
  right: auto;
  left: 0;
  transform: translateX(-100%);
}

.drawer-left.open { transform: translateX(0); }

/* The menu is a list of short labels, not content — it doesn't need the full
   width the cart drawer uses, and leaving the page visible behind it makes
   the panel easier to dismiss. */
.drawer-left {
  width: min(320px, 84%);
}

.drawer-left .cat-item { padding: 11px 4px; }

.drawer-left .cat-name { font-size: 0.96rem; }

.drawer-left .cat-desc { font-size: 0.78rem; }

.drawer-left .nav-group { margin: 16px 0 0; }

.drawer-left .drawer-head { padding: 16px 20px; }

.drawer-left .drawer-body { padding: 10px 20px 16px; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 { font-size: 1.3rem; font-weight: 700; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-soft);
}
.icon-btn:hover { background: var(--wash); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  /* A tinted panel behind white input fields: white-on-white gave the form
     no visible edges, so the fields read as part of the background. */
  background: var(--wash);
}

.drawer-head,
.drawer-foot {
  background: var(--paper);
}

/* Inputs stay white so each field is clearly a place to type. */
.drawer-body input,
.drawer-body select,
.drawer-body textarea {
  background: var(--paper);
}

.drawer-foot {
  border-top: 1px solid var(--line);
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  background: var(--paper);
  /* Stacks multiple actions rather than letting them sit side by side. */
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------- category menu */

.cat-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  color: var(--ink);
}

.cat-item:last-child { border-bottom: none; }
.cat-item:hover { color: var(--gold-deep); }

.cat-item[aria-current="true"] {
  color: var(--gold-deep);
  font-weight: 600;
}

.cat-name { font-size: 1rem; font-weight: 500; }

.cat-item[aria-current="true"] .cat-name { font-weight: 700; }

.cat-desc {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-weight: 400;
  margin-top: 2px;
}

.cat-count {
  flex: 0 0 auto;
  font-size: 0.8rem;
  color: var(--ink-faint);
  background: var(--wash);
  border-radius: 999px;
  padding: 3px 10px;
}

/* Shows which category the grid is currently filtered to. */
.browsing-now {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  /* The hero used to provide this top spacing; the product grid now sits
     directly under the topbar, so the gap lives here instead. */
  padding: 26px 0 16px;
}

.browsing-now h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

.browsing-now .clear-filter {
  font-size: 0.86rem;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.browsing-now .clear-filter:hover { color: var(--gold-deep); }

/* --------------------------------------------------------- cart lines */

.line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.line:last-child { border-bottom: none; }

.line-name { font-weight: 600; font-size: 0.95rem; }
.line-variant { font-size: 0.83rem; color: var(--ink-faint); }
.line-price { font-weight: 600; white-space: nowrap; }

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-top: 6px;
}

.qty button {
  width: 30px;
  height: 30px;
  color: var(--ink-soft);
  font-size: 1.05rem;
}
.qty button:hover { background: var(--wash); }
.qty span { min-width: 30px; text-align: center; font-size: 0.9rem; }

.totals {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.totals.grand {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  padding-top: 12px;
  margin-top: 6px;
  border-top: 1px solid var(--line);
}

/* -------------------------------------------------------------- forms */

label {
  display: block;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin: 14px 0 5px;
}

input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--body);
  font-size: 1rem;
  background: var(--paper);
  color: var(--ink);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(217, 138, 11, 0.16);
}

textarea { resize: vertical; min-height: 74px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  transition: background 0.15s ease;
}

.btn:hover { background: #262340; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-deep); color: var(--paper); }

.btn-quiet {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.btn-quiet:hover { background: var(--wash); }

.btn-sm { width: auto; padding: 8px 14px; font-size: 0.88rem; }

/* -------------------------------------------------------------- notes */

.note {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  margin: 14px 0;
}

.note-error { background: #FBEDEB; color: var(--rose); }
.note-ok { background: #E7F2F0; color: var(--teal); }
.note-info { background: var(--wash); color: var(--ink-soft); }

.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--ink-faint);
}

.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------- status badge */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--wash);
  color: var(--ink-soft);
}
.badge.good { background: #E7F2F0; color: var(--teal); }
.badge.warn { background: #FDF2E0; color: var(--gold-deep); }
.badge.bad { background: #FBEDEB; color: var(--rose); }

/* ----------------------------------------------------- variant picker */

.variant-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.variant-btn {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  font-size: 0.9rem;
}
.variant-btn[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.variant-btn:disabled { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }

.detail-img {
  width: 100%;
  border-radius: var(--r-md);
  aspect-ratio: 4/5;
  object-fit: cover;
  background: var(--wash);
}

/* ------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; background: var(--paper); border-radius: var(--r-md); }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

th {
  text-align: left;
  padding: 12px 14px;
  color: var(--ink-faint);
  font-weight: 500;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }

/* --------------------------------------------------------------- misc */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat {
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 18px;
}

.stat-label { font-size: 0.82rem; color: var(--ink-faint); }

.stat-value {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.7rem;
  margin-top: 4px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 14px;
}

.section-head h2 { font-size: 1.35rem; font-weight: 700; }

.muted { color: var(--ink-faint); font-size: 0.88rem; }

.panel {
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 22px;
}

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 620px) {
  .intro { padding: 30px 0 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
  .topbar nav { gap: 12px; font-size: 0.85rem; }
  .topbar nav .hide-sm { display: none; }
}

/* --------------------------------------------------------- site footer */

.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 28px 0 calc(24px + env(safe-area-inset-bottom));
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: space-between;
  align-items: center;
  /* min-width:0 stops the flex children from forcing the row wider than the
     viewport, which was clipping the wordmark and the copy on mobile. */
  min-width: 0;
}

.footer-inner > div {
  flex: 1 1 260px;
  min-width: 0;
  max-width: 46ch;
}

.footer-mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  margin-bottom: 5px;
}

.footer-mark span { color: var(--gold); }

.site-footer .muted {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.88rem;
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: 0 0 auto;
}

/* Icon-only round buttons in each channel's brand colour. */
.contact-link {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.contact-link:hover { transform: translateY(-2px); filter: brightness(1.1); }

.contact-link svg { width: 19px; height: 19px; fill: #fff; }

.contact-link.whatsapp  { background: #25D366; }
.contact-link.facebook  { background: #1877F2; }
.contact-link.tiktok    { background: #010101; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.contact-link.instagram { background: linear-gradient(45deg, #F58529, #DD2A7B 55%, #8134AF); }
.contact-link.email     { background: var(--gold); }
.contact-link.email svg { fill: var(--ink); }

@media (max-width: 620px) {
  .site-footer { padding: 24px 0 calc(20px + env(safe-area-inset-bottom)); }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer-inner > div { flex: 0 1 auto; }
}

/* ------------------------------------------------------ admin nav menu */

.nav-group {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 22px 0 2px;
}

.nav-group:first-child { margin-top: 6px; }

.admin-section-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 0 16px;
}

/* Row for a view's primary action, now that the heading lives in the
   section bar above it. */
.view-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.admin-section-bar h1 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800;
}

/* ================================================================
   DESKTOP LAYOUT
   Phones keep the drawer-based layout above. From 1024px up there is
   room for permanent navigation, so the menu stops being a drawer and
   becomes a sidebar that is always on screen.
   ================================================================ */

@media (min-width: 1024px) {

  /* --- shared: the menu drawer becomes a static sidebar --- */
  /* Gated on .nav-static: the admin adds it after sign-in, so the sidebar
     never appears as an empty panel beside the login form. */
  body.nav-static .drawer-left {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    width: 268px;
    height: calc(100dvh - var(--topbar-h));
    transform: none;           /* never slides away */
    border-right: 1px solid var(--line);
    background: var(--paper);
    z-index: 20;               /* under the cart drawer, over the page */
  }

  body.nav-static .drawer-left .drawer-head { display: none; }

  body.nav-static .drawer-left .drawer-body { padding: 18px 20px; }

  body.nav-static .drawer-left .drawer-foot {
    border-top: 1px solid var(--line);
    background: var(--paper);
  }

  /* The hamburger has nothing left to toggle. */
  body.nav-static .menu-btn { display: none; }

  /* Content sits to the right of the sidebar and uses the full width, which
     matters most for the wide admin tables. */
  /* Every direct child of body has to clear the fixed sidebar, not just
     <main> — the footer is a sibling, so offsetting main alone left the
     footer running underneath the sidebar. */
  body.nav-static > main,
  body.nav-static > .site-footer {
    /* The width must be definite. `.shell` sets `margin: 0 auto`, and a flex
       item with auto cross-axis margins and an auto width shrinks to fit its
       content instead of filling the row. Subtracting the fixed sidebar from
       100% fills the remaining space exactly, with no overflow. */
    width: calc(100% - 268px);
    margin-left: 268px;
    margin-right: 0;
    max-width: none;
  }

  body.nav-static > main { padding: 0 32px; }

  /* The hints help on first use in the mobile drawer, but they make eleven
     items too tall for a fixed sidebar. Labels alone are clear enough here. */
  body.nav-static .drawer-left .cat-desc { display: none; }

  body.nav-static .drawer-left .cat-item { padding: 11px 4px; }

  body.nav-static .drawer-left .nav-group { margin: 18px 0 2px; }

  /* --- storefront --- */
  .intro { padding: 52px 0 24px; }

  .intro h1 { font-size: clamp(2.4rem, 3.4vw, 3.4rem); }

  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }

  /* --- admin --- */
  .admin-section-bar { padding: 30px 0 20px; }

  /* Tables keep their own horizontal scroll. Letting them overflow visibly
     would push the page wide and reintroduce the page-level scrollbar. */
  table { font-size: 0.92rem; }

  th, td { padding: 13px 16px; }

}

@media (min-width: 1440px) {
  body.nav-static .drawer-left { width: 292px; }
  body.nav-static > main,
  body.nav-static > .site-footer {
    width: calc(100% - 292px);
    margin-left: 292px;
  }
}

/* ================================================================
   THEMES
   The default palette lives in :root above. Each theme below only
   overrides the colour tokens, so every component picks up the change
   without any component-level theme rules.
   Applied by setting data-theme on <html>.
   ================================================================ */

/* Forest — deep green, calm and natural. */
[data-theme="forest"] {
  --ink: #14312A;
  --ink-soft: #44605A;
  --ink-faint: #7E938E;
  --paper: #FFFFFF;
  --wash: #EFF2EE;
  --line: #D7DED9;
  --gold: #C9A227;
  --gold-deep: #96780F;
  --teal: #0F6157;
  --rose: #A8382E;
}

/* Berry — plum with a bright pink accent. */
[data-theme="berry"] {
  --ink: #2B1430;
  --ink-soft: #5E4463;
  --ink-faint: #94809A;
  --paper: #FFFFFF;
  --wash: #F5EFF4;
  --line: #E2D6E3;
  --gold: #C2185B;
  --gold-deep: #8E0E41;
  --teal: #17695E;
  --rose: #B3302B;
}

/* Ocean — navy with a fresh teal accent. */
[data-theme="ocean"] {
  --ink: #12233B;
  --ink-soft: #45586F;
  --ink-faint: #8496A9;
  --paper: #FFFFFF;
  --wash: #EDF1F6;
  --line: #D5DDE7;
  --gold: #0E9594;
  --gold-deep: #0A6E6D;
  --teal: #0E7C86;
  --rose: #B23A3A;
}

/* Clay — warm brown with burnt orange. */
[data-theme="clay"] {
  --ink: #2A1D17;
  --ink-soft: #5D4A40;
  --ink-faint: #98857A;
  --paper: #FFFFFF;
  --wash: #F4EFEA;
  --line: #E3D8CE;
  --gold: #C2571A;
  --gold-deep: #93400F;
  --teal: #14675A;
  --rose: #AE3226;
}

/* Mono — black and white, nothing else. */
[data-theme="mono"] {
  --ink: #141414;
  --ink-soft: #4D4D4D;
  --ink-faint: #8A8A8A;
  --paper: #FFFFFF;
  --wash: #F0F0F0;
  --line: #DBDBDB;
  --gold: #141414;
  --gold-deep: #000000;
  --teal: #2F6B4F;
  --rose: #9E2B20;
}

/* Mono's accent matches the ink, so gold-on-ink buttons would vanish.
   Flip them to a light fill for contrast. */
[data-theme="mono"] .cart-pill,
[data-theme="mono"] .btn-gold {
  background: var(--paper);
  color: var(--ink);
}

[data-theme="mono"] .cart-pill b {
  background: var(--ink);
  color: var(--paper);
}

[data-theme="mono"] .btn-gold:hover {
  background: var(--wash);
  color: var(--ink);
}

[data-theme="mono"] .wordmark span,
[data-theme="mono"] .footer-mark span {
  color: var(--paper);
}

/* --------------------------------------------------------- theme picker */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.theme-card {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.theme-card:hover { transform: translateY(-2px); }

.theme-card[aria-pressed="true"] {
  border-color: var(--gold);
}

.theme-swatches {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.theme-swatches i {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.theme-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
}

.theme-desc {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: 2px;
}

.theme-current {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* ----------------------------------------------------------- search bar */

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.search-bar input {
  flex: 1 1 220px;
  min-width: 0;
}

.search-bar .btn { flex: 0 0 auto; }

/* ------------------------------------------------------ product gallery */

.gallery { position: relative; }

/* scroll-snap does the paging, so swiping matches the phone's native feel
   and no carousel library is needed. */
.gallery-strip {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--r-md);
  -webkit-overflow-scrolling: touch;
}

.gallery-strip::-webkit-scrollbar { display: none; }

.gallery-slide {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  scroll-snap-align: start;
  background: var(--wash);
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  background: var(--line);
  transition: background 0.15s ease, transform 0.15s ease;
}

.gallery-dot[aria-current="true"] {
  background: var(--gold);
  transform: scale(1.3);
}

.gallery-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin: 8px 0 0;
}

/* ------------------------------------------------------------ cart rows */

.cart-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
}

.cart-row {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.cart-row:last-child { border-bottom: none; }

.cart-thumb {
  width: 76px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--wash);
}

.cart-thumb-blank {
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  color: var(--ink-faint);
  text-align: center;
}

.cart-detail { min-width: 0; }

.cart-name {
  font-weight: 600;
  font-size: 0.96rem;
  line-height: 1.3;
}

.cart-variant {
  font-size: 0.83rem;
  color: var(--ink-faint);
  margin-top: 1px;
}

.cart-price {
  font-family: var(--display);
  font-weight: 700;
  margin-top: 4px;
}

.cart-stock-warn {
  font-size: 0.8rem;
  color: var(--rose);
  margin-top: 2px;
}

.cart-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.cart-remove {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--gold-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

.cart-remove:hover { color: var(--rose); }

.cart-controls .qty { margin-top: 0; }

.cart-line-total {
  font-weight: 600;
  white-space: nowrap;
  align-self: start;
}

.btn-checkout {
  font-family: var(--display);
  font-size: 1.05rem;
  padding: 15px 20px;
}

@media (max-width: 400px) {
  .cart-row { grid-template-columns: 62px 1fr; }
  .cart-thumb { width: 62px; }
  /* On the narrowest screens the line total moves under the details rather
     than squeezing the product name into two characters per line. */
  .cart-line-total { grid-column: 2; margin-top: 4px; }
}

/* ------------------------------------------------------------ add toast */

/* Sits above the drawer so it's visible while the product panel is open. */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(100% - 32px);
  padding: 13px 16px 13px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 8px 28px rgba(25, 23, 39, 0.3);
  font-size: 0.92rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.toast button {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  padding: 0;
}

.toast button:hover { text-decoration: underline; }

/* A brief pulse on the cart count, so the change is noticeable when the
   toast is off screen or dismissed early. */
.cart-pill b {
  transition: transform 0.2s ease;
}

.cart-pill.bump b { transform: scale(1.35); }

/* -------------------------------------------------------- upload dropzone */

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--wash);
  padding: 26px 18px;
  margin-top: 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.over {
  border-color: var(--gold);
  background: var(--paper);
}

#dropzoneIdle strong {
  display: block;
  font-size: 0.98rem;
}

#dropzoneIdle span {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: 3px;
}

#proofPreview img {
  max-width: 100%;
  max-height: 260px;
  border-radius: var(--r-sm);
  display: block;
  margin: 0 auto;
}

#proofClear {
  margin-top: 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--gold-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------ order hit list */

.order-hit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  color: var(--ink);
}

.order-hit:last-child { border-bottom: none; }
.order-hit:hover { color: var(--gold-deep); }

/* ------------------------------------------------------- shop search bar */

.shop-search {
  display: flex;
  gap: 8px;
  padding: 20px 0 4px;
}

.shop-search input {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 999px;
  padding: 12px 18px;
}

.shop-search button {
  flex: 0 0 auto;
  width: 46px;
  border-radius: 50%;
  background: var(--ink);
  display: grid;
  place-items: center;
}

.shop-search button svg { width: 19px; height: 19px; fill: var(--paper); }
.shop-search button:hover { background: var(--gold); }
.shop-search button:hover svg { fill: var(--ink); }

/* ----------------------------------------------------- floating cart button */

.cart-fab {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 45;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #D32F2F;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease;
}

.cart-fab:hover { transform: translateY(-2px); }
.cart-fab:active { transform: scale(0.94); }

.cart-fab svg { width: 24px; height: 24px; fill: #fff; }

.cart-fab b {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--paper);
  font-size: 0.72rem;
  display: grid;
  place-items: center;
}

/* Hidden when the cart is empty — a badge showing 0 is noise. */
.cart-fab.empty b { display: none; }

/* ------------------------------------------------------- units sold note */

.sold-note {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 4px;
}

/* --------------------------------------------------- product detail blocks */

.detail-block {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.detail-block h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.detail-block p { color: var(--ink-soft); margin: 0; }

/* Ratings */
.stars { color: var(--gold); letter-spacing: 1px; }
.stars-muted { color: var(--line); }

.rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.review {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.review:last-child { border-bottom: none; }

.review-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.review-name { font-weight: 600; font-size: 0.93rem; }

.verified-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal);
  background: #E7F2F0;
  padding: 2px 8px;
  border-radius: 999px;
}

.review-body { color: var(--ink-soft); font-size: 0.92rem; margin-top: 4px; }

.star-picker { display: flex; gap: 4px; margin-top: 6px; }

.star-picker button {
  font-size: 1.6rem;
  line-height: 1;
  color: var(--line);
  padding: 0;
}

.star-picker button[aria-pressed="true"] { color: var(--gold); }

/* ----------------------------------------------------- related products */

/* A horizontal strip rather than a second grid: these are a sideline to the
   product being viewed, not the main thing on screen. */
.related-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.related-strip::-webkit-scrollbar { display: none; }

.related-card {
  flex: 0 0 122px;
  scroll-snap-align: start;
  text-align: left;
  padding: 0;
}

.related-card img,
.related-card .related-blank {
  width: 122px;
  height: 122px;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--wash);
  display: block;
}

.related-blank {
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  color: var(--ink-faint);
}

.related-name {
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.25;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-price { font-size: 0.85rem; font-weight: 700; margin-top: 2px; }

/* ---------------------------------------------------------- colour picker */

.colour-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.colour-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 8px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.9rem;
  text-transform: capitalize;
}

.colour-btn[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.colour-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

.colour-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: 0 0 auto;
  /* An outline so white and very light colours stay visible. */
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}
