/* The store pages' one stylesheet (online store 2b, decisions G8, G9, G12).
   Hand-written, no framework, system fonts only (no outside font: the CSP
   allows none). Logical properties throughout (inline-start/end, margin-
   inline), so the same rules read right in Arabic and Hebrew (rtl) and in
   English (ltr). The merchant's colour arrives as --accent / --on-accent
   from /brand.css and is only ever a fill (decision G12). */
:root {
  --accent: #2563eb;
  --on-accent: #ffffff;
  /* Lines, never fills: the accent when it shows at 3:1 on white, else
     dark ink (render.ring_of, from /brand.css; fix round, UI F4). */
  --ring: #2563eb;
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --surface: #f8fafc;
  --card: #ffffff;
  --danger: #b91c1c;
  --warning: #92400e;
  /* "Number confirmed" (ui R10): never the accent, which may be red. */
  --success: #047857;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", "Noto Sans Hebrew", Arial, sans-serif;
  color: var(--text);
  background: var(--surface);
  line-height: 1.5;
}
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
bdi.price-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; inset-inline-start: 0.5rem; top: -3rem; background: var(--card); padding: 0.5rem 1rem; border-radius: 0.5rem; z-index: 50; }
.skip:focus { top: 0.5rem; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.wrap { max-width: 64rem; margin-inline: auto; padding-inline: 1rem; }

/* header */
.bar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.96); border-block-end: 1px solid var(--line); }
.bar .wrap { display: flex; align-items: center; gap: 0.75rem; min-height: 3.5rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; min-width: 0; flex: 1; text-decoration: none; font-weight: 700; font-size: 0.95rem; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand img { width: 2rem; height: 2rem; border-radius: 0.5rem; object-fit: cover; }
.icon-link { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 0.5rem; }
.icon-link svg { width: 1.4rem; height: 1.4rem; }
.badge { position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
[hidden] { display: none !important; }

/* home and lists */
.cover { width: 100%; aspect-ratio: 5 / 2; max-height: 12rem; object-fit: cover; }
.brandblock { display: flex; align-items: flex-end; gap: 0.75rem; padding-block: 1rem 0.5rem; }
.brandblock img { width: 4rem; height: 4rem; border-radius: 1rem; object-fit: cover; background: var(--card); border: 4px solid var(--card); }
h1 { font-size: 1.4rem; line-height: 1.3; margin: 0.5rem 0; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }
.about { color: var(--muted); margin: 0 0 0.75rem; white-space: pre-line; }
.searchform { display: flex; gap: 0.5rem; margin-block: 0.75rem; }
.searchform input { flex: 1; min-height: 44px; padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: 0.5rem; font: inherit; background: var(--card); }
.button, .searchform button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0.5rem 1rem; border-radius: 0.5rem; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); width: 100%; min-height: 52px; font-size: 1rem; }
/* A busy or spent button reads as such (ui S2). */
.button[disabled] { opacity: 0.6; cursor: progress; }
.chips { display: flex; gap: 0.5rem; overflow-x: auto; padding-block: 0.25rem; scrollbar-width: none; }
.chip { flex-shrink: 0; display: inline-flex; align-items: center; min-height: 40px; min-width: 44px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.chip[aria-current] { background: var(--accent); color: var(--on-accent); border-color: var(--ring); }
.filter { display: flex; align-items: center; gap: 0.5rem; overflow-x: auto; padding-block: 0.25rem; }
.filter .label { flex-shrink: 0; font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.filter .chip { border-radius: 0.5rem; }
.clear { font-size: 0.9rem; }
.grid { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 0.75rem; }
@media (min-width: 40rem) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { display: block; text-decoration: none; }
.tile .ph { position: relative; aspect-ratio: 4 / 5; border-radius: 0.75rem; overflow: hidden; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; }
.tile .ph > svg { width: 2rem; height: 2rem; color: var(--muted); opacity: 0.5; }
.tile .ph picture { position: absolute; inset: 0; }
/* No display:flex: that drops the disclosure triangle (UX N1); the 44px
   target comes from padding instead. */
details.filters > summary { min-height: 44px; padding-block: 0.7rem; font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.tile .ph img { width: 100%; height: 100%; object-fit: cover; }
.tile.sold .ph img { opacity: 0.7; }
.tile h3 { font-size: 0.9rem; font-weight: 400; margin: 0.5rem 0 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile .price { margin: 0.15rem 0 0; font-size: 0.9rem; font-weight: 600; }
.soldchip { position: absolute; top: 0.5rem; inset-inline-start: 0.5rem; border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.75rem; font-weight: 600; background: var(--text); color: #ffffff; }
.more { display: flex; margin-block: 1.25rem; }
.empty { border: 1px dashed var(--line); border-radius: 0.75rem; padding: 1.5rem; text-align: center; color: var(--muted); }

/* product */
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 0.9rem; }
.gallery { position: relative; }
.strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; border-radius: 0.75rem; background: var(--card); scrollbar-width: none; }
.strip figure { margin: 0; flex: 0 0 100%; scroll-snap-align: start; }
.strip img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.gallery .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.92); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.gallery .prev { inset-inline-start: 0.5rem; }
.gallery .next { inset-inline-end: 0.5rem; }
[dir="rtl"] .gallery .nav svg, [dir="rtl"] svg.flip { transform: scaleX(-1); }
.back svg { flex-shrink: 0; }
.counter { position: absolute; bottom: 0.5rem; inset-inline-end: 0.5rem; border-radius: 999px; padding: 0.1rem 0.6rem; background: rgba(15, 23, 42, 0.7); color: #ffffff; font-size: 0.75rem; }
/* A category's size table (store template P3): a <details> under the
   options; a wide table scrolls inside its own region, never the page. */
.sizeguide { margin-block: 0.5rem 1rem; }
.sizeguide summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.table-scroll { overflow-x: auto; }
.sizeguide table { border-collapse: collapse; min-width: 100%; font-size: 0.875rem; }
.sizeguide th, .sizeguide td { padding: 0.5rem 0.75rem; border-block-end: 1px solid var(--line); text-align: start; white-space: nowrap; }
.sizeguide tbody tr:nth-child(odd) { background: var(--surface); }
.was { color: var(--muted); font-size: 0.85em; font-weight: 600; text-decoration-thickness: 1.5px; margin-inline-start: 0.35rem; }
.was-row { margin: 0; }
.sale-chip { display: inline-block; border-radius: 999px; padding: 0.1rem 0.6rem; font-size: 0.75rem; font-weight: 700; background: var(--text); color: var(--card); }
.sale-ends { color: var(--muted); font-size: 0.875rem; margin: 0.25rem 0 0; }
.product-price { font-size: 1.25rem; font-weight: 700; margin: 0.25rem 0 0.75rem; }
.status { color: var(--muted); margin: 0 0 0.75rem; }
fieldset.option { border: 0; padding: 0; margin: 0 0 1rem; }
fieldset.option legend { font-size: 0.9rem; font-weight: 500; margin-block-end: 0.5rem; padding: 0; }
fieldset.option.missing legend { color: var(--danger); }
.values { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.value { min-height: 44px; min-width: 48px; padding: 0 0.75rem; border-radius: 0.5rem; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.value[aria-checked="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--ring); }
.value[aria-disabled="true"] {
  border-style: dashed; color: var(--muted); background-color: var(--surface);
  background-image: linear-gradient(to top right, transparent calc(50% - 0.5px), var(--line) 50%, transparent calc(50% + 0.5px));
}
.hint { font-size: 0.8rem; color: var(--muted); margin: 0.35rem 0 0; min-height: 1em; }
/* Phase 5b (ui UI2, UI5): a sold-out value the buyer may still choose, to wait
   for it. It keeps the sold-out look; chosen, a dashed ring and no accent fill,
   because a fill means "chosen and buyable". */
.value.waitable {
  border-style: dashed; color: var(--muted); background-color: var(--surface);
  background-image: linear-gradient(to top right, transparent calc(50% - 0.5px), var(--line) 50%, transparent calc(50% + 0.5px));
}
.value.waitable[aria-checked="true"] { border: 2px dashed var(--ring); color: var(--text); background-color: var(--card); }
.wait { display: grid; gap: 0.5rem; border: 1px solid var(--line); background: var(--card); border-radius: 0.75rem; padding: 0.75rem; margin-block: 0.5rem; }
.wait[hidden], .wait [hidden], [data-add][hidden] { display: none; }
.wait-line { margin: 0; font-weight: 600; }
.button.notify { width: 100%; min-height: 52px; border-color: var(--ring); display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; text-decoration: none; }
.wait-note { margin: 0; font-size: 0.8rem; color: var(--muted); }
fieldset.option.missing .hint { color: var(--danger); }
.add-status { color: var(--danger); font-size: 0.9rem; min-height: 1em; margin: 0.35rem 0; }
.incart { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; border: 1px solid var(--line); background: var(--surface); border-radius: 0.5rem; padding: 0.5rem 0.75rem; margin-block: 0.5rem; font-size: 0.9rem; }
.soldline { display: inline-block; border-radius: 999px; padding: 0.25rem 0.75rem; background: var(--text); color: #ffffff; font-weight: 600; }
.lines { list-style: none; padding: 0; margin: 0.75rem 0; color: var(--muted); font-size: 0.9rem; }
.lines li { margin-block: 0.25rem; }
.desc p, .legal p { margin: 0 0 0.75rem; white-space: pre-line; unicode-bidi: plaintext; }
dl.details { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 0; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; }
@media (min-width: 64rem) {
  .product { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
  .product .gallery { position: sticky; top: 5rem; }
}

/* cart */
.cart-lines { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 0.75rem; }
.cart-line { display: grid; grid-template-columns: 4rem 1fr auto; gap: 0.25rem 0.75rem; padding: 0.75rem; border-block-end: 1px solid var(--line); }
.cart-line:last-child { border-block-end: 0; }
.cart-line img, .cart-line .noimg { width: 4rem; height: 4rem; border-radius: 0.5rem; object-fit: cover; background: var(--line); grid-row: span 3; }
.cart-line .name { font-size: 0.9rem; font-weight: 500; }
.cart-line .total { font-weight: 600; text-align: end; }
.cart-line .sub { grid-column: 2 / 4; font-size: 0.8rem; color: var(--muted); }
.cart-line.off { opacity: 0.6; }
.cart-line .warn { grid-column: 2 / 4; font-size: 0.8rem; color: var(--warning); }
.stepper { grid-column: 2 / 3; display: inline-flex; align-items: center; gap: 0.25rem; }
.stepper button, .cart-line .trash { min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: var(--card); border-radius: 0.5rem; font: inherit; cursor: pointer; }
.stepper button[disabled] { opacity: 0.4; cursor: default; }
.stepper output { min-width: 2rem; text-align: center; }
.removed { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem; color: var(--muted); background: var(--surface); }
.summary { display: flex; justify-content: space-between; font-weight: 700; margin-block: 1rem 0.25rem; }
.summary small { font-weight: 400; color: var(--muted); }
.notice { border-radius: 0.5rem; background: #ecfeff; color: #155e75; padding: 0.5rem 0.75rem; font-size: 0.9rem; margin-block: 0.5rem; }
.info { display: flex; gap: 0.75rem; border: 1px solid var(--line); background: var(--card); border-radius: 0.75rem; padding: 1rem; margin-block: 1rem; }
.info h2 { margin: 0; font-size: 0.95rem; }
.info p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.9rem; }

/* checkout (Phase 3a, decision K9; ui R1-R10). One column, four steps;
   the button sits under the disclosures and is never sticky (ui R9). */
.co-summary { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between; color: var(--muted); }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 0.75rem; padding: 1rem; margin-block: 0.75rem; }
.step h2 { margin: 0 0 0.5rem; }
.step h3 { font-size: 0.95rem; margin: 1rem 0 0.35rem; }
.step-head { display: flex; align-items: center; gap: 0.5rem; font-size: 1rem; }
.step-n { inline-size: 1.5rem; block-size: 1.5rem; flex-shrink: 0; border-radius: 999px; display: inline-grid; place-items: center; font-size: 0.8rem; border: 1px solid var(--line); }
.step[data-state="locked"] .step-head { color: var(--muted); }
.field { display: grid; gap: 0.25rem; margin-block: 0.75rem; }
.field label { font-size: 0.9rem; font-weight: 500; }
.field input, .field select, .phone-row select { min-height: 44px; padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: 0.5rem; font: inherit; background: var(--card); color: var(--text); }
.field input.bad { border-color: var(--danger); }
/* A number in a right-to-left page sits under its label (ui R2). */
[dir="rtl"] .field input[dir="ltr"]:not(.code) { text-align: right; }
/* ...but beside its +972 prefix the number starts at the prefix (ui M4);
   as specific as the rule above, so it wins by order. */
[dir="rtl"] .field .phone-row input[dir="ltr"]:not(.code) { text-align: left; }
.phone-row { display: flex; gap: 0.5rem; }
.phone-row input { flex: 1; min-width: 0; }
.field input.code { font-size: 1.5rem; letter-spacing: 0.3em; text-align: center; max-width: 12rem; }
.error { color: var(--danger); font-size: 0.85rem; margin: 0.25rem 0 0; }
.error:empty { display: none; }
.state { display: inline-flex; gap: 0.35rem; align-items: center; border-radius: 999px; padding: 0.15rem 0.6rem; font-weight: 600; font-size: 0.85rem; }
.state.ok { color: var(--success); background: #ecfdf5; }
.state.wait { color: var(--warning); background: #fffbeb; }
.linkish { background: none; border: 0; padding: 0 0.25rem; min-height: 44px; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.choices { border: 0; padding: 0; margin: 0.5rem 0; display: grid; gap: 0.5rem; }
.choices legend { font-size: 0.9rem; font-weight: 500; padding: 0; margin-block-end: 0.5rem; }
@media (min-width: 22rem) { .choices { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); } }
.choice { display: flex; align-items: center; gap: 0.5rem; min-height: 56px; border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.75rem 1rem; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--ring); box-shadow: inset 0 0 0 1px var(--ring); }
.choice-sub { display: block; font-size: 0.9rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; margin-block: 0.5rem; }
.check input { width: 1.25rem; height: 1.25rem; }
.review-lines { list-style: none; padding: 0; margin: 0; }
.review-lines li { display: grid; gap: 0.15rem; padding-block: 0.5rem; border-block-end: 1px solid var(--line); }
.review-lines .sub { font-size: 0.8rem; color: var(--muted); }
.review-lines .warn { font-size: 0.8rem; color: var(--warning); }
.review-row { display: flex; justify-content: space-between; gap: 0.75rem; }
.totals { border-block-start: 1px solid var(--line); margin-block: 0.75rem; padding-block-start: 0.5rem; display: grid; gap: 0.25rem; }
.totals .grand { font-size: 1.1rem; font-weight: 700; }
.totals .sub { font-size: 0.8rem; color: var(--muted); margin: 0; }
.terms { white-space: pre-line; unicode-bidi: plaintext; font-size: 0.9rem; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
[data-co-days] .value, [data-co-windows] .value { flex-shrink: 0; }
[data-co-windows] { margin-block-start: 0.5rem; }

/* footer */
.foot { margin-block-start: 2rem; border-block-start: 1px solid var(--line); padding-block: 1.5rem; font-size: 0.8rem; color: var(--muted); }
.foot nav, .co-legal { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.foot nav a, .co-legal a, .powered a { display: inline-flex; align-items: center; min-height: 44px; }
.foot h2 { font-size: 0.85rem; margin: 1rem 0 0.25rem; color: var(--text); }
.foot dl { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.75rem; margin: 0; }
.foot dd { margin: 0; }
.langs { display: flex; gap: 0.5rem; margin-block: 1rem; }
.langs a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 0.75rem; border: 1px solid var(--line); border-radius: 0.5rem; text-decoration: none; }
.langs a[aria-current] { border-color: var(--ring); font-weight: 700; }
.powered { margin-block-start: 1rem; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
/* A nested category's breadcrumb (product management B, E10). */
.crumbs { font-size: 0.8125rem; padding-block: 0.75rem 0; color: var(--muted); }
.crumbs a { color: inherit; }
