:root {
  --bg-base:    #0a0a0a;
  --bg-surface: #121212;
  --bg-raised:  #1a1a1a;
  --line:       rgba(255,255,255,0.08);
  --line-strong:rgba(255,255,255,0.14);
  --text:       #e6e6e6;
  --text-dim:   #9a9a9a;
  --text-faint: #8a8a8a;
  --gold:       #d4af37;
  --gold-dim:   #8a7223;
  --danger:     #e05252;
  --ok:         #4caf7d;
  --radius:     2px;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --max:        1400px;
}

[data-theme="pearl"] {
  --bg-base:    #f5f5f0;
  --bg-surface: #ffffff;
  --bg-raised:  #ecece6;
  --line:       rgba(0,0,0,0.08);
  --line-strong:rgba(0,0,0,0.16);
  --text:       #111;
  --text-dim:   #555;
  --text-faint: #888;
  --gold:       #8a7223;
  --gold-dim:   #c0a44a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }

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

/* ═══════════════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════════════ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem 1.5rem;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

[data-theme="pearl"] .topbar { background: rgba(245,245,240,0.85); }

.brand-mark {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

.topbar-search {
  flex: 1;
  display: flex;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-surface);
}

.topbar-search input {
  flex: 1;
  padding: 0.55rem 0.9rem;
  background: transparent;
  border: 0;
  color: var(--text);
  outline: none;
}

.topbar-search input::placeholder { color: var(--text-faint); }

.topbar-search button {
  padding: 0 1rem;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  transition: color 0.15s;
}
.topbar-search button:hover { color: var(--gold); }

#lang-dropdown,
#currency-dropdown {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  outline: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

#topbar-location {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.topbar-right a {
  position: relative;
  display: flex;
  align-items: center;
  font-size: 1.2rem;
  color: var(--text);
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--gold);
  color: #111;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════ */

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.page-head {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
}
.page-head h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}
.page-head .subtitle {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════
   PRODUCT CARD + GRID
   ═══════════════════════════════════════════════════════════ */

.product-grid,
#product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.product-card.out-of-stock { opacity: 0.55; }

.product-img {
  aspect-ratio: 1/1;
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-img i {
  font-size: 2rem;
  color: var(--text-faint);
}

.product-body {
  padding: 0.75rem 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.product-brand {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.product-name {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  margin-top: auto;
  padding-top: 0.4rem;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════
   PAGINATION / STATES
   ═══════════════════════════════════════════════════════════ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem 0 0;
}
.pagination button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  transition: 0.15s;
}
.pagination button:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.pagination .page-info {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.loading,
.error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
  font-style: italic;
}
.error { color: var(--danger); }

/* ═══════════════════════════════════════════════════════════
   BREADCRUMBS
   ═══════════════════════════════════════════════════════════ */

.breadcrumbs {
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 0.5rem 0 1.25rem;
}
.breadcrumbs a { color: var(--text-dim); transition: color 0.15s; }
.breadcrumbs a:hover { color: var(--gold); }

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 0.75rem; padding: 0.6rem 1rem; }
  .topbar-search { order: 3; flex-basis: 100%; max-width: none; }
  .brand-mark { font-size: 1.05rem; }
  #topbar-location { display: none; }
  .product-grid, #product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    padding: 0 0.75rem;
  }
  .page { padding: 1rem 0.75rem 4rem; }
}

/* CLS-skydd — reservera plats för dynamiskt innehåll */
#header-placeholder { display: block; min-height: 62px; }
.site-footer         { display: block; min-height: 84px; }

@media (max-width: 720px) {
  #header-placeholder { min-height: 110px; }
}

/* The shop-aside is injected by header.js on every page. On desktop
   it's hidden; on mobile (≤860px) sidebar.css un-hides it as a drawer. */
.shop-aside[data-mode="offcanvas"] { display: none; }

/* ═══════════════════════════════════════════════════════════
   LEGACY ALIASES — map the old --metal-* naming onto the
   canonical design tokens so about/contact/faq/news render
   correctly under the unified theme.
   ═══════════════════════════════════════════════════════════ */
:root {
  --metal-text:   var(--text);
  --metal-muted:  var(--text-dim);
  --metal-hint:   var(--text-faint);
  --metal-border: var(--line);
  --metal-panel:  var(--bg-surface);
  --radius-sm:    var(--radius);
  --radius-md:    var(--radius);
  --radius-pill:  999px;
}

