@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

/* ==========================================================================
   جواهری اصیل — Design system
   Palette taken directly from the brand mark: #CC3433 red on white.
   ========================================================================== */
:root {
  --red: #CC3433;
  --red-700: #A82826;
  --red-100: #F9DEDE;
  --red-50: #FDF4F4;

  --ink: #17110F;
  --ink-2: #3A3330;
  --ink-3: #6B625E;
  --ink-4: #9A918C;
  --line: #ECE8E6;
  --line-2: #E0DAD7;
  --bg: #FFFFFF;
  --bg-alt: #FAF8F7;
  --bg-3: #F3EFED;

  --text: var(--ink);
  --text-soft: var(--ink-3);

  --font: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1rem;
  --fs-md: clamp(1.0625rem, 0.98rem + 0.4vw, 1.1875rem);
  --fs-lg: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --fs-xl: clamp(1.75rem, 1.45rem + 1.5vw, 2.5rem);
  --fs-2xl: clamp(2.125rem, 1.6rem + 2.6vw, 3.75rem);

  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4.5rem;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 34px;
  --r-full: 999px;

  --sh-1: 0 1px 2px rgba(23,17,15,.04), 0 2px 6px rgba(23,17,15,.04);
  --sh-2: 0 2px 6px rgba(23,17,15,.05), 0 10px 26px rgba(23,17,15,.07);
  --sh-3: 0 8px 20px rgba(23,17,15,.08), 0 24px 56px rgba(23,17,15,.10);
  --sh-red: 0 8px 24px rgba(204,52,51,.28);

  --e: cubic-bezier(.22,.61,.36,1);
  --e-out: cubic-bezier(.16,1,.3,1);
  --t-fast: .18s;
  --t: .32s;
  --t-slow: .6s;

  --header-h: 72px;
  --wrap: 1220px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.85;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px; }
/* The UA hides [hidden] via display:none, but any explicit display rule wins —
   .filter-block is display:flex, so the charge filter stayed visible on the
   used-gold tab. This makes the attribute authoritative everywhere. */
