/* ============================================================================
   ATELIER — BASE
   Reset, type primitives, layout, controls, header, panels, notifications,
   footer, motion. Consumes atelier-system.css and defines no raw values.

   `!important` appears twice: on `[hidden]`, which has to beat component
   `display` rules, and in the reduced-motion block, which has to beat
   everything including inline styles the runtime sets. Nowhere else.
   ========================================================================= */

/* ----------------------------------------------------------- 1. RESET --- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
  background: var(--ground);
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: clip;
  background: var(--ground);
  color: var(--ink-800);
  font-family: var(--font);
  font-size: var(--t-16);
  font-weight: 400;
  font-variation-settings: "wdth" var(--normal);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; background: var(--surface-sink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
/* Headings state their family rather than inheriting it. A merchant theme
   from an earlier design still ships an `h1, h2, h3, h4 { font-family: ... }`
   rule, and inheritance loses to it. The locked system does not negotiate
   over the typeface. */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  letter-spacing: var(--track-normal);
  text-transform: none;
}
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6 {
  font-family: var(--font-ar);
}
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--ink-900); color: var(--surface); }

/* One focus ring for the entire project. Never removed, only re-coloured for
   the dark rooms. */
/* One focus treatment everywhere: a 2px ink ring held 3px off the element,
   inheriting the element's own corner so it traces the shape instead of
   boxing it. Never the browser default. */
:focus-visible {
  outline: 2px solid var(--ink-900);
  outline-offset: 3px;
  border-radius: inherit;
}
.at-room :focus-visible, .at-on-room :focus-visible { outline-color: var(--on-room); }
:focus:not(:focus-visible) { outline: none; }

.at-sr, .m-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

.m-skip {
  position: fixed; inset-inline-start: var(--sp-4); top: -100px;
  z-index: var(--z-toast);
  padding: var(--sp-3) var(--sp-6);
  background: var(--ink-900); color: var(--surface);
  font-size: var(--t-11); font-weight: 500;
  letter-spacing: var(--track-label); text-transform: uppercase;
  transition: top var(--t-state) var(--ease);
}
.m-skip:focus { top: var(--sp-4); }

/* Every number that can change under the reader gets tabular figures. */
.at-num, .m-num, .at-price, .m-card-price, .line-total, .detail-price b,
.summary-row strong, .summary-total strong, .qty input, .at-count {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-variation-settings: "wdth" var(--narrow);
}

/* ------------------------------------------------------------ 2. TYPE --- */

.at-d1, .at-d2, .at-d3, .at-d4, .m-display-md, .m-display-xs {
  font-family: var(--font);
  font-weight: 600;
  font-variation-settings: "wdth" var(--wide);
  letter-spacing: var(--track-display);
  line-height: var(--leading-display);
  text-wrap: balance;
}
.at-d1 { font-size: var(--d-1); }
.at-d2, .m-display-md { font-size: var(--d-2); }
.at-d3 { font-size: var(--d-3); line-height: var(--leading-heading); }
.at-d4, .m-display-xs { font-size: var(--d-4); line-height: var(--leading-heading); letter-spacing: var(--track-tight); }

html[dir="rtl"] .at-d1, html[dir="rtl"] .at-d2, html[dir="rtl"] .at-d3,
html[dir="rtl"] .at-d4, html[dir="rtl"] .m-display-md, html[dir="rtl"] .m-display-xs {
  font-family: var(--font-ar-display);
  font-variation-settings: normal;
  font-weight: 600;
}

/* The one wide-tracked label style in the project. It is used for a handful
   of named things — the utility row, a panel title, a table head — never as
   an eyebrow above every section. */
.at-label, .m-label {
  display: block;
  font-size: var(--t-11);
  font-weight: 500;
  font-variation-settings: "wdth" var(--normal);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-600);
  line-height: 1.4;
}
html[dir="rtl"] .at-label, html[dir="rtl"] .m-label { text-transform: none; }

.at-lede, .m-lede {
  max-width: var(--measure);
  font-size: var(--t-20);
  line-height: var(--leading-body);
  color: var(--ink-600);
  text-wrap: pretty;
}
.at-body { max-width: var(--measure); color: var(--ink-600); text-wrap: pretty; }
.at-quiet, .m-quiet { color: var(--ink-600); }
.m-help { font-size: var(--t-13); color: var(--ink-600); line-height: 1.5; }
.m-req { color: var(--bad); }

.at-room .at-lede, .at-room .m-lede, .at-on-room .at-lede, .at-on-room .m-lede,
.at-room .at-body, .at-room .at-quiet, .at-on-room .at-quiet, .at-on-room .m-quiet,
.at-footer .at-lede, .at-footer .m-lede, .at-footer .at-quiet, .at-footer .m-quiet,
.craft .at-lede, .craft .m-lede, .craft .at-quiet, .craft .m-quiet,
.auth-aside .at-lede, .auth-aside .m-lede, .auth-aside .at-quiet, .auth-aside .m-quiet {
  color: var(--on-room-2);
  line-height: var(--leading-loose);
}

/* Labels and helper text follow the same rule on the same grounds. */
.at-room .at-label, .at-room .m-label, .at-on-room .at-label, .at-on-room .m-label,
.at-footer .at-label, .at-footer .m-label, .at-footer .m-help,
.craft .at-label, .craft .m-label,
.auth-aside .at-label, .auth-aside .m-label {
  color: var(--on-room-2);
}

/* The editorial link. A rule that retracts from the leading edge on hover,
   which is the same gesture the nav uses — one idea, two places. */
.at-link, .m-link {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  position: relative;
  min-height: 44px;
  font-size: var(--t-13);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-900);
}
html[dir="rtl"] .at-link, html[dir="rtl"] .m-link { text-transform: none; }
.at-link::after, .m-link::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 12px;
  height: 1px; background: currentColor;
  transform-origin: var(--edge-a, left);
  transition: transform var(--t-state) var(--ease);
}
.at-link:hover::after, .m-link:hover::after,
.at-link:focus-visible::after, .m-link:focus-visible::after {
  transform: scaleX(0); transform-origin: var(--edge-b, right);
}
html[dir="rtl"] .at-link::after, html[dir="rtl"] .m-link::after {
  --edge-a: right; --edge-b: left;
}
.at-room .at-link, .at-on-room .m-link { color: var(--on-room); }

/* ---------------------------------------------------------- 3. LAYOUT --- */

.at-shell, .m-shell {
  width: 100%; max-width: var(--shell);
  margin-inline: auto; padding-inline: var(--gutter);
}
.at-shell--wide { max-width: var(--shell-wide); }
.at-shell--narrow, .m-shell-narrow { max-width: var(--shell-narrow); }

.at-band, .m-band { padding-block: var(--band); }
.at-band-tight, .m-band-tight { padding-block: var(--band-tight); }
.at-bleed { width: 100vw; margin-inline: calc(50% - 50vw); }

.m-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.m-stack { display: grid; gap: var(--sp-4); }

.at-rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.at-room .at-rule { background: var(--line-room); }

.at-room, .m-on-lacquer, .at-on-room {
  background: var(--room); color: var(--on-room);
}
.at-on-room, .m-on-lacquer { background: transparent; }
.at-room { background: var(--room); }
.at-plate { background: var(--surface); }

/* ------------------------------------------- 4. THE SIGNATURE: THE FRAME ---
   A hairline rectangle offset behind an image, the way a print sits on a mat
   board. It is the one recurring visual device in the project: campaign
   images, the category portals, the story block and the account panel all
   use it, at different offsets, and nothing else does. */

