/* ===========================================================================
   توفير X · xtawfir — final design system
   Dark-default, light-toggle, RTL/LTR. Minimal + warm. Accent: amber.
   =========================================================================== */

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

/* ---------- tokens ---------- */
:root,
[data-theme="dark"] {
  --bg:        #131419;
  --bg-2:      #0f1014;
  --surface:   #1b1d24;
  --surface-2: #23262f;
  --line:      rgba(255,255,255,.09);
  --line-2:    rgba(255,255,255,.16);
  --ink:       #f4f2ec;
  --ink-2:     #c7c8ce;
  --mut:       #8d909b;
  --mut-2:     #62656f;

  --acc:       #f2b73c;   /* amber */
  --acc-ink:   #1a1407;   /* text on amber */
  --acc-soft:  rgba(242,183,60,.14);
  --acc-line:  rgba(242,183,60,.42);

  --ok:        #54c98a;   /* copied confirmation */
  --ok-soft:   rgba(84,201,138,.14);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 8px 26px rgba(0,0,0,.36);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.5);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg:        #f6f3ec;
  --bg-2:      #efe9dd;
  --surface:   #ffffff;
  --surface-2: #f3efe6;
  --line:      rgba(28,24,16,.10);
  --line-2:    rgba(28,24,16,.18);
  --ink:       #1c1a15;
  --ink-2:     #44423b;
  --mut:       #6f6d64;
  --mut-2:     #97958b;

  --acc:       #d2960f;
  --acc-ink:   #1c1403;
  --acc-soft:  rgba(210,150,15,.12);
  --acc-line:  rgba(210,150,15,.40);

  --ok:        #2f9d68;
  --ok-soft:   rgba(47,157,104,.12);

  --shadow-sm: 0 1px 2px rgba(40,30,10,.06);
  --shadow:    0 10px 30px rgba(60,45,15,.10);
  --shadow-lg: 0 24px 60px rgba(60,45,15,.16);
  color-scheme: light;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Tajawal', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
.theme-switching * { transition: none !important; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.mono { font-family: 'IBM Plex Mono', monospace; }
.muted { color: var(--mut); }
.accent { color: var(--acc); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 700; font-size: 15px; line-height: 1;
  padding: 0 20px; height: 46px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink);
  transition: transform .12s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-accent { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn-accent:hover { box-shadow: 0 8px 22px var(--acc-soft); }
.btn-ghost { background: transparent; }
.btn-sm { height: 38px; font-size: 13.5px; padding: 0 14px; border-radius: 10px; }
.btn-block { width: 100%; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--mut); font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--ink); border-color: var(--line-2); }
.chip.on { color: var(--acc); border-color: var(--acc-line); background: var(--acc-soft); }

.eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--acc); font-weight: 500;
}
html[dir="rtl"] .eyebrow { letter-spacing: .04em; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar { display: flex; align-items: center; gap: 22px; height: 68px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 900; font-size: 19px; letter-spacing: -.01em; white-space: nowrap; }
.brand .glyph {
  width: 30px; height: 30px; border-radius: 9px 3px 9px 3px; display: grid; place-items: center;
  background: var(--acc); color: var(--acc-ink); font-family: 'IBM Plex Mono'; font-weight: 600; font-size: 16px;
}
.brand b { color: var(--acc); font-weight: 900; }
.nav { display: flex; gap: 4px; margin-inline-start: 4px; }
.nav a {
  padding: 8px 13px; border-radius: 9px; font-size: 15px; font-weight: 500; color: var(--mut);
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a.active { color: var(--ink); font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: color .15s, border-color .15s, background .15s; font-size: 17px;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }

.seg {
  display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden;
  font-family: 'IBM Plex Mono'; font-size: 12.5px; background: var(--surface);
}
.seg button, .seg a {
  border: 0; background: transparent; cursor: pointer; padding: 8px 0; min-width: 38px; color: var(--mut);
  font-family: inherit; transition: color .15s, background .15s; letter-spacing: .04em;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.seg button.on, .seg a.on { background: var(--acc); color: var(--acc-ink); }

.burger { display: none; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 30px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 900; line-height: 1.14; letter-spacing: -.02em; margin: 16px 0 12px; }
.hero p { font-size: clamp(15px, 2vw, 19px); color: var(--mut); margin: 0 auto 30px; max-width: 540px; }

.search {
  display: flex; align-items: center; gap: 10px; width: min(620px, 100%); margin: 0 auto;
  background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 18px;
  padding: 8px 8px 8px 20px; box-shadow: var(--shadow);
  transition: border-color .18s, box-shadow .18s;
}
.search:focus-within { border-color: var(--acc-line); box-shadow: 0 10px 30px var(--acc-soft); }
.search .ic { font-size: 22px; color: var(--mut); }
.search input {
  flex: 1; border: 0; background: transparent; color: var(--ink); font-family: inherit;
  font-size: 17px; min-width: 0;
}
.search input::placeholder { color: var(--mut); }
.search input:focus { outline: none; }
.search .btn { height: 46px; }

.suggest { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; align-items: center; }
.suggest .lbl { font-size: 13px; color: var(--mut-2); }
.suggest-chips { display: contents; }

/* ---------- section ---------- */
.section { padding: 30px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { font-size: clamp(20px, 3vw, 27px); font-weight: 800; margin: 0; letter-spacing: -.01em; }
.section-head .sub { color: var(--mut); font-size: 14.5px; margin-top: 3px; }
.section-head .more { color: var(--acc); font-weight: 700; font-size: 14.5px; }

/* ---------- coupon ticket ---------- */
.coupon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.coupon {
  position: relative;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, #fff 8%), var(--surface));
  border: 1.5px solid var(--line);
  border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.coupon:hover { transform: translateY(-3px); border-color: var(--acc-line);
  box-shadow: var(--shadow), 0 6px 22px var(--acc-soft), inset 0 1px 0 rgba(255,255,255,.07); }
.coupon .top { display: flex; align-items: center; gap: 12px; }
.coupon .logo {
  width: 48px; height: 48px; border-radius: 12px; flex: 0 0 auto; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--surface-2), color-mix(in srgb, var(--surface-2) 88%, #000 12%));
  border: 1.5px solid var(--line); color: var(--ink-2);
  font-weight: 800; font-size: 13px; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.coupon .meta { flex: 1; min-width: 0; }
.coupon .meta .name { font-weight: 800; font-size: 16px; }
.coupon .meta .desc { font-size: 13px; color: var(--mut); margin-top: 1px; }
.coupon .off { font-weight: 900; font-size: 22px; color: var(--acc); white-space: nowrap;
  background: var(--acc-soft); border: 1px solid var(--acc-line); border-radius: 11px; padding: 5px 11px; line-height: 1; }

.coupon .divider { border-top: 2px dashed var(--line-2); position: relative; margin: 2px -18px; }
.coupon .notch { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--bg);
  border: 1.5px solid var(--line); transform: translateY(-50%); }
.coupon .notch.s { inset-inline-start: -10px; }
.coupon .notch.e { inset-inline-end: -10px; }

/* ---------- the one nice copy button (used everywhere) ---------- */
.copy-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  height: 52px; padding-block: 7px; padding-inline-start: 18px; padding-inline-end: 7px;
  border-radius: 13px; cursor: pointer; font-family: inherit;
  border: 1.5px solid var(--acc-line); background: var(--acc-soft); color: var(--acc);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .12s;
}
.copy-btn:hover { background: color-mix(in srgb, var(--acc-soft) 45%, var(--acc) 20%); box-shadow: 0 6px 18px var(--acc-soft); }
.copy-btn:active { transform: scale(.99); }
.copy-btn .code { font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: 18px; letter-spacing: .04em; color: var(--acc); }
.copy-btn .act {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 17px; border-radius: 10px;
  background: var(--acc); color: #000; font-weight: 700; font-size: 13.5px; white-space: nowrap;
  transition: background .15s;
}
.copy-btn .act .lbl { color: inherit; }
.copy-btn .act .ic { font-size: 15px; }
.copy-btn.copied { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.copy-btn.copied .code { color: var(--ok); }
.copy-btn.copied .act { background: var(--ok); color: #fff; }

/* ---------- article card ---------- */
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.article-card {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; transition: transform .15s, border-color .18s, box-shadow .18s;
}
.article-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.article-card .thumb { aspect-ratio: 16/9; border-bottom: 1.5px solid var(--line); }
.article-card .body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.article-card .tags { display: flex; gap: 6px; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--mut); border: 1px solid var(--line); }
.article-card h3 { font-size: 17.5px; font-weight: 800; margin: 0; line-height: 1.4; letter-spacing: -.01em; }
.article-card .excerpt { font-size: 13.5px; color: var(--mut); line-height: 1.6; }
.article-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--mut-2); }
.article-card .foot .read { color: var(--acc); font-weight: 700; }

/* ===========================================================================
   DEALS / OFFERS  —  قسم التخفيضات والعروض
   Product cards: image-top, discount badge, rating + orders, old/new price.
   Three switchable visual styles via [data-deal-style="a|b|c"] on the grid.
   =========================================================================== */
.deals-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.deal {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px;
  overflow: hidden; transition: transform .18s, border-color .18s, box-shadow .18s;
}
.deal:hover { transform: translateY(-4px); border-color: var(--acc-line);
  box-shadow: var(--shadow), 0 6px 22px var(--acc-soft); }

/* ---- product image ---- */
.deal-img { position: relative; aspect-ratio: 1 / 1; border-bottom: 1.5px solid var(--line);
  background-size: cover; background-position: center; }
.deal-img.ph { display: grid; place-items: center; }
.deal-store {
  position: absolute; inset-block-start: 10px; inset-inline-start: 10px;
  font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 11px; line-height: 1;
  padding: 5px 9px; border-radius: 8px; background: color-mix(in srgb, var(--bg) 72%, transparent);
  color: var(--ink); border: 1px solid var(--line-2); backdrop-filter: blur(6px);
}
.deal-off {
  position: absolute; inset-block-start: 10px; inset-inline-end: 10px;
  font-weight: 900; font-size: 15px; line-height: 1; padding: 6px 9px; border-radius: 9px;
  background: var(--acc); color: var(--acc-ink); box-shadow: var(--shadow-sm);
}

/* ---- body ---- */
.deal-body { padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.deal-title {
  font-size: 14.5px; font-weight: 700; line-height: 1.5; margin: 0; color: var(--ink);
  letter-spacing: -.005em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.9em;
}
.deal-stats { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.deal-rate { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 700; }
.deal-rate .star { color: var(--acc); font-size: 13px; }
.deal-rate i { color: var(--mut); font-weight: 500; font-style: normal; }
.deal-orders { display: inline-flex; align-items: center; gap: 5px; color: var(--mut); font-weight: 500; }
.deal-orders::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--mut-2); }

.deal-price { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin-top: auto; }
.deal-new { font-weight: 900; font-size: 21px; color: var(--ink); letter-spacing: -.01em; line-height: 1; }
.deal-new .cur { font-size: 13px; font-weight: 700; color: var(--mut); margin-inline-start: 2px; }
.deal-old { font-size: 13.5px; color: var(--mut-2); text-decoration: line-through; }
.deal-save { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px;
  background: var(--ok-soft); color: var(--ok); white-space: nowrap; }

.deal-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 100%;
  height: 44px; border-radius: 12px; font-family: inherit; font-weight: 800; font-size: 14px;
  border: 1.5px solid var(--acc-line); background: var(--acc-soft); color: var(--acc);
  transition: background .15s, box-shadow .15s; margin-top: 2px;
}
.deal:hover .deal-cta { background: color-mix(in srgb, var(--acc-soft) 50%, var(--acc) 18%); }

/* =================== STYLE B — bold price-forward =================== */
[data-deal-style="b"] .deal-off {
  inset-inline-end: 0; inset-block-start: 12px; border-radius: 9px 0 0 9px; padding: 7px 11px 7px 12px;
  font-size: 16px;
}
[data-deal-style="b"] .deal-new { color: var(--acc); font-size: 24px; }
[data-deal-style="b"] .deal-new .cur { color: color-mix(in srgb, var(--acc) 75%, var(--mut)); }
[data-deal-style="b"] .deal-cta {
  background: var(--acc); border-color: var(--acc); color: var(--acc-ink);
}
[data-deal-style="b"] .deal:hover .deal-cta { box-shadow: 0 8px 20px var(--acc-soft); background: var(--acc); }
[data-deal-style="b"] .deal-stats { gap: 7px; }
[data-deal-style="b"] .deal-rate, [data-deal-style="b"] .deal-orders {
  padding: 4px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
[data-deal-style="b"] .deal-orders::before { display: none; }

/* =================== STYLE C — stat pills + filled footer =================== */
[data-deal-style="c"] .deal { border-radius: 18px; }
[data-deal-style="c"] .deal-body { padding-bottom: 0; gap: 10px; }
[data-deal-style="c"] .deal-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px; order: 2;
}
[data-deal-style="c"] .deal-rate, [data-deal-style="c"] .deal-orders {
  justify-content: center; padding: 7px 6px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 12px;
}
[data-deal-style="c"] .deal-orders::before { display: none; }
[data-deal-style="c"] .deal-stats > :only-child { grid-column: 1 / -1; }
[data-deal-style="c"] .deal-price { order: 3; }
[data-deal-style="c"] .deal-cta {
  order: 4; margin: 4px -15px 0; width: calc(100% + 30px); border-radius: 0; height: 48px;
  border: 0; border-top: 1.5px solid var(--acc-line); background: var(--acc); color: var(--acc-ink);
}
[data-deal-style="c"] .deal:hover .deal-cta { background: var(--acc); filter: brightness(1.04); }

@media (max-width: 900px) { .deals-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) {
  .deals-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .deal { border-radius: 15px; }
  [data-deal-style="c"] .deal { border-radius: 15px; }
  .deal-body { padding: 12px 12px 13px; gap: 9px; }
  .deal-title { font-size: 13px; line-height: 1.45; min-height: 2.6em; }
  .deal-stats { font-size: 11.5px; gap: 7px; }
  .deal-price { gap: 6px 8px; }
  .deal-new { font-size: 18.5px; } [data-deal-style="b"] .deal-new { font-size: 20px; }
  .deal-new .cur { font-size: 11px; }
  .deal-old { font-size: 12px; }
  .deal-save { font-size: 10.5px; padding: 2px 6px; }
  .deal-off { font-size: 13px; padding: 5px 7px; }
  .deal-store { font-size: 10px; padding: 4px 7px; }
  .deal-cta { height: 42px; font-size: 13px; }
  [data-deal-style="c"] .deal-body { gap: 8px; }
  [data-deal-style="c"] .deal-stats { gap: 6px; }
  [data-deal-style="c"] .deal-rate, [data-deal-style="c"] .deal-orders { padding: 6px 4px; font-size: 11px; }
  [data-deal-style="c"] .deal-cta { margin: 4px -12px 0; width: calc(100% + 24px); height: 44px; }
}

/* ---------- placeholder imagery ---------- */
.empty-slot { grid-column: 1 / -1; text-align: center; color: var(--mut); padding: 44px 20px; border: 1.5px dashed var(--line-2); border-radius: 16px; font-size: 15px; }
.logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; display: block; }
.ph {
  background:
    repeating-linear-gradient(135deg, transparent 0 11px, color-mix(in srgb, var(--ink) 6%, transparent) 11px 12px),
    var(--surface-2);
  display: grid; place-items: center; color: var(--mut-2);
  font-family: 'IBM Plex Mono'; font-size: 11.5px; letter-spacing: .03em;
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 40px 0 30px; background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
.footer-grid h4 { font-size: 14px; font-weight: 800; margin: 0 0 14px; }
.footer-grid a { display: block; color: var(--mut); font-size: 14px; padding: 5px 0; }
.footer-grid a:hover { color: var(--ink); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--mut-2); font-size: 13px; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; inset-block-end: 24px; inset-inline: 0; display: flex; justify-content: center; z-index: 100; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--ok); border-radius: 14px; padding: 13px 18px; box-shadow: var(--shadow-lg);
  font-weight: 700; font-size: 14.5px; transform: translateY(20px); opacity: 0;
  transition: transform .25s cubic-bezier(.2,.8,.3,1), opacity .25s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast .dot { width: 24px; height: 24px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 14px; }
.toast .code { font-family: 'IBM Plex Mono'; color: var(--ok); }

/* ---------- page head ---------- */
.page-head { padding: 44px 0 20px; }
.page-head h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 900; letter-spacing: -.02em; margin: 12px 0 8px; }
.page-head p { color: var(--mut); font-size: 16px; margin: 0; max-width: 560px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 22px 0 6px; }
.toolbar .grow { flex: 1; }
.filter-search {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--mut); min-width: 220px;
}
.filter-search input { border: 0; background: transparent; color: var(--ink); font-family: inherit; font-size: 14.5px; flex: 1; min-width: 0; }
.filter-search input:focus { outline: none; }