[hidden] { display: none !important; }
::selection { background: var(--red); color: #fff; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-weight: 800; line-height: 1.25; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: var(--fs-2xl); font-weight: 900; line-height: 1.16; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); font-weight: 700; }
p { color: var(--text-soft); }
strong { font-weight: 700; color: var(--ink); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em;
  color: var(--red); margin-bottom: var(--sp-3);
}
.eyebrow::before { content: ''; width: 22px; height: 3px; background: var(--red); border-radius: 2px; }
.lead { font-size: var(--fs-md); color: var(--text-soft); max-width: 56ch; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--sp-5); }
.section { padding-block: var(--sp-8); }
.section-sm { padding-block: var(--sp-7); }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: var(--sp-7); max-width: 62ch; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head p { margin-top: var(--sp-3); }
.head-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-5); flex-wrap: wrap; margin-bottom: var(--sp-6);
}
.grid { display: grid; gap: var(--sp-5); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 560px) { .grid-4 { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 0.95em 1.7em;
  font-size: var(--fs-sm); font-weight: 700; line-height: 1;
  border-radius: var(--r-full);
  border: 1.5px solid transparent;
  white-space: nowrap;
  transition: transform var(--t-fast) var(--e), background var(--t-fast) var(--e),
              color var(--t-fast) var(--e), border-color var(--t-fast) var(--e),
              box-shadow var(--t) var(--e);
}
.btn svg { width: 1.15em; height: 1.15em; flex-shrink: 0; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-700); box-shadow: var(--sh-red); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; box-shadow: var(--sh-2); }
.btn-outline { border-color: var(--line-2); color: var(--ink); background: #fff; }
.btn-outline:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.btn-ghost { color: var(--red); background: var(--red-50); }
.btn-ghost:hover { background: var(--red-100); }
.btn-light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.28); }
.btn-light:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn-white { background: #fff; color: var(--red); }
.btn-white:hover { background: var(--ink); color: #fff; }
.btn-sm { padding: 0.7em 1.2em; font-size: var(--fs-xs); }
.btn-lg { padding: 1.1em 2.2em; font-size: var(--fs-base); }
.btn-block { width: 100%; }

.link-arrow {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-weight: 700; font-size: var(--fs-sm); color: var(--red);
}
.link-arrow svg { width: 16px; height: 16px; transition: transform var(--t) var(--e); }
.link-arrow:hover svg { transform: translateX(-4px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t) var(--e), box-shadow var(--t) var(--e);
}
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: 0 1px 20px rgba(23,17,15,.05); }
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); }
.brand { display: flex; align-items: center; gap: var(--sp-3); }
.brand img { width: 42px; height: 42px; border-radius: 11px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: var(--fs-base); font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.brand-sub { font-size: 0.7rem; font-weight: 500; color: var(--ink-4); }

.nav-links { display: flex; align-items: center; gap: var(--sp-2); }
.nav-links a {
  padding: 0.5em 0.95em; font-size: var(--fs-sm); font-weight: 600;
  color: var(--ink-2); border-radius: var(--r-full);
  transition: color var(--t-fast) var(--e), background var(--t-fast) var(--e);
}
.nav-links a:hover { color: var(--ink); background: var(--bg-3); }
.nav-links a[aria-current="page"] { color: var(--red); background: var(--red-50); }
.nav-actions { display: flex; align-items: center; gap: var(--sp-2); }

.nav-toggle {
  display: none; width: 42px; height: 42px; border-radius: 12px;
  align-items: center; justify-content: center; flex-direction: column; gap: 5px;
  background: var(--bg-3);
}
.nav-toggle span {
  width: 18px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform var(--t) var(--e), opacity var(--t-fast) var(--e);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed; inset-inline: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; box-shadow: 0 20px 40px rgba(23,17,15,.10);
    padding-inline: var(--sp-5);
    max-height: 0; overflow: hidden;
    transition: max-height var(--t) var(--e), padding var(--t) var(--e);
  }
  .nav-links.is-open { max-height: 60vh; padding-block: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--line); }
  .nav-links a { padding: 0.85em 0.6em; border-radius: var(--r-xs); font-size: var(--fs-base); }
  .nav-actions .desktop-only { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding-block: var(--sp-8) var(--sp-7); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--sp-8); align-items: center; }
.hero h1 { margin-bottom: var(--sp-5); }
.hero h1 .accent { color: var(--red); }
.hero-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-6); }
/* Brand block: the mark sits on a soft tinted stage rather than a hard red
   box, and the logo is given real breathing room so it is never cropped. */
.hero-brand {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-4);
  justify-self: end; width: 100%; max-width: 360px;
}
.brand-plate {
  position: relative; width: 100%; aspect-ratio: 1;
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 30% 22%, #E24A46 0%, transparent 55%),
    linear-gradient(150deg, #D93B39 0%, var(--red) 45%, #A82826 100%);
  display: grid; place-items: center;
  box-shadow: 0 18px 50px rgba(204,52,51,.30), inset 0 1px 0 rgba(255,255,255,.22);
  overflow: hidden;
}
/* Soft ring detail, purely decorative, kept well clear of the logo. */
.brand-plate::before {
  content: ''; position: absolute; inset: 9%;
  border: 1px solid rgba(255,255,255,.16); border-radius: calc(var(--r-xl) - 8px);
}
.brand-plate img {
  position: relative; z-index: 1;
  width: 58%; height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.18));
}
.brand-caption {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3);
  background: var(--bg-alt); border: 1px solid var(--line);
  padding: 0.6em 1.1em; border-radius: var(--r-full);
}
.brand-caption svg { width: 16px; height: 16px; color: var(--red); }

@media (max-width: 900px) {
  .hero { padding-block: var(--sp-6); }
  .hero-grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .hero-brand { order: -1; max-width: 210px; margin-inline: auto; justify-self: center; }
  .brand-plate { border-radius: var(--r-lg); }
}