/* ─── Global promise banner (used by index/about/faq/news/...) ─── */
.promise {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 3rem auto;
  padding: 2.25rem 1.5rem;
  text-align: center;
  max-width: 720px;
}
.promise p { color: var(--text-dim); font-size: .95rem; line-height: 1.7; }
.promise strong {
  color: var(--text);
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: .02em;
}
.promise-sub {
  display: inline-block;
  margin-top: .5rem;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ═══════════════════════════════════════════════════════════
   CONTENT PAGES — about / contact / faq / news / shipping
   All classes use the canonical design tokens.
   ═══════════════════════════════════════════════════════════ */

.content-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}
.content-page--wide { max-width: 1100px; }

.content-page h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  letter-spacing: .01em;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--text);
}
.content-page .lead {
  text-align: center;
  color: var(--text-dim);
  max-width: 60ch;
  margin: 0 auto 3rem;
  line-height: 1.7;
}

/* ─── Hero orb (CSS only) ─── */
.orb-wrap {
  width: 100px; height: 100px;
  margin: 0 auto 1.75rem;
  position: relative;
}
.orb-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  animation: orb-spin 28s linear infinite;
}
.orb-ring-2 {
  inset: -20px;
  border-color: var(--line);
  animation-duration: 18s;
  animation-direction: reverse;
}
.orb-body {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--bg-raised) 0%, var(--bg-surface) 55%, var(--bg-base) 100%);
  box-shadow:
    inset 0 3px 12px rgba(255,255,255,.05),
    inset 0 -3px 8px rgba(0,0,0,.5),
    0 12px 40px rgba(0,0,0,.5);
  animation: orb-breathe 5s ease-in-out infinite;
}
.orb-glint {
  position: absolute;
  top: 18%; left: 22%;
  width: 28%; height: 18%;
  border-radius: 50%;
  background: rgba(212,175,55,.35);
  filter: blur(2px);
}
@keyframes orb-spin    { to { transform: rotate(360deg); } }
@keyframes orb-breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* ─── Prose blocks ─── */
.prose-block {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.prose-block h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: .02em;
  color: var(--text);
  margin-bottom: .9rem;
}
.prose-block p {
  color: var(--text-dim);
  line-height: 1.75;
  margin-bottom: .8rem;
}
.prose-block p:last-child { margin-bottom: 0; }

/* ─── Values / feature grid ─── */
.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}
.value-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
}
.value-card .value-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(212,175,55,.08);
  color: var(--gold);
  margin-bottom: .9rem;
}
.value-card h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: .04em;
  color: var(--text);
  margin-bottom: .4rem;
}
.value-card p {
  color: var(--text-dim);
  font-size: .88rem;
  line-height: 1.6;
}

/* ─── Brand partner grid (about page) ─── */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.partner-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: .95rem;
  letter-spacing: .06em;
  transition: border-color .15s, transform .15s;
}
.partner-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-3px);
  color: var(--gold);
}

/* ─── Contact ─── */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 2.5rem;
  margin-top: 1rem;
}
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; gap: 2rem; } }

.form-row-c {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: 1rem;
}
.form-row-c label {
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.form-row-c input,
.form-row-c textarea {
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .75rem .9rem;
  color: var(--text);
  font-size: .95rem;
  outline: none;
  font-family: inherit;
  transition: border-color .15s;
}
.form-row-c input:focus,
.form-row-c textarea:focus { border-color: var(--gold); }
.form-row-c textarea { resize: vertical; min-height: 120px; }

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .85rem 1.75rem;
  background: var(--gold);
  color: #111;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  transition: filter .15s;
}
.btn-gold:hover { filter: brightness(1.1); }

.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li {
  padding: .9rem 0;
  border-bottom: 1px solid var(--line);
}
.info-list li:last-child { border-bottom: 0; }
.info-list dt {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: .25rem;
}
.info-list dd {
  color: var(--text);
  font-size: .92rem;
  line-height: 1.55;
  margin: 0;
}
.info-list a { color: var(--gold); }
.info-list a:hover { text-decoration: underline; }

/* ─── FAQ ─── */
.faq-list {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}
.faq-list details {
  border-bottom: 1px solid var(--line);
  padding: 0;
}
.faq-list summary {
  cursor: pointer;
  padding: 1.25rem 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: .9rem;
  transition: color .15s;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::before {
  content: "+";
  flex: 0 0 22px;
  color: var(--gold);
  font-family: var(--font-sans);
  font-size: 1.15rem;
  line-height: 1;
  text-align: center;
  transition: transform .2s;
}
.faq-list details[open] summary::before { content: "−"; }
.faq-list summary:hover { color: var(--gold); }
.faq-list .faq-a {
  padding: 0 0 1.5rem 2.1rem;
  color: var(--text-dim);
  line-height: 1.75;
  font-size: .92rem;
}

/* ─── News ─── */
.news-list { margin-top: 2rem; }
.news-list article {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}
.news-list article:first-child { border-top: 1px solid var(--line); }
@media (max-width: 560px) {
  .news-list article { grid-template-columns: 1fr; gap: .5rem; }
}
.news-list time {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-top: .3rem;
}
.news-list h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: .01em;
  color: var(--text);
  margin-bottom: .4rem;
}
.news-list p {
  color: var(--text-dim);
  line-height: 1.7;
  font-size: .92rem;
}

