/* ClickACart site: one shared stylesheet for the home page and the legal pages.
   RTL-first (logical properties only), rem-based so the browser text size setting scales everything,
   8px spacing grid, palette from the app (src/theme.ts). All text pairs are WCAG AA in both themes. */

:root {
  color-scheme: light dark;
  --ground: #F7F9FC;
  --surface: #FFFFFF;
  --mint: #E3EDFE;
  --ink: #111827;
  --muted: #5F6B76;
  --primary: #1467F5;
  --primary-strong: #0F55D0;
  --line: #E5E9EF;
  --line-strong: #C9CED6;
  --warn: #8A5A00;
  --warn-bg: #FFF3D9;
  --promo: #B42318;
  --promo-bg: #FBEAE8;
  --chip-bg: #F2F4F7;
  --focus: #1467F5;
  --select: #E3EDFE;
  --bezel: #111827;
  /* Logo: the app's colours (BrandLogo.tsx, assets/icon.png), lightened for the dark ground below. */
  --logo-primary: #45647B;
  --logo-accent: #B9674F;

  --s1: .5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2rem; --s5: 3rem; --s6: 4rem; --s7: 6rem;
  --radius: 14px;
  --measure: 70ch;
  --wrap: 72rem;
  --font: system-ui, -apple-system, "SF Hebrew", "Segoe UI", "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0F1420;
    --surface: #161D2B;
    --mint: #1C2A44;
    --ink: #E6EAF2;
    --muted: #A9B3C2;
    --primary: #8AB4FF;
    --primary-strong: #B5CEFF;
    --line: #2A3446;
    --line-strong: #3E4A5E;
    --warn: #F2C46D;
    --warn-bg: #33290F;
    --promo: #F0A39A;
    --promo-bg: #3A1F1A;
    --chip-bg: #222C3D;
    --focus: #8AB4FF;
    --select: #23365A;
    --bezel: #2A3446;
    --logo-primary: #9DB8CC;
    --logo-accent: #E39A78;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--s3); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;            /* 18px at the default browser size, scales with it */
  line-height: 1.7;
  overflow-wrap: break-word;
}
::selection { background: var(--select); color: var(--ink); }
img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--primary-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; inset-inline-start: var(--s2); top: -10rem; z-index: 10;
  background: var(--surface); color: var(--ink); padding: var(--s1) var(--s2);
  border: 2px solid var(--focus); border-radius: 8px; font-weight: 600;
}
.skip:focus { top: var(--s2); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: max(16px, 4vw); }
@media (min-width: 90rem) { .wrap { padding-inline: var(--s5); } }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s1) var(--s3); padding-block: var(--s2); }
.brand { display: inline-flex; align-items: center; min-height: 44px; color: inherit; }
.brand svg { width: auto; height: 1.75rem; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0 var(--s3); margin: 0; padding: 0; list-style: none; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--ink); text-decoration: none; font-size: 1rem; font-weight: 500;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--primary); border-bottom-color: currentColor; }
.site-nav a[aria-current="page"] { color: var(--primary); border-bottom-color: currentColor; }

/* Logo colours (inline SVG) */
.lg-primary { fill: var(--logo-primary); }
.lg-accent { fill: var(--logo-accent); }
.lg-primary-s { stroke: var(--logo-primary); }
.lg-accent-s { stroke: var(--logo-accent); }
.lg-click { stroke: var(--logo-accent); }

/* Type scale: 1.125 body, 1.25 / 1.5 / 1.875 / up to 3.25 display */
h1, h2, h3 { line-height: 1.25; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); font-weight: 800; margin: 0 0 var(--s3); }
h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem); font-weight: 750; margin: 0 0 var(--s2); }
h3 { font-size: 1.25rem; font-weight: 700; margin: 0 0 var(--s1); }
p { margin: 0 0 var(--s2); }
.lead { font-size: 1.25rem; line-height: 1.65; color: var(--ink); max-width: 36em; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.small { font-size: 1rem; }

/* Sections */
.section { padding-block: var(--s6); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: 40rem; margin-bottom: var(--s4); }
.section-head p { color: var(--muted); }

/* Hero */
.hero { padding-block: var(--s5) var(--s6); }
.hero-grid { display: grid; gap: var(--s5); align-items: start; }
@media (min-width: 60rem) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "copy phone" "shelf phone"; gap: var(--s4) var(--s6); }
  .hero-copy { grid-area: copy; }
  .hero-grid .shelf { grid-area: shelf; margin-top: 0; }
  .hero-phone { grid-area: phone; }
}
.availability { display: inline-flex; flex-wrap: wrap; gap: .25em .6em; align-items: baseline; margin-top: var(--s1); padding: var(--s1) var(--s2); background: var(--mint); border-radius: 10px; font-size: 1rem; }
.availability strong { font-weight: 700; }

