/* ==========================================================================
   Gemynos — storefront styles
   Warm-leather brand palette, RTL-first, mobile-first.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Brand tokens — Gemynos is gold on black (taken from the brand mark).
   Light is the default; dark is offered via prefers-color-scheme and an
   explicit [data-theme] set by the header toggle.
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;
  /* Brand constants — identical in both themes */
  --gold:        #C59739;
  --gold-bright: #E3C173;
  --gold-deep:   #A77827;
  --ink:         #0B0B0C;
  --ink-soft:    #16161A;

  /* ---- Light theme ---- */
  --bg:          #FDFBF8;
  --surface:     #FFFFFF;
  --surface-2:   #F7F4EE;
  --surface-3:   #F0EBE1;
  --line:        #E7E0D3;
  --line-strong: #D8CFBE;

  --text:        #1A1A1C;
  --text-soft:   #57555A;
  --text-mute:   #8B8790;

  --accent:         var(--gold-deep);
  --accent-contrast:#FFFFFF;
  --on-accent:      #FFFFFF;

  /* Header / footer are always the brand black so the gold mark sits right */
  --header-bg:   #0B0B0C;
  --header-text: #F2EDE3;
  --footer-bg:   #0B0B0C;
  --footer-text: #CFC7B8;

  --ok:     #3E7C56;
  --warn:   #B07A22;
  --danger: #B03A2E;
  --info:   #3A6B8A;

  --shadow-color: 18 16 12;
  --sh-1: 0 1px 2px rgb(var(--shadow-color) / .05), 0 2px 8px rgb(var(--shadow-color) / .04);
  --sh-2: 0 2px 6px rgb(var(--shadow-color) / .06), 0 12px 28px rgb(var(--shadow-color) / .08);
  --sh-3: 0 18px 48px rgb(var(--shadow-color) / .14);

  --font-body:    'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
  --font-display: 'Cormorant Garamond', 'Cairo', Georgia, serif;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;
  --r-pill: 999px;

  --wrap: 1200px;
  --gap:  clamp(14px, 2.2vw, 26px);
  --header-h: 64px;

  --ease: cubic-bezier(.4, 0, .2, 1);

  /* Aliases kept so existing rules keep working */
  --brand:      var(--gold-deep);
  --brand-dark: var(--ink);
  --brand-deep: var(--ink);
  --on-brand:   #FFFFFF;
}

/* ---- Dark theme: system preference, unless the reader chose light ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:          #0B0B0C;
    --surface:     #141416;
    --surface-2:   #1B1B1E;
    --surface-3:   #232327;
    --line:        #2C2C31;
    --line-strong: #3C3C43;

    --text:        #F2EFE9;
    --text-soft:   #B6B2AA;
    --text-mute:   #86827C;

    --accent:         var(--gold);
    --accent-contrast:#0B0B0C;
    --on-accent:      #0B0B0C;

    --header-bg:   #0B0B0C;
    --header-text: #F2EDE3;
    --footer-bg:   #080809;
    --footer-text: #B9B2A5;

    --ok:     #5FA97C;
    --warn:   #D2A045;
    --danger: #E0705F;
    --info:   #6BA3C6;

    --shadow-color: 0 0 0;
    --sh-1: 0 1px 2px rgb(0 0 0 / .40), 0 2px 8px rgb(0 0 0 / .30);
    --sh-2: 0 2px 6px rgb(0 0 0 / .45), 0 12px 28px rgb(0 0 0 / .40);
    --sh-3: 0 18px 48px rgb(0 0 0 / .58);

    --brand:      var(--gold);
    --brand-dark: var(--gold-bright);
    --brand-deep: #080809;
    --on-brand:   #0B0B0C;
  }
}

/* ---- Dark theme: explicit choice always wins ---- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #0B0B0C;
  --surface:     #141416;
  --surface-2:   #1B1B1E;
  --surface-3:   #232327;
  --line:        #2C2C31;
  --line-strong: #3C3C43;

  --text:        #F2EFE9;
  --text-soft:   #B6B2AA;
  --text-mute:   #86827C;

  --accent:         var(--gold);
  --accent-contrast:#0B0B0C;
  --on-accent:      #0B0B0C;

  --header-bg:   #0B0B0C;
  --header-text: #F2EDE3;
  --footer-bg:   #080809;
  --footer-text: #B9B2A5;

  --ok:     #5FA97C;
  --warn:   #D2A045;
  --danger: #E0705F;
  --info:   #6BA3C6;

  --shadow-color: 0 0 0;
  --sh-1: 0 1px 2px rgb(0 0 0 / .40), 0 2px 8px rgb(0 0 0 / .30);
  --sh-2: 0 2px 6px rgb(0 0 0 / .45), 0 12px 28px rgb(0 0 0 / .40);
  --sh-3: 0 18px 48px rgb(0 0 0 / .58);

  --brand:      var(--gold);
  --brand-dark: var(--gold-bright);
  --brand-deep: #080809;
  --on-brand:   #0B0B0C;
}
/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The off-canvas drawers sit outside the viewport; clip on the root as well
     as the body so they never create a sideways scroll (notably in RTL). */
  overflow-x: hidden;
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.skip-link {
  position: absolute; inset-inline-start: -9999px; top: 0; z-index: 999;
  background: var(--brand); color: #fff; padding: 10px 16px;
}
.skip-link:focus { inset-inline-start: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: clamp(14px, 3vw, 28px); }