/* ---------- Choice cards (نو / دست دوم) ---------- */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.choice-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 230px; padding: var(--sp-6);
  border-radius: var(--r-lg);
  transition: transform var(--t) var(--e-out), box-shadow var(--t) var(--e-out);
}
.choice-card:hover { transform: translateY(-5px); box-shadow: var(--sh-3); }
.choice-card .tag {
  align-self: flex-start; font-size: var(--fs-xs); font-weight: 700;
  padding: 0.4em 0.9em; border-radius: var(--r-full); margin-bottom: var(--sp-4);
}
.choice-card h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); color: #fff; }
.choice-card p { font-size: var(--fs-sm); max-width: 34ch; }
.choice-card .go {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-weight: 700; font-size: var(--fs-sm); margin-top: var(--sp-5); color: #fff;
}
.choice-card .go svg { width: 18px; height: 18px; transition: transform var(--t) var(--e); }
.choice-card:hover .go svg { transform: translateX(-5px); }
.choice-card .bg-num {
  position: absolute; z-index: -1;
  inset-inline-end: -8px; bottom: -40px;
  font-size: 9rem; font-weight: 900; line-height: 1;
  letter-spacing: -0.04em; opacity: .08; color: #fff;
}
.choice-new { background: var(--red); }
.choice-new p { color: rgba(255,255,255,.82); }
.choice-new .tag { background: rgba(255,255,255,.18); color: #fff; }
.choice-used { background: var(--ink); }
.choice-used p { color: rgba(255,255,255,.68); }
.choice-used .tag { background: rgba(255,255,255,.12); color: #fff; }
@media (max-width: 720px) {
  .choice-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 0; padding: var(--sp-5); }
}

/* ---------- Live gold price ---------- */
.price-strip { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: var(--sp-6); }
.price-strip-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); flex-wrap: wrap; }
.price-strip .label { font-size: var(--fs-xs); color: rgba(255,255,255,.55); }
.price-strip .title { font-size: var(--fs-md); font-weight: 700; color: #fff; }
.price-strip .value {
  display: flex; align-items: baseline; gap: var(--sp-2);
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem);
  font-weight: 900; letter-spacing: -0.02em; color: #fff;
}
.price-strip .value .unit { font-size: var(--fs-sm); font-weight: 500; color: rgba(255,255,255,.55); }
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #4ADE80; margin-inline-end: var(--sp-2);
  box-shadow: 0 0 0 0 rgba(74,222,128,.7); animation: livePulse 2s infinite;
}
@keyframes livePulse {
  70% { box-shadow: 0 0 0 9px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

/* ---------- Category tiles ---------- */
.cat-tile {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-3); text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  transition: transform var(--t) var(--e-out), border-color var(--t-fast) var(--e), box-shadow var(--t) var(--e-out);
}
/* 9 categories: 5+4 on desktop, 3+3+3 on tablet/mobile — never a lone orphan. */
.cat-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1000px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .cat-grid { gap: var(--sp-3); } .cat-tile { padding: var(--sp-4) var(--sp-2); } .cat-tile span { font-size: var(--fs-xs); } }
.cat-tile:hover { transform: translateY(-4px); border-color: var(--red); box-shadow: var(--sh-2); }
.cat-tile .ic { width: 46px; height: 46px; display: grid; place-items: center; color: var(--red); transition: transform var(--t) var(--e-out); }
.cat-tile:hover .ic { transform: scale(1.1); }
.cat-tile .ic svg { width: 100%; height: 100%; }
.cat-tile span { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }

/* ---------- Product card ---------- */
.product-card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
  transition: transform var(--t) var(--e-out), box-shadow var(--t) var(--e-out), border-color var(--t-fast) var(--e);
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--sh-2); border-color: var(--line-2); }
.product-card .thumb {
  position: relative; aspect-ratio: 1; background: var(--bg-alt);
  display: grid; place-items: center; overflow: hidden;
}
.product-card .thumb > img {
  grid-area: 1 / 1;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--e-out);
}
.product-card:hover .thumb > img { transform: scale(1.06); }
/* Icon sits underneath and only shows through when the photo is missing. */
.product-card .thumb-fallback {
  grid-area: 1 / 1; display: none;
  width: 52%; height: 52%; color: var(--red); opacity: .5;
}
.product-card .thumb.no-img { padding: var(--sp-6); }
.product-card .thumb.no-img .thumb-fallback { display: block; }
.product-card .thumb-fallback svg { width: 100%; height: 100%; }
.product-card .badge-code {
  position: absolute; top: var(--sp-3); inset-inline-start: var(--sp-3);
  font-size: 0.6875rem; font-weight: 700;
  background: rgba(23,17,15,.85); color: #fff;
  padding: 0.35em 0.7em; border-radius: var(--r-xs);
}
.product-card .badge-tag {
  position: absolute; top: var(--sp-3); inset-inline-end: var(--sp-3);
  font-size: 0.6875rem; font-weight: 700;
  padding: 0.35em 0.7em; border-radius: var(--r-xs);
  background: var(--red); color: #fff;
}
.product-card .badge-tag.used { background: var(--ink); }
.product-card .body { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.product-card .cat { font-size: var(--fs-xs); color: var(--ink-4); }
.product-card h3 { font-size: var(--fs-base); font-weight: 700; line-height: 1.5; }
.product-card h3 a:hover { color: var(--red); }
.product-card .meta {
  display: flex; gap: var(--sp-3); flex-wrap: wrap;
  font-size: var(--fs-xs); color: var(--ink-4);
  padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line);
}
.product-card .meta-hl { color: var(--red); font-weight: 700; }
.product-card .foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); margin-top: auto; padding-top: var(--sp-1);
}
.product-card .price { display: flex; flex-direction: column; line-height: 1.3; }
.product-card .price .n { font-size: var(--fs-base); font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.product-card .price .u { font-size: 0.6875rem; color: var(--ink-4); }
@media (max-width: 560px) {
  .product-card .body { padding: var(--sp-3); }
  .product-card .meta-hl { color: var(--red); font-weight: 700; }
.product-card .foot { flex-direction: column; align-items: stretch; }
  .product-card .foot .btn { width: 100%; }
}

/* ---------- Segmented control ---------- */
.segmented { display: inline-flex; padding: 5px; background: var(--bg-3); border-radius: var(--r-full); gap: 2px; }
.segmented button {
  padding: 0.65em 1.35em; font-size: var(--fs-sm); font-weight: 700;
  color: var(--ink-3); border-radius: var(--r-full); white-space: nowrap;
  transition: color var(--t-fast) var(--e), background var(--t) var(--e);
}
.segmented button[aria-selected="true"] { background: #fff; color: var(--red); box-shadow: var(--sh-1); }
@media (max-width: 560px) {
  .segmented { width: 100%; }
  .segmented button { flex: 1; padding: 0.7em 0.5em; font-size: var(--fs-xs); }
}

/* ---------- Chips ---------- */
.chip-row { display: flex; gap: var(--sp-2); overflow-x: auto; padding-block: var(--sp-1); scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 0.6em 1.1em; font-size: var(--fs-xs); font-weight: 600;
  border-radius: var(--r-full); border: 1.5px solid var(--line-2);
  color: var(--ink-2); background: #fff;
  transition: all var(--t-fast) var(--e);
}
.chip:hover { border-color: var(--ink-4); }
.chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- Filters ---------- */
.filter-panel {
  position: sticky; top: calc(var(--header-h) + 16px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-6);
}
.filter-block { display: flex; flex-direction: column; gap: var(--sp-3); }
.filter-label { display: flex; align-items: center; justify-content: space-between; }
.filter-label > span:first-child { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.filter-hint { font-size: var(--fs-xs); color: var(--ink-4); }

.range-inputs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: var(--sp-2); }
.range-inputs .dash { color: var(--ink-4); font-size: var(--fs-xs); padding-bottom: 0.7em; }
.num-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.num-field label { font-size: 0.6875rem; color: var(--ink-4); font-weight: 500; }
.num-field input {
  width: 100%; padding: 0.6em 0.35em;
  font-size: 0.75rem; font-weight: 700; text-align: center;
  letter-spacing: -0.02em;
  border: 1.5px solid var(--line-2); border-radius: var(--r-xs);
  background: #fff; -moz-appearance: textfield;
  transition: border-color var(--t-fast) var(--e), box-shadow var(--t-fast) var(--e);
}
.num-field input::-webkit-outer-spin-button,
.num-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-field input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-50); }
.num-field input.is-invalid { border-color: var(--red); background: var(--red-50); }

