/* Elderlymed Medical: shared styles
   Palette: neutral solid backgrounds, clinical teal for trust, one warm coral-orange for action.
   Sized for older readers (18px base). */

:root {
  --paper: #f7f7f5;
  --paper-2: #eeefec;
  --surface: #ffffff;
  --ink: #15171a;
  --ink-2: #4b5058;
  --ink-3: #696e76;
  --line: #e3e4e6;
  --line-strong: #c9cbcf;

  --pine: #0a7c7a;
  --pine-700: #075f5d;
  --pine-50: #e3f3f2;
  --clay: #ffa41b;             /* bright amber-orange: calls to action, never errors */
  --clay-ink: #a35200;         /* the same hue dark enough for small text on light paper */
  --on-clay: #1f1400;          /* text on an orange-filled button */
  --clay-50: #fff3dc;
  --danger: #b42318;
  --danger-50: #fdecea;
  --ok: #157f3d;
  --ok-50: #e6f5ec;

  --on-pine: #ffffff;          /* text on a teal-filled button */
  --surface-2: #fafafa;        /* table heads, card footers */
  --header-bg: rgba(247, 247, 245, .94);
  --media-bg: #f3f3f1;         /* product photo wells stay light in both themes */
  --band-bg: #0a5f5d;
  --deep: #15171a;             /* toasts, admin sidebar: always dark */
  --notice-err-ink: #7a1a12;
  --notice-ok-ink: #0f4f27;
  --callout-ink: #6b3a00;
  --callout-line: #f5d79c;
  --shadow-rgb: 21, 23, 26;
  color-scheme: light;

  --font-display: "Newsreader", "Noto Naskh Arabic", Georgia, serif;
  --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;

  --radius: 6px;
  --radius-lg: 10px;
  --wrap: 1320px;
  --gutter: clamp(14px, 2.4vw, 28px);
  --nav-h: 72px;
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--pine);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Dark theme (set by data-theme on <html>) ---------- */
:root[data-theme="dark"] {
  --paper: #0e1012;
  --paper-2: #16191c;
  --surface: #181b1f;
  --surface-2: #1d2125;
  --ink: #eceef0;
  --ink-2: #b3b8bf;
  --ink-3: #8a9099;
  --line: #272b30;
  --line-strong: #3a3f46;
  --pine: #3fc1b9;
  --pine-700: #6fd6cf;
  --pine-50: #12302e;
  --on-pine: #071413;
  --clay: #ffb43a;
  --clay-ink: #ffc35c;
  --on-clay: #1f1400;
  --clay-50: #2d220f;
  --danger: #ff8a7a;
  --danger-50: #321715;
  --ok: #5fd08a;
  --ok-50: #10281a;
  --header-bg: rgba(14, 16, 18, .92);
  --band-bg: #0f3a39;
  --deep: #08090a;
  --notice-err-ink: #ffc9c1;
  --notice-ok-ink: #bdeccd;
  --callout-ink: #ffe0a8;
  --callout-line: #5a4316;
  --shadow-rgb: 0, 0, 0;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  transition: background-color .3s var(--ease), color .3s var(--ease);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--pine); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--pine-700); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius); }
[hidden], .is-hidden { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 .5em;
  color: var(--ink);
  letter-spacing: -.005em;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

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

.skip-link {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 3000;
  background: var(--deep); color: #fff; padding: 10px 16px; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--clay-ink);
  margin-bottom: .9rem;
}
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .ltr { text-align: right; }
[dir="ltr"] .flip-dir { display: inline-block; transform: scaleX(-1); }
html.i18n-pending body { visibility: hidden; }

/* ---------- Site header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 900;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 8px 24px -20px rgba(var(--shadow-rgb), .5); }
/* brand | centred menu | actions */
.site-header .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: var(--nav-h); gap: 24px; }
.site-header .wrap > .brand { justify-self: start; }
.site-header .header-actions { justify-self: end; }

.brand {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: "Newsreader", Georgia, serif; font-size: 1.35rem; font-weight: 600;
  color: var(--ink); text-decoration: none; direction: ltr; white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand-logo {
  width: 56px; height: 56px; align-self: center; flex: none; margin-inline-end: .2rem;
  border-radius: 50%; background: #fff;
}
.site-footer .brand-logo { width: 72px; height: 72px; }
.brand-name { display: inline-flex; align-items: baseline; gap: .45rem; }
.brand small { font-family: var(--font-body); font-size: .8rem; font-weight: 500; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }

.nav-list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: block; padding: 10px 16px; border-radius: var(--radius);
  color: var(--ink-2); font-weight: 500; text-decoration: none; font-size: 1rem;
}
.nav-list a:hover { color: var(--ink); background: var(--paper-2); }
.nav-list a.active, .nav-list a[aria-current="page"] { color: var(--pine); box-shadow: inset 0 -2px 0 var(--pine); border-radius: 0; }