.at-frame { position: relative; display: block; }
.at-frame > * { position: relative; z-index: 1; }
.at-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  transform: translate(var(--frame-x), var(--frame-y));
  pointer-events: none;
  z-index: 0;
}
.at-frame--flip { --frame-x: calc(var(--sp-5) * -1); }
.at-frame--tight { --frame-x: var(--sp-3); --frame-y: var(--sp-3); }
html[dir="rtl"] .at-frame::before { transform: translate(calc(var(--frame-x) * -1), var(--frame-y)); }
.at-room .at-frame::before, .at-on-room .at-frame::before { border-color: var(--line-room-strong); }
@media (max-width: 719px) { .at-frame { --frame-x: var(--sp-2); --frame-y: var(--sp-2); } }

/* The frame draws itself in when its section arrives. Scale on a transform,
   so no layout work. */
.reveal-on .at-frame::before {
  transform: translate(var(--frame-x), var(--frame-y)) scale(0.94);
  opacity: 0;
  transition: transform var(--t-image) var(--ease) 160ms,
              opacity var(--t-reveal) var(--ease) 160ms;
}
.reveal-on .at-frame.is-in::before,
.reveal-on .is-in .at-frame::before {
  transform: translate(var(--frame-x), var(--frame-y)) scale(1);
  opacity: 1;
}

/* Locked image ratios. Nothing in the project sets an ad-hoc aspect-ratio. */
.at-fig { overflow: hidden; background: var(--surface-sink); }
.at-fig > img { width: 100%; height: 100%; object-fit: cover; }
.at-fig--portrait { aspect-ratio: 4 / 5; }
.at-fig--tall     { aspect-ratio: 3 / 4; }
.at-fig--square   { aspect-ratio: 1 / 1; }
.at-fig--land     { aspect-ratio: 4 / 3; }
.at-fig--wide     { aspect-ratio: 16 / 9; }

/* ------------------------------------------------------------ 5. ICONS --- */

.m-i, .at-i {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.35;
  flex: none;
}
.m-i-sm { width: 16px; height: 16px; stroke-width: 1.5; }
.m-i-lg { width: 26px; height: 26px; stroke-width: 1.2; }
html[dir="rtl"] .m-i-arrow, html[dir="rtl"] .m-i-chevron-end { transform: scaleX(-1); }

/* --------------------------------------------------------- 6. CONTROLS ---
   One button. Four voices. The primary does not slide a fill across itself —
   that gesture belonged to the previous pass and read as a trick. It lifts
   its surface by one step and presses back down, which is what a physical
   control does. */

.m-btn, .at-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: var(--sp-3) var(--sp-7);
  border: 1px solid var(--btn-bg, var(--ink-900));
  border-radius: var(--btn-radius, var(--r-sm));
  background: var(--btn-bg, var(--ink-900));
  color: var(--btn-text, var(--surface));
  font-size: var(--t-11);
  font-weight: 600;
  font-variation-settings: "wdth" var(--normal);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  position: relative;
  box-shadow: var(--lift-1);
  transition: background var(--t-hover) var(--ease),
              border-color var(--t-hover) var(--ease),
              color var(--t-hover) var(--ease),
              box-shadow var(--t-hover) var(--ease),
              transform var(--t-press) var(--ease-soft),
              opacity var(--t-hover) linear;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
html[dir="rtl"] .m-btn, html[dir="rtl"] .at-btn { text-transform: none; }

/* Hover lifts one elevation step. Press compresses the whole control with
   a scale rather than nudging it down, so the shadow tucks in with it and
   the button reads as giving under a finger. */
.m-btn:hover { background: var(--btn-bg-hover, var(--ink-700)); border-color: var(--btn-bg-hover, var(--ink-700)); box-shadow: var(--lift-2); }
.m-btn:active { transform: scale(0.98); background: var(--btn-bg, var(--ink-900)); box-shadow: var(--lift-1); }
.m-btn[disabled], .m-btn[aria-disabled="true"] { opacity: 0.36; pointer-events: none; }

/* Secondary: a rule and a label. It inks in on hover rather than filling. */
.m-btn-ghost {
  background: var(--surface); color: var(--ink-900);
  border-color: var(--line); box-shadow: none;
}
.m-btn-ghost:hover { background: var(--surface); border-color: var(--ink-900); box-shadow: var(--lift-1); }
.m-btn-ghost:active { transform: scale(0.98); box-shadow: none; }

/* Inside a dark room the two voices swap grounds. */
.at-room .m-btn, .at-on-room .m-btn, .m-on-lacquer .m-btn {
  background: var(--on-room); color: var(--ink-900); border-color: var(--on-room);
}
.at-room .m-btn:hover, .at-on-room .m-btn:hover, .m-on-lacquer .m-btn:hover {
  background: #fff; border-color: #fff;
}
.at-room .m-btn-ghost, .at-on-room .m-btn-ghost, .m-on-lacquer .m-btn-ghost {
  background: transparent; color: var(--on-room); border-color: var(--line-room-strong);
}
.at-room .m-btn-ghost:hover, .at-on-room .m-btn-ghost:hover, .m-on-lacquer .m-btn-ghost:hover {
  border-color: var(--on-room); background: rgba(244, 244, 244, 0.06);
}

.m-btn-sm { min-height: 38px; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-xs); }
.m-btn-lg { min-height: 56px; padding: var(--sp-4) var(--sp-8); }
.m-btn-wide { width: 100%; }

/* The loading state is part of the button, not a swap. The label stays in
   place and a hairline sweeps beneath it, so the control never resizes. */
.m-btn[data-busy="true"] { pointer-events: none; }
.m-btn[data-busy="true"]::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px;
  background: currentColor; opacity: 0.5;
  transform-origin: left;
  animation: at-sweep 900ms var(--ease-io) infinite;
}
@keyframes at-sweep {
  0% { transform: scaleX(0); transform-origin: left; }
  50% { transform: scaleX(1); transform-origin: left; }
  51% { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

.m-btn-wa { background: var(--wa); border-color: var(--wa); color: var(--on-wa); }
.m-btn-wa:hover { background: var(--wa-press); border-color: var(--wa-press); color: var(--on-wa); }

.m-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  width: 42px; height: 42px;
  color: inherit;
  border-radius: var(--r-full);
  transition: background var(--t-hover) var(--ease),
              opacity var(--t-hover) var(--ease),
              transform var(--t-press) var(--ease-soft);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.m-iconbtn:hover { background: rgba(8, 8, 8, 0.05); }
.m-iconbtn:active { transform: scale(0.94); }
.at-header[data-invert="true"]:not([data-stuck="true"]) .m-iconbtn:hover { background: rgba(255, 255, 255, 0.12); }
.m-iconbtn[disabled] { opacity: 0.3; pointer-events: none; }

/* The bag counter. It ticks over rather than swapping, which is the one
   moment in the chrome that acknowledges a purchase. */
.m-count, .at-count {
  position: absolute; top: 5px; inset-inline-end: 3px;
  min-width: 16px; height: 16px; padding-inline: 4px;
  display: grid; place-items: center;
  background: var(--ink-900); color: var(--surface);
  border-radius: var(--r-full);
  font-size: 10px; font-weight: 600; line-height: 1;
}
.at-header[data-invert="true"]:not([data-stuck="true"]) .m-count {
  background: var(--on-room); color: var(--ink-900);
}
.m-count[data-bump="true"] { animation: at-bump 460ms var(--ease); }
@keyframes at-bump {
  0% { transform: scale(1); }
  30% { transform: scale(1.34); }
  100% { transform: scale(1); }
}

/* --- Fields ------------------------------------------------------------- */

.m-field { display: grid; gap: var(--sp-2); min-width: 0; }
.m-field > label, .m-field-label {
  font-size: var(--t-11); font-weight: 500;
  letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--ink-600);
}
html[dir="rtl"] .m-field > label, html[dir="rtl"] .m-field-label { text-transform: none; }

.m-input, .m-select, .m-textarea {
  width: 100%;
  min-height: 50px;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-900);
  font-size: var(--t-16);   /* 16px — below this iOS zooms the viewport */
  line-height: 1.5;
  transition: border-color var(--t-hover) var(--ease),
              box-shadow var(--t-hover) var(--ease);
  appearance: none;
}
.m-textarea { min-height: 108px; resize: vertical; }
.m-input::placeholder, .m-textarea::placeholder { color: var(--ink-600); opacity: 1; }
.m-input:hover, .m-select:hover, .m-textarea:hover { border-color: var(--line-strong); }
/* A soft ink halo rather than an inner stroke: it reads at a glance and
   does not shift the text inside the field. */