/* Logical properties keep RTL/LTR honest without duplicated rules. */
[dir="rtl"] { --start: right; --end: left; }
[dir="ltr"] { --start: left;  --end: right; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px;
  border-radius: var(--r-pill);
  font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent;
  transition: background .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), transform .12s var(--ease), box-shadow .2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-dark); box-shadow: var(--sh-2); }
.btn-outline { border-color: var(--line-strong); color: var(--brand-dark); background: var(--surface); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { color: var(--brand); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 30px; font-size: 15.5px; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--r-pill);
  color: var(--brand-dark);
  transition: background .18s var(--ease), color .18s var(--ease);
  position: relative;
}
.icon-btn:hover { background: var(--surface-3); }

/* ---------- Top bar ---------- */
.topbar {
  background: #060607; color: #C9C2B6;
  font-size: 12.5px; letter-spacing: .01em;
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.topbar-note { opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-links { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.topbar a { opacity: .9; transition: opacity .18s var(--ease); }
.topbar a:hover { opacity: 1; }
.lang-switch {
  border: 1px solid rgba(255,255,255,.28); border-radius: var(--r-pill);
  padding: 2px 12px; font-size: 12px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg); color: var(--header-text);
  border-bottom: 1px solid rgba(197,151,57,.22);
  transition: box-shadow .25s var(--ease);
  /* No backdrop-filter here on purpose: filter/backdrop-filter makes an element
     a containing block for position:fixed descendants, which would trap the
     mobile nav drawer inside the header band instead of the viewport. */
}
.site-header .icon-btn { color: var(--header-text); }
.site-header .icon-btn:hover { background: rgba(197,151,57,.16); color: var(--gold-bright); }
.site-header.is-stuck { box-shadow: var(--sh-1); }
.header-in { display: flex; align-items: center; gap: 10px; min-height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; }
.brand-name {
  font-family: var(--font-display);
  font-size: 25px; font-weight: 600; letter-spacing: .14em;
  color: var(--gold-bright); line-height: 1; text-transform: uppercase;
}
[dir="rtl"] .brand-name { font-family: var(--font-body); font-size: 20px; font-weight: 700; letter-spacing: 0; }

.header-actions { display: flex; align-items: center; gap: 2px; margin-inline-start: auto; }
.cart-link { position: relative; }
.cart-badge {
  position: absolute; top: 4px; inset-inline-end: 3px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--gold); color: var(--ink);
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.cart-badge.is-empty { display: none; }

/* ---------- Navigation ---------- */
.main-nav { margin-inline-start: 18px; }
.nav-list { display: flex; align-items: center; gap: 2px; }
.nav-list > li { position: relative; }
.nav-list > li > a {
  display: block; padding: 8px 14px; border-radius: var(--r-pill);
  font-size: 14.5px; font-weight: 600; color: var(--header-text);
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav-list > li > a:hover { color: var(--gold-bright); background: rgba(197,151,57,.14); }
.nav-close, .nav-foot, .submenu-toggle { display: none; }

.submenu {
  position: absolute; top: calc(100% + 6px); inset-inline-start: 0;
  min-width: 200px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--sh-2);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.nav-list > li:hover > .submenu,
.nav-list > li:focus-within > .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu a {
  display: block; padding: 8px 12px; border-radius: var(--r-sm);
  font-size: 14px; color: var(--text-soft);
}
.submenu a:hover { background: var(--surface-2); color: var(--brand); }

.nav-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(43,37,33,.45); backdrop-filter: blur(2px);
}
.nav-overlay[hidden] { display: none; }

/* ---------- Search bar ---------- */
.search-bar { border-top: 1px solid rgba(197,151,57,.2); background: var(--ink-soft); }
.search-bar input { background: rgba(255,255,255,.06); border-color: rgba(197,151,57,.3); color: #F2EDE3; }
.search-bar input::placeholder { color: #8B8780; }
.search-bar[hidden] { display: none; }
.search-form { display: flex; gap: 8px; padding-block: 12px; }
.search-form input {
  flex: 1; padding: 11px 16px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--surface-2);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.search-form input:focus { outline: none; border-color: var(--brand); background: var(--surface); }

/* ---------- Hero / banners ---------- */
.hero { position: relative; background: var(--surface-3); overflow: hidden; }
.hero-slides { position: relative; }
.hero-slide {
  position: relative; display: none;
  min-height: clamp(300px, 46vw, 520px);
}
.hero-slide.is-active { display: block; animation: fadeIn .5s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero-slide picture { position: absolute; inset: 0; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to var(--end), rgba(43,37,33,.72) 0%, rgba(43,37,33,.35) 48%, rgba(43,37,33,.06) 100%);
}
.hero-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; justify-content: center;
  min-height: clamp(300px, 46vw, 520px);
  max-width: 620px; padding-block: 40px; color: #fff;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 5.4vw, 58px); font-weight: 600;
  letter-spacing: .01em; margin-bottom: 12px;
  text-shadow: 0 2px 20px rgba(0,0,0,.28);
}
[dir="rtl"] .hero-title { font-family: var(--font-body); font-weight: 700; font-size: clamp(26px, 4.8vw, 48px); }
.hero-sub { font-size: clamp(14.5px, 1.7vw, 18px); opacity: .93; margin-bottom: 24px; max-width: 46ch; }
.hero-dots { position: absolute; bottom: 18px; inset-inline-start: 50%; transform: translateX(50%); display: flex; gap: 8px; z-index: 3; }
[dir="ltr"] .hero-dots { transform: translateX(-50%); }
.hero-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.45); transition: all .2s var(--ease); }
.hero-dot.is-active { background: #fff; width: 26px; border-radius: var(--r-pill); }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.18); color: #fff;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); transition: background .2s var(--ease);
}
.hero-arrow:hover { background: rgba(255,255,255,.32); }
.hero-prev { inset-inline-start: 16px; }
.hero-next { inset-inline-end: 16px; }
.hero:hover .hero-arrow { display: flex; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(38px, 6vw, 72px); }
.section-alt { background: var(--surface-2); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: clamp(20px, 3vw, 34px);
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 36px); font-weight: 600;
  color: var(--brand-dark); letter-spacing: .01em;
}
[dir="rtl"] .section-title { font-family: var(--font-body); font-weight: 700; font-size: clamp(21px, 3vw, 30px); }
.section-title::after {
  content: ''; display: block; width: 52px; height: 2px;
  background: linear-gradient(to var(--end), var(--gold-bright), var(--gold-deep));
  margin-top: 10px; border-radius: 2px;
}
.section-head .btn { flex-shrink: 0; }