.nav-toggle {
  display: none; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 1rem; cursor: pointer;
}
.nav-toggle-bars { width: 18px; height: 12px; position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after, .nav-toggle-bars span {
  content: ""; position: absolute; inset-inline: 0; height: 2px; background: currentColor; transition: transform .2s var(--ease), opacity .2s;
}
.nav-toggle-bars::before { top: 0; }
.nav-toggle-bars span { top: 5px; }
.nav-toggle-bars::after { bottom: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 860px) {
  .site-header .wrap { grid-template-columns: 1fr auto; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; inset-inline: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
    display: none;
  }
  .site-nav.open { display: block; }
  .nav-list { flex-direction: column; }
  .nav-list a { padding: 14px 4px; font-size: 1.1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-list a.active, .nav-list a[aria-current="page"] { box-shadow: none; color: var(--pine); font-weight: 600; }
}

.header-actions { display: flex; align-items: center; gap: 8px; }
/* language switch: globe + the other language's own name */
.lang-switch {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px 0 12px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}
.lang-switch .bi { font-size: 1.05rem; color: var(--pine); }
.lang-switch:hover { border-color: var(--pine); color: var(--pine); }
.lang-switch [data-lang-label][lang="ar"] { font-family: "IBM Plex Sans Arabic", sans-serif; }
.admin-side .lang-switch { background: transparent; color: #cfd6d2; border-color: rgba(255, 255, 255, .25); width: calc(100% - 24px); margin: 0 12px 8px; justify-content: center; }
.admin-side .lang-switch .bi { color: #9fd3c1; }
.admin-side .lang-switch:hover { background: rgba(255, 255, 255, .06); color: #fff; }

/* round icon buttons in the header: theme and cart */
.head-icon {
  position: relative; width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none;
  border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink);
  font-size: 1.1rem; cursor: pointer; transition: border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.head-icon:hover { border-color: var(--pine); color: var(--pine); }
.theme-toggle .bi-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .bi-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .bi-moon-stars { display: none; }
.cart-btn .cart-count {
  position: absolute; top: -4px; inset-inline-end: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; font-size: .72rem; line-height: 20px; font-weight: 700;
  background: var(--clay); color: var(--on-clay); text-align: center; box-shadow: 0 0 0 2px var(--paper);
  transition: transform .25s var(--ease);
}
.cart-btn .cart-count.is-empty { transform: scale(0); }
.cart-btn.bump { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.15); } }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--pine); --btn-fg: var(--on-pine); --btn-bd: var(--pine);
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 52px; padding: 0 26px;
  border: 1px solid var(--btn-bd); border-radius: var(--radius);
  background: var(--btn-bg); color: var(--btn-fg);
  font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.btn:hover { --btn-bg: var(--pine-700); --btn-bd: var(--pine-700); color: var(--btn-fg); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-secondary { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line-strong); }
.btn-secondary:hover { --btn-bg: var(--paper-2); --btn-bd: var(--ink-3); --btn-fg: var(--ink); }
.btn-quiet { --btn-bg: transparent; --btn-fg: var(--pine); --btn-bd: transparent; padding-inline: 8px; }
.btn-quiet:hover { --btn-bg: var(--pine-50); --btn-bd: transparent; --btn-fg: var(--pine-700); }
.btn-danger { --btn-bg: transparent; --btn-fg: var(--danger); --btn-bd: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger:hover { --btn-bg: var(--danger); --btn-fg: var(--paper); --btn-bd: var(--danger); }
.btn-sm { min-height: 42px; padding: 0 16px; font-size: .92rem; }
.btn-block { width: 100%; }
.btn .bi { font-size: 1.1em; }
.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " ←"; }

/* ---------- Forms ---------- */
.field { margin-bottom: 20px; }
.field label, .field .label, fieldset legend {
  display: block; font-weight: 600; font-size: .98rem; margin-bottom: 8px; color: var(--ink);
}
.field .hint { display: block; font-size: .88rem; color: var(--ink-3); margin-top: 6px; }
.optional { font-weight: 400; color: var(--ink-3); font-size: .88rem; }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 1.02rem; line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 140px; resize: vertical; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 42px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 22px) center, calc(100% - 16px) center;
  background-size: 6px 6px; background-repeat: no-repeat;
}
[dir="rtl"] .select { padding-right: 14px; padding-left: 42px; background-position: 16px center, 22px center; }
.input::placeholder, .textarea::placeholder { color: #8b928e; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px var(--pine-50); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-error { display: block; color: var(--danger); font-size: .9rem; margin-top: 6px; font-weight: 500; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.password-wrap { position: relative; }
.password-wrap .input { padding-right: 84px; }
[dir="rtl"] .password-wrap .input { padding-right: 14px; padding-left: 84px; }
.password-wrap .toggle {
  position: absolute; right: 6px; top: 6px; bottom: 6px;
  border: 0; background: transparent; color: var(--pine); font: inherit; font-size: .92rem; font-weight: 600;
  padding: 0 12px; cursor: pointer; border-radius: var(--radius);
}
.password-wrap .toggle:hover { background: var(--pine-50); }
[dir="rtl"] .password-wrap .toggle { right: auto; left: 6px; }

/* star rating: DOM order 5..1, rendered so 1 sits on the right (reading start) */
.stars-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.stars-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars-input label {
  margin: 0; font-size: 2.1rem; line-height: 1; padding: 4px; cursor: pointer; color: #cfc8b8;
  transition: color .12s, transform .12s;
}
.stars-input input:checked ~ label,
.stars-input label:hover,
.stars-input label:hover ~ label { color: var(--clay); }
.stars-input input:focus-visible + label { box-shadow: var(--focus); border-radius: var(--radius); }

/* ---------- Surfaces ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(20px, 3.5vw, 36px);
}
.rule { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

.page-head { padding: clamp(16px, 2.5vw, 28px) 0 clamp(14px, 2vw, 20px); border-bottom: 1px solid var(--line); margin-bottom: clamp(20px, 3vw, 28px); }
.page-head .eyebrow { margin-bottom: .4rem; }
.page-head h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: .2em; }
.page-head p { color: var(--ink-2); max-width: 60ch; margin: 0; font-size: 1.08rem; }
.page-head-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

.section { padding: clamp(48px, 8vw, 96px) 0; }

/* ---------- Status / states ---------- */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
}
.notice-error { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-50); color: var(--notice-err-ink); }
.notice-ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-50); color: var(--notice-ok-ink); }
.state { text-align: center; padding: 56px 20px; color: var(--ink-2); }
.state h2, .state h3 { color: var(--ink); }