/* ─── Shipping table ─── */
.ship-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 2rem;
  font-size: .9rem;
}
.ship-table th,
.ship-table td {
  padding: .85rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
}
.ship-table th {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
}
.ship-table td strong { color: var(--text); font-weight: 500; }
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: center;
  align-items: center;
  margin: 2rem auto 0;
}
.pagination button {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: .45rem .85rem;
  border-radius: var(--radius);
  font-size: .82rem;
  min-width: 38px;
  transition: border-color .15s, color .15s;
}
.pagination button:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}
.pagination button.is-active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212,175,55,.08);
}
.pagination button:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.pagination .page-info {
  color: var(--text-faint);
  padding: 0 .25rem;
  font-size: .82rem;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE OPTIMIZATION
   Touch targets, iOS quirks, safe-area, narrow layouts.
   ═══════════════════════════════════════════════════════════ */

/* ─── Global baseline ────────────────────────────────────── */
html {
  -webkit-text-size-adjust: 100%;     /* iOS: no auto-inflate */
  scroll-behavior: smooth;
}
body {
  /* iPhone notch / home indicator clearance */
  padding-left:   env(safe-area-inset-left);
  padding-right:  env(safe-area-inset-right);
  overflow-x: hidden;                  /* kill any stray overflow */
}
a, button { -webkit-tap-highlight-color: rgba(212,175,55,.18); }

/* ─── iOS auto-zoom fix ──────────────────────────────────
   Any input/select/textarea with font-size < 16px makes iOS
   zoom in on focus and NOT zoom back out — the page stays
   scrolled and cropped until the user pinches. Force 16px
   on touch-capable viewports. Desktop is untouched.        */
@media (max-width: 860px), (hover: none) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ─── Touch targets — Apple HIG: 44×44 minimum ────────── */
@media (max-width: 860px), (hover: none) {
  button,
  .btn-primary, .btn-secondary, .btn-gold,
  .btn-cart, .btn-buy, .btn-auth, .btn-inquire,
  .sort-toggle, .filter-reset,
  .pagination button,
  .qty-btn, .cat-toggle,
  .aside-toggle, .aside-close {
    min-height: 44px;
  }
  .qty-btn, .cat-toggle, .aside-close {
    min-width: 44px;
  }
  .cart-item-remove,
  .variant-btn,
  .filter-switch {
    min-height: 40px;
  }
}

/* ─── Tables — always scroll horizontally ──────────────── */
.prose-block { overflow-x: auto; }
.ship-table { min-width: 520px; }
.ship-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem -1rem 2rem;
  padding: 0 1rem;
}

/* ─── Long words / URLs / emails ───────────────────────── */
.cart-item-name, .product-name, .prose-block p,
.info-list dd, .news-list p, .confirm-facts dd,
.checkout-item .ck-name, .faq-a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ─── Topbar — compact on phones ───────────────────────── */
@media (max-width: 720px) {
  .topbar {
    padding: calc(0.5rem + env(safe-area-inset-top)) 0.75rem 0.5rem;
    gap: 0.4rem;
    flex-wrap: nowrap;
  }
  .brand-mark { font-size: 1rem; letter-spacing: 0.14em; }
  .topbar-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    margin-top: 0.4rem;
  }
  .topbar-search input { padding: 0.55rem 0.75rem; }
  #topbar-location { display: none; }
  #lang-dropdown {
    font-size: 0.75rem;
    padding: 0.4rem 0.5rem;
    max-width: 84px;
  }
}
@media (max-width: 400px) {
  #lang-dropdown { display: none; }   /* move to drawer only */
}

/* ─── Product grid — 2 cols on phones ──────────────────── */
@media (max-width: 480px) {
  .product-grid, #product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    padding: 0 0.65rem;
  }
  .product-body { padding: 0.6rem 0.7rem 0.9rem; }
  .product-brand { font-size: 0.62rem; }
  .product-name { font-size: 0.85rem; line-height: 1.3; }
  .product-price { font-size: 0.9rem; }
}

/* ─── Hero — scale down ────────────────────────────────── */
@media (max-width: 480px) {
  .hero { padding: 1.75rem 1rem 1.25rem; }
  .hero h1 { font-size: clamp(1.75rem, 7vw, 2.25rem); line-height: 1.1; }
  .hero-lead { font-size: 0.88rem; }
  .hero-search { margin-bottom: 1.25rem; }
  .hero-search input { padding: 0.75rem 0.85rem; font-size: 16px; }
  .hero-stats { font-size: 0.62rem; letter-spacing: 0.1em; gap: 0.35rem; }
}
@media (max-width: 360px) {
  .hero-stats { display: none; }
}