.m-input:focus, .m-select:focus, .m-textarea:focus {
  border-color: var(--ink-900);
  box-shadow: 0 0 0 3px rgba(8, 8, 8, 0.08);
}
/* The ring is never suppressed. A border change is a state, not a focus
   indicator, and a keyboard visitor needs both. */
.m-input:focus-visible, .m-select:focus-visible, .m-textarea:focus-visible {
  outline: 2px solid var(--ink-900); outline-offset: 2px;
}
.m-input[aria-invalid="true"], .m-select[aria-invalid="true"], .m-textarea[aria-invalid="true"] {
  border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-wash);
}
/* A field that just failed nudges once. No shaking the page. */
.m-input[data-nudge="true"], .m-select[data-nudge="true"], .m-textarea[data-nudge="true"] {
  animation: at-nudge 320ms var(--ease-io);
}
@keyframes at-nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.m-select {
  padding-inline-end: var(--sp-9);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right calc(var(--sp-4) + 4px) center, right var(--sp-4) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
html[dir="rtl"] .m-select {
  background-position: left var(--sp-4) center, left calc(var(--sp-4) + 4px) center;
  background-image: linear-gradient(135deg, transparent 50%, currentColor 50%),
                    linear-gradient(45deg, currentColor 50%, transparent 50%);
}

.m-error {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--t-13); color: var(--bad);
}

.m-checkline {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 44px; font-size: var(--t-15); color: var(--ink-800);
  cursor: pointer;
}
.m-checkline input[type="checkbox"], .m-checkline input[type="radio"] {
  appearance: none;
  width: 18px; height: 18px; flex: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  background: var(--surface);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background var(--t-press) linear, border-color var(--t-press) linear;
}
.m-checkline input[type="radio"] { border-radius: var(--r-full); }
.m-checkline input:checked { background: var(--ink-900); border-color: var(--ink-900); }
.m-checkline input[type="checkbox"]:checked::after {
  content: ""; width: 9px; height: 5px;
  border-inline-start: 1.5px solid var(--surface);
  border-bottom: 1.5px solid var(--surface);
  transform: rotate(-45deg) translate(1px, -1px);
}
.m-checkline input[type="radio"]:checked::after {
  content: ""; width: 6px; height: 6px; background: var(--surface); border-radius: var(--r-full);
}

.pw-wrap { position: relative; display: block; }
.pw-wrap .m-input { padding-inline-end: 52px; }
.pw-toggle {
  position: absolute; inset-inline-end: 2px; top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--ink-600);
  transition: color var(--t-hover) var(--ease);
}
.pw-toggle:hover { color: var(--ink-900); }

.qty {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}
.qty button {
  width: 42px; min-height: 44px;
  display: grid; place-items: center;
  color: var(--ink-900);
  transition: background var(--t-press) linear;
}
.qty button:hover:not([disabled]) { background: var(--surface-sink); }
.qty button[disabled] { opacity: 0.28; cursor: not-allowed; }
.qty input {
  width: 42px; border: 0; background: transparent; text-align: center;
  font-size: var(--t-15); font-weight: 500;
  border-inline: 1px solid var(--line-faint);
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}

.m-pills { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.m-pill {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 36px; padding: 0 var(--sp-4);
  border: 1px solid var(--line); border-radius: var(--r-full);
  background: var(--surface);
  font-size: var(--t-11); font-weight: 500;
  letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--ink-800);
  transition: background var(--t-hover) var(--ease),
              border-color var(--t-hover) var(--ease),
              color var(--t-hover) var(--ease);
}
html[dir="rtl"] .m-pill { text-transform: none; }
.m-pill span:last-child { color: var(--ink-600); font-variant-numeric: tabular-nums; }
.m-pill:hover { border-color: var(--ink-900); }
.m-pill.is-on, .m-pill[aria-pressed="true"] {
  background: var(--ink-900); border-color: var(--ink-900); color: var(--surface);
}
.m-pill.is-on span:last-child, .m-pill[aria-pressed="true"] span:last-child {
  color: rgba(244, 244, 244, 0.62);
}

.m-notice {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: var(--t-15); line-height: 1.55;
}
.m-notice .m-i { margin-top: 2px; color: var(--ink-600); }
.m-notice-critical { border-color: var(--bad); background: var(--bad-wash); }
.m-notice-critical .m-i { color: var(--bad); }
.m-notice-positive { border-color: var(--ok); background: var(--ok-wash); }
.m-notice-positive .m-i { color: var(--ok); }

.m-empty {
  display: grid; justify-items: center; gap: var(--sp-4);
  padding: var(--sp-11) var(--sp-5);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.m-empty > .m-i { width: 28px; height: 28px; color: var(--ink-500); stroke-width: 1; }
.m-empty p { max-width: 44ch; color: var(--ink-600); }
.m-empty .m-btn { margin-top: var(--sp-2); }

/* ------------------------------------------------------ 7. UTILITY ROW --- */

.at-utility {
  background: var(--room);
  color: var(--on-room-2);
  font-size: var(--t-11);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}
html[dir="rtl"] .at-utility { text-transform: none; letter-spacing: 0; }
.at-utility__inner {
  display: flex; align-items: center; justify-content: center;
  gap: var(--sp-4);
  min-height: 34px;
}
.at-utility b { color: var(--on-room); font-weight: 500; }
.at-utility i { font-style: normal; color: var(--signal-lift); }
@media (max-width: 767px) { .at-utility__aside { display: none; } }

/* --------------------------------------------------------- 8. HEADER ---
   Thin. 64px, and it does not grow. Over a dark hero it starts transparent
   and inverted; once the page leaves the hero it takes a solid ground rather
   than a blur, because a blurred bar over moving photography reads as a
   smear. */

.at-header {
  position: sticky; top: 0;
  z-index: var(--z-header);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--t-state) var(--ease),
              border-color var(--t-state) var(--ease),
              color var(--t-state) var(--ease);
}
.at-header[data-invert="true"] { color: var(--on-room); }
/* Stuck, the bar becomes a floating surface: it insets from the page edge,
   takes the control radius and a soft shadow, and sits on translucent white
   with a restrained blur. It is a bar that lifted off the page, not a capsule
   pill floating in space. */