.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--pine);
  animation: spin .9s linear infinite; margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton { background: linear-gradient(90deg, var(--paper-2), var(--surface), var(--paper-2)); background-size: 200% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Toasts ---------- */
.toast-region {
  position: fixed; z-index: 2500; inset-inline: 0; bottom: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; padding: 0 16px;
}
.toast {
  pointer-events: auto; max-width: 520px; width: 100%;
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--deep); color: #fff; padding: 14px 18px; border-radius: var(--radius);
  font-size: 1rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .08);
  animation: toast-in .25s var(--ease);
}
.toast-error { background: var(--danger); }
.toast-ok { background: var(--pine); }
.toast button { margin-inline-start: auto; background: transparent; border: 0; color: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 4px; opacity: .8; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: clamp(56px, 8vw, 110px); padding: 44px 0 36px; color: var(--ink-2); font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h2 { font-family: var(--font-body); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; font-weight: 600; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { color: var(--ink); text-decoration: none; }
.footer-grid a:hover { color: var(--pine); text-decoration: underline; }
.footer-base { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--ink-3); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }

/* =========================================================
   HOME
   ========================================================= */
.hero { padding: clamp(28px, 5vw, 64px) 0 clamp(48px, 7vw, 88px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero-copy h1 { font-size: clamp(2.5rem, 5.8vw, 4.6rem); line-height: 1.08; letter-spacing: -.02em; margin-bottom: .45em; }
.hero-copy h1 em { font-style: italic; font-weight: 400; color: var(--pine); }
[lang="ar"] .hero-copy h1 { letter-spacing: 0; line-height: 1.3; }
[lang="ar"] .hero-copy h1 em { font-style: normal; font-weight: 600; }
.hero-copy .lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--ink-2); max-width: 34ch; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-figure { position: relative; margin: 0; }
.hero-figure img { width: 100%; height: auto; aspect-ratio: 5 / 4; max-height: 560px; object-fit: cover; border-radius: var(--radius-lg); filter: saturate(.85) contrast(1.02); }
.hero-figure::after {
  content: ""; position: absolute; inset: 14px; border: 1px solid rgba(255, 255, 255, .55); border-radius: 6px; pointer-events: none;
}
.hero-meta { display: flex; gap: 28px; margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .95rem; flex-wrap: wrap; }
.hero-meta strong { display: block; font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); font-weight: 600; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { order: -1; }
  .hero-figure img { aspect-ratio: 16 / 10; }
}

.commitments-head { display: grid; grid-template-columns: 1fr 1.4fr; gap: 32px; align-items: end; margin-bottom: 40px; }
.commitments-head h2 { margin: 0; }
.commitments-head p { margin: 0; color: var(--ink-2); }
.commitments { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.commitments li { padding: 28px 28px 8px; border-inline-start: 1px solid var(--line); }
.commitments li:first-child { border-inline-start: 0; padding-inline-start: 0; }
.commitments .c-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: .5em; }
.commitments .n { font-family: "Newsreader", Georgia, serif; font-size: 1.45rem; line-height: 1.2; color: var(--clay-ink); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; direction: ltr; flex: none; }
.commitments h3 { font-size: 1.45rem; margin: 0; }
.commitments p { color: var(--ink-2); margin: 0; }
@media (max-width: 860px) {
  .commitments-head { grid-template-columns: 1fr; gap: 12px; }
  .commitments { grid-template-columns: 1fr; }
  .commitments li { border-inline-start: 0; border-bottom: 1px solid var(--line); padding: 24px 0; }
}

.band { background: var(--band-bg); color: #e9efe9; border-radius: var(--radius-lg); padding: clamp(28px, 5vw, 56px); display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.band h2 { color: #fff; margin: 0 0 .25em; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.band p { margin: 0; color: #c9d6cf; }
.band .btn { --btn-bg: #fff; --btn-fg: #163a32; --btn-bd: #fff; }
.band .btn:hover { --btn-bg: var(--paper); --btn-bd: var(--paper); }
.band .btn-secondary { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, .45); }
.band .btn-secondary:hover { --btn-bg: rgba(255, 255, 255, .1); --btn-bd: #fff; --btn-fg: #fff; }

/* =========================================================
   PRODUCTS
   ========================================================= */
/* compact catalogue: three cards of at most 300px, centred */
/* the catalogue column is as wide as three 320px cards, so the heading lines up with the grid */
.catalog { max-width: calc(3 * 320px + 2 * 24px + 2 * var(--gutter)); }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 28px 24px; }
@media (max-width: 980px) { .catalog { max-width: calc(2 * 320px + 24px + 2 * var(--gutter)); } .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .catalog { max-width: calc(360px + 2 * var(--gutter)); } .product-grid { grid-template-columns: minmax(0, 1fr); } }

.product-card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 1px 0 rgba(var(--shadow-rgb), .04);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.product-media { display: block; flex: none; background: var(--media-bg); aspect-ratio: 5 / 4; padding: 14px; border-bottom: 1px solid var(--line); overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; transition: transform .6s var(--ease); }
/* a thin accent rule that draws in along the top edge on hover */
.product-card::after {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px; background: var(--pine);
  transform: scaleX(0); transform-origin: var(--rule-origin, left); transition: transform .45s var(--ease);
}
[dir="rtl"] .product-card::after { --rule-origin: right; }
@media (hover: hover) {
  .product-card:hover, .product-card:focus-within {
    transform: translateY(-6px);
    border-color: var(--line-strong);
    box-shadow: 0 22px 40px -24px rgba(var(--shadow-rgb), .45), 0 2px 6px rgba(var(--shadow-rgb), .06);
  }
  .product-card:hover::after, .product-card:focus-within::after { transform: scaleX(1); }
  .product-card:hover .product-media img { transform: scale(1.05); }
}
.product-body { padding: 12px 14px 12px; display: flex; flex-direction: column; flex: 1; }
.product-body h2 { font-size: 1.12rem; line-height: 1.35; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-body h2 a { color: inherit; text-decoration: none; }
.product-body h2 a:hover { color: var(--pine); }
.product-desc { color: var(--ink-2); font-size: .9rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 10px; }
.product-foot { margin-top: auto; }
.price { font-family: var(--font-display); font-size: 1.55rem; font-weight: 600; color: var(--ink); display: inline-block; }
.price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.stock-tag { font-size: .85rem; font-weight: 600; color: var(--ok); }
.stock-tag.out { color: var(--danger); }
.product-actions { display: grid; gap: 10px; }
.product-actions .btn-quiet { min-height: 36px; }
.product-card .price { font-size: 1.3rem; }
.product-actions .btn { min-height: 44px; font-size: .95rem; }

.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: clamp(32px, 5vw, 56px); flex-wrap: wrap; }
.pager-btn {
  min-width: 48px; height: 48px; padding: 0 14px; display: inline-grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.pager-btn:hover:not(:disabled):not(.is-current) { border-color: var(--pine); color: var(--pine); transform: translateY(-2px); }
.pager-btn.is-current { background: var(--pine); border-color: var(--pine); color: var(--on-pine); cursor: default; }
.pager-btn:disabled { opacity: .35; cursor: not-allowed; }
.skeleton-card { height: 400px; border-radius: var(--radius-lg); }

/* Cart trigger + drawer */

.scrim { position: fixed; inset: 0; z-index: 1300; background: rgba(12, 16, 14, .5); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; z-index: 1400; top: 0; bottom: 0; inset-inline-end: 0;
  width: min(460px, 100%); background: var(--paper); border-inline-start: 1px solid var(--line);
  display: flex; flex-direction: column; box-shadow: 0 0 60px rgba(0, 0, 0, .18);
  transform: translateX(-100%); transition: transform .35s var(--ease), visibility .35s; visibility: hidden;
}
[dir="ltr"] .drawer { transform: translateX(100%); }
.drawer.open, [dir="ltr"] .drawer.open { transform: none; visibility: visible; }
body.no-scroll { overflow: hidden; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.45rem; margin: 0; }
.drawer-sub { margin: 2px 0 0; font-size: .9rem; color: var(--ink-3); }
.icon-btn {
  width: 48px; height: 48px; display: inline-grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius); color: var(--ink-2); cursor: pointer; font-size: 1.3rem;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 20px 24px 24px; background: var(--surface); }
.drawer-note { font-size: .88rem; color: var(--ink-2); margin: 0 0 16px; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 1.05rem; }
.total-row strong { font-family: var(--font-display); font-size: 1.6rem; }
.drawer-foot .btn + .btn { margin-top: 10px; }
.cart-empty { text-align: center; color: var(--ink-2); padding: 56px 8px; display: grid; justify-items: center; gap: 12px; }
.cart-empty p { margin: 0; font-size: 1.05rem; }
.cart-empty-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--pine-50); color: var(--pine); font-size: 1.8rem; }