/* ---------- store grid ---------- */
.store-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.store-card {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 22px 18px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  transition: transform .15s, border-color .18s, box-shadow .18s;
}
.store-card:hover { transform: translateY(-3px); border-color: var(--acc-line); box-shadow: var(--shadow); }
.store-card .logo { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center;
  background: var(--surface-2); border: 1.5px solid var(--line); font-weight: 800; font-size: 16px; color: var(--ink-2); margin-bottom: 6px; }
.store-card .sc-name { font-weight: 800; font-size: 16px; }
.store-card .sc-cat { font-size: 13px; color: var(--mut); }
.store-card .sc-count { font-size: 12px; color: var(--acc); margin-top: 4px; }

/* ---------- article page ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 720px); justify-content: center; padding: 28px 0 0; position: relative; }
.article-hero { }
.article-hero .tags { display: flex; gap: 7px; margin-bottom: 14px; }
.article-hero h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 900; line-height: 1.28; letter-spacing: -.02em; margin: 0; }
.article-byline { display: flex; align-items: center; gap: 10px; margin: 16px 0 22px; font-size: 13.5px; color: var(--mut); }
.article-byline .av { width: 30px; height: 30px; border-radius: 9px 3px 9px 3px; display: grid; place-items: center; background: var(--acc); color: var(--acc-ink); font-family: 'IBM Plex Mono'; font-weight: 600; font-size: 16px; flex: 0 0 auto; overflow: hidden; }
.article-byline .av.has-img { background: #fff; border: 1.5px solid var(--line); }
.article-byline .av img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; display: block; }
.article-cover { aspect-ratio: 16/8; border-radius: 16px; margin-bottom: 26px; }
.prose { font-size: 17px; line-height: 1.85; color: var(--ink-2); }
.prose h2 { font-size: 23px; font-weight: 800; color: var(--ink); margin: 30px 0 12px; letter-spacing: -.01em; scroll-margin-top: 90px; }
.prose p { margin: 0 0 18px; }
.prose .lead { font-size: 19px; color: var(--ink); }
.prose h3 { font-size: 18px; font-weight: 800; color: var(--ink); margin: 26px 0 10px; letter-spacing: -.01em; }
.prose ul { margin: 0 0 18px; padding-inline-start: 22px; }
.prose li { margin: 0 0 9px; }
.prose a { color: var(--acc); text-decoration: none; border-bottom: 1px solid var(--acc-line); }
.prose a:hover { border-bottom-color: var(--acc); }
.prose strong { color: var(--ink); font-weight: 700; }
.legal { max-width: 780px; }
.legal-updated { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--mut); margin-top: 8px; }
.legal-note { margin: 34px 0 8px; padding: 16px 18px; border: 1.5px dashed var(--line-2); border-radius: 12px; font-size: 14px; line-height: 1.7; color: var(--mut); }
.legal-toc { margin: 24px 0 30px; padding: 18px 20px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; }
.legal-toc h4 { margin: 0 0 12px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--mut); }
.legal-toc ol { margin: 0; padding-inline-start: 20px; columns: 2; column-gap: 28px; }
.legal-toc li { margin: 0 0 7px; }
.legal-toc a { color: var(--ink-2); text-decoration: none; border: 0; font-size: 14.5px; }
.legal-toc a:hover { color: var(--acc); }
@media (max-width: 560px) { .legal-toc ol { columns: 1; } }
.legal-consent { margin: 30px 0 8px; padding: 18px 20px; border: 1.5px solid var(--acc); border-radius: 14px; background: var(--acc-soft); }
.legal-consent p { margin: 0; font-size: 15px; line-height: 1.8; color: var(--ink); }
.legal-consent strong { color: var(--acc); }

/* ---------- in-article table of contents ---------- */
.prose ol { margin: 0 0 18px; padding-inline-start: 22px; }
.article-toc { margin: 4px 0 30px; padding: 16px 20px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; }
.article-toc h4 { margin: 0 0 10px; font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); font-weight: 600; }
.article-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; display: flex; flex-direction: column; gap: 2px; }
.article-toc li { margin: 0; }
.article-toc a { display: flex; align-items: baseline; gap: 11px; padding: 9px 11px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 600; transition: background .15s, color .15s; }
.article-toc a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--acc); font-weight: 700; min-width: 18px; }
.article-toc a:hover { background: var(--acc-soft); color: var(--ink); }
@keyframes tocFlash { 0% { background: var(--acc-soft); } 100% { background: transparent; } }
.toc-flash { animation: tocFlash 1.3s ease; border-radius: 7px; }