/* ─── Category strip — tighter tiles ───────────────────── */
@media (max-width: 720px) {
  .cat-strip { gap: 0.5rem; padding: 0.25rem 0.75rem 0.85rem; }
  .cat-tile { min-width: 104px; padding: 0.6rem 0.75rem; font-size: 0.78rem; }
  .cat-tile .cat-name { max-width: 140px; }
}

/* ─── Filter bar — stack on phones ─────────────────────── */
@media (max-width: 720px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem 0.85rem;
  }
  .filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }
  .filter-group-right { margin-left: 0; }
  .filter-switch { padding: 0.35rem 0; }
  .filter-price { flex-wrap: wrap; gap: 0.4rem; }
  .filter-price input { flex: 1 1 40%; width: auto; min-width: 84px; }
  .filter-select { flex-direction: column; align-items: stretch; gap: 0.3rem; }
  .filter-select select { width: 100%; }
}

/* ─── Sidebar (drawer) — better touch + scroll ─────────── */
@media (max-width: 860px) {
  .shop-aside[data-mode="offcanvas"] {
    width: min(320px, 88vw);
    padding: calc(0.9rem + env(safe-area-inset-top))
             1rem
             calc(1.25rem + env(safe-area-inset-bottom));
  }
  .aside-close {
    font-size: 1.9rem;
    line-height: 1;
    padding: 0 0.6rem;
    color: var(--text);
  }
  .aside-section { padding: 0.9rem 0; }
  .aside-select { font-size: 16px; }   /* iOS: no zoom on the drawer's selects */
  .filter-attr-list label { padding: 0.6rem 0.55rem; }
  .filter-cat-list a, .filter-cat-list button { padding: 0.6rem 0.55rem; }
}

/* ─── Cart — restructured for narrow ───────────────────── */
@media (max-width: 620px) {
  .cart-layout { gap: 1rem; }
  .cart-summary {
    position: static;              /* stop sticking on mobile */
    margin-top: 0.5rem;
  }
  .cart-item {
    grid-template-columns: 60px 1fr auto;
    grid-template-areas:
      "img info remove"
      "img qty  total";
    gap: 0.45rem 0.65rem;
    padding: 0.75rem 0.7rem;
  }
  .cart-item-img { grid-area: img; width: 60px; height: 60px; }
  .cart-item-info { grid-area: info; }
  .cart-item-qty { grid-area: qty; justify-self: start; padding: 0.15rem; }
  .cart-item-total { grid-area: total; justify-self: end; align-self: center; }
  .cart-item-remove { grid-area: remove; font-size: 1.35rem; }
  .cart-item-name { font-size: 0.92rem; }
  .cart-actions { flex-direction: column-reverse; gap: 0.5rem; }
  .cart-actions .btn-secondary { width: 100%; }
  .btn-checkout { font-size: 0.95rem; padding: 1rem; }
}

/* ─── Checkout ─────────────────────────────────────────── */
@media (max-width: 620px) {
  .checkout-section { padding: 1.15rem; }
  .form-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .form-row input, .form-grid input { font-size: 16px; padding: 0.85rem 0.9rem; }
}

/* ─── Product detail — stack the grid ──────────────────── */
@media (max-width: 720px) {
  .product-detail { padding: 0.5rem 0 2rem; }
  .product-detail-grid { gap: 1.25rem; }
  .gallery-thumbs { grid-template-columns: repeat(4, 1fr); gap: 0.4rem; }
  .gallery-main { aspect-ratio: 1/1; }
  .product-info-title { font-size: 1.4rem; }
  .product-info-price { font-size: 1.4rem; }
  .purchase-row { flex-direction: column; gap: 0.6rem; }
  .qty-control { align-self: stretch; }
  .qty-input { flex: 1; width: auto; font-size: 16px; }
  .btn-cart, .btn-buy { width: 100%; min-height: 48px; }
  .product-description { font-size: 0.88rem; }
}