.cart-item { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--line); animation: rise .35s var(--ease) both; }
.cart-item img { width: 76px; height: 76px; object-fit: contain; background: var(--media-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; mix-blend-mode: normal; }
.cart-item .name { display: block; font-weight: 600; line-height: 1.35; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cart-item .price-sm { color: var(--ink-2); font-size: .95rem; display: inline-block; }
.cart-item .item-error { display: block; color: var(--danger); font-size: .85rem; margin-top: 4px; font-weight: 500; }
.cart-item-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 12px; align-self: stretch; }
.line-total { font-family: var(--font-display); font-size: 1.15rem; }
/* − qty + stepper */
.stepper { display: inline-flex; align-items: center; margin-top: 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); overflow: hidden; }
.step-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink); cursor: pointer; font-size: 1rem; transition: background-color .15s, color .15s; }
.step-btn:hover:not(:disabled) { background: var(--pine-50); color: var(--pine); }
.step-btn:disabled { opacity: .35; cursor: not-allowed; }
.stepper .qty {
  width: 44px; height: 38px; border: 0; background: transparent; color: var(--ink); text-align: center;
  font: inherit; font-weight: 700; font-size: 1rem; -moz-appearance: textfield; padding: 0;
}
.stepper .qty::-webkit-outer-spin-button, .stepper .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .qty:focus { outline: none; box-shadow: inset 0 0 0 2px var(--pine-50); }
.stepper-lg .step-btn { width: 48px; height: 48px; font-size: 1.1rem; }
.stepper-lg .qty { width: 56px; height: 48px; font-size: 1.1rem; }
.remove-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); border-radius: 999px; background: transparent;
  color: var(--danger); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.remove-btn:hover { background: var(--danger); border-color: var(--danger); color: var(--paper); }

/* =========================================================
   PRODUCT DETAILS
   ========================================================= */