.dual-range { position: relative; height: 28px; margin-top: var(--sp-1); }
.dual-range .track { position: absolute; inset-inline: 0; top: 50%; transform: translateY(-50%); height: 4px; background: var(--line-2); border-radius: 2px; }
.dual-range .track-fill { position: absolute; top: 50%; transform: translateY(-50%); height: 4px; background: var(--red); border-radius: 2px; }
.dual-range input[type="range"] {
  position: absolute; inset-inline: 0; top: 0; width: 100%; height: 28px;
  -webkit-appearance: none; appearance: none; background: none; pointer-events: none;
}
.dual-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--red);
  box-shadow: var(--sh-1); cursor: grab; pointer-events: auto;
  transition: transform var(--t-fast) var(--e);
}
.dual-range input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.15); }
.dual-range input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--red);
  box-shadow: var(--sh-1); cursor: grab; pointer-events: auto;
}

.filter-toggle-mobile { display: none; }
.filter-backdrop { display: none; }
@media (max-width: 960px) {
  .filter-toggle-mobile { display: inline-flex; }
  .filter-panel {
    position: fixed; inset-inline: 0; bottom: 0; top: auto; z-index: 200;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    transform: translateY(101%);
    transition: transform var(--t) var(--e-out);
    max-height: 82vh; overflow-y: auto;
    box-shadow: 0 -12px 40px rgba(23,17,15,.16);
    padding-bottom: var(--sp-6);
  }
  .filter-panel.is-open { transform: translateY(0); }
  .filter-backdrop {
    display: block; position: fixed; inset: 0; z-index: 199;
    background: rgba(23,17,15,.4);
    opacity: 0; pointer-events: none;
    transition: opacity var(--t) var(--e);
  }
  .filter-backdrop.is-open { opacity: 1; pointer-events: auto; }
}

.sort-select { position: relative; }
.sort-select select {
  appearance: none; -webkit-appearance: none;
  padding: 0.7em 2.4em 0.7em 1.1em;
  font-size: var(--fs-xs); font-weight: 600;
  border: 1.5px solid var(--line-2); border-radius: var(--r-full);
  background: #fff; cursor: pointer;
  transition: border-color var(--t-fast) var(--e);
}
.sort-select select:hover { border-color: var(--ink-4); }
.sort-select::after {
  content: ''; position: absolute; inset-inline-start: 14px; top: 50%;
  width: 7px; height: 7px;
  border-inline-start: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: translateY(-70%) rotate(-45deg); pointer-events: none;
}

.search-bar { position: relative; margin-bottom: var(--sp-4); }
.search-bar input {
  width: 100%; padding: 0.95em 3em 0.95em 2.8em;
  font-size: var(--fs-sm);
  border: 1.5px solid var(--line-2); border-radius: var(--r-full);
  background: #fff; color: var(--ink);
  transition: border-color var(--t-fast) var(--e), box-shadow var(--t-fast) var(--e);
}
.search-bar input::placeholder { color: var(--ink-4); }
.search-bar input:focus {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-50);
}
.search-bar input::-webkit-search-cancel-button { display: none; }
.search-bar .search-ic {
  position: absolute; inset-inline-start: 1.1em; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--ink-4); pointer-events: none;
}
.search-clear {
  position: absolute; inset-inline-end: 0.7em; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-3); color: var(--ink-3);
  transition: background var(--t-fast) var(--e), color var(--t-fast) var(--e);
}
.search-clear:hover { background: var(--red); color: #fff; }
.search-clear svg { width: 12px; height: 12px; }

.products-layout { display: grid; grid-template-columns: 300px 1fr; gap: var(--sp-6); align-items: start; }
@media (max-width: 960px) { .products-layout { grid-template-columns: 1fr; } }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.result-line { font-size: var(--fs-sm); color: var(--text-soft); margin-bottom: var(--sp-4); }
.result-line strong { color: var(--red); }

/* ---------- Product detail ---------- */
.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8); align-items: start; }
@media (max-width: 900px) { .pd-grid { grid-template-columns: 1fr; gap: var(--sp-6); } }