/* Shelf label: the exact-match rule, with a real EAN-13 drawn from its digits */
.shelf {
  max-width: 34rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 3px 10px rgb(20 53 42 / .07);
  overflow: hidden;
}
.shelf-top { padding: var(--s2) var(--s3) var(--s1); }
.shelf-title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--muted); }
.shelf-product { margin: .25rem 0 0; font-size: 1.25rem; font-weight: 700; line-height: 1.4; }
.shelf-keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); }
@media (min-width: 30rem) { .shelf-keys { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.shelf-keys div { padding: var(--s1) var(--s3) var(--s1) var(--s2); border-inline-start: 1px solid var(--line); border-top: 1px solid var(--line); margin-top: -1px; }
.shelf-keys div:nth-child(2n+1) { border-inline-start: 0; }
@media (min-width: 30rem) { .shelf-keys div:nth-child(2n+1) { border-inline-start: 1px solid var(--line); } .shelf-keys div:first-child { border-inline-start: 0; } }
.shelf-keys dt { font-size: .9375rem; color: var(--muted); }
.shelf-keys dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.shelf-code { display: flex; align-items: center; gap: var(--s2); padding: var(--s1) var(--s3) var(--s2); border-top: 1px solid var(--line); }
.shelf-code svg { height: 2.75rem; width: auto; flex: none; }
.shelf-code .bars { fill: var(--ink); }
.shelf-code span { font-variant-numeric: tabular-nums; letter-spacing: .06em; direction: ltr; unicode-bidi: isolate; font-size: 1rem; }
.shelf-note { margin: 0; padding: var(--s2) var(--s3); border-top: 1px solid var(--line); background: var(--mint); font-size: 1rem; }

/* Phone frame around the app screenshots (iPhone 6.9" screen, 1320x2868) */
.phone { margin: 0; width: min(18.5rem, 78vw); margin-inline: auto; }
.phone-body {
  position: relative; padding: 10px; border-radius: 2.4rem; background: var(--bezel);
  box-shadow: 0 18px 40px -18px rgb(20 53 42 / .45);
}
.phone-body img { display: block; width: 100%; height: auto; border-radius: 1.75rem; background: #FAF6EF; }
.phone figcaption { margin-top: var(--s2); font-size: 1rem; color: var(--muted); text-align: center; max-width: 24em; margin-inline: auto; }
.phones { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s4); }
.phones .phone { margin-inline: 0; }

/* How it works: a real 3-step sequence, so the numbers carry meaning */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: var(--s4); max-width: 38rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: 0 var(--s2); }
.steps li::before {
  content: counter(step); grid-row: span 2;
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 2px solid var(--primary); color: var(--primary); font-weight: 800; font-size: 1.25rem;
}
.steps h3 { margin: .35rem 0 .25rem; }
.steps p { margin: 0; color: var(--muted); }
.how-grid { display: grid; gap: var(--s5); align-items: center; }
@media (min-width: 60rem) { .how-grid { grid-template-columns: minmax(0, 1fr) auto; gap: var(--s6); } }

/* Price labels: a ledger. Each row pairs a sample price row (as the label looks in the app) with what it means. */
.ruled::before { content: ""; display: block; width: 36px; height: 3px; margin-bottom: var(--s2); background: var(--primary); border-radius: 2px; }
.ledger { list-style: none; margin: 0; padding: 0; border-bottom: .5px solid var(--line-strong); max-width: 60rem; }
.ledger > li {
  display: grid; grid-template-columns: minmax(0, 19rem) minmax(0, 1fr); gap: var(--s2) var(--s5); align-items: start;
  padding-block: var(--s3); border-top: .5px solid var(--line-strong);
}
.ledger h3 { margin: 0 0 .25rem; font-size: 1.125rem; }
.ledger p { margin: 0; color: var(--muted); }
@media (max-width: 600px) { .ledger > li { grid-template-columns: minmax(0, 1fr); } }
.sample {
  display: flex; align-items: center; gap: var(--s1); padding: .6rem .85rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 1rem;
}
.sample-chain { font-weight: 600; color: var(--ink); }
.sample-price { margin-inline-start: auto; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.sample-old, .sample-none { color: var(--muted); }
.sample-old { font-weight: 600; }
.tag { display: inline-block; padding: .125rem .625rem; border-radius: 999px; font-size: .75rem; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-promo { background: var(--promo-bg); color: var(--promo); }
.tag-old { background: var(--chip-bg); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tag-ok { background: var(--mint); color: var(--primary); }
.ledger-note { margin: var(--s2) 0 0; font-size: .875rem; color: var(--muted); }

/* Chains strip */
.chains { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: 0 0 var(--s3); padding: 0; list-style: none; }
.chains li { display: flex; align-items: center; gap: var(--s1); font-weight: 600; }
.chain-mark {
  width: 48px; height: 48px; flex: none; border-radius: 11px; display: grid; place-items: center;
  background: #FFFFFF; border: 1px solid #E5E9EF; overflow: hidden;
}
.chain-mark img { width: 44px; height: 44px; object-fit: contain; }
.chain-letter { border: 0; border-radius: 50%; color: #FFFFFF; font-weight: 800; font-size: 1.25rem; }
.fineprint { font-size: 1rem; color: var(--muted); max-width: var(--measure); }

/* Contact */
.contact p { font-size: 1.25rem; }
.contact a { font-weight: 600; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: var(--s4) var(--s5); color: var(--muted); }
.site-footer .wrap { display: grid; gap: var(--s2); }
.site-footer .brand svg { height: 1.4rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0 var(--s3); margin: 0; padding: 0; list-style: none; }
.site-footer li a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer p { margin: 0; }

/* Legal pages: a calm reading column */
.legal { max-width: var(--measure); margin-inline: auto; padding-block: var(--s5) var(--s6); }
.legal h1 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.375rem); }
.legal h2 { font-size: 1.375rem; margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); scroll-margin-top: var(--s2); }
.legal h3 { margin-top: var(--s4); }
.legal ul { margin: 0 0 var(--s2); padding-inline-start: 1.4rem; }
.legal li { margin-bottom: var(--s1); }
.legal li::marker { color: var(--muted); }
.legal a { overflow-wrap: anywhere; }
.toc { margin: 0 0 var(--s4); padding: var(--s2) var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toc h2 { all: unset; display: block; font-weight: 700; font-size: 1rem; color: var(--muted); margin-bottom: .25rem; }
.toc ol { margin: 0; padding: 0; list-style: none; columns: 2 16rem; column-gap: var(--s4); }
.toc li { margin: 0; break-inside: avoid; }
.toc a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.table-wrap { margin: 0 0 var(--s3); }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 1rem; }
th, td { text-align: start; vertical-align: top; padding: .65rem .8rem; border: 1px solid var(--line); }
th { background: var(--mint); font-weight: 700; }
@media (max-width: 40rem) {
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table, tbody, tr, td { display: block; width: 100%; }
  table { background: none; }
  tr { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: .75rem; padding: .25rem 0; }
  td { border: 0; padding: .35rem 1rem; }
  td::before { content: attr(data-label); display: block; font-size: .9375rem; font-weight: 600; color: var(--muted); }
  td:first-child { font-weight: 700; }
  td:first-child::before { display: none; }
}

/* FAQ: native <details> (no JS), one question per row */
.faq > p { color: var(--muted); }
.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-of-type { border-bottom: 1px solid var(--line); }
.faq-item summary {
  display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding-block: var(--s2);
  cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; margin-inline-start: auto; flex: none; width: 1.75rem; height: 1.75rem; display: grid; place-items: center;
  border: 1.5px solid var(--primary); border-radius: 50%; color: var(--primary); font-weight: 700; line-height: 1;
}
.faq-item[open] summary::after { content: "−"; }
.legal .faq-item h2 { margin: 0; padding: 0; border: 0; font-size: 1.1875rem; font-weight: 700; }
.faq-item summary:hover h2 { color: var(--primary); }
.faq-answer { padding-block: 0 var(--s2); }
.faq-answer p:last-child, .faq-answer ul:last-child { margin-bottom: 0; }
.contact .contact-faq { font-size: 1.125rem; }

/* 404 */
.notfound { padding-block: var(--s7); max-width: var(--measure); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  a, .site-nav a { transition: color .15s ease-out, border-color .15s ease-out, text-decoration-thickness .15s ease-out; }
}

@media print {
  :root { --ground: #fff; --surface: #fff; --ink: #000; --muted: #333; --primary: #000; --line: #999; --mint: #fff; }
  body { font-size: 11pt; line-height: 1.5; background: #fff; color: #000; }
  .skip, .site-nav, .toc, .site-footer ul { display: none; }
  .faq-item summary::after { display: none; }
  .site-header { border: 0; }
  .legal { max-width: none; padding: 0; }
  .legal h2 { break-after: avoid; border-top: 0; margin-top: 1.25rem; padding-top: 0; }
  tr, li { break-inside: avoid; }
  a { color: #000; }
  .phone, .chains { break-inside: avoid; }
}