/* ---------- Department tiles ---------- */
.dept-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.dept-card {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--r-lg); aspect-ratio: 3 / 4;
  background: var(--brand-dark);
  box-shadow: var(--sh-1);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.dept-card:hover { transform: translateY(-4px); box-shadow: var(--sh-3); }
.dept-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.dept-card:hover img { transform: scale(1.06); }
.dept-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(43,37,33,.78) 0%, rgba(43,37,33,.15) 55%, transparent 100%);
}
.dept-name {
  position: absolute; bottom: 0; inset-inline: 0; z-index: 2;
  padding: 18px 16px; color: #fff;
  font-size: 16.5px; font-weight: 700; text-align: center;
}

/* ---------- Product grid ---------- */
.product-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
}
.product-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: var(--line-strong); }
.pc-media { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--surface-2); overflow: hidden; }
.pc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s var(--ease); }
.product-card:hover .pc-media img { transform: scale(1.05); }
.pc-badges { position: absolute; top: 10px; inset-inline-start: 10px; z-index: 2; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.badge {
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 700; color: #fff;
  background: var(--brand); letter-spacing: .01em;
  box-shadow: 0 1px 4px rgba(0,0,0,.14);
}
.badge-sale { background: var(--danger); }
.badge-out  { background: var(--text-mute); }
.pc-body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pc-cat { font-size: 12px; color: var(--text-mute); }
.pc-name {
  font-size: 15px; font-weight: 600; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.9em;
}
.pc-name a:hover { color: var(--brand); }
.pc-price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
.price-now { font-size: 16.5px; font-weight: 700; color: var(--brand-dark); }
.price-old { font-size: 13px; color: var(--text-mute); text-decoration: line-through; }
.pc-actions { margin-top: 10px; }

/* ---------- Empty state ---------- */
.empty {
  text-align: center; padding: clamp(40px, 8vw, 80px) 20px;
  color: var(--text-soft);
}
.empty svg { margin: 0 auto 16px; color: var(--line-strong); }
.empty h3 { font-size: 19px; margin-bottom: 8px; color: var(--text); }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-mute);
  padding-block: 16px;
}
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { opacity: .5; }