/* ─── Content pages (about / contact / faq / news / shipping) */
@media (max-width: 720px) {
  .content-page { padding: 2rem 1rem 3rem; }
  .content-page .lead { margin-bottom: 2rem; }
  .prose-block { padding: 1.25rem; }
  .value-grid { gap: 0.75rem; }
  .partner-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .partner-card { padding: 1rem 0.6rem; font-size: 0.85rem; }
  .contact-grid { gap: 1.5rem; }
  .faq-list summary { font-size: 0.98rem; padding: 1rem 0; }
  .faq-list .faq-a { padding: 0 0 1rem 1.7rem; font-size: 0.9rem; }
}
@media (max-width: 480px) {
  .content-page h1 { font-size: 1.6rem; }
  .value-grid { grid-template-columns: 1fr; }
  .news-list article { grid-template-columns: 1fr; gap: 0.4rem; padding: 1.25rem 0; }
  .news-list time { padding-top: 0; }
  .news-list h2 { font-size: 1.05rem; }
  .news-list p { font-size: 0.88rem; }
  .confirm-facts > div { grid-template-columns: 1fr; gap: 0.15rem; }
  .confirm-actions .btn-primary,
  .confirm-actions .btn-secondary { min-width: 0; flex: 1 1 100%; }
  .confirmation { padding: 1.25rem 1rem; margin: 1rem auto; }
}

/* ─── Categories tree ──────────────────────────────────── */
@media (max-width: 560px) {
  .cat-tree { padding: 0.4rem 0.6rem 0.85rem; margin: 0 0.4rem; }
  .cat-row { padding: 0.55rem 0; gap: 0.55rem; }
  .cat-link { font-size: 0.92rem; }
  .cat-children { padding-left: 0.7rem; }
}

/* ─── Brands / Tags grids ──────────────────────────────── */
@media (max-width: 560px) {
  .brands-section, .tags-section { padding: 2rem 1rem; }
  .brands-header h1 { font-size: 1.6rem; }
  .brands-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .brand-item { padding: 0.8rem 0.65rem; }
  .brand-item .brand-name { font-size: 0.85rem; }
  .tags-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .tag-item { padding: 0.85rem 0.65rem; font-size: 0.85rem; }
  .tags-controls { flex-direction: column; align-items: stretch; }
  #tag-search, #brand-search { min-width: 0; width: 100%; font-size: 16px; }
  .brands-controls { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .sort-toggle { justify-content: center; }
}

/* ─── Pagination ───────────────────────────────────────── */
@media (max-width: 560px) {
  .pagination { gap: 0.25rem; padding: 1.5rem 0 0; }
  .pagination button {
    min-width: 38px;
    padding: 0.4rem 0.55rem;
    font-size: 0.78rem;
  }
  .pagination .page-info { display: none; }   /* hide ellipses on phones */
}

/* ─── Auth ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-section { padding: 1.5rem 1rem; }
  .auth-card { padding: 1.25rem; }
  .auth-section h1 { font-size: 1.6rem; }
}

/* ─── Footer ───────────────────────────────────────────── */
@media (max-width: 720px) {
  .site-footer {
    padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
    font-size: 0.75rem;
  }
  .footer-links { gap: 0.45rem; line-height: 2; }
}

/* ═══════════════════════════════════════════════════════════
   DRAWER POPULATION — list, filters, hints
   ═══════════════════════════════════════════════════════════ */

.drawer-cat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  max-height: 40vh;
  overflow-y: auto;
}
.drawer-cat-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .55rem .55rem;
  color: var(--text-dim);
  border-radius: var(--radius);
  font-size: .9rem;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.drawer-cat-list a:hover,
.drawer-cat-list a:active {
  background: var(--bg-raised);
  color: var(--text);
}

.drawer-loading,
.drawer-error,
.drawer-hint {
  padding: .5rem .55rem;
  font-size: .85rem;
  line-height: 1.55;
  margin: 0;
}
.drawer-loading { color: var(--text-faint); }
.drawer-error   { color: var(--danger); }
.drawer-hint    { color: var(--text-faint); }
.drawer-hint a  { color: var(--gold); }

.drawer-switch {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
}

.drawer-price-row {
  display: flex;
  gap: .4rem;
  align-items: center;
}
.drawer-price-row input {
  flex: 1 1 0;
  min-width: 0;
  padding: .55rem .5rem;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;                /* iOS: no auto-zoom */
  text-align: center;
  -moz-appearance: textfield;
}
.drawer-price-row input:focus { border-color: var(--gold); outline: none; }
.drawer-price-row input::-webkit-outer-spin-button,
.drawer-price-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.drawer-dash { color: var(--text-faint); }
.drawer-cur  { font-size: .72rem; color: var(--text-faint); letter-spacing: .06em; }