.at-header[data-stuck="true"] {
  color: var(--ink-900);
  padding-block: var(--sp-2);
}
.at-header[data-stuck="true"] .at-header__bar {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line-faint);
  border-radius: var(--r-md);
  box-shadow: var(--lift-2);
  padding-inline: var(--sp-5);
  min-height: 58px;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .at-header[data-stuck="true"] .at-header__bar {
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
  }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .at-header[data-stuck="true"] .at-header__bar { background: var(--surface); }
}
@media (prefers-reduced-transparency: reduce) {
  .at-header[data-stuck="true"] .at-header__bar {
    background: var(--surface); backdrop-filter: none;
  }
}

.at-header[data-solid="true"]:not([data-stuck="true"]) { color: var(--ink-900); }

.at-header__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-4);
  min-height: var(--header-h);
  padding-inline: 0;
  transition: background var(--t-state) var(--ease),
              box-shadow var(--t-state) var(--ease),
              border-color var(--t-state) var(--ease),
              padding var(--t-state) var(--ease),
              min-height var(--t-state) var(--ease);
  border: 1px solid transparent;
  border-radius: var(--r-md);
}
.at-header__start { display: flex; align-items: center; gap: var(--sp-1); min-width: 0; }
.at-header__end {
  display: flex; align-items: center; justify-content: flex-end;
  gap: var(--sp-1); min-width: 0;
}

/* The wordmark. Small, tracked, and it never becomes decoration — the house
   name is a signature, not a section. */
.at-wordmark {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding-inline: var(--sp-3);
  font-size: var(--t-15);
  font-weight: 600;
  font-variation-settings: "wdth" var(--wide);
  letter-spacing: 0.2em;
  text-indent: 0.2em;         /* re-centres the block the tracking pushes */
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  color: inherit;
}
html[dir="rtl"] .at-wordmark { letter-spacing: 0.05em; text-indent: 0.05em; }
.at-wordmark--footer { justify-content: flex-start; padding-inline: 0; font-size: var(--t-13); }

.at-nav { display: none; align-items: center; gap: clamp(var(--sp-4), 1.5vw, var(--sp-7)); }
@media (min-width: 1000px) { .at-nav { display: flex; } }
.at-nav__item { position: relative; }

.at-nav__link {
  display: inline-flex; align-items: center; gap: 6px;
  position: relative;
  min-height: 44px;
  font-size: var(--t-11);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: inherit;
  white-space: nowrap;
}
html[dir="rtl"] .at-nav__link { text-transform: none; letter-spacing: 0; font-size: var(--t-13); }
.at-nav__link::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 14px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: var(--edge-a, left);
  transition: transform var(--t-state) var(--ease);
}
.at-nav__link:hover::after, .at-nav__link:focus-visible::after,
.at-nav__item[data-open="true"] .at-nav__link::after,
.at-nav__link[aria-current="page"]::after { transform: scaleX(1); }
html[dir="rtl"] .at-nav__link::after { --edge-a: right; }
.at-nav__link[data-signal="true"]::before {
  content: ""; width: 4px; height: 4px; flex: none;
  background: var(--signal); border-radius: var(--r-full);
}
.at-header[data-invert="true"]:not([data-stuck="true"]) .at-nav__link[data-signal="true"]::before {
  background: var(--signal-lift);
}

/* --- The menu ----------------------------------------------------------- */

.at-menu {
  position: absolute; inset-inline: var(--gutter); top: calc(100% + var(--sp-2));
  z-index: var(--z-menu);
  background: var(--surface);
  border: 1px solid var(--line-faint);
  border-radius: var(--r-lg);
  color: var(--ink-900);
  box-shadow: var(--lift-3);
  overflow: hidden;
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--t-hover) var(--ease),
              transform var(--t-state) var(--ease),
              visibility 0s linear var(--t-state);
}
.at-menu[data-open="true"] {
  opacity: 1; visibility: visible; transform: translateY(0); transition-delay: 0s;
}
@media (max-width: 999px) { .at-menu { display: none; } }

.at-menu__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--sp-7);
  padding: var(--sp-8);
  max-width: none;
}
.at-menu__col { display: grid; gap: var(--sp-1); align-content: start; }
.at-menu__col h3 {
  font-size: var(--t-11); font-weight: 500;
  letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--ink-600);
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-2);
  border-bottom: 1px solid var(--line);
}
html[dir="rtl"] .at-menu__col h3 { text-transform: none; letter-spacing: 0; }
.at-menu__col a {
  display: flex; align-items: center;
  min-height: 36px;
  font-size: var(--t-15);
  color: var(--ink-800);
  transition: color var(--t-press) linear, transform var(--t-hover) var(--ease);
}
.at-menu__col a:hover, .at-menu__col a:focus-visible {
  color: var(--ink-900); transform: translateX(var(--nudge, 4px));
}
html[dir="rtl"] .at-menu__col a:hover { --nudge: -4px; }

.at-menu__feature { display: grid; gap: var(--sp-3); }
.at-menu__feature .at-fig { border-radius: var(--r-md); }
.at-menu__feature .at-fig > img { transition: transform var(--t-image) var(--ease-soft); }
.at-menu__feature:hover .at-fig > img { transform: scale(1.04); }
.at-menu__feature b { font-size: var(--t-15); font-weight: 600; }
.at-menu__feature span { font-size: var(--t-12); color: var(--ink-600); }

/* --------------------------------------------------------- 9. SEARCH --- */

.at-search {
  position: fixed; inset: 0;
  z-index: var(--z-overlay);
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr;
  background: var(--ground);
  opacity: 0; visibility: hidden;
  transition: opacity var(--t-state) var(--ease),
              visibility 0s linear var(--t-state);
}
.at-search[data-open="true"] { opacity: 1; visibility: visible; transition-delay: 0s; }

.at-search__bar { min-width: 0; padding-block: var(--sp-4); border-bottom: 1px solid var(--line-faint); }
.at-search__form {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 64px;
  padding-inline: var(--sp-4);
  border: 0;
  border-radius: var(--r-md);
  background: var(--surface);
}
.at-search__form:focus-within {
  outline: none;
}
.at-search__form > .m-i { color: var(--ink-600); flex: none; }
.at-search__input {
  flex: 1 1 0; min-width: 0;
  border: 0; background: transparent;
  font-size: var(--d-3);
  font-weight: 600;
  font-variation-settings: "wdth" var(--wide);
  letter-spacing: var(--track-tight);
  line-height: 1.2;
  color: var(--ink-900);
  padding: var(--sp-3) 0;
}
.at-search__input::placeholder { color: var(--ink-500); }
.at-search__input:focus { outline: none; }
.at-search__input:focus-visible { outline: none; }
.at-search__input::-webkit-search-cancel-button { display: none; }