/* ---------- Catalogue layout ---------- */
.catalog { display: grid; gap: clamp(20px, 3vw, 34px); grid-template-columns: 250px 1fr; align-items: start; padding-bottom: clamp(40px, 6vw, 72px); }
.filters-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px;
  position: sticky; top: calc(var(--header-h) + 14px);
}
.filter-group + .filter-group { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.filter-group h4 { font-size: 14px; margin-bottom: 10px; color: var(--brand-dark); }
.filter-list li + li { margin-top: 3px; }
.filter-list a {
  display: block; padding: 6px 10px; border-radius: var(--r-sm);
  font-size: 14px; color: var(--text-soft);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.filter-list a:hover { background: var(--surface-2); color: var(--brand); }
.filter-list a.is-active { background: var(--surface-3); color: var(--brand-dark); font-weight: 600; }
.price-inputs { display: flex; gap: 8px; align-items: center; }
.price-inputs input {
  width: 100%; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: 13.5px;
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-chip {
  padding: 5px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 12.5px; color: var(--text-soft);
  transition: all .18s var(--ease);
}
.tag-chip:hover { border-color: var(--brand); color: var(--brand); }
.tag-chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.catalog-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.result-count { font-size: 13.5px; color: var(--text-soft); }
.sort-select, .filters-open {
  padding: 8px 14px; border: 1px solid var(--line-strong);
  border-radius: var(--r-pill); background: var(--surface); font-size: 13.5px;
}
.filters-open { display: none; align-items: center; gap: 6px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: clamp(28px, 4vw, 44px); }
.pg {
  min-width: 38px; height: 38px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: 14px; color: var(--text-soft); background: var(--surface);
  transition: all .18s var(--ease);
}
.pg:hover { border-color: var(--brand); color: var(--brand); }
.pg.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pg.dots { border-color: transparent; pointer-events: none; }

/* ---------- Product page ---------- */
.product-layout { display: grid; gap: clamp(24px, 4vw, 52px); grid-template-columns: 1fr 1fr; align-items: start; padding-bottom: clamp(40px, 6vw, 72px); }
.gallery { position: sticky; top: calc(var(--header-h) + 14px); }
.gallery-main {
  position: relative; aspect-ratio: 1 / 1;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
}
.gallery-main img, .gallery-main video, .gallery-main iframe {
  width: 100%; height: 100%; object-fit: cover; border: 0;
}
.gallery-item { display: none; width: 100%; height: 100%; }
.gallery-item.is-active { display: block; }
.gallery-thumbs { display: flex; gap: 9px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.gallery-thumb {
  position: relative; flex: 0 0 72px; width: 72px; height: 72px;
  border: 2px solid var(--line); border-radius: var(--r-sm);
  overflow: hidden; background: var(--surface-2);
  transition: border-color .18s var(--ease);
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.is-active { border-color: var(--brand); }
.gallery-thumb .play-icon {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(43,37,33,.42); color: #fff;
}

.product-info h1 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 36px); font-weight: 600;
  color: var(--brand-dark); margin-bottom: 10px;
}
[dir="rtl"] .product-info h1 { font-family: var(--font-body); font-weight: 700; font-size: clamp(21px, 3vw, 30px); }
.product-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-block: 14px; border-block: 1px solid var(--line); margin-bottom: 18px; }
.price-row .price-now { font-size: 27px; }
.price-save { font-size: 13px; font-weight: 700; color: var(--danger); background: #FBEDEB; padding: 3px 10px; border-radius: var(--r-pill); }
.meta-list { font-size: 14px; margin-bottom: 20px; }
.meta-list li { display: flex; gap: 10px; padding-block: 5px; }
.meta-list .k { color: var(--text-mute); min-width: 92px; }
.stock-ok { color: var(--ok); font-weight: 600; }
.stock-no { color: var(--danger); font-weight: 600; }
.stock-low { color: var(--warn); font-weight: 600; }

.opt-group { margin-bottom: 20px; }
.opt-label { font-size: 14px; font-weight: 600; margin-bottom: 9px; display: block; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.color-swatch { position: relative; }
.color-swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
.color-swatch span {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 10px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-pill);
  font-size: 13.5px; cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.color-swatch span::before {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  background: var(--sw, var(--surface-3));
  border: 1px solid rgba(0,0,0,.12); flex-shrink: 0;
}
.color-swatch input:checked + span { border-color: var(--brand); background: var(--surface-2); font-weight: 600; }
.color-swatch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.qty-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.qty-box { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-pill); overflow: hidden; background: var(--surface); }
.qty-box button { width: 40px; height: 42px; font-size: 19px; color: var(--brand-dark); transition: background .16s var(--ease); }
.qty-box button:hover { background: var(--surface-2); }
.qty-box input { width: 52px; height: 42px; text-align: center; border: 0; border-inline: 1px solid var(--line); background: transparent; -moz-appearance: textfield; }
.qty-box input::-webkit-outer-spin-button, .qty-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.buy-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.buy-actions .btn { flex: 1 1 180px; }

.share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--line); }
.share-label { font-size: 13.5px; color: var(--text-mute); }
.share-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-soft);
  border: 1px solid var(--line);
  transition: all .2s var(--ease);
}
.share-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); transform: translateY(-2px); }

.product-desc { margin-top: clamp(30px, 4vw, 48px); }
.product-desc h2 { font-size: 18px; color: var(--brand-dark); margin-bottom: 12px; }
.rte { font-size: 15px; line-height: 1.9; color: var(--text-soft); }
.rte h2, .rte h3, .rte h4 { color: var(--text); margin: 1.2em 0 .5em; }
.rte ul, .rte ol { padding-inline-start: 1.4em; margin-bottom: 1em; }
.rte ul { list-style: disc; }
.rte ol { list-style: decimal; }
.rte li { margin-bottom: .35em; }
.rte img { border-radius: var(--r); margin-block: 1em; }
.rte a { color: var(--brand); text-decoration: underline; }
.rte table { margin-block: 1em; font-size: 14px; }
.rte th, .rte td { border: 1px solid var(--line); padding: 8px 12px; text-align: start; }
.rte th { background: var(--surface-2); }