.gallery { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-alt); }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 1;
  display: grid; place-items: center; overflow: hidden;
}
.gallery-slide > img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; }
.slide-fallback { grid-area: 1 / 1; display: none; width: 46%; height: 46%; color: var(--red); opacity: .5; }
.gallery-slide.no-img { padding: var(--sp-8); }
.gallery-slide.no-img .slide-fallback { display: block; }
.slide-fallback svg { width: 100%; height: 100%; }
.gallery-dots { display: flex; justify-content: center; gap: var(--sp-2); padding: var(--sp-4); }
.gallery-dots button { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); transition: all var(--t) var(--e); }
.gallery-dots button[aria-current="true"] { background: var(--red); width: 24px; border-radius: 4px; }

.code-tag {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-xs); font-weight: 600;
  padding: 0.45em 0.9em; border: 1.5px dashed var(--line-2);
  border-radius: var(--r-xs); color: var(--ink-3);
}
.code-tag strong { color: var(--ink); font-weight: 700; }

.info-table { font-size: var(--fs-sm); }
.info-table th, .info-table td { padding: 0.95em 0; text-align: start; }
.info-table tr { border-bottom: 1px solid var(--line); }
.info-table th { font-weight: 500; color: var(--text-soft); }
.info-table td { text-align: end; font-weight: 700; color: var(--ink); }
.info-table td .pct {
  font-size: var(--fs-xs); font-weight: 600; color: var(--ink-4);
  background: var(--bg-3); padding: 0.15em 0.5em; border-radius: 6px; margin-inline-end: var(--sp-2);
}
.info-table tr.total { border-bottom: 0; }
.info-table tr.total th { font-size: var(--fs-base); font-weight: 800; color: var(--ink); }
.info-table tr.total td { font-size: var(--fs-lg); font-weight: 900; color: var(--red); letter-spacing: -0.02em; }

.pd-cta { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-6); }
.pd-note {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  font-size: var(--fs-xs); color: var(--ink-3);
  background: var(--bg-alt); padding: var(--sp-4);
  border-radius: var(--r-sm); margin-top: var(--sp-4);
}
.pd-note svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--red); margin-top: 3px; }

/* ---------- Article card ---------- */
.article-card {
  display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  transition: transform var(--t) var(--e-out), box-shadow var(--t) var(--e-out);
}
.article-card:hover { transform: translateY(-5px); box-shadow: var(--sh-2); }
.article-card .top { aspect-ratio: 16/9; background: var(--red-50); display: grid; place-items: center; color: var(--red); }
.article-card .top svg { width: 46px; height: 46px; }
.article-card .body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; }
.article-card h3 { font-size: var(--fs-md); line-height: 1.5; }
.article-card h3 a:hover { color: var(--red); }
.article-card .date { font-size: var(--fs-xs); color: var(--ink-4); }
.article-card p { font-size: var(--fs-sm); }
.article-card .link-arrow { margin-top: auto; }

/* ---------- Feature / step ---------- */
.feature {
  padding: var(--sp-6); background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-md);
  transition: transform var(--t) var(--e-out), border-color var(--t-fast) var(--e);
}
.feature:hover { transform: translateY(-4px); border-color: var(--red); }
.feature .ic {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--red-50); color: var(--red);
  display: grid; place-items: center; margin-bottom: var(--sp-4);
}
.feature .ic svg { width: 23px; height: 23px; }
.feature h4 { margin-bottom: var(--sp-2); }
.feature p { font-size: var(--fs-sm); }