.at-search__body { overflow-y: auto; padding-block: var(--sp-8) var(--sp-11); }
.at-search__grid { display: grid; gap: var(--sp-8); grid-template-columns: 1fr; }
@media (min-width: 900px) { .at-search__grid { grid-template-columns: minmax(200px, 1fr) 2.4fr; } }
.at-search__aside { display: grid; gap: var(--sp-7); align-content: start; }
.at-search__set { display: grid; gap: var(--sp-2); }
.at-search__set h2 {
  font-size: var(--t-11); font-weight: 500;
  letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--ink-600);
  padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line);
  margin-bottom: var(--sp-1);
}
html[dir="rtl"] .at-search__set h2 { text-transform: none; letter-spacing: 0; }
.at-search__term {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  width: 100%; min-height: 44px;
  padding-inline: var(--sp-3);
  margin-inline: calc(var(--sp-3) * -1);
  border-radius: var(--r-sm);
  font-size: var(--t-15); color: var(--ink-800); text-align: start;
  transition: color var(--t-press) linear, background var(--t-hover) var(--ease);
}
.at-search__term .m-i { color: var(--ink-500); opacity: 0; transition: opacity var(--t-hover) linear; }
.at-search__term:hover { color: var(--ink-900); background: var(--surface); }
.at-search__term:hover .m-i, .at-search__term:focus-visible .m-i { opacity: 1; }

.at-search__results { display: grid; gap: 0; align-content: start; }
.at-search__hint { color: var(--ink-600); font-size: var(--t-15); }

.at-result {
  display: grid; grid-template-columns: 56px 1fr auto;
  gap: var(--sp-4); align-items: center;
  padding: var(--sp-3);
  margin-inline: calc(var(--sp-3) * -1);
  border-radius: var(--r-md);
  transition: background var(--t-hover) var(--ease);
}
.at-result + .at-result { box-shadow: 0 -1px 0 var(--line-faint); }
.at-result:hover, .at-result.is-active { background: var(--surface); box-shadow: var(--lift-1); }
.at-result__thumb {
  width: 56px; aspect-ratio: 4 / 5;
  background: var(--well); overflow: hidden;
  border-radius: var(--r-xs);
}
.at-result__thumb img { width: 100%; height: 100%; object-fit: cover; }
.at-result__body { display: grid; gap: 2px; min-width: 0; }
.at-result__name {
  font-size: var(--t-15); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.at-result__cat { font-size: var(--t-12); color: var(--ink-600); }
.at-result__price { font-size: var(--t-15); white-space: nowrap; }

.at-search__all {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  min-height: 56px; margin-top: var(--sp-4);
  padding-inline: var(--sp-3); margin-inline: calc(var(--sp-3) * -1);
  border-top: 1px solid var(--line);
  font-size: var(--t-11); font-weight: 600;
  letter-spacing: var(--track-label); text-transform: uppercase;
}
html[dir="rtl"] .at-search__all { text-transform: none; letter-spacing: 0; }

.at-skeleton {
  background: linear-gradient(90deg, var(--surface-sink) 25%, var(--surface-lift) 50%, var(--surface-sink) 75%);
  background-size: 200% 100%;
  animation: at-shimmer 1.3s linear infinite;
}
@keyframes at-shimmer { to { background-position: -200% 0; } }
.at-result--skeleton { pointer-events: none; }
.at-result--skeleton .at-skeleton-line { height: 11px; }
.at-result--skeleton .at-skeleton-line + .at-skeleton-line { width: 42%; margin-top: 7px; }

/* ------------------------------------------------- 10. SCRIM AND PANELS --- */

.m-scrim {
  position: fixed; inset: 0;
  z-index: var(--z-scrim);
  background: rgba(8, 8, 8, 0.46);
  opacity: 0;
  transition: opacity var(--t-drawer) var(--ease);
}
.m-scrim[data-open="true"] { opacity: 1; }

.at-panel {
  position: fixed; top: 0; bottom: 0;
  z-index: var(--z-drawer);
  width: min(430px, 92%);
  display: grid; grid-template-rows: auto 1fr auto;
  background: var(--ground);
  box-shadow: var(--lift-panel);
  transition: transform var(--t-drawer) var(--ease);
  overscroll-behavior: contain;
}
/* The drawer rounds only the corners facing the page, so it reads as a panel
   sliding out of the edge rather than a floating rectangle. */
.at-panel--start {
  inset-inline-start: 0; transform: translateX(-102%);
  border-start-end-radius: var(--r-xl); border-end-end-radius: var(--r-xl);
}
.at-panel--end {
  inset-inline-end: 0; transform: translateX(102%);
  border-start-start-radius: var(--r-xl); border-end-start-radius: var(--r-xl);
}
html[dir="rtl"] .at-panel--start { transform: translateX(102%); }
html[dir="rtl"] .at-panel--end { transform: translateX(-102%); }
.at-panel[data-open="true"] { transform: translateX(0); }
/* The rule above never won in RTL: "html[dir=rtl] .at-panel--start" carries
   an extra element-selector point, so the closed position it sets kept
   beating the plain open rule on specificity alone, no matter that
   data-open="true" was present — the drawer opened in French and never in
   Arabic. Matching the qualifier here is what actually fixes it. */
html[dir="rtl"] .at-panel[data-open="true"] { transform: translateX(0); }

.at-panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-6);
  border-bottom: 1px solid var(--line);
  min-height: var(--header-h);
}
.at-panel__title {
  display: flex; align-items: baseline; gap: var(--sp-2);
  font-size: var(--t-11); font-weight: 600;
  letter-spacing: var(--track-label); text-transform: uppercase;
}
html[dir="rtl"] .at-panel__title { text-transform: none; letter-spacing: 0; }
.at-panel__title span { color: var(--ink-600); font-variant-numeric: tabular-nums; }
.at-panel__body { overflow-y: auto; padding: var(--sp-6); -webkit-overflow-scrolling: touch; }
.at-panel__foot {
  padding: var(--sp-5) var(--sp-6) calc(var(--sp-6) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: grid; gap: var(--sp-3);
}

/* --- Mobile navigation -------------------------------------------------- */

.at-navpanel__group { display: grid; gap: var(--sp-1); margin-bottom: var(--sp-8); }
.at-navpanel__group > .m-label { margin-bottom: var(--sp-3); }
.at-navpanel__link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  min-height: 54px;
  padding-inline: var(--sp-4);
  margin-inline: calc(var(--sp-4) * -1);
  border-radius: var(--r-sm);
  transition: background var(--t-hover) var(--ease);
  font-size: var(--d-4);
  font-weight: 600;
  font-variation-settings: "wdth" var(--wide);
  letter-spacing: var(--track-tight);
  color: var(--ink-900);
}
html[dir="rtl"] .at-navpanel__link { font-family: var(--font-ar-display); font-variation-settings: normal; letter-spacing: 0; }
.at-navpanel__link .m-i { color: var(--ink-500); }
.at-navpanel__link--sub {
  font-size: var(--t-15); font-weight: 400;
  font-variation-settings: "wdth" var(--normal);
  letter-spacing: 0;
  min-height: 48px; color: var(--ink-800);
}
html[dir="rtl"] .at-navpanel__link--sub { font-family: var(--font-ar); }

.at-panel[data-open="true"] .at-navpanel__link {
  animation: at-panel-in var(--t-enter) var(--ease) backwards;
  animation-delay: calc(80ms + var(--i, 0) * var(--stagger));
}
@keyframes at-panel-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.m-lang { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.m-lang button {
  flex: 1; min-width: 84px; min-height: 44px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface);
  font-size: var(--t-11); font-weight: 500;
  letter-spacing: var(--track-label); text-transform: uppercase;
  transition: background var(--t-hover) var(--ease), color var(--t-hover) var(--ease);
}
html[dir="rtl"] .m-lang button { text-transform: none; letter-spacing: 0; }
.m-lang button:hover { background: var(--surface-sink); }
.m-lang button[aria-pressed="true"] { background: var(--ink-900); border-color: var(--ink-900); color: var(--surface); }

