@font-face { font-family: 'Vazirmatn'; src: url('/assets/fonts/Vazirmatn.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
:root { --font-fa: 'Vazirmatn'; }
/* Divan Watch — "Shamseh": night navy, aged gold, ivory (turquoise only as a rare extra) */
:root {
  --navy: #0B1B2B;
  --navy-2: #16304A;
  --gold: #B8925A;
  --gold-light: #C9A66B;
  --gold-text: #7A5C30; /* gold dark enough for text on white/ivory (≥4.5:1) */
  --ivory: #F4EFE6;
  --turquoise: #2E6B66;
  --ink: #14171C;
  --ink-2: #3C4654;
  --muted: #545B66;
  --line: #E3D9C7;
  --line-2: #D2C6B0;
  --bg: var(--ivory);
  --card: #fff;
  --accent: var(--navy);
  --accent-2: var(--navy-2);
  --accent-soft: #ecfdf5;
  --warn-bg: #fef3c7;
  --warn-fg: #78350f;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-fa), Tahoma, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }
a:hover { color: var(--accent-2); }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.35; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- header ---------- */
.topbar {
  background: var(--navy);
  border-bottom: 1px solid rgba(201, 166, 107, .35);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-in {
  max-width: 1360px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brandmark { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; direction: ltr; }
.brandmark:hover { color: #fff; }
.brandword { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.brandword img { width: 96px; height: auto; }
.brandsub { font-size: 11px; color: var(--gold-light); letter-spacing: 2px; direction: rtl; }
.topnav { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 14px; }
.topnav a { color: #e5e7eb; text-decoration: none; padding: 8px 4px; }
.topnav a:hover, .topnav a.on { color: #fff; }
.topnav a.on { box-shadow: inset 0 -2px 0 var(--gold-light); }
.topnav .who { color: #d1d5db; }
.btn-out {
  font: inherit; color: #fff; background: transparent; border: 1px solid #4b5563;
  border-radius: 8px; padding: 6px 14px; cursor: pointer; min-height: 38px;
}
.btn-out:hover { border-color: #9ca3af; }

.page { max-width: 1360px; margin: 0 auto; padding: 20px 16px 56px; }
.page-narrow { max-width: 860px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; margin-bottom: 16px; }
.page-head h1 { font-size: 24px; font-weight: 800; }

/* ---------- forms & buttons ---------- */
.btn {
  font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--accent-2); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: #f9fafb; color: var(--ink); }
.btn-danger { background: #fff; color: var(--danger); border-color: #fca5a5; }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.input, select.input, textarea.input {
  font: inherit; font-weight: 400; font-size: 16px; /* 16px stops iOS zoom */
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-2);
  border-radius: 10px; background: #fff; color: var(--ink);
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 36px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.alert { border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.alert-ok { background: var(--accent-soft); color: #065f46; border: 1px solid #a7f3d0; }
.alert-err { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.alert-warn { background: var(--warn-bg); color: var(--warn-fg); border: 1px solid #fde68a; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--bg); white-space: nowrap; }
.pill-new { background: var(--navy); color: var(--ivory); }
.pill-used { background: var(--warn-bg); color: var(--warn-fg); }
.pill-ok { background: var(--accent-soft); color: #065f46; }
.pill-sold { background: var(--danger-bg); color: var(--danger); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--navy); position: relative; overflow: hidden; }
.login-bg { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: .14; pointer-events: none; max-width: none; }
.login-card { position: relative; width: 100%; max-width: 400px; background: var(--ivory); border-radius: 18px; padding: 24px 24px 28px; display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--gold); }
.login-card .logo { width: 180px; height: 180px; margin: -8px auto -12px; }
.login-card h1 { font-size: 20px; text-align: center; }
.login-card p { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- catalog ---------- */
.catalog { display: flex; gap: 20px; align-items: flex-start; }
.filters { flex: 0 0 250px; position: sticky; top: 80px; }
.filters h2 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.filters fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.filters legend { font-size: 15px; font-weight: 700; margin-bottom: 4px; padding: 0; }
.brand-list { display: flex; flex-direction: column; gap: 6px; }
.brand-opt { display: flex; justify-content: space-between; align-items: center; min-height: 42px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14px; background: #fff; }
.brand-opt input { position: absolute; opacity: 0; pointer-events: none; }
.brand-opt:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.brand-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.catalog-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.searchbar { display: flex; gap: 8px; }
.searchbar .input { flex: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.wcard { text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s; }
.wcard:hover { color: var(--ink); box-shadow: 0 4px 18px rgba(17,24,39,.08); }
.wcard .ph { aspect-ratio: 1/1; background: #e9ebee; position: relative; display: grid; place-items: center; }
.wcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.wcard .ph .pill { position: absolute; top: 10px; right: 10px; }
.wcard .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; }
.wcard .brand { font-size: 12px; font-weight: 700; color: var(--gold-text); letter-spacing: 1.5px; }
.wcard .model { font-size: 15px; font-weight: 700; }
.wcard .ref { font-size: 13px; color: var(--muted); }
.wcard .ph .pill { direction: ltr; }
.wcard .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; white-space: nowrap; }
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip small { color: var(--muted); font-size: 12px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.on small { color: var(--gold-light); }
.chip-back { background: var(--bg); }
.group-title { font-size: 18px; font-weight: 800; display: flex; align-items: baseline; gap: 8px; margin-top: 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.group-title a { color: var(--ink); text-decoration: none; }
.group-title a:hover { color: var(--accent); }
.group-title small { font-size: 13px; color: var(--muted); font-weight: 400; }
@media (max-width: 860px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 0 16px 4px; scrollbar-width: none; }
}
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.filter-toggle { display: none; }

@media (max-width: 860px) {
  .catalog { flex-direction: column; }
  .filters { position: static; flex: none; width: 100%; display: none; }
  .filters.open { display: block; }
  .filter-toggle { display: inline-flex; }
  .brand-list { flex-direction: row; flex-wrap: wrap; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .wcard .body { padding: 10px; }
  .wcard .model { font-size: 14px; }
  .page-head h1 { font-size: 20px; }
}

/* ---------- watch page ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.gallery { display: flex; flex-direction: column; gap: 10px; }
.gallery .main { background: #e9ebee; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1/1; border: 0; padding: 0; cursor: zoom-in; width: 100%; }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { flex: 0 0 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: #e9ebee; }
.thumbs button.on { border-color: var(--gold); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.specs { display: flex; flex-direction: column; gap: 14px; }
.specs .brand { color: var(--gold-text); font-weight: 800; letter-spacing: 2px; }
.specs h1 { font-size: 26px; font-weight: 800; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.spec-table th { text-align: start; font-weight: 600; color: var(--muted); padding: 10px 0; width: 38%; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.noimg { aspect-ratio: 1/1; display: grid; place-items: center; background: #e9ebee; border-radius: var(--radius); color: #9ca3af; }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 100; display: flex; flex-direction: column; }
.lightbox .lb-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; color: #fff; font-size: 14px; }
.lightbox .lb-bar button { font: inherit; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 10px; min-width: 44px; min-height: 44px; cursor: pointer; }
.lightbox .lb-view { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; touch-action: pan-x pan-y pinch-zoom; }
.lightbox .lb-view img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.lightbox .lb-view.zoom { display: block; }
.lightbox .lb-view.zoom img { max-width: none; max-height: none; width: 220%; cursor: zoom-out; }
.lightbox .lb-nav { display: flex; justify-content: center; gap: 12px; padding: 10px; }

@media (max-width: 860px) {
  .watch { grid-template-columns: 1fr; gap: 16px; }
  .specs h1 { font-size: 21px; }
}

/* ---------- admin ---------- */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.subnav a { text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.subnav a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
table.data th { text-align: right; font-weight: 700; background: #f9fafb; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data img.t { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; background: #e9ebee; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 13px; color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo-grid figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.photo-grid img { aspect-ratio: 1/1; object-fit: cover; width: 100%; }
.photo-grid figcaption { padding: 6px 8px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
details.box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
details.box summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.progress { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .2s; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 15px; background: #f9fafb; border: 1px dashed var(--line-2); border-radius: 8px; padding: 6px 10px; direction: ltr; display: inline-block; user-select: all; }

.contents{display:contents}
.filters.open{display:block}
[hidden]{display:none !important}

@media (max-width: 860px) { .catalog { align-items: stretch; } .catalog-main { width: 100%; } }
/* login on phones: navy edge to edge (status bar + Safari toolbar), visible-height layout */
html:has(body.is-login), body.is-login { background: var(--navy); }
.login-wrap { min-height: 100vh; min-height: 100dvh; padding-top: max(24px, env(safe-area-inset-top)); padding-bottom: max(24px, env(safe-area-inset-bottom)); }