.step { padding: var(--sp-6); background: var(--bg-alt); border-radius: var(--r-md); }
.step .n {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: var(--r-full); background: var(--red); color: #fff;
  font-weight: 800; font-size: var(--fs-sm); margin-bottom: var(--sp-4);
}
.step h4 { margin-bottom: var(--sp-2); }
.step p { font-size: var(--fs-sm); }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--red); color: #fff; border-radius: var(--r-xl);
  padding: var(--sp-8) var(--sp-6); text-align: center;
  position: relative; overflow: hidden;
}
.cta-band::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(90% 120% at 50% 0%, rgba(255,255,255,.16), transparent 60%);
}
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.82); max-width: 48ch; margin: var(--sp-4) auto var(--sp-6); }
.cta-actions { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: var(--sp-6); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
  display: flex; align-items: flex-start; gap: var(--sp-4);
  padding: var(--sp-5); background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color var(--t-fast) var(--e), transform var(--t) var(--e-out);
}
.contact-card:hover { border-color: var(--red); transform: translateY(-3px); }
.contact-card .ic {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 13px;
  background: var(--red-50); color: var(--red);
  display: grid; place-items: center;
}
.contact-card .ic svg { width: 21px; height: 21px; }
.contact-card h4 { margin-bottom: var(--sp-1); font-size: var(--fs-sm); }
.contact-card p, .contact-card a { font-size: var(--fs-sm); }
.contact-card .val { color: var(--red); font-weight: 700; }
.map-frame { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--bg-alt); aspect-ratio: 4/3; }
.map-frame iframe { width: 100%; height: 100%; border: 0; }

/* ---------- Icon buttons ---------- */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 13px;
  background: rgba(255,255,255,.08); color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  transition: all var(--t-fast) var(--e);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--red); border-color: var(--red); transform: translateY(-3px); }
.icon-btn-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #fff; padding-block: var(--sp-8) var(--sp-5); margin-top: var(--sp-8); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: var(--sp-7); }
.site-footer h4 { color: #fff; font-size: var(--fs-sm); margin-bottom: var(--sp-4); }
.site-footer p, .site-footer li, .site-footer a { color: rgba(255,255,255,.6); font-size: var(--fs-sm); }
.site-footer a:hover { color: #fff; }
.site-footer ul { display: flex; flex-direction: column; gap: var(--sp-3); }
.footer-brand { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.footer-brand img { width: 46px; height: 46px; border-radius: 12px; }
.footer-brand span { font-size: var(--fs-md); font-weight: 800; color: #fff; }
.footer-bottom {
  margin-top: var(--sp-7); padding-top: var(--sp-5);
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
}
.footer-bottom p { font-size: var(--fs-xs); color: rgba(255,255,255,.4); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; gap: var(--sp-6); } }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  font-size: var(--fs-xs); color: var(--ink-4);
  padding-block: var(--sp-5) var(--sp-2);
}
.breadcrumbs a:hover { color: var(--red); }
.breadcrumbs .sep { opacity: .45; }
.breadcrumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* ---------- Article body ---------- */
.article-body { display: flex; flex-direction: column; gap: var(--sp-4); font-size: var(--fs-md); line-height: 2.05; }
.article-body p { color: var(--ink-2); }
/* Headings written as #, ## and ### in the admin panel. */
.article-body h1,
.article-body h2,
.article-body h3 { line-height: 1.4; scroll-margin-top: calc(var(--header-h) + 16px); }
.article-body h1 { font-size: var(--fs-xl); font-weight: 900; margin-top: var(--sp-5); }
.article-body h2 {
  font-size: var(--fs-lg); font-weight: 800; margin-top: var(--sp-5);
  padding-bottom: var(--sp-2); border-bottom: 2px solid var(--red-100);
}
.article-body h3 { font-size: var(--fs-md); font-weight: 700; color: var(--red); margin-top: var(--sp-4); }
.article-body > :first-child { margin-top: 0; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: var(--sp-8) var(--sp-4); }
.empty-state .ic {
  width: 62px; height: 62px; margin-inline: auto; margin-bottom: var(--sp-4);
  border-radius: var(--r-full); background: var(--bg-3); color: var(--ink-4);
  display: grid; place-items: center;
}
.empty-state .ic svg { width: 28px; height: 28px; }
.empty-state p { margin-bottom: var(--sp-5); }

.rule { height: 1px; background: var(--line); border: 0; }