/* ---------- Cart ---------- */
.page-head { padding-block: clamp(24px, 4vw, 42px) 0; }
.page-title {
  font-family: var(--font-display); font-size: clamp(26px, 4vw, 40px);
  font-weight: 600; color: var(--brand-dark);
}
[dir="rtl"] .page-title { font-family: var(--font-body); font-weight: 700; font-size: clamp(22px, 3.4vw, 32px); }

.cart-layout { display: grid; gap: clamp(20px, 3vw, 34px); grid-template-columns: 1fr 340px; align-items: start; padding-block: clamp(20px, 3vw, 34px) clamp(40px, 6vw, 72px); }
.cart-items { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.cart-row { display: grid; grid-template-columns: 92px 1fr auto; gap: 14px; padding: 16px; align-items: center; }
.cart-row + .cart-row { border-top: 1px solid var(--line); }
.cart-thumb { width: 92px; height: 92px; border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-name { font-weight: 600; font-size: 15px; line-height: 1.5; }
.cart-name a:hover { color: var(--brand); }
.cart-variant { font-size: 12.5px; color: var(--text-mute); margin-top: 2px; }
.cart-unit { font-size: 13.5px; color: var(--text-soft); margin-top: 4px; }
.cart-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cart-line-total { font-weight: 700; color: var(--brand-dark); white-space: nowrap; }
.cart-remove { font-size: 12.5px; color: var(--text-mute); transition: color .18s var(--ease); }
.cart-remove:hover { color: var(--danger); }
.cart-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px; background: var(--surface-2); border-top: 1px solid var(--line); }

.summary {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px;
  position: sticky; top: calc(var(--header-h) + 14px);
}
.summary h3 { font-size: 17px; color: var(--brand-dark); margin-bottom: 14px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding-block: 7px; font-size: 14.5px; }
.sum-row .k { color: var(--text-soft); }
.sum-total {
  margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 18px; font-weight: 700; color: var(--brand-dark);
}
.sum-note { font-size: 12.5px; color: var(--text-mute); margin-top: 10px; }
.summary .btn { margin-top: 16px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.field .req { color: var(--danger); }
.field .hint { font-size: 12px; color: var(--text-mute); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); font-size: 14.5px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(107,78,61,.11);
}
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B6058' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-size: 17px;
  background-position: var(--end) 12px center;
  padding-inline-end: 38px;
}
.field-error { font-size: 12.5px; color: var(--danger); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: clamp(18px, 2.6vw, 26px);
}
.card + .card { margin-top: 18px; }
.card h3 { font-size: 17px; color: var(--brand-dark); margin-bottom: 16px; }