/* ═══════════════════════════════════════════════════════════
   FOOTER LEGAL LINK ROW
   ═══════════════════════════════════════════════════════════ */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  justify-content: center;
  margin-bottom: .85rem;
}
.footer-links--legal {
  padding-top: .85rem;
  border-top: 1px solid var(--line);
  margin-bottom: .85rem;
}
.footer-links--legal a,
.footer-link-btn {
  font-size: .78rem;
  color: var(--text-faint);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.footer-link-btn {
  background: transparent;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: color .15s;
}
.footer-links--legal a:hover,
.footer-link-btn:hover {
  color: var(--gold);
}

/* ═══════════════════════════════════════════════════════════
   BROWSER AWARENESS
   Native UI theming, a11y, motion, print, contrast.
   ═══════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;
  accent-color: var(--gold);
}
[data-theme="pearl"] { color-scheme: light; }

input, select, textarea, button { caret-color: var(--gold); }

::selection { background: rgba(212,175,55,.28); color: var(--text); }
[data-theme="pearl"] ::selection { background: rgba(138,114,35,.22); color: #111; }

/* Scrollbar — Firefox + WebKit */
html {
  scrollbar-gutter: stable;
  scrollbar-color: rgba(212,175,55,.35) transparent;
  scrollbar-width: thin;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(212,175,55,.22);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(212,175,55,.45);
  background-clip: content-box;
}

/* Keyboard focus ring */
:focus { outline: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Anchor jumps land below the sticky topbar */
[id] { scroll-margin-top: 90px; }

/* Modern typography */
h1, h2, h3, h4 { text-wrap: balance; }
p, li, dd      { text-wrap: pretty; }

/* Disable hover transforms on touch-only devices */
@media (hover: none) {
  .product-card:hover,
  .brand-logo:hover,
  .cat-tile:hover,
  .partner-card:hover,
  .tag-item:hover,
  .brand-item:hover {
    transform: none;
    box-shadow: none;
  }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .orb-ring, .orb-body,
  .cat-tile.is-skeleton,
  .cookie-banner, .cookie-modal-panel,
  .cookie-modal-backdrop { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* Higher contrast preference */
@media (prefers-contrast: more) {
  :root {
    --line:        rgba(255,255,255,.22);
    --line-strong: rgba(255,255,255,.38);
    --text-dim:    #d4d4d4;
    --text-faint:  #b4b4b4;
  }
  .product-card, .cart-item, .prose-block,
  .value-card, .partner-card, .brand-item, .tag-item,
  .cookie-banner, .cookie-modal-panel { border-width: 2px; }
}

/* Windows High Contrast / forced-colors */
@media (forced-colors: active) {
  a { color: LinkText; }
  a:visited { color: VisitedText; }
  ::selection { background: Highlight; color: HighlightText; }
  .btn-primary, .btn-secondary, .btn-gold,
  .btn-cart, .btn-buy, .btn-auth, .btn-inquire,
  .cookie-btn, .btn-checkout {
    border: 1px solid ButtonText;
    forced-color-adjust: none;
  }
  .product-card, .cart-item, .prose-block,
  .value-card, .partner-card, .brand-item, .tag-item,
  .cookie-banner, .cookie-modal-panel { border: 1px solid CanvasText; }
  input, select, textarea { border: 1px solid ButtonText; }
}

/* Print */
@media print {
  :root {
    --bg-base: #fff; --bg-surface: #fff; --bg-raised: #f5f5f5;
    --text: #000; --text-dim: #333; --text-faint: #666;
    --line: #ccc; --line-strong: #999; --gold: #8a7223;
  }
  body { background: #fff !important; color: #000 !important; font-size: 11pt; padding: 0 !important; }
  .topbar, .shop-aside, .aside-backdrop, .aside-toggle,
  .cookie-banner, .cookie-modal, .site-footer .footer-links,
  .hero-search, .filter-bar, .pagination, .grid-more,
  .cart-item-img, .cart-item-qty, .cart-item-remove,
  .btn-cart, .btn-buy, .btn-checkout, .confirm-actions,
  .product-card .product-img { display: none !important; }
  a { color: #000 !important; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  .content-page, .prose-block, .product-detail, .confirmation,
  .about-section, .contact-section, .faq-section, .news-section {
    padding: 0 !important; margin: 0 !important; max-width: none !important;
    border: 0 !important; box-shadow: none !important; background: transparent !important;
  }
  .product-detail-grid { grid-template-columns: 1fr !important; gap: 1rem; }
  img { max-width: 100% !important; height: auto !important; }
  @page { margin: 15mm; }
}

/* Progressive enhancement */
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .btn-primary:hover { background: color-mix(in srgb, var(--gold) 88%, white); }
  .btn-secondary:hover { border-color: color-mix(in srgb, var(--gold) 70%, transparent); }
}
@supports selector(:has(*)) {
  .filter-switch:has(input:checked) { color: var(--text); }
}

/* Reduced-data preference */
@media (prefers-reduced-data: reduce) {
  .orb-ring, .orb-body, .cat-tile.is-skeleton { animation: none !important; }
}

#product-grid { overflow-anchor: auto; }

/* ═══════════════════════════════════════════════════════════
   PAGESPEED BENCHMARK
   ═══════════════════════════════════════════════════════════ */
.pagespeed-benchmark {
  margin: 3rem 0 2rem;
  padding: 2.5rem 0 0;
  border-top: 1px solid var(--line);
}
.pagespeed-benchmark h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: .02em;
  color: var(--text);
  text-align: center;
  margin-bottom: .75rem;
}
.ps-lead {
  text-align: center;
  color: var(--text-dim);
  font-size: .92rem;
  line-height: 1.65;
  max-width: 60ch;
  margin: 0 auto 2rem;
}


@media (max-width: 640px) {
  
}

.ps-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.25rem;
}
.ps-card--win {
  border-color: var(--gold);
  box-shadow: 0 12px 32px rgba(212,175,55,.08);
}

.ps-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}
.ps-card h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: .02em;
  color: var(--text);
  margin: 0;
}
.ps-verify {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-decoration: none;
  transition: color .15s;
}
.ps-verify:hover { color: var(--gold); }

.ps-metrics {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.ps-metrics > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem .75rem;
  border-radius: var(--radius);
}
.ps-metrics > div:nth-child(odd) { background: var(--bg-base); }

.ps-metrics dt {
  font-size: .82rem;
  color: var(--text-dim);
  letter-spacing: .02em;
}
.ps-metrics dd {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  margin: 0;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.ps-metrics dd[data-score="100"] { color: var(--ok); }
.ps-metrics dd[data-score="59"],
.ps-metrics dd[data-score="83"],
.ps-metrics dd[data-score="92"] { color: var(--text-dim); }
.ps-card:not(.ps-card--win) .ps-metrics dd[data-score="100"] { color: var(--text); }

.ps-note {
  text-align: center;
  font-size: .78rem;
  color: var(--text-faint);
  line-height: 1.7;
  max-width: 62ch;
  margin: 0 auto;
}
.ps-note a { color: var(--gold); text-decoration: none; }
.ps-note a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .ps-card { padding: 1.15rem 1.15rem 1rem; }
  .ps-metrics dd { font-size: 1.15rem; }
  .ps-card header { flex-direction: column; align-items: flex-start; gap: .35rem; }
}


/* ═══════════════════════════════════════════════════════════
   PAGESPEED BENCHMARK — 4-site grid
   ═══════════════════════════════════════════════════════════ */
.ps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 640px) {
  .ps-grid { grid-template-columns: 1fr; gap: 1rem; }
}