.az-lang { position: relative; }
.az-lang > summary {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 44px; padding-inline: var(--sp-3);
  list-style: none; cursor: pointer;
  font-size: var(--t-11); font-weight: 500;
  letter-spacing: var(--track-label); text-transform: uppercase;
}
html[dir="rtl"] .az-lang > summary { text-transform: none; letter-spacing: 0; }
.az-lang > summary::-webkit-details-marker { display: none; }
.az-lang > summary > span { display: none; }
.az-lang__menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0;
  z-index: var(--z-menu);
  min-width: 190px; padding: var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--line-faint);
  border-radius: var(--r-md);
  box-shadow: var(--lift-3);
  color: var(--ink-900);
}
.az-lang__menu button { border-radius: var(--r-xs); }
.az-lang__menu p {
  display: flex; justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  font-size: 10px; letter-spacing: var(--track-label);
  text-transform: uppercase; color: var(--ink-600);
}
.az-lang__menu button {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 44px; padding-inline: var(--sp-3);
  font-size: var(--t-15); text-align: start;
  transition: background var(--t-press) linear;
}
.az-lang__menu button:hover { background: var(--surface-sink); }
.az-lang__menu button small { color: var(--ink-600); font-size: var(--t-11); }
.az-lang__menu button[aria-pressed="true"] { font-weight: 600; }
.az-lang__menu button[aria-pressed="true"]::after {
  content: ""; width: 4px; height: 4px; background: var(--signal);
  border-radius: var(--r-full); margin-inline-start: var(--sp-2);
}
@media (max-width: 999px) { .az-lang { display: none; } }

/* -------------------------------------------------------- 11. THE BAG --- */

.at-bag__empty { display: grid; gap: var(--sp-4); justify-items: center; text-align: center; padding-block: var(--sp-9); }
.at-bag__empty .m-i { width: 26px; height: 26px; color: var(--ink-500); stroke-width: 1; }
.at-bag__lines { display: grid; }

.at-bagline {
  display: grid; grid-template-columns: 76px 1fr;
  gap: var(--sp-4);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--line-faint);
  border-radius: var(--r-md);
}
/* A line the visitor just added arrives rather than appearing. */
.at-bagline[data-fresh="true"] { animation: at-line-in var(--t-enter) var(--ease); }
@keyframes at-line-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.at-bagline__thumb {
  width: 76px; aspect-ratio: 4 / 5;
  background: var(--well); overflow: hidden;
  border-radius: var(--r-sm);
}
.at-bagline__thumb img { width: 100%; height: 100%; object-fit: cover; }
.at-bagline__body { display: grid; gap: var(--sp-2); align-content: start; min-width: 0; }
.at-bagline__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.at-bagline__name { font-size: var(--t-15); font-weight: 600; line-height: 1.3; }
.at-bagline__meta {
  display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3);
  font-size: var(--t-12); color: var(--ink-600);
}
.at-bagline__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.at-bagline__price { font-size: var(--t-15); font-weight: 600; font-variant-numeric: tabular-nums; }
.at-bagline__remove {
  width: 34px; height: 34px; display: grid; place-items: center;
  color: var(--ink-500); transition: color var(--t-press) linear;
}
.at-bagline__remove:hover { color: var(--bad); }
.at-bagline[data-busy="true"] { opacity: 0.4; pointer-events: none; }

.at-meter { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.at-meter__copy { font-size: var(--t-12); color: var(--ink-600); }
.at-meter__copy b { color: var(--ink-900); font-weight: 600; }
.at-meter__track {
  height: 3px; background: var(--line); overflow: hidden;
  border-radius: var(--r-full);
}
.at-meter__fill {
  height: 100%; width: 0; background: var(--ink-900);
  border-radius: var(--r-full);
  transition: width var(--t-enter) var(--ease);
}
.at-meter[data-complete="true"] .at-meter__fill { background: var(--signal); }

.at-bag__totals { display: grid; gap: var(--sp-2); }
.at-bag__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3);
  font-size: var(--t-15);
}
.at-bag__row span { color: var(--ink-600); }
.at-bag__row strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.at-bag__row--total {
  padding-top: var(--sp-3); margin-top: var(--sp-1);
  border-top: 1px solid var(--line);
  font-size: var(--t-20);
}
.at-bag__row--total span { color: var(--ink-900); }
.at-bag__note { font-size: var(--t-12); color: var(--ink-600); text-align: center; }

/* ------------------------------------------------------ 12. BOTTOM BAR --- */

.at-tabbar {
  position: fixed; inset-inline: 0; bottom: 0;
  z-index: var(--z-bottom-bar);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid var(--line-faint);
  box-shadow: 0 -8px 24px -16px rgba(8, 8, 8, 0.24);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .at-tabbar {
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .at-tabbar { background: var(--surface); backdrop-filter: none; }
}
@media (min-width: 1000px) { .at-tabbar { display: none; } }
.at-tabbar > * {
  position: relative;
  display: grid; justify-items: center; align-content: center; gap: 3px;
  min-height: 56px; padding: var(--sp-2) 4px;
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-600);
  transition: color var(--t-press) linear;
}
html[dir="rtl"] .at-tabbar > * { text-transform: none; letter-spacing: 0; font-size: var(--t-11); }
.at-tabbar > *:hover, .at-tabbar [aria-current="page"] { color: var(--ink-900); }
.at-tabbar [aria-current="page"]::before {
  content: ""; position: absolute; top: 0; inset-inline: 32%;
  height: 1px; background: var(--ink-900);
}
.at-tabbar .m-count { top: 4px; inset-inline-end: calc(50% - 20px); }
@media (max-width: 999px) { .at-page-end { padding-bottom: calc(56px + env(safe-area-inset-bottom)); } }

/* WhatsApp. Squared to the system, hairlined, and it hides itself while a
   layer is open so it never floats over a drawer. */
.at-wa {
  position: fixed;
  inset-inline-end: var(--gutter);
  bottom: calc(68px + env(safe-area-inset-bottom));
  z-index: var(--z-bottom-bar);
  display: inline-flex; align-items: center; gap: var(--sp-2);
  height: 46px; padding-inline: var(--sp-4);
  background: rgba(14, 14, 14, 0.9); color: var(--on-room);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-full);
  font-size: var(--t-11); font-weight: 500;
  letter-spacing: var(--track-label); text-transform: uppercase;
  box-shadow: var(--lift-3), var(--edge-dark);
  animation: at-wa-in var(--t-enter) var(--ease) 900ms backwards;
  transition: transform var(--t-hover) var(--ease-soft),
              opacity var(--t-hover) var(--ease),
              box-shadow var(--t-hover) var(--ease);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .at-wa { -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
}
@keyframes at-wa-in {
  from { opacity: 0; transform: scale(0.9) translateY(8px); }
  to { opacity: 1; transform: none; }
}
html[dir="rtl"] .at-wa { text-transform: none; letter-spacing: 0; }
.at-wa .m-i { color: var(--wa); }
.at-wa:hover { transform: translateY(-2px); box-shadow: var(--lift-3); }
.at-wa:active { transform: scale(0.97); }
.at-wa__label { display: none; }
@media (min-width: 1000px) {
  .at-wa { bottom: var(--sp-7); }
  .at-wa__label { display: inline; }
}
body[data-layer-open="true"] .at-wa { opacity: 0; pointer-events: none; }
/* On a product page the sticky buy bar owns the bottom edge. The contact
   button steps aside rather than sitting on top of the primary action. */