/* ---------- how-it-works steps ---------- */
.how-steps { counter-reset: step; display: flex; flex-direction: column; gap: 14px; margin: 26px 0 32px; padding: 0; list-style: none; }
.how-steps li { display: flex; gap: 16px; padding: 18px 20px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; }
.how-steps li::before { counter-increment: step; content: counter(step); flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc); border: 1.5px solid var(--acc-line); font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: 18px; }
.how-steps .st-t { font-weight: 800; font-size: 17px; color: var(--ink); margin: 2px 0 5px; }
.how-steps .st-d { font-size: 14.5px; color: var(--ink-2); line-height: 1.65; margin: 0; }
.cta-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 13px 24px; border-radius: 12px; background: var(--acc); color: #000; font-weight: 800; font-size: 15px; text-decoration: none; border: 0; box-shadow: var(--shadow); }
.cta-btn:hover { filter: brightness(1.05); }

/* ---------- collapsible side coupon (peek tab) ---------- */
.side-coupon {
  position: fixed; inset-inline-start: 0; top: 46%; transform: translateY(-50%);
  z-index: 40; animation: sc-fade .45s ease both;
}
@keyframes sc-fade { from { opacity: 0; } to { opacity: 1; } }

/* always-visible handle (the tab pinned to the screen edge) */
.sc-handle {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  width: 48px; padding: 15px 0; cursor: pointer; font-family: inherit;
  background: linear-gradient(160deg, color-mix(in srgb, var(--acc) 92%, #fff 8%), var(--acc));
  color: #000; border: none;
  border-start-end-radius: 16px; border-end-end-radius: 16px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.25);
  transition: filter .2s;
}
.sc-handle:hover { filter: brightness(1.06); }
.sc-handle .sc-pct { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: rgba(0,0,0,.16); font-family: 'IBM Plex Mono'; font-weight: 700; font-size: 16px; line-height: 1; }
.sc-handle .sc-handle-txt { writing-mode: vertical-rl; font-size: 12.5px; font-weight: 800; letter-spacing: .04em; }
html[dir="rtl"] .sc-handle .sc-handle-txt { rotate: 180deg; }
.sc-handle .sc-caret { font-size: 11px; opacity: .7; transition: rotate .3s; }
.side-coupon.open .sc-handle .sc-caret { rotate: 180deg; }

/* panel: fixed width, absolutely anchored beside the handle.
   Animated with opacity + transform only (no width animation) → rock solid. */
.sc-panel {
  position: absolute; top: 50%; inset-inline-start: 56px;
  width: 284px; box-sizing: border-box;
  display: flex; align-items: center; gap: 11px; white-space: nowrap;
  padding: 12px 16px; background: var(--surface);
  border: 1.5px solid var(--acc-line); border-radius: 16px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(calc(-50% - 7px));
  transition: opacity .24s ease, transform .3s cubic-bezier(.22,.85,.3,1), visibility 0s linear .3s;
}
.side-coupon.open .sc-panel, .side-coupon:hover .sc-panel {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(-50%);
  transition: opacity .24s ease, transform .3s cubic-bezier(.22,.85,.3,1), visibility 0s;
}
.sc-panel .logo { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--surface-2), color-mix(in srgb, var(--surface-2) 88%, #000 12%));
  border: 1.5px solid var(--line); font-weight: 800; font-size: 12px; color: var(--ink-2); flex: 0 0 auto; }
.sc-panel .sc-body { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.sc-panel .sc-body > .lbl { font-size: 11px; color: var(--mut); }
.sc-panel .copy-btn { height: 44px; padding-inline-start: 12px; padding-inline-end: 6px; gap: 8px; }
.sc-panel .copy-btn .code { font-size: 14.5px; letter-spacing: .02em; }
.sc-panel .copy-btn .act { height: 32px; padding: 0 11px; font-size: 12px; gap: 5px; }
.sc-panel .copy-btn .act .ic { font-size: 13px; }
.side-coupon.copied .sc-panel { border-color: var(--ok); }

/* mobile sticky bottom coupon bar (retired in favor of side tab) */
.bottom-coupon { display: none !important; }

/* related */
.related { border-top: 1.5px dashed var(--line-2); margin-top: 36px; padding-top: 26px; }
.related .rh { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.related .rh .logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); border: 1.5px solid var(--line); font-weight: 800; font-size: 11px; color: var(--ink-2); }
.related .rh h2 { font-size: 21px; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.related .rh .sub { font-size: 13px; color: var(--mut); }

/* ---------- mobile drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .25s; }
.drawer-overlay.show { opacity: 1; }
.drawer { position: absolute; inset-block: 0; inset-inline-end: 0; width: min(280px, 80vw); background: var(--bg);
  border-inline-start: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 6px;
  transform: translateX(100%); transition: transform .25s cubic-bezier(.2,.8,.3,1); }
html[dir="rtl"] .drawer { inset-inline-end: 0; transform: translateX(-100%); }
.drawer-overlay.show .drawer { transform: translateX(0); }
.drawer-close { align-self: flex-end; margin-bottom: 10px; }
.drawer nav { display: flex; flex-direction: column; gap: 4px; }
.drawer nav a { padding: 12px 14px; border-radius: 10px; font-size: 17px; font-weight: 600; color: var(--ink-2); }
.drawer nav a:hover, .drawer nav a.active { background: var(--surface); color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .store-grid { grid-template-columns: repeat(3, 1fr); }
  .coupon-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  .nav, .seg-lang-text { display: none; }
  .burger { display: grid; }
  .coupon-grid, .article-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .store-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 40px 0 20px; }
  .section { padding: 22px 0; }

  /* on phones: keep the collapsible side tab (smaller), drop the bottom bar */
  .side-coupon { top: auto; bottom: 90px; transform: none; }
  @keyframes sc-fade { from { opacity: 0; } to { opacity: 1; } }
  .sc-handle { width: 44px; padding: 13px 0; }
  .sc-panel { width: min(82vw, 284px); inset-inline-start: 52px; }
  .article-layout { padding-bottom: 40px; }
}