/* Cards reuse all the .ps-card, .ps-card--win, .ps-metrics rules already
   defined above. Only the container changes. */

/* ═══════════════════════════════════════════════════════════
   B2B CATALOGUE HOSTING — about page
   ═══════════════════════════════════════════════════════════ */
.b2b-hero {
  margin-bottom: 2.5rem;
}
.b2b-hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  letter-spacing: .01em;
  color: var(--text);
  margin-bottom: 1rem;
}
.b2b-hero .lead {
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 60ch;
}

/* ═══════════════════════════════════════════════════════════
   TOPBAR ACCOUNT LINK
   ═══════════════════════════════════════════════════════════ */
#topbar-account {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--text);
  font-size: .82rem;
  letter-spacing: .02em;
  padding: .35rem .6rem;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
  white-space: nowrap;
}
#topbar-account:hover { color: var(--gold); }
#topbar-account.is-logged-in {
  color: var(--gold);
  background: rgba(212,175,55,.08);
}
#topbar-account-label {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 720px) {
  #topbar-account-label { display: none; }
  #topbar-account { padding: .35rem; }
}

/* ═══════════════════════════════════════════════════════════
   ACCOUNT PASSWORD FORM
   ═══════════════════════════════════════════════════════════ */
.account-pw-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 420px;
}
.account-pw-form .form-row-c { margin-bottom: 0; }
.account-pw-form label {
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--text-dim);
}
.account-pw-form input {
  padding: .65rem .85rem;
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .95rem;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
.account-pw-form input:focus { border-color: var(--gold); }
.account-pw-form .hint {
  font-size: .72rem;
  color: var(--text-faint);
  margin-top: .15rem;
}
.account-pw-form .btn-gold {
  align-self: flex-start;
  margin-top: .25rem;
}
.account-pw-status {
  margin-top: .25rem;
  padding: .75rem .9rem;
  border-radius: var(--radius);
  font-size: .85rem;
  line-height: 1.5;
  border: 1px solid var(--line);
}
.account-pw-status--ok {
  border-color: var(--ok);
  background: rgba(76,175,125,.08);
  color: var(--ok);
}
.account-pw-status--error {
  border-color: var(--danger);
  background: rgba(224,82,82,.08);
  color: var(--danger);
}




/* ═══════════════════════════════════════════════════════════
   CATEGORY NAV — 3-section sidebar / drawer layout
   Shared by .filter-cat-* (sidebar) and .drawer-cat-* (drawer)
   ═══════════════════════════════════════════════════════════ */

.filter-cat-list, .filter-cat-list ul,
.drawer-cat-tree, .drawer-cat-tree ul,
.filter-cat-more-list, .drawer-cat-more-list {
  list-style: none; padding: 0; margin: 0;
}

.filter-cat-all, .drawer-cat-all {
  display: flex; align-items: center; gap: .35rem;
  padding: .5rem .5rem;
  font-size: .82rem;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: var(--radius);
  border-bottom: 1px solid var(--line);
  margin-bottom: .5rem;
  transition: color .12s;
}
.filter-cat-all:hover, .drawer-cat-all:hover { color: var(--gold); }

.filter-cat-crumb, .drawer-cat-crumb {
  display: block;
  padding: .35rem .5rem .6rem;
  font-size: .75rem;
  line-height: 1.5;
  color: var(--text-faint);
  border-bottom: 1px solid var(--line);
  margin-bottom: .6rem;
  overflow-wrap: anywhere;
}
.filter-cat-crumb a, .drawer-cat-crumb a {
  color: var(--text-dim);
  text-decoration: none;
}
.filter-cat-crumb a:hover, .drawer-cat-crumb a:hover { color: var(--gold); }
.filter-cat-sep, .drawer-cat-sep {
  color: var(--text-faint);
  padding: 0 .3rem;
  opacity: .5;
}

.filter-cat-heading, .drawer-cat-heading {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: .02em;
  padding: .35rem .5rem .75rem;
  margin-bottom: .25rem;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.filter-cat-section, .drawer-cat-section {
  display: block;
  margin: .9rem 0 .35rem;
  padding: .5rem .5rem 0;
  border-top: 1px solid var(--line);
  font-size: .65rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.filter-cat-section:first-of-type, .drawer-cat-section:first-of-type {
  margin-top: 0; border-top: 0; padding-top: 0;
}

.filter-cat-node, .drawer-cat-node { padding: 0; }
.filter-cat-row, .drawer-cat-row {
  display: flex; align-items: center; gap: .3rem;
  min-height: 30px;
}
.filter-cat-tick, .drawer-cat-tick {
  flex: 0 0 14px;
  text-align: center;
  color: var(--text-faint);
  font-size: .85rem;
  opacity: .55;
}
.filter-cat-link, .drawer-cat-link {
  flex: 1;
  padding: .35rem .5rem;
  font-size: .85rem;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: var(--radius);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.filter-cat-link:hover, .drawer-cat-link:hover {
  background: var(--bg-raised);
  color: var(--text);
}

.filter-cat-more, .drawer-cat-more {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--gold);
  font-family: inherit;
  font-size: .75rem;
  padding: .35rem .5rem;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background .12s;
}
.filter-cat-more:hover, .drawer-cat-more:hover {
  background: rgba(212, 175, 55, 0.08);
}

/* Drawer sizing — slightly more breathing room */
.drawer-cat-row { min-height: 40px; }
.drawer-cat-link { font-size: .9rem; padding: .5rem .55rem; }
.drawer-cat-tick { flex: 0 0 18px; font-size: .95rem; }
.drawer-cat-heading { font-size: 1.15rem; padding: .5rem .55rem 1rem; }
.drawer-cat-crumb { font-size: .78rem; }
.drawer-cat-section { font-size: .68rem; }

/* ═══════════════════════════════════════════════════════════
   THEME TOGGLE — Onyx / Pearl mode switch
   ═══════════════════════════════════════════════════════════ */

.topbar-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-width: 34px;
  height: 34px;
  padding: 0 .7rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-family: inherit;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
  flex-shrink: 0;
  margin-right: .5rem;
}
.topbar-theme:hover {
  color: var(--gold);
  background: rgba(212, 175, 55, .08);
  border-color: rgba(212, 175, 55, .3);
}
.topbar-theme .theme-icon { display: inline-flex; line-height: 0; }
.topbar-theme .theme-icon svg { display: block; }

/* Icon swap: show the icon of the mode you'll switch TO */
.topbar-theme .theme-icon-light { display: none; }
.topbar-theme .theme-icon-dark  { display: inline-flex; }
html[data-theme="pearl"] .topbar-theme .theme-icon-dark  { display: none; }
html[data-theme="pearl"] .topbar-theme .theme-icon-light { display: inline-flex; }

.theme-label {
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
  min-width: 3.4em;
  text-align: left;
}

/* Mobile: icon-only circle */
@media (max-width: 720px) {
  .theme-label { display: none; }
  .topbar-theme {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    margin-right: .25rem;
  }
}