body:has(.at-buybar[data-show="true"]) .at-wa { opacity: 0; pointer-events: none; }

/* ------------------------------------------------- 13. NOTIFICATIONS ---
   Designed as a small object, not a line of text: a mark, a title, a body,
   an optional action, a dismiss, and a hairline that drains for the life of
   the toast so the reader knows how long they have. */

.at-toasts {
  position: fixed;
  inset-inline-end: var(--gutter);
  bottom: calc(68px + env(safe-area-inset-bottom));
  z-index: var(--z-toast);
  display: grid; gap: var(--sp-2);
  width: min(360px, calc(100vw - var(--sp-8)));
  pointer-events: none;
}
@media (min-width: 1000px) { .at-toasts { bottom: var(--sp-7); } }
/* The bag drawer occupies the same corner. While any layer is open the stack
   crosses to the other side rather than sitting on top of the checkout
   button. */
body[data-layer-open="true"] .at-toasts {
  inset-inline-end: auto;
  inset-inline-start: var(--gutter);
}

/* On phones the toast belongs at the bottom edge, full width, above the bar. */
@media (max-width: 719px) {
  .at-toasts {
    inset-inline: var(--sp-3);
    width: auto;
    bottom: calc(64px + env(safe-area-inset-bottom));
  }
  body[data-layer-open="true"] .at-toasts { inset-inline: var(--sp-3); }
}

.at-toast {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: rgba(14, 14, 14, 0.92);
  color: var(--on-room);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--r-lg);
  box-shadow: var(--lift-3), var(--edge-dark);
  pointer-events: auto;
  overflow: hidden;
  animation: at-toast-in var(--t-enter) var(--ease);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .at-toast {
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    backdrop-filter: blur(20px) saturate(1.4);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .at-toast { background: var(--room); backdrop-filter: none; }
}
@keyframes at-toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.at-toast[data-out="true"] { animation: at-toast-out 200ms var(--ease-in) forwards; }
@keyframes at-toast-out {
  to { opacity: 0; transform: translateY(6px) scale(0.99); }
}

.at-toast__mark {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border: 1px solid var(--line-room-strong);
  border-radius: var(--r-full);
  color: var(--on-room);
}
.at-toast--ok .at-toast__mark { border-color: var(--on-room); }
.at-toast--bad .at-toast__mark { border-color: var(--bad-lift); color: var(--bad-lift); }

/* A product thumbnail replaces the mark when the toast is about a piece. */
.at-toast__thumb {
  width: 42px; aspect-ratio: 4 / 5;
  background: var(--room-lift-2); overflow: hidden;
  border-radius: var(--r-xs);
}
.at-toast__thumb img { width: 100%; height: 100%; object-fit: cover; }

.at-toast__body { display: grid; gap: 3px; min-width: 0; }
.at-toast__title {
  font-size: var(--t-13); font-weight: 600;
  letter-spacing: var(--track-label); text-transform: uppercase;
}
html[dir="rtl"] .at-toast__title { text-transform: none; letter-spacing: 0; }
.at-toast__text {
  font-size: var(--t-13); color: var(--on-room-2); line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis;
}
.at-toast__action {
  justify-self: start; margin-top: var(--sp-1);
  min-height: 32px;
  font-size: var(--t-11); font-weight: 600;
  letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--on-room);
  border-bottom: 1px solid var(--line-room-strong);
  transition: border-color var(--t-hover) var(--ease);
}
html[dir="rtl"] .at-toast__action { text-transform: none; letter-spacing: 0; }
.at-toast__action:hover { border-bottom-color: var(--on-room); }
.at-toast__close {
  width: 28px; height: 28px; display: grid; place-items: center;
  color: var(--on-room-2);
  transition: color var(--t-press) linear;
}
.at-toast__close:hover { color: var(--on-room); }

/* The lifetime hairline. Transform only, and it pauses on hover. */
.at-toast__life {
  position: absolute; inset-inline: 0; bottom: 0; height: 1px;
  background: var(--on-room); opacity: 0.4;
  transform-origin: var(--edge-a, left);
  animation: at-life var(--life, 5000ms) linear forwards;
}
html[dir="rtl"] .at-toast__life { --edge-a: right; }
.at-toast:hover .at-toast__life { animation-play-state: paused; }
@keyframes at-life { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* --------------------------------------------------------- 14. FOOTER ---
   No oversized wordmark. The footer earns its height with a statement, the
   letter, four columns of real links, and a base line. */

/* A rounded dark room resting on the page ground rather than a slab bolted
   to the bottom of the document. */
.at-footer {
  background: var(--room);
  color: var(--on-room);
  margin: var(--band) var(--gutter) 0;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  overflow: hidden;
}
@media (max-width: 719px) {
  .at-footer { margin-inline: var(--sp-3); border-radius: var(--r-xl) var(--r-xl) 0 0; }
}
.at-footer > .at-shell { padding-inline: clamp(var(--sp-6), 3vw, var(--sp-11)); }

.at-footer__top {
  display: grid; gap: var(--sp-8);
  padding-block: var(--band-tight);
  border-bottom: 1px solid var(--line-room);
}
@media (min-width: 900px) {
  .at-footer__top { grid-template-columns: 1fr 1fr; gap: var(--sp-11); align-items: end; }
}
.at-footer__statement {
  font-size: var(--d-3);
  font-weight: 600;
  font-variation-settings: "wdth" var(--wide);
  letter-spacing: var(--track-display);
  line-height: var(--leading-heading);
  max-width: 18ch;
}
html[dir="rtl"] .at-footer__statement { font-family: var(--font-ar-display); font-variation-settings: normal; letter-spacing: 0; }

.at-signup { display: grid; gap: var(--sp-3); min-width: 0; }
.at-signup__row {
  display: flex; align-items: stretch; min-width: 0;
  border-bottom: 1px solid var(--line-room-strong);
  transition: border-color var(--t-hover) var(--ease);
}
.at-signup__row:focus-within { border-bottom-color: var(--on-room); }
.at-signup__row input {
  flex: 1 1 0; min-width: 0;
  border: 0; background: transparent;
  padding: var(--sp-3) 0;
  font-size: var(--t-16); color: var(--on-room);
}
.at-signup__row input::placeholder { color: var(--on-room-3); }
.at-signup__row input:focus { outline: none; }
.at-signup__row input:focus-visible { outline: 2px solid var(--on-room); outline-offset: 4px; }
.at-signup__row button {
  flex: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding-inline: var(--sp-3);
  font-size: var(--t-11); font-weight: 600;
  letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--on-room);
  transition: color var(--t-hover) var(--ease);
}
html[dir="rtl"] .at-signup__row button { text-transform: none; letter-spacing: 0; }
.at-signup__row button:hover { color: var(--signal-lift); }
.at-signup small { font-size: var(--t-12); color: var(--on-room-2); }