.back-row { padding: 28px 0 8px; }
.detail-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 920px) { .detail-grid { grid-template-columns: 1fr; } }
.gallery-main { background: var(--media-bg); border: 1px solid var(--line); border-radius: var(--radius-lg); aspect-ratio: 1 / 1; padding: 24px; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.thumb {
  aspect-ratio: 1 / 1; padding: 8px; background: var(--media-bg); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; overflow: hidden; display: grid; place-items: center; font: inherit;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb:hover { border-color: var(--ink-3); }
.thumb.active { border-color: var(--pine); box-shadow: inset 0 0 0 1px var(--pine); }
.thumb.empty { cursor: default; color: var(--ink-3); font-size: .85rem; background: var(--paper-2); }
.detail-info h1 { font-size: clamp(2rem, 3.6vw, 2.8rem); }
.detail-desc { color: var(--ink-2); font-size: 1.08rem; line-height: 1.9; margin-bottom: 28px; white-space: pre-line; }
.detail-price { display: flex; align-items: baseline; gap: 14px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.detail-price .label { color: var(--ink-2); font-size: .95rem; }
.detail-price .price { font-size: 2.1rem; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 0 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.facts div { padding: 14px 18px; }
.facts div + div { border-inline-start: 1px solid var(--line); }
.facts dt { font-size: .85rem; color: var(--ink-3); margin-bottom: 2px; }
.facts dd { margin: 0; font-weight: 600; }
.video-block h2 { font-size: 1.35rem; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; background: var(--ink); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #dfe6e2; text-align: center; padding: 24px; }
.video-fallback h3 { color: #fff; font-size: 1.2rem; margin: 0; }
.video-fallback p { margin: 0; }
.video-fallback .btn { --btn-bg: #fff; --btn-fg: var(--ink); --btn-bd: #fff; margin-top: 6px; }

/* =========================================================
   CHECKOUT / THANK YOU
   ========================================================= */
.checkout-grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: clamp(24px, 4vw, 48px); align-items: start; }
@media (max-width: 900px) { .checkout-grid { grid-template-columns: 1fr; } .summary { order: -1; } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.summary { position: sticky; top: calc(var(--nav-h) + 20px); }
@media (max-width: 900px) { .summary { position: static; } }
.summary h2 { font-size: 1.35rem; }
.summary-list { list-style: none; padding: 0; margin: 0 0 16px; }
.summary-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .98rem; }
.summary-list .qty-x { color: var(--ink-3); }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--ink-2); }
.sum-row.total { color: var(--ink); font-weight: 600; font-size: 1.1rem; border-top: 1px solid var(--ink); margin-top: 10px; padding-top: 14px; }
.sum-row.total strong { font-family: var(--font-display); font-size: 1.7rem; }

.receipt { max-width: 640px; margin: clamp(40px, 7vw, 88px) auto 0; }
.receipt-mark { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-50); color: var(--ok); font-size: 1.7rem; margin-bottom: 20px; }
.receipt dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 24px 0; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.receipt dt { color: var(--ink-3); }
.receipt dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.receipt ul { margin: 0; padding-inline-start: 20px; }
.receipt .callout { background: var(--clay-50); border: 1px solid var(--callout-line); border-radius: var(--radius); padding: 16px 18px; color: var(--callout-ink); margin-bottom: 24px; }
.receipt .callout a { color: var(--clay-ink); font-weight: 700; }

/* =========================================================
   REVIEWS / CONTACT
   ========================================================= */
.two-col { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(24px, 5vw, 64px); align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.sticky-col { position: sticky; top: calc(var(--nav-h) + 20px); }
@media (max-width: 900px) { .sticky-col { position: static; } }

.review-list { display: flex; flex-direction: column; }
.review { padding: 24px 0; border-bottom: 1px solid var(--line); }
.review:first-child { padding-top: 0; }
.review-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.review-name { font-weight: 600; font-size: 1.08rem; }
.review-date { color: var(--ink-3); font-size: .88rem; }
.review-stars { color: var(--clay); letter-spacing: 2px; font-size: 1.1rem; margin-bottom: 6px; }
.review-stars .off { color: #d5cebf; }
.review-text { margin: 0; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }

.channels { list-style: none; padding: 0; margin: 0 0 28px; border-top: 1px solid var(--line); }
.channels li { border-bottom: 1px solid var(--line); }
.channels a { display: grid; grid-template-columns: 48px 1fr auto; gap: 16px; align-items: center; padding: 18px 4px; text-decoration: none; color: var(--ink); }
.channels a:hover { background: var(--surface); }
.channels .bi { font-size: 1.5rem; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--pine-50); color: var(--pine); }
.channels strong { display: block; font-size: 1.08rem; }
.channels span.sub { color: var(--ink-2); font-size: .92rem; }
.channels .go { color: var(--pine); font-weight: 600; font-size: .95rem; }

/* =========================================================
   AUTH (customer + admin sign-in)
   ========================================================= */
.auth-page { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.auth-main { display: grid; place-items: center; padding: 32px var(--gutter) 64px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: clamp(1.8rem, 3vw, 2.3rem); margin-bottom: .25em; }
.auth-card .sub { color: var(--ink-2); margin-bottom: 28px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; padding: 20px var(--gutter); }

/* =========================================================
   ADMIN
   ========================================================= */
.admin { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.admin-side { background: var(--deep); color: #cfd6d2; padding: 24px 16px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; }
.admin-side .brand { color: #fff; padding: 0 10px; }
.admin-side .brand small { color: #8f9a95; }
.admin-nav { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: var(--radius); color: #cfd6d2; text-decoration: none; font-size: .98rem; }
.admin-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-nav a[aria-current="page"] { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; }
.admin-nav .bi { font-size: 1.1rem; opacity: .85; }
.admin-drawer { display: flex; flex-direction: column; flex: 1; gap: 24px; }
.admin-side .foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 16px; }
.admin-side .who { font-size: .85rem; color: #8f9a95; padding: 0 12px 10px; overflow-wrap: anywhere; }
.admin-main { padding: clamp(20px, 4vw, 48px); min-width: 0; }
.admin-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.admin-head h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin: 0; }
.admin-head p { margin: 4px 0 0; color: var(--ink-2); }
.admin-topbar, .topbar-actions, .admin-foot { display: none; }
@media (max-width: 900px) {
  /* the sidebar's Rafaq credit is folded into the menu here, so show it under the page content instead */
  .admin-foot { display: flex; justify-content: center; margin-top: 40px; }
  .admin-side .rafaq-credit { display: none; }
  .admin { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .admin-side { position: static; height: auto; padding: 0; background: var(--deep); gap: 0; }
  .admin-topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
  .admin-topbar .nav-toggle { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
  /* theme + language buttons sit in the top bar on small screens, not inside the menu */
  .topbar-actions { display: flex; align-items: center; gap: 8px; }
  .topbar-actions .head-icon, .topbar-actions .lang-switch { background: transparent; color: #cfd6d2; border-color: rgba(255, 255, 255, .3); }
  .topbar-actions .lang-switch { width: auto; margin: 0; }
  .admin-side .side-controls { display: none; }
  .admin-side > .brand { display: none; }
  .admin-drawer { display: none; padding: 0 12px 16px; }
  .admin-drawer.open { display: block; }
}

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile {
  display: flex; flex-direction: column; gap: 6px; padding: 22px; min-height: 150px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  text-decoration: none; color: var(--ink); transition: border-color .15s;
}
.tile:hover { border-color: var(--pine); color: var(--ink); }
.tile .bi { font-size: 1.5rem; color: var(--pine); margin-bottom: 8px; }
.tile strong { font-size: 1.15rem; }
.tile span { color: var(--ink-2); font-size: .95rem; }
.tile.tile-danger .bi { color: var(--danger); }
.tile.tile-danger:hover { border-color: var(--danger); }

.admin-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.admin-card .thumb-lg { aspect-ratio: 16 / 10; background: var(--paper-2); padding: 12px; border-bottom: 1px solid var(--line); }
.admin-card .thumb-lg img { width: 100%; height: 100%; object-fit: contain; }
.admin-card .body { padding: 18px 20px; flex: 1; }
.admin-card h2, .admin-card h3 { font-size: 1.15rem; margin-bottom: .3em; font-family: var(--font-body); font-weight: 600; }
.admin-card .desc { color: var(--ink-2); font-size: .95rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: .95rem; margin: 12px 0 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.admin-card .actions { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }

.order-id-btn { font: inherit; font-weight: 700; background: var(--pine-50); color: var(--pine); border: 0; border-radius: var(--radius); padding: 2px 10px; cursor: pointer; }
.order-id-btn:hover { background: var(--pine); color: var(--on-pine); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.table { width: 100%; border-collapse: collapse; font-size: .96rem; }
.table th, .table td { padding: 14px 16px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.table th { font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td.msg { min-width: 260px; white-space: pre-line; }
.table td.nowrap { white-space: nowrap; }
@media (max-width: 720px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table td { border: 0; padding: 6px 16px; }
  .table td::before { content: attr(data-label); display: block; font-size: .78rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
}

/* dialog used for admin edit forms */
.dialog { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(640px, calc(100% - 24px)); max-height: calc(100vh - 32px); background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.dialog::backdrop { background: rgba(12, 16, 14, .55); }
.dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 1.35rem; margin: 0; }
.dialog-body { padding: 20px 24px; overflow-y: auto; }
.dialog-foot { display: flex; gap: 10px; justify-content: flex-start; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--surface); }

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

.reveal { animation: rise .6s var(--ease) both; }
.reveal-2 { animation-delay: .08s; }
.reveal-3 { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 420px) {
  .brand small { display: none; }
  .auth-top, .site-header .wrap { gap: 8px; }
  .auth-top .btn-sm, .site-header .btn-sm { padding-inline: 10px; }
}

/* Text typed into the database (product names, reviews, messages) may be in either
   language; let each paragraph take the direction of its own words. */
.product-body h2, .product-desc, .cart-item .name, .summary-list li > span:first-child,
.detail-info h1, .detail-desc, .review-name, .review-text,
.admin-card h2, .admin-card .desc, .kv dd, .table td.msg, .receipt dd { unicode-bidi: plaintext; }

@media (max-width: 480px) {
  .auth-top { flex-wrap: wrap; row-gap: 12px; }
  .nav-toggle, .lang-switch { padding-inline: 10px; }
  .nav-toggle > [data-i18n], .compact-sm > span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* =========================================================
   ROUND 3: outline + accent buttons, product page, hero, credit
   ========================================================= */
.btn-outline { --btn-bg: transparent; --btn-fg: var(--pine); --btn-bd: color-mix(in srgb, var(--pine) 55%, var(--line-strong)); }
.btn-outline:hover { --btn-bg: var(--pine); --btn-fg: var(--on-pine); --btn-bd: var(--pine); }
.btn-accent { --btn-bg: var(--clay); --btn-fg: var(--on-clay); --btn-bd: var(--clay); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--clay) 80%, transparent); }
.btn-accent:hover { --btn-bg: color-mix(in srgb, var(--clay) 88%, #fff); --btn-bd: color-mix(in srgb, var(--clay) 88%, #fff); --btn-fg: var(--on-clay); }
.product-actions .details-btn { min-height: 40px; font-size: .9rem; }

/* ---------- product page ---------- */
.back-row { display: flex; align-items: center; gap: 16px; padding: 20px 0 12px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; }
.back-link:hover { border-color: var(--pine); color: var(--pine); }
.back-title { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 48ch; }

.pdp {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px);
  align-items: start; padding: 8px 0 0;
}
.pdp-gallery { position: static; }
.pdp .gallery-main { aspect-ratio: 1 / 1; padding: clamp(16px, 3vw, 32px); }
.pdp .gallery-main img { mix-blend-mode: multiply; }
.pdp .thumbs { grid-template-columns: repeat(auto-fill, minmax(76px, 92px)); }
.pdp .thumb img { mix-blend-mode: multiply; }
.pdp-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 32px);
}
.pdp-panel h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 0 0 12px; line-height: 1.2; unicode-bidi: plaintext; }
.pdp-price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.pdp-price-row .price { font-size: 2rem; }
.pdp .detail-desc { font-size: 1.02rem; line-height: 1.8; margin: 0 0 22px; }
.pdp-buy { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: end; }
.pdp-qty { display: grid; gap: 6px; }
.pdp-label { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.pdp-buy .stepper { margin-top: 0; }
.pdp-add { min-height: 50px; font-size: 1.02rem; }
.pdp-limit { margin: 10px 0 0; }
.perks { list-style: none; padding: 18px 0 0; margin: 20px 0 0; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.perks li { display: flex; align-items: center; gap: 12px; font-size: .95rem; color: var(--ink-2); }
.perks .bi { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--pine-50); color: var(--pine); font-size: 1.05rem; flex: none; }
.perks a { font-weight: 600; }
.pdp .video-block { grid-column: 1 / -1; padding-top: clamp(16px, 3vw, 32px); border-top: 1px solid var(--line); }
.video-link { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); flex-wrap: wrap; }
.video-link > .bi { font-size: 1.8rem; color: var(--pine); }
.video-link > div { flex: 1; min-width: 180px; }
.video-link p { margin: 2px 0 0; font-size: .9rem; color: var(--ink-2); }
@media (max-width: 860px) {
  .pdp { grid-template-columns: 1fr; }
  .pdp-gallery { position: static; }
}
@media (max-width: 420px) {
  .pdp-buy { grid-template-columns: 1fr; }
}

/* ---------- Rafaq Tec credit ---------- */
.footer-base { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.rafaq-credit {
  margin: 0; display: inline-flex; align-items: center; gap: 12px; padding: 8px 18px 8px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2);
  box-shadow: 0 6px 18px -12px rgba(var(--shadow-rgb), .35);
}
[dir="rtl"] .rafaq-credit { padding: 8px 10px 8px 18px; }
.rafaq-text { display: grid; line-height: 1.2; }
.rafaq-text small { font-size: .75rem; color: var(--ink-3); letter-spacing: .02em; }
.rafaq-text strong { font-size: 1.1rem; color: var(--ink); font-weight: 700; letter-spacing: .01em; direction: ltr; text-align: start; }
.rafaq-logo { height: 44px; width: auto; display: block; }
.site-footer-slim { margin-top: clamp(40px, 6vw, 72px); padding: 20px 0; }
.site-footer-slim .footer-base { margin: 0; padding: 0; border: 0; }
.auth-foot { display: flex; justify-content: center; padding: 0 var(--gutter) 28px; }
.admin-side .rafaq-credit { margin: 12px 12px 0; background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .12); box-shadow: none; }
.admin-side .rafaq-text small { color: #9aa1a8; }
.admin-side .rafaq-text strong { color: #f1f3f4; }
.side-controls { display: flex; gap: 8px; align-items: center; padding: 0 12px 8px; }
.side-controls .lang-switch { flex: 1; width: auto; margin: 0; }
.side-controls .head-icon { background: transparent; color: #cfd6d2; border-color: rgba(255, 255, 255, .25); }

/* ---------- header actions on small screens ---------- */
@media (max-width: 560px) {
  .lang-switch [data-lang-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .lang-switch { width: 44px; padding: 0; justify-content: center; }
  .header-actions { gap: 6px; }
  .site-header .brand { font-size: 1.15rem; }
  .brand-logo { width: 46px; height: 46px; }
  .head-icon, .lang-switch, .topbar-actions .lang-switch { width: 40px; height: 40px; min-height: 40px; }
  .nav-toggle { min-height: 40px; }
}
@media (max-width: 360px) {
  .brand-logo { width: 40px; height: 40px; }
}
@media (max-width: 350px) {
  /* very small phones: the round logo alone, so the menu button still fits (the name stays for screen readers) */
  .site-header .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* =========================================================
   HERO: fills the first screen; features start below the fold
   ========================================================= */
.hero2 {
  position: relative; overflow: hidden;
  min-height: calc(100vh - var(--nav-h)); min-height: calc(100svh - var(--nav-h));
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(24px, 4vw, 48px) 0 clamp(72px, 9vw, 104px);
}
.hero2 .wrap { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.kicker {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: .9rem; font-weight: 600; color: var(--ink-2); margin-bottom: 22px;
}
.kicker .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--clay); color: var(--on-clay); font-size: .8rem; }
.hero2 h1 { font-size: clamp(2.6rem, 6.2vw, 5rem); line-height: 1.04; letter-spacing: -.025em; margin: 0 0 .4em; }
.hero2 h1 em { font-style: italic; font-weight: 400; color: var(--pine); }
[lang="ar"] .hero2 h1 { letter-spacing: 0; line-height: 1.25; }
[lang="ar"] .hero2 h1 em { font-style: normal; font-weight: 700; }
.hero2 .lede { font-size: clamp(1.1rem, 1.7vw, 1.35rem); color: var(--ink-2); max-width: 38ch; margin: 0 0 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.btn-hero { min-height: 60px; padding: 0 30px; font-size: 1.12rem; border-radius: 999px; }
.btn-hero { min-width: 180px; }
.btn-hero.btn-secondary { --btn-bd: var(--ink-3); background: var(--surface); }
.btn-hero.btn-secondary:hover { --btn-bd: var(--pine); --btn-fg: var(--pine); }
.trust { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 24px; padding: 0; margin: 2.2rem 0 0; }
.trust li { display: inline-flex; align-items: center; gap: 8px; font-size: .95rem; font-weight: 500; color: var(--ink-2); }
.trust .bi { color: var(--pine); font-size: 1.1rem; }

/* hero photo: the original stethoscope photograph, framed */
.hero-photo { position: relative; margin: 0; justify-self: end; width: 100%; max-width: 560px; }
.hero-photo::before {
  content: ""; position: absolute; inset: 0; transform: translate(18px, 18px); border-radius: 22px;
  background: var(--pine-50); border: 1px solid color-mix(in srgb, var(--pine) 25%, transparent);
}
[dir="rtl"] .hero-photo::before { transform: translate(-18px, 18px); }
.hero-photo img {
  position: relative; width: 100%; height: auto; aspect-ratio: 4 / 5; max-height: min(620px, calc(100svh - var(--nav-h) - 120px));
  object-fit: cover; object-position: 40% center; border-radius: 22px; display: block;
  box-shadow: 0 30px 60px -30px rgba(var(--shadow-rgb), .45);
}

.scroll-cue {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: .82rem; font-weight: 600; color: var(--ink-3); text-decoration: none; letter-spacing: .02em;
}
.scroll-cue .bi { font-size: 1.1rem; animation: nudge 1.8s ease-in-out infinite; }
.scroll-cue:hover { color: var(--pine); }
@keyframes nudge { 50% { transform: translateY(5px); } }

@media (max-width: 900px) {
  .hero2 { min-height: auto; padding-bottom: 56px; }
  .hero2 .wrap { grid-template-columns: 1fr; }
  .hero-photo { justify-self: center; max-width: 440px; }
  .hero-photo img { aspect-ratio: 4 / 3; max-height: none; }
  .scroll-cue { display: none; }
}
@media (max-width: 480px) {
    .hero-photo::before { display: none; }
}

/* footer: official brand marks for the contact channels */
.footer-grid .social-row { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.footer-grid .social-row li { margin: 0; }
.footer-grid .social {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  color: #fff; font-size: 1.4rem; text-decoration: none;
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .45);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.footer-grid .social:hover { color: #fff; text-decoration: none; transform: translateY(-3px); box-shadow: 0 12px 22px -10px rgba(0, 0, 0, .5); }
.footer-grid .social:focus-visible { outline: 2px solid var(--pine); outline-offset: 3px; }
.social-wa { background: #25d366; }
.social-ms { background: radial-gradient(circle at 20% 100%, #0099ff 0%, #a033ff 60%, #ff5280 92%, #ff7061 100%); }
.social-ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
@media (prefers-reduced-motion: reduce) { .footer-grid .social, .footer-grid .social:hover { transition: none; transform: none; } }
.channels .bi-whatsapp, .channels .bi-messenger, .channels .bi-instagram { color: #fff; border-radius: 14px; }
.channels .bi-whatsapp { background: #25d366; }
.channels .bi-messenger { background: radial-gradient(circle at 20% 100%, #0099ff 0%, #a033ff 60%, #ff5280 92%, #ff7061 100%); }
.channels .bi-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }

/* ---------- checkout: grouped sections, area picker, phone with country ---------- */
.form-section { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
.form-section + .form-section { border-top: 1px solid var(--line); padding-top: 22px; }
.form-section > legend { float: inline-start; width: 100%; font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 14px; padding: 0; }
.form-section > legend + * { clear: both; }

.picker { position: relative; }
.picker-trigger { text-align: start; cursor: pointer; display: flex; align-items: center; }
.picker-trigger .picker-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-trigger.is-placeholder .picker-value { color: #8b928e; }
.picker-trigger:disabled { cursor: not-allowed; opacity: .6; }
.picker-trigger[aria-invalid="true"] { border-color: var(--danger); }
.picker-trigger:focus-visible, .phone-country:focus-visible { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px var(--pine-50); }

.picker-panel {
  position: absolute; z-index: 40; top: calc(100% + 6px); inset-inline: 0; min-width: 260px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .35); overflow: hidden;
}
.picker-search { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.picker-input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1rem; padding: 6px 0; outline: none; }
.picker-list { list-style: none; margin: 0; padding: 6px; max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.picker-option { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; cursor: pointer; color: var(--ink); }
.picker-option.is-active { background: var(--pine-50); }
.picker-option.is-other { color: var(--pine); font-weight: 600; border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; margin-top: 4px; }
.picker-option.is-other .bi { font-size: 1rem; }
.picker-list .is-other:first-child { border-top: 0; margin-top: 0; }
.picker-label { flex: 1; min-width: 0; }
.picker-sub { color: var(--ink-3); font-size: .9rem; font-variant-numeric: tabular-nums; direction: ltr; }
.picker-empty { padding: 12px 10px; color: var(--ink-3); font-size: .95rem; }
.picker-option .fi { width: 22px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); flex: none; background-size: cover; }

.phone-field { position: relative; display: flex; }
.phone-country {
  display: inline-flex; align-items: center; gap: 7px; flex: none; min-height: 52px; padding: 0 10px 0 12px;
  border: 1px solid var(--line-strong); border-right: 0; border-radius: var(--radius) 0 0 var(--radius);
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: 1rem; cursor: pointer;
}
.phone-country .fi { width: 24px; height: 18px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); background-size: cover; }
.phone-country .phone-dial { font-variant-numeric: tabular-nums; }
.phone-country .bi { font-size: .75rem; color: var(--ink-3); }
.phone-field .input { border-radius: 0 var(--radius) var(--radius) 0; min-width: 0; direction: ltr; text-align: left; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.phone-field .picker-panel { inset-inline: 0; }
.phone-field[dir="ltr"] .picker-panel { left: 0; right: 0; }
.picker-input:focus-visible { box-shadow: none; }
.picker-input::-webkit-search-cancel-button { cursor: pointer; }
.picker-search:focus-within { color: var(--pine); }

/* ---------- filter chips (orders by status) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: .95rem; cursor: pointer;
}
.chip:hover { border-color: var(--pine); }
.chip[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: var(--on-pine); }
.chip .chip-count { font-size: .82rem; opacity: .75; font-variant-numeric: tabular-nums; }

/* ---------- order status ---------- */
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; border: 1px solid transparent; }
.status-new { background: var(--clay-50); color: var(--callout-ink); border-color: var(--callout-line); }
.status-confirmed { background: var(--pine-50); color: var(--pine-700); }
.status-shipped { background: var(--paper-2); color: var(--ink); border-color: var(--line-strong); }
.status-delivered { background: var(--ok-50); color: var(--notice-ok-ink); }
.status-cancelled { background: var(--danger-50); color: var(--notice-err-ink); text-decoration: line-through; }
.admin-card.is-new { border-color: var(--clay); box-shadow: inset 4px 0 0 var(--clay); }
[dir="rtl"] .admin-card.is-new { box-shadow: inset -4px 0 0 var(--clay); }
.status-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.status-row .select { min-height: 40px; width: auto; padding-block: 0; }

/* ---------- product checks ---------- */
.warn-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.warn-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius); font-size: .82rem; background: var(--clay-50); color: var(--callout-ink); border: 1px solid var(--callout-line); }
.check-toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: .95rem; cursor: pointer; }

/* ---------- photo field: link + upload button + preview ---------- */
.upload-row { display: flex; gap: 8px; align-items: stretch; }
.upload-row .input { flex: 1; min-width: 0; }
.upload-row .btn { flex: none; }
.upload-preview { display: block; width: 72px; height: 72px; margin-top: 8px; object-fit: contain; background: var(--media-bg); border: 1px solid var(--line); border-radius: var(--radius); }
.upload-preview[hidden] { display: none; }

/* ---------- policy pages ---------- */
.policy { max-width: 760px; }
.policy h2 { font-family: var(--font-body); font-size: 1.2rem; font-weight: 600; margin: 28px 0 10px; }
.policy ul, .policy ol { padding-inline-start: 1.3em; display: grid; gap: 6px; }
.policy a { color: var(--pine); }
.policy .policy-meta { color: var(--ink-3); font-size: .9rem; }

/* ---------- payment note at checkout ---------- */
.pay-note { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); font-size: .93rem; color: var(--ink-2); }
.pay-note strong { color: var(--ink); }