/* ---------- Payment method picker ---------- */
.pay-options { display: flex; flex-direction: column; gap: 10px; }
.pay-option { position: relative; }
.pay-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.pay-option label {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; cursor: pointer;
  border: 1.5px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.pay-option label::before {
  content: ''; flex-shrink: 0; margin-top: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line-strong);
  transition: all .18s var(--ease);
}
.pay-option input:checked + label { border-color: var(--brand); background: var(--surface-2); }
.pay-option input:checked + label::before { border-color: var(--brand); border-width: 5px; }
.pay-option input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.pay-title { font-weight: 600; font-size: 14.5px; }
.pay-desc { font-size: 12.5px; color: var(--text-mute); margin-top: 3px; line-height: 1.6; }

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 16px; border-radius: var(--r);
  font-size: 14px; margin-block: 14px;
  border: 1px solid transparent; border-inline-start-width: 3px;
}
.alert-success { background: #EEF6F1; color: #24603F; border-color: #BFDDCC; }
.alert-error   { background: #FBEDEB; color: #8E2E24; border-color: #F0C8C2; }
.alert-danger  { background: #FBEDEB; color: #8E2E24; border-color: #F0C8C2; }
.alert-warning { background: #FDF5E6; color: #85591A; border-color: #EBD9B4; }
.alert-info    { background: #EDF3F7; color: #2C556E; border-color: #C7DBE7; }

/* ---------- Order result ---------- */
.result-box { max-width: 620px; margin: 0 auto; text-align: center; padding-block: clamp(36px, 6vw, 68px); }
.result-icon {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  background: #EEF6F1; color: var(--ok);
}
.result-icon.is-fail { background: #FBEDEB; color: var(--danger); }
.result-icon.is-wait { background: #FDF5E6; color: var(--warn); }
.result-box h1 { font-size: clamp(23px, 3.4vw, 32px); color: var(--brand-dark); margin-bottom: 10px; }
.order-no-box {
  display: inline-block; margin: 16px 0;
  padding: 12px 26px; border: 1px dashed var(--line-strong);
  border-radius: var(--r); background: var(--surface-2);
}
.order-no-box .k { font-size: 12.5px; color: var(--text-mute); display: block; }
.order-no-box .v { font-size: 21px; font-weight: 700; color: var(--brand-dark); letter-spacing: .04em; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

.order-table { font-size: 14px; margin-top: 24px; text-align: start; }
.order-table th, .order-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: start; }
.order-table thead th { background: var(--surface-2); color: var(--brand-dark); font-size: 13px; }
.order-table tfoot td { font-weight: 700; }

.status-pill {
  display: inline-block; padding: 3px 12px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 600;
}
.st-new        { background: #EDF3F7; color: #2C556E; }
.st-processing { background: #FDF5E6; color: #85591A; }
.st-shipped    { background: #EEF1F8; color: #3B4A7A; }
.st-delivered  { background: #EEF6F1; color: #24603F; }
.st-cancelled  { background: #F3F1F0; color: #6B6058; }
.st-unpaid     { background: #F3F1F0; color: #6B6058; }
.st-pending    { background: #FDF5E6; color: #85591A; }
.st-paid       { background: #EEF6F1; color: #24603F; }
.st-failed     { background: #FBEDEB; color: #8E2E24; }
.st-refunded   { background: #EDF3F7; color: #2C556E; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-text); margin-top: clamp(40px, 6vw, 80px); }
.site-footer a:hover { color: var(--gold-bright); }
.footer-grid {
  display: grid; gap: clamp(24px, 3.5vw, 44px);
  grid-template-columns: 1.4fr repeat(3, 1fr);
  padding-block: clamp(36px, 5vw, 58px);
}
.footer-logo { width: 54px; height: 54px; object-fit: contain; border-radius: 8px; background: rgba(255,255,255,.06); padding: 4px; margin-bottom: 12px; }
.footer-tagline { font-size: 13.5px; opacity: .78; line-height: 1.8; max-width: 34ch; }
.footer-col h4 { font-size: 14.5px; color: #fff; margin-bottom: 14px; font-weight: 700; }
.footer-col li + li { margin-top: 8px; }
.footer-col a, .contact-list li { font-size: 13.5px; opacity: .78; transition: opacity .18s var(--ease); }
.footer-col a:hover { opacity: 1; color: #fff; }
.socials { display: flex; gap: 9px; margin-top: 16px; }
.social {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.09); color: #E9DFD6;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.social:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); }
.footer-bottom-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding-block: 15px;
  font-size: 12.5px; opacity: .68;
}
.pay-note { display: flex; gap: 7px; flex-wrap: wrap; }
.pay-chip { border: 1px solid rgba(255,255,255,.18); border-radius: var(--r-pill); padding: 2px 11px; }

/* ---------- WhatsApp float ---------- */
.wa-float {
  position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 50;
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #25D366; color: #fff;
  box-shadow: 0 6px 20px rgba(37,211,102,.38);
  transition: transform .2s var(--ease);
}
.wa-float:hover { transform: scale(1.07); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; inset-inline-start: 50%;
  transform: translate(50%, 120%);
  z-index: 200; max-width: min(90vw, 380px);
  background: var(--brand-deep); color: #fff;
  padding: 12px 20px; border-radius: var(--r-pill);
  font-size: 14px; box-shadow: var(--sh-3);
  transition: transform .32s var(--ease), opacity .32s var(--ease);
  opacity: 0; pointer-events: none;
}
[dir="ltr"] .toast { transform: translate(-50%, 120%); }
.toast.is-open { transform: translate(50%, 0); opacity: 1; }
[dir="ltr"] .toast.is-open { transform: translate(-50%, 0); }

/* ==========================================================================
   Responsive — the storefront is built mobile-first from here down
   ========================================================================== */
@media (max-width: 1000px) {
  .catalog { grid-template-columns: 1fr; }
  .filters-panel {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 80;
    width: min(86vw, 320px); border-radius: 0; border: 0;
    overflow-y: auto; padding: 20px;
    transition: transform .3s var(--ease);
    box-shadow: var(--sh-3);
  }
  [dir="ltr"] .filters-panel { transform: translateX(-100%); }
  [dir="rtl"] .filters-panel { transform: translateX(100%); }
  .filters-panel.is-open { transform: translateX(0); }
  .filters-open { display: inline-flex; }
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .product-layout { grid-template-columns: 1fr; }
  .gallery { position: static; }
}

@media (max-width: 780px) {
  .main-nav {
    position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 80;
    width: min(84vw, 320px); margin: 0;
    background: var(--surface); box-shadow: var(--sh-3);
    padding: 18px; overflow-y: auto;
    display: flex; flex-direction: column;
    transition: transform .3s var(--ease);
  }
  /* CSS transforms are not direction-aware, so each direction gets its own
     off-screen sign: the drawer hides toward the edge it is pinned to. */
  [dir="ltr"] .main-nav { transform: translateX(100%); }
  [dir="rtl"] .main-nav { transform: translateX(-100%); }
  .main-nav.is-open { transform: translateX(0); }
  .nav-close { display: inline-flex; align-self: flex-end; margin-bottom: 6px; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list > li { border-bottom: 1px solid var(--line); }
  .nav-list > li > a { padding: 13px 6px; border-radius: 0; font-size: 15.5px; }
  .nav-list > li.has-children { position: relative; }
  .submenu-toggle {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 6px; inset-inline-end: 0;
    width: 40px; height: 40px; color: var(--text-soft);
    transition: transform .22s var(--ease);
  }
  .nav-list > li.is-open .submenu-toggle { transform: rotate(180deg); }
  .submenu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; padding: 0 0 8px;
    background: transparent; min-width: 0;
    display: none;
  }
  .nav-list > li.is-open .submenu { display: block; }
  .submenu a { padding: 9px 18px; font-size: 14px; }
  .nav-foot { display: block; margin-top: auto; padding-top: 18px; }
  .nav-foot .lang-switch { color: var(--brand); border-color: var(--line-strong); padding: 6px 16px; display: inline-block; }
  .topbar-note { display: none; }
  .topbar-in { justify-content: flex-end; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  :root { --header-h: 58px; }
  .brand-logo { width: 34px; height: 34px; }
  .brand-name { font-size: 20px; }
  [dir="rtl"] .brand-name { font-size: 17px; }
  .icon-btn { width: 38px; height: 38px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .pc-body { padding: 11px 12px 13px; }
  .pc-name { font-size: 13.5px; min-height: 2.8em; }
  .price-now { font-size: 15px; }
  .dept-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .footer-bottom-in { justify-content: center; text-align: center; }
  .cart-row { grid-template-columns: 68px 1fr; row-gap: 10px; padding: 13px; }
  .cart-thumb { width: 68px; height: 68px; }
  .cart-controls { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .buy-actions .btn { flex: 1 1 100%; }
  .hero-content { max-width: 100%; }
  .wa-float { width: 46px; height: 46px; bottom: 14px; inset-inline-end: 14px; }
  .gallery-thumb { flex-basis: 60px; width: 60px; height: 60px; }
}

@media (max-width: 380px) {
  .product-grid { grid-template-columns: 1fr; }
  .dept-grid { grid-template-columns: 1fr; }
}

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

@media print {
  .topbar, .site-header, .site-footer, .wa-float, .result-actions, .btn { display: none !important; }
  body { background: #fff; }
  .card, .order-table { border-color: #ccc; }
}

/* ==========================================================================
   Theme toggle
   ========================================================================== */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--r-pill);
  color: var(--header-text);
  transition: background .18s var(--ease), color .18s var(--ease);
}
.theme-toggle:hover { background: rgba(197,151,57,.16); color: var(--gold-bright); }
/* Show the sun in dark mode and the moon in light mode. */
.theme-toggle .i-sun  { display: none; }
.theme-toggle .i-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .i-sun  { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun  { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

/* The brand mark is gold-on-transparent, so it needs no per-theme treatment,
   but an uploaded logo with a light background gets a soft plate in dark mode. */
.brand-logo { background: transparent; }

/* Gold accents that only make sense against the dark chrome */
.lang-switch { border-color: rgba(197,151,57,.42); color: var(--gold-bright); }
.lang-switch:hover { background: rgba(197,151,57,.16); }

/* Product imagery keeps a neutral plate in both themes */
.pc-media, .gallery-main, .cart-thumb { background: var(--surface-2); }

/* Price + heading accents lean on the gold in dark mode */
.price-now { color: var(--brand-dark); }
.badge { color: #fff; }
.badge-sale { background: var(--danger); }

/* Hero text stays light because the overlay is always dark */
.hero-title, .hero-sub { color: #fff; }
.hero-overlay {
  background: linear-gradient(to var(--end),
              rgba(6,6,7,.80) 0%, rgba(6,6,7,.42) 48%, rgba(6,6,7,.08) 100%);
}
.dept-card::after {
  background: linear-gradient(to top, rgba(6,6,7,.82) 0%, rgba(6,6,7,.18) 55%, transparent 100%);
}

/* Mobile nav drawer is a dark panel to match the header */
@media (max-width: 780px) {
  .main-nav { background: var(--ink-soft); }
  .main-nav .nav-list > li { border-bottom-color: rgba(197,151,57,.16); }
  .main-nav .nav-close { color: var(--header-text); }
  .main-nav .submenu a { color: #C9C2B6; }
  .main-nav .submenu a:hover { color: var(--gold-bright); background: rgba(197,151,57,.12); }
}

/* ---------- Status pills & alerts in dark mode ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .st-new,       :root:not([data-theme="light"]) .st-refunded { background:#142630; color:#8FC2DE; }
  :root:not([data-theme="light"]) .st-processing,:root:not([data-theme="light"]) .st-pending  { background:#33280F; color:#E3C173; }
  :root:not([data-theme="light"]) .st-shipped    { background:#1B1F33; color:#A3AEE0; }
  :root:not([data-theme="light"]) .st-delivered, :root:not([data-theme="light"]) .st-paid     { background:#16301F; color:#8FD3A9; }
  :root:not([data-theme="light"]) .st-cancelled, :root:not([data-theme="light"]) .st-unpaid   { background:#26262B; color:#B6B2AA; }
  :root:not([data-theme="light"]) .st-failed     { background:#331817; color:#EC9C90; }
  :root:not([data-theme="light"]) .alert-success { background:#16301F; color:#8FD3A9; border-color:#2C5C3E; }
  :root:not([data-theme="light"]) .alert-error,
  :root:not([data-theme="light"]) .alert-danger  { background:#331817; color:#EC9C90; border-color:#6B302A; }
  :root:not([data-theme="light"]) .alert-warning { background:#33280F; color:#E3C173; border-color:#6B5520; }
  :root:not([data-theme="light"]) .alert-info    { background:#142630; color:#8FC2DE; border-color:#2A4C61; }
  :root:not([data-theme="light"]) .price-save    { background:#331817; color:#EC9C90; }
  :root:not([data-theme="light"]) .result-icon              { background:#16301F; color:#8FD3A9; }
  :root:not([data-theme="light"]) .result-icon.is-fail      { background:#331817; color:#EC9C90; }
  :root:not([data-theme="light"]) .result-icon.is-wait      { background:#33280F; color:#E3C173; }
}
:root[data-theme="dark"] .st-new,        :root[data-theme="dark"] .st-refunded { background:#142630; color:#8FC2DE; }
:root[data-theme="dark"] .st-processing, :root[data-theme="dark"] .st-pending  { background:#33280F; color:#E3C173; }
:root[data-theme="dark"] .st-shipped     { background:#1B1F33; color:#A3AEE0; }
:root[data-theme="dark"] .st-delivered,  :root[data-theme="dark"] .st-paid     { background:#16301F; color:#8FD3A9; }
:root[data-theme="dark"] .st-cancelled,  :root[data-theme="dark"] .st-unpaid   { background:#26262B; color:#B6B2AA; }
:root[data-theme="dark"] .st-failed      { background:#331817; color:#EC9C90; }
:root[data-theme="dark"] .alert-success  { background:#16301F; color:#8FD3A9; border-color:#2C5C3E; }
:root[data-theme="dark"] .alert-error,
:root[data-theme="dark"] .alert-danger   { background:#331817; color:#EC9C90; border-color:#6B302A; }
:root[data-theme="dark"] .alert-warning  { background:#33280F; color:#E3C173; border-color:#6B5520; }
:root[data-theme="dark"] .alert-info     { background:#142630; color:#8FC2DE; border-color:#2A4C61; }
:root[data-theme="dark"] .price-save     { background:#331817; color:#EC9C90; }
:root[data-theme="dark"] .result-icon            { background:#16301F; color:#8FD3A9; }
:root[data-theme="dark"] .result-icon.is-fail    { background:#331817; color:#EC9C90; }
:root[data-theme="dark"] .result-icon.is-wait    { background:#33280F; color:#E3C173; }

/* ---------- Sham Cash wallet QR ---------- */
.qr-block {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-top: 12px; padding: 12px;
  background: #fff;                 /* a QR must sit on white to scan reliably */
  border: 1px solid var(--line-strong); border-radius: var(--r);
  max-width: 260px;
}
.qr-img { width: 200px; height: 200px; object-fit: contain; display: block; }
.qr-hint { font-size: 12.5px; color: #57555A; text-align: center; line-height: 1.6; }
@media (max-width: 480px) {
  .qr-block { max-width: 100%; }
  .qr-img { width: 170px; height: 170px; }
}
@media print { .qr-block { break-inside: avoid; } }

/* ---------- Active filter chips ---------- */
.active-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 14px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r);
}
.af-label { font-size: 12.5px; color: var(--text-mute); font-weight: 600; }
.af-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line-strong);
  font-size: 12.5px; color: var(--text);
  transition: border-color .16s var(--ease), color .16s var(--ease);
}
.af-chip:hover { border-color: var(--danger); color: var(--danger); }
.af-chip svg { opacity: .55; flex-shrink: 0; }
.af-chip:hover svg { opacity: 1; }
.af-clear {
  font-size: 12.5px; color: var(--accent); font-weight: 600;
  margin-inline-start: auto; text-decoration: underline;
}

/* ---------- Form controls: never inherit the OS-default field colours ---------- */
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="submit"]):not([type="button"]),
select,
textarea {
  background-color: var(--surface);
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--text-mute); opacity: 1; }
option { background-color: var(--surface); color: var(--text); }
/* The header search sits on the dark chrome and keeps its own treatment. */
.search-bar input { background-color: rgba(255,255,255,.06); color: #F2EDE3; }
.search-bar input::placeholder { color: #8B8780; }