.at-footer__grid {
  display: grid; gap: var(--sp-8) var(--sp-6);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  padding-block: var(--sp-9);
}
.at-footer__col { display: grid; gap: var(--sp-1); align-content: start; }
.at-footer__col h4 {
  font-size: var(--t-11); font-weight: 600;
  letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--on-room);
  padding-bottom: var(--sp-3); margin-bottom: var(--sp-2);
  border-bottom: 1px solid var(--line-room);
}
html[dir="rtl"] .at-footer__col h4 { text-transform: none; letter-spacing: 0; }
.at-footer__col a, .at-footer__col span {
  display: flex; align-items: center;
  min-height: 40px;
  font-size: var(--t-13); color: var(--on-room-2);
  transition: color var(--t-press) linear;
}
.at-footer__col a:hover { color: var(--on-room); }
.at-footer__col small { display: block; font-size: var(--t-12); color: var(--on-room-3); }

.at-socials { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.at-socials a {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--line-room); border-radius: var(--r-full);
  color: var(--on-room-2);
  transition: color var(--t-hover) var(--ease), border-color var(--t-hover) var(--ease);
}
.at-socials a:hover { color: var(--on-room); border-color: var(--on-room); }

.at-footer__base {
  display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6);
  align-items: center; justify-content: space-between;
  padding-block: var(--sp-5) calc(var(--sp-7) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-room);
  font-size: var(--t-12); color: var(--on-room-2);
}
.at-footer__base nav { display: flex; flex-wrap: wrap; gap: var(--sp-5); }
.at-footer__base nav a { display: inline-flex; align-items: center; min-height: 40px; }
.at-footer__base a:hover { color: var(--on-room); }
@media (max-width: 999px) { .at-footer__base { padding-bottom: calc(72px + env(safe-area-inset-bottom)); } }

/* ------------------------------------------------- 15. PAGE FURNITURE --- */

.page-head {
  padding-block: var(--sp-8) var(--sp-7);
  border-bottom: 1px solid var(--line);
}
.page-head-inner {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: var(--sp-4) var(--sp-7);
  margin-top: var(--sp-5);
}
.page-head h1 {
  font-size: var(--d-2);
  font-weight: 600;
  font-variation-settings: "wdth" var(--wide);
  letter-spacing: var(--track-display);
  line-height: var(--leading-display);
}
html[dir="rtl"] .page-head h1 { font-family: var(--font-ar-display); font-variation-settings: normal; letter-spacing: 0; line-height: var(--leading-heading); }
.page-head-inner > div > p { margin-top: var(--sp-3); max-width: 52ch; color: var(--ink-600); font-size: var(--t-15); }

.m-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2);
  font-size: var(--t-11);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-600);
}
html[dir="rtl"] .m-crumbs { text-transform: none; letter-spacing: 0; font-size: var(--t-13); }
.m-crumbs a { display: inline-flex; align-items: center; min-height: 32px; transition: color var(--t-press) linear; }
.m-crumbs a:hover { color: var(--ink-900); }
.m-crumbs .m-i { color: var(--ink-500); }
.m-crumbs [aria-current="page"] { color: var(--ink-900); }

.pagination {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  margin-top: var(--sp-9);
  padding-top: var(--sp-7);
  border-top: 1px solid var(--line);
}
.pagination a, .pagination span {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 44px; padding-inline: var(--sp-5);
  border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: var(--t-11); font-weight: 500;
  letter-spacing: var(--track-label); text-transform: uppercase;
  transition: border-color var(--t-hover) var(--ease);
}
html[dir="rtl"] .pagination a, html[dir="rtl"] .pagination span { text-transform: none; letter-spacing: 0; }
.pagination a { border-color: var(--line); background: var(--surface); }
.pagination a:hover { box-shadow: var(--lift-1); }
.pagination a:hover { border-color: var(--ink-900); }
.pagination [aria-current="page"] { color: var(--ink-600); }

/* ------------------------------------------------- 16. MOTION SYSTEM ---
   Content is visible by default. The runtime only arms the hidden start
   state once it has confirmed it can un-arm it, and a failsafe timer shows
   everything regardless. Four reveal shapes, picked per content type — a
   single fade-up on every section is the tell this project avoids. */

/* Text: rises. */
.reveal-on [data-rise] {
  opacity: 0; transform: translateY(18px);
  transition: opacity var(--t-reveal) var(--ease), transform var(--t-reveal) var(--ease);
}
.reveal-on [data-rise].is-in, .reveal-on .is-in [data-rise] { opacity: 1; transform: none; }

/* Headlines: each line clears a mask. */
.at-line { display: block; overflow: hidden; padding-block: 0.02em; }
.at-line > span { display: block; }
.reveal-on .at-line > span {
  transform: translateY(105%);
  transition: transform var(--t-image) var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.reveal-on .is-in .at-line > span, .reveal-on .at-line.is-in > span { transform: none; }

/* Images: the frame opens and the picture settles back to true scale. */
.reveal-on [data-clip] { clip-path: inset(0 0 100% 0); transition: clip-path var(--t-image) var(--ease); }
.reveal-on [data-clip].is-in, .reveal-on .is-in [data-clip] { clip-path: inset(0 0 0 0); }
.reveal-on [data-clip] > img { transform: scale(1.1); transition: transform 1300ms var(--ease); }
.reveal-on [data-clip].is-in > img, .reveal-on .is-in [data-clip] > img { transform: scale(1); }

/* Rules: draw across. */
.reveal-on [data-draw] { transform: scaleX(0); transform-origin: var(--edge-a, left); transition: transform var(--t-image) var(--ease); }
.reveal-on [data-draw].is-in, .reveal-on .is-in [data-draw] { transform: scaleX(1); }
html[dir="rtl"] [data-draw] { --edge-a: right; }

/* Labels: resolve out of tighter tracking. */
.reveal-on [data-track] {
  opacity: 0; letter-spacing: 0.02em;
  transition: opacity var(--t-reveal) var(--ease), letter-spacing var(--t-image) var(--ease);
}
.reveal-on [data-track].is-in, .reveal-on .is-in [data-track] { opacity: 1; letter-spacing: var(--track-label); }

/* Grids: children stagger. */
.reveal-on [data-stagger] > * {
  opacity: 0; transform: translateY(16px);
  transition: opacity var(--t-enter) var(--ease), transform var(--t-enter) var(--ease);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
.reveal-on [data-stagger].is-in > * { opacity: 1; transform: none; }

/* ------------------------------------------------- 17. REDUCED MOTION ---
   The second justified `!important`: this has to beat every component rule
   and every inline style the runtime writes. */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-on [data-rise], .reveal-on [data-stagger] > *,
  .reveal-on .at-line > span, .reveal-on [data-track] {
    opacity: 1 !important; transform: none !important; letter-spacing: inherit !important;
  }
  .reveal-on [data-clip] { clip-path: none !important; }
  .reveal-on [data-clip] > img { transform: none !important; }
  .reveal-on [data-draw] { transform: none !important; }
  .reveal-on .at-frame::before { opacity: 1 !important; transform: translate(var(--frame-x), var(--frame-y)) !important; }
  .at-toast__life { animation: none !important; }
}

/* ---------------------------------------------------------- 18. PRINT --- */

@media print {
  .at-header, .at-utility, .at-tabbar, .at-toasts, .at-panel, .at-search,
  .m-scrim, .at-wa, .m-skip { display: none !important; }
  body { background: #fff; color: #000; }
  .at-footer { background: #fff; color: #000; margin-top: var(--sp-7); }
}

/* ------------------------------------------------------ 19. UTILITIES --- */

.at-nav-btn { margin-inline-start: -10px; }
@media (min-width: 1000px) { .at-nav-btn { display: none; } }
@media (max-width: 999px) { .at-hide-sm { display: none; } }
.at-center { text-align: center; }
