/* =====================================================================
   Iraq Deals Radar: site stylesheet
   Mobile first. Breakpoints (min-width only): 600px, 900px, 1200px.
   Order: 1 tokens, 2 dark tokens, 3 reset, 4 layout, 5 header,
   6 hero and tabs, 7 filters, 8 cards, 9 pagination, 10 stores,
   11 comparisons, 12 sheets, 13 toast/PWA/back-to-top/thumb bar,
   14 utilities and shared components, 15 breakpoints, hover, motion.
   Hex colours live only in the two token blocks.
   ===================================================================== */

/* ---------- 1. Tokens (light only) ---------- */
:root {
  color-scheme: light;

  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-2: #F6F6F3;
  --fill: #F1F1EE;
  --fill-strong: #E6E6E1;
  --border: #EAEAE5;
  --border-strong: #D4D4CD;
  --text: #0E0E0C;
  --text-2: #3D3D38;
  --text-3: #74746C;
  --accent: #0E0E0C;
  --accent-strong: #2B2B27;
  --accent-soft: #F1F1EE;
  --accent-ring: rgb(14 14 12 / 0.16);
  --on-accent: #FFFFFF;
  --success: #1F7A3D;
  --success-soft: #EAF4EC;
  --danger: #B3261E;
  --danger-soft: #FBEDEB;
  --warning: #9A5B00;
  --gold: #B3261E;
  --gold-soft: #FBEDEB;
  --overlay: rgb(14 14 12 / 0.42);
  --img-bg: #FFFFFF;
  --brand: #2A55E5;
  --brand-soft: #EEF2FE;
  --bar-cheap: #22A06B;
  --bar-mid: #F2B13A;
  --bar-dear: #E5534B;
  --c-all: #0E0E0C;
  --c-mobiles: #2A55E5;
  --c-pc: #5B4BDB;
  --c-appliances: #0F8F7E;
  --c-xbox: #8B3FD9;
  --c-audio: #E0661A;
  --c-beauty: #D23F80;
  --nav-bg: rgb(255 255 255 / 0.88);
  --toast-bg: #0E0E0C;
  --toast-text: #FAFAF8;
  --shimmer: rgb(255 255 255 / 0.7);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: clamp(1.75rem, 1.2rem + 2.2vw, 3rem);

  --shadow-1: 0 1px 2px rgb(14 14 12 / 0.04);
  --shadow-2: 0 24px 48px -16px rgb(14 14 12 / 0.18), 0 2px 6px rgb(14 14 12 / 0.05);

  --z-header: 100;
  --z-thumb: 200;
  --z-fab: 210;
  --z-pwa: 300;
  --z-toast: 400;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "IBM Plex Sans Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
  --gutter: 16px;
  --header-h: 64px;
  --control-h: 44px;
  --summary-w: 112px;
}

/* ---------- 3. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--s-3));
}

html.has-modal { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }

img,
video { max-width: 100%; height: auto; }

svg { flex-shrink: 0; }

button,
input,
select,
textarea { font: inherit; color: inherit; letter-spacing: inherit; }

button,
summary { cursor: pointer; }

a { color: var(--accent); text-decoration: none; }

kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::selection { background: var(--accent-soft); }

[hidden] { display: none !important; }

/* ---------- 4. Layout ---------- */
.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  top: -60px;
  inset-inline-start: var(--s-3);
  z-index: calc(var(--z-toast) + 1);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  transition: top 0.2s var(--ease);
}

.skip-link:focus { top: var(--s-3); }

.site-main { padding-bottom: var(--s-7); }

.banner-slot:empty { display: none; }

/* Footer: the brand's deep navy, violet-to-aqua light, and a live radar sweep. */
.site-footer {
  --ft-bg: #0D0238;
  --ft-ink: #F4F1FF;
  --ft-dim: rgb(244 241 255 / 0.62);
  --ft-line: rgb(244 241 255 / 0.12);
  --ft-violet: #7B3CFF;
  --ft-aqua: #8DEBF3;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: var(--s-6);
  background:
    radial-gradient(60% 120% at 100% 0%, rgb(123 60 255 / 0.35), transparent 60%),
    radial-gradient(50% 100% at 0% 100%, rgb(141 235 243 / 0.18), transparent 60%),
    var(--ft-bg);
  color: var(--ft-dim);
  font-size: var(--fs-sm);
  padding-bottom: calc(88px + var(--safe-b));
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--ft-aqua), var(--ft-violet), var(--ft-aqua));
  background-size: 200% 100%;
  animation: brandPan 8s linear infinite alternate;
}

.site-footer__radar {
  position: absolute;
  z-index: -1;
  top: -60px;
  inset-inline-end: -80px;
  width: 360px;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.55;
}

.site-footer__ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgb(141 235 243 / 0.22);
  border-radius: 50%;
}

.site-footer__ring:nth-child(2) { inset: 18%; }

.site-footer__ring:nth-child(3) { inset: 36%; }

.site-footer__sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgb(141 235 243 / 0.35), transparent 22%);
  animation: sweep 6s linear infinite;
}

.site-footer__blip {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px;
  border-radius: 50%;
  background: var(--ft-aqua);
  box-shadow: 0 0 10px var(--ft-aqua);
  animation: blip 6s ease-out infinite;
}

.site-footer__blip:nth-of-type(1) { inset-inline-start: 62%; top: 30%; animation-delay: 1s; }

.site-footer__blip:nth-of-type(2) { inset-inline-start: 28%; top: 58%; animation-delay: 3.2s; }

.site-footer__blip:nth-of-type(3) { inset-inline-start: 70%; top: 72%; animation-delay: 4.6s; }

.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-6);
  padding-block: var(--s-7) var(--s-6);
}

.site-footer__brand { grid-column: 1 / -1; display: flex; flex-direction: column; gap: var(--s-3); }

.site-footer .footer-brand { color: var(--ft-ink); }

.footer-brand .brand-mark { color: var(--ft-aqua); }

.site-footer .footer-brand .brand-word strong { color: var(--ft-ink); font-size: 1.375rem; }

.site-footer .footer-brand .brand-word span { color: var(--ft-dim); }

.site-footer__tagline { color: var(--ft-ink); font-size: var(--fs-md); font-weight: 300; }

.site-footer__stats { display: flex; flex-wrap: wrap; gap: var(--s-5); margin: var(--s-1) 0 0; }

.site-footer__stats > div { display: flex; flex-direction: column-reverse; }

.site-footer__stats dt { color: var(--ft-dim); font-size: var(--fs-xs); }

.site-footer__stats dd {
  margin: 0;
  background: linear-gradient(90deg, var(--ft-aqua), #C9B6FF);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.2;
}

.site-footer__stats dd.is-loading:empty { background: rgb(244 241 255 / 0.12); }

.site-footer__col { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-3); }

.site-footer__heading { margin-bottom: var(--s-1); color: var(--ft-ink); font-size: var(--fs-sm); font-weight: 600; }

.site-footer .link-btn { color: var(--ft-dim); font-weight: 400; transition: color 0.15s ease, transform 0.2s var(--ease); }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-block: var(--s-5);
  border-top: 1px solid var(--ft-line);
  font-size: var(--fs-xs);
}

.site-footer__credit { color: var(--ft-dim); }

.site-footer__credit b {
  background: linear-gradient(90deg, #B79BFF, var(--ft-aqua));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}

@media (hover: hover) and (pointer: fine) {
  .site-footer .link-btn:hover { color: var(--ft-ink); text-decoration: none; transform: translateX(-3px); }

  .site-footer__credit:hover { color: var(--ft-ink); }
}

@keyframes sweep { to { transform: rotate(360deg); } }

@keyframes blip {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  8% { opacity: 1; transform: scale(1.2); }
  40% { opacity: 0.2; transform: scale(1); }
}

/* ---------- 5. Header ---------- */
.apple-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

/* Hairline appears once the page scrolls under the header. */
.apple-nav.nav-hidden { border-bottom-color: var(--border); }

.nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  height: var(--header-h);
}

.nav-brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  white-space: nowrap;
}

.brand-mark { color: var(--text); }

.brand-word { display: inline-flex; align-items: baseline; gap: 6px; line-height: 1; }

.brand-word strong { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }

.brand-word span { color: var(--text-3); font-size: var(--fs-sm); font-weight: 400; }

.nav-actions { display: flex; align-items: center; gap: var(--s-1); flex-shrink: 0; }

.nav-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  list-style: none;
  user-select: none;
  transition: background-color 0.15s ease;
}

.nav-icon-btn img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }

.nav-icon-btn::-webkit-details-marker,
.filter-more__summary::-webkit-details-marker { display: none; }

.nav-icon-btn__badge {
  position: absolute;
  top: 4px;
  inset-inline-start: 2px;
  min-width: 17px;
  height: 17px;
  padding-inline: 4px;
  border: 2px solid var(--surface);
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--surface);
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 13px;
  text-align: center;
}

.nav-wishlist { display: none; }

.nav-settings[open] > .nav-icon-btn { background: var(--fill); }

.nav-settings__panel {
  position: absolute;
  top: calc(100% + var(--s-1));
  inset-inline-end: var(--gutter);
  width: min(320px, calc(100vw - 2 * var(--gutter)));
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  animation: popIn 0.18s var(--ease);
}

.currency-toggle { width: 100%; justify-content: flex-start; }

.nav-auth { display: flex; align-items: center; }

/* ---------- 6. Hero and tabs ---------- */
.hero {
  padding-block: var(--s-6) var(--s-5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.hero__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }

.hero__title {
  font-size: var(--fs-2xl);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero__stats {
  display: flex;
  gap: var(--s-5);
  margin-top: var(--s-3);
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.hero__stats strong { color: var(--text); font-weight: 600; }

.search-field--hero { width: 100%; max-width: 680px; margin-top: var(--s-5); text-align: start; }

.search-field--hero .apple-input {
  height: 56px;
  padding-inline: 52px 52px;
  border-radius: var(--r-pill);
  border-color: var(--border-strong);
  background: var(--surface);
  font-size: var(--fs-md);
}

.search-field--hero .search-field__icon { inset-inline-start: 20px; }

.search-field--hero .search-field__clear { inset-inline-end: 12px; }

.search-field--hero .filter-desktop-shortcut { inset-inline-end: 20px; }

.master-tab-bar {
  display: flex;
  justify-content: center;
  gap: var(--s-7);
  margin-bottom: var(--s-4);
  box-shadow: inset 0 -1px var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.master-tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 50px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: var(--fs-md);
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.master-tab-btn::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: var(--text);
  transform: scaleX(0);
  transition: transform 0.35s var(--ease);
}

.master-tab-btn.active { color: var(--text); }

.master-tab-btn:focus-visible { outline-offset: -2px; border-radius: var(--r-sm); }

.master-tab-btn.active::after { transform: scaleX(1); }

.master-tab-badge { color: var(--text-3); font-size: var(--fs-sm); font-weight: 400; }

.tab-panel:focus-visible { outline-offset: 6px; }

/* ---------- 7. Filters ---------- */
.filter-panel {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  scroll-margin-top: calc(var(--header-h) + var(--s-3));
}

.category-scroll-container,
.quick-sub-pills-bar,
.comp-pills {
  display: flex;
  gap: var(--s-2);
  /* 6px block padding holds the 2px focus ring + 2px offset; the negative
     block margin keeps the visual spacing unchanged. */
  margin-block: -4px;
  margin-inline: calc(-1 * var(--gutter));
  padding: 6px var(--gutter);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-padding-inline: var(--gutter);
}

.category-scroll-container::-webkit-scrollbar,
.quick-sub-pills-bar::-webkit-scrollbar,
.comp-pills::-webkit-scrollbar,
.master-tab-bar::-webkit-scrollbar { display: none; }

.comp-pills:empty { display: none; }

.apple-segmented-bar { display: flex; gap: var(--s-2); flex-shrink: 0; }

.apple-segment-item,
.comp-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: 40px;
  padding-inline: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.apple-segment-item.active,
.comp-cat-btn.active { border-color: var(--text); background: var(--text); color: var(--surface); }

.segment-count { color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; }

.segment-count:empty { display: none; }

.apple-segment-item.active :is(.segment-count, .muted),
.comp-cat-btn.active :is(.segment-count, .muted) { color: inherit; opacity: 0.7; }

.sub-pill {
  flex-shrink: 0;
  height: 32px;
  padding-inline: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sub-pill.active { border-color: transparent; background: var(--accent-soft); color: var(--accent); }

/* Toolbar: search / sort / "فلاتر". The summary sits in a reserved
   grid slot so the open disclosure body can span the full width. */
.filter-toolbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto var(--summary-w);
  align-items: center;
  column-gap: var(--s-2);
}

.filter-toolbar > .results-bar__count { grid-column: 1; grid-row: 1; }

.filter-toolbar__sort { grid-column: 2; grid-row: 1; min-width: 0; }

.filter-toolbar__sort .apple-select { width: auto; min-width: 108px; }

.filter-more { grid-column: 1 / -1; grid-row: 2; }

.filter-more__summary {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  width: var(--summary-w);
  height: var(--control-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  list-style: none;
  user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.filter-more[open] > .filter-more__summary { border-color: var(--text); background: var(--text); color: var(--surface); }

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  gap: var(--s-3);
  margin-top: var(--s-3);
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.check-control {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  height: var(--control-h);
  padding-inline: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.check-control input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.search-field { position: relative; min-width: 0; }

.search-field__icon {
  position: absolute;
  top: 50%;
  inset-inline-start: var(--s-3);
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.search-field .apple-input { padding-inline: 40px 44px; }

.search-field .apple-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.search-field__clear {
  position: absolute;
  top: 50%;
  inset-inline-end: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fill);
  color: var(--text-2);
}

.filter-desktop-shortcut {
  display: none;
  position: absolute;
  top: 50%;
  inset-inline-end: var(--s-3);
  transform: translateY(-50%);
  padding: 2px 7px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: 1.4;
  pointer-events: none;
}

.search-field .apple-input:not(:placeholder-shown) ~ .filter-desktop-shortcut { display: none; }

.search-suggestions {
  position: absolute;
  top: calc(100% + var(--s-2));
  inset-inline: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  animation: popIn 0.16s var(--ease);
}

.trending-chip {
  height: 32px;
  padding-inline: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.trending-chip.active { border-color: transparent; background: var(--accent-soft); color: var(--accent); }

.results-bar { display: flex; justify-content: flex-start; }

.results-bar:not(:has(> :not([hidden]))) { display: none; }

.results-bar__count {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.results-bar__reset,
.clear-all-chips-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 var(--s-2);
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}

.chip-row:empty { display: none; }

.search-suggestions__group { display: flex; flex-direction: column; gap: var(--s-2); }

.search-suggestions__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.search-suggestions__head .link-btn { font-size: var(--fs-xs); color: var(--text-3); }

.search-suggestions__chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.search-suggestions .trending-chip { display: inline-flex; align-items: center; gap: 6px; }

.search-suggestions .trending-chip svg { color: var(--text-3); }

/* Instant results */
.search-live { display: flex; flex-direction: column; margin: calc(-1 * var(--s-2)) calc(-1 * var(--s-2)) 0; padding: 0; list-style: none; }

.search-live__item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2);
  border-radius: var(--r-md);
  cursor: pointer;
}

.search-live__item img {
  width: 48px;
  height: 48px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--img-bg);
  object-fit: contain;
}

.search-live__body { display: flex; flex-direction: column; min-width: 0; }

/* Two-line clamp, not a one-line ellipsis: in RTL an English title would lose its start. */
.search-live__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.search-live__title mark { background: none; color: inherit; font-weight: 600; }

.search-live__meta { color: var(--text-3); font-size: var(--fs-xs); }

.search-live__price { color: var(--text); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }

.search-live__all,
.search-live__empty {
  margin-top: var(--s-2);
  padding: var(--s-3) var(--s-2) var(--s-1);
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.search-live__all { font-weight: 500; cursor: pointer; }

.search-live__all .num { color: var(--text-3); font-weight: 400; }

.search-live [aria-selected="true"] { background: var(--fill); }

.search-live__all[aria-selected="true"] { border-radius: var(--r-md); }

/* Price range pair */
.range-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }

.range-pair .apple-input { min-width: 0; }

/* Recently viewed */
.recent-strip { margin-bottom: var(--s-5); }

.recent-strip__title { margin-bottom: var(--s-3); font-size: var(--fs-md); font-weight: 600; }

.recent-strip__list {
  display: flex;
  gap: var(--s-3);
  margin: 0 calc(-1 * var(--gutter));
  padding: 2px var(--gutter);
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.recent-strip__list::-webkit-scrollbar { display: none; }

.recent-strip__list > li { flex: 0 0 auto; scroll-snap-align: start; }

.recent-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 136px;
  padding: var(--s-2) var(--s-2) var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-align: start;
  transition: border-color 0.15s ease;
}

.recent-card img {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  padding: 10%;
  border-radius: var(--r-md);
  background: var(--img-bg);
  object-fit: contain;
}

.recent-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.recent-card__price { color: var(--text); font-size: var(--fs-sm); font-weight: 600; }

.sheet__icon-btn { width: var(--control-h); padding: 0; justify-content: center; }

.sheet__footer .sheet__icon-btn { flex: 0 0 auto; }

/* ---------- 8. Cards ---------- */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
  margin-top: var(--s-4);
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
}

.deals-grid > .empty-state,
.deals-grid > .error-state,
.h2h-grid > .empty-state,
.h2h-grid > .error-state { grid-column: 1 / -1; }

.deal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  container: card / inline-size;
  transition: border-color 0.15s ease;
}

/* golden-deal keeps the neutral border: one accent colour only */

.deal-card.is-out-of-stock .image-wrapper img { filter: grayscale(1); opacity: 0.55; }

.deal-card.is-out-of-stock .card-new-price { color: var(--text-3); }

.image-wrapper {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  margin: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  background: var(--img-bg);
  overflow: hidden;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  padding: 12%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 0.35s var(--ease);
}

.badge-clean-discount,
.badge-clean-lowest,
.badge-clean-outofstock {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding-inline: var(--s-2);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  unicode-bidi: isolate;
}

.image-wrapper .badge-clean-discount,
.image-wrapper .badge-clean-lowest,
.image-wrapper .badge-clean-outofstock {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2); /* physical on purpose: the badge carries dir="ltr" */
  z-index: 1;
}

.badge-clean-discount { background: var(--danger-soft); color: var(--danger); }

.deal-card.golden-deal .badge-clean-discount { background: var(--danger); color: var(--on-accent); }

.badge-clean-lowest { background: var(--success-soft); color: var(--success); }

.badge-clean-outofstock {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-2);
}

.btn-wishlist {
  position: absolute;
  top: var(--s-2);
  inset-inline-end: var(--s-2);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: color 0.15s ease, transform 0.2s var(--ease);
}

.btn-wishlist.active { color: var(--danger); }

.btn-wishlist.active svg {
  fill: currentColor;
  stroke: currentColor;
  animation: heartPop 0.38s var(--ease-spring);
}

.card-body-compact {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-4);
  min-width: 0;
}

.card-meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text-3);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.card-store-name {
  flex-shrink: 0;
  max-width: 62%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-3);
  font-weight: 500;
}

.card-store-sub {
  display: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-store-sub:not(:empty)::before { content: "·"; margin-inline-end: 6px; }

.card-title-compact {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: calc(1.45em * 2);
  overflow: hidden;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.45;
  cursor: pointer;
  transition: color 0.15s ease;
}

.card-price-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}

.card-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--s-2);
}

.card-new-price {
  color: var(--text);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-old-price { color: var(--text-3); font-size: var(--fs-xs); text-decoration: line-through; }

.card-delivery-compact {
  overflow: hidden;
  color: var(--text-3);
  font-size: var(--fs-xs);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card-delivery-compact strong { color: var(--text-2); font-weight: 500; }

.card-cta-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: var(--s-1);
}

.btn-card-cta,
.btn-card-compare {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: 38px;
  padding-inline: var(--s-3);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-card-cta { border: 1px solid var(--text); background: var(--surface); color: var(--text); }

.deal-card.is-out-of-stock .btn-card-cta { border-color: var(--border); color: var(--text-3); }

.btn-card-compare,
.compare-deal-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); }

/* Loading placeholders */
.skeleton-card {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background-color: var(--surface);
  background-image:
    linear-gradient(var(--fill), var(--fill)),
    linear-gradient(var(--fill), var(--fill)),
    linear-gradient(var(--fill), var(--fill)),
    linear-gradient(var(--fill), var(--fill)),
    linear-gradient(var(--fill), var(--fill)),
    linear-gradient(var(--fill), var(--fill));
  background-repeat: no-repeat;
  background-size:
    calc(100% - 12px) 50%,
    40% 10px,
    calc(100% - 24px) 12px,
    65% 12px,
    45% 18px,
    calc(100% - 24px) 38px;
  background-position:
    right 6px top 6px,
    right 12px top calc(50% + 22px),
    right 12px top calc(50% + 44px),
    right 12px top calc(50% + 64px),
    right 12px top calc(50% + 94px),
    right 12px bottom 12px;
}

.skeleton {
  position: relative;
  display: block;
  min-height: 1em;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--fill);
}

.skeleton-card::after,
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--shimmer), transparent);
  transform: translateX(100%);
  animation: shimmer 1.4s ease-in-out infinite;
}

.is-loading:empty {
  display: inline-block;
  min-width: 2.5em;
  height: 0.9em;
  vertical-align: -0.1em;
  border-radius: 4px;
  background: var(--fill);
  animation: pulse 1.1s ease-in-out infinite alternate;
}

/* ---------- 9. Pagination ---------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: var(--s-6);
}

.pagination:empty { display: none; }

.pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  min-width: 40px;
  height: 40px;
  padding-inline: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pagination__btn[aria-current="page"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--surface);
}

.pagination__btn:disabled { opacity: 0.4; cursor: not-allowed; }

.pagination__ellipsis { min-width: 24px; color: var(--text-3); text-align: center; }

.pagination__info {
  flex-basis: 100%;
  margin-top: var(--s-1);
  color: var(--text-3);
  font-size: var(--fs-xs);
  text-align: center;
}

/* ---------- 10. Stores ---------- */
.stores {
  margin-top: calc(var(--s-8) + var(--s-4));
  padding-top: var(--s-6);
  border-top: 1px solid var(--border);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  margin-bottom: var(--s-4);
}

.section-head__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-lg);
  font-weight: 800;
  line-height: 1.35;
}

.section-head__text { color: var(--text-2); font-size: var(--fs-sm); }

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: var(--s-3);
  padding: 0;
  list-style: none;
}

.store-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color 0.15s ease;
}

.store-card__name {
  overflow: hidden;
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.store-card__meta { color: var(--text-3); font-size: var(--fs-xs); }

.store-card > .row { justify-content: space-between; margin-top: auto; padding-top: var(--s-2); }

.store-card .btn-apple-secondary { min-height: 34px; padding-inline: var(--s-3); font-size: var(--fs-xs); }

.store-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-width: 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  unicode-bidi: isolate;
}

/* ---------- 11. Comparisons ---------- */
.hub-header {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.hub-header__text { min-width: 0; }

.hub-header__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1.3;
}

.hub-header__sub { margin-top: var(--s-1); color: var(--text-2); font-size: var(--fs-sm); }

.hub-header__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.hub-tools {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.h2h-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--s-4);
}

.h2h-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  min-width: 0;
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color 0.15s ease;
}

.h2h-card h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.45;
}

.h2h-card > :last-child { margin-top: auto; }

.h2h-alert-btn { color: var(--warning); }

.view-h2h-modal-btn { flex: 1 1 auto; }

.view-single-comp-btn { flex-shrink: 0; }

.offer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: var(--s-2);
  justify-content: space-between;
  gap: var(--s-3);
  min-width: 0;
  padding: var(--s-2) var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
}

.offer-row > :first-child { flex: 1 1 180px; min-width: 0; }

.offer-row > :is(a, button):last-child { flex: 1 1 100%; }

.offer-row.is-best {
  border-color: color-mix(in srgb, var(--success) 45%, transparent);
  background: var(--success-soft);
}

.offer-row.is-best .muted { color: var(--text-2); }

.offer-row strong { font-weight: 700; }

.offer-row strong .num { font-weight: 800; }

.offer-row .stack { gap: 2px; }

.offer-row > .stack + .stack { align-items: flex-end; flex-shrink: 0; text-align: end; }

.offer-row a {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.spec-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
  gap: 6px;
}

.spec {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 6px var(--s-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.spec__label,
.spec__value { margin: 0; }

.spec__label { color: var(--text-3); font-size: var(--fs-xs); }

.spec__value { overflow-wrap: anywhere; font-size: var(--fs-sm); font-weight: 600; }

/* ---------- 12. Sheets (native <dialog>) ---------- */
.sheet {
  --sp-x: var(--s-4);
  --sp-y: var(--s-5);
  width: 100%;
  max-width: 100%;
  max-height: min(90vh, 90dvh);
  margin: auto 0 0;
  padding: 0 0 var(--safe-b);
  border: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  overscroll-behavior: contain;
}

.sheet[open] { display: flex; flex-direction: column; animation: sheetUp 0.3s var(--ease); }

.sheet::before {
  content: "";
  flex-shrink: 0;
  width: 36px;
  height: 4px;
  margin: var(--s-2) auto 0;
  border-radius: 2px;
  background: var(--border-strong);
}

.sheet::backdrop { background: var(--overlay, rgb(14 17 22 / 0.46)); animation: fadeIn 0.2s ease; }

.sheet__body {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--s-4);
  min-height: 0;
  padding: var(--sp-y) var(--sp-x);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet__header {
  position: sticky;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  margin: calc(-1 * var(--sp-y)) calc(-1 * var(--sp-x)) 0;
  padding: var(--s-4) var(--sp-x) var(--s-3);
  top: calc(-1 * var(--sp-y));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.sheet__title {
  min-width: 0;
  font-size: var(--fs-lg);
  font-weight: 800;
  line-height: 1.4;
  text-wrap: balance;
}

.sheet__body > .sheet__title { padding-inline-end: 44px; }

.sheet__close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fill);
  color: var(--text-2);
  font-size: 1.125rem;
  line-height: 1;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sheet__body > .sheet__close {
  position: absolute;
  top: var(--s-3);
  inset-inline-end: var(--s-3);
  z-index: 3;
}

.sheet__footer {
  position: sticky;
  bottom: calc(-1 * var(--sp-y));
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-2);
  margin: auto calc(-1 * var(--sp-x)) calc(-1 * var(--sp-y));
  padding: var(--s-3) var(--sp-x);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: var(--s-2);
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: var(--s-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.metric__label { color: var(--text-3); font-size: var(--fs-xs); }

.metric__value {
  font-size: var(--fs-lg);
  font-weight: 800;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.list-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.list-row__media {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--img-bg);
}

.list-row__media img {
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.list-row__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: var(--fs-sm);
}

.list-row__body :is(h3, h4, strong) {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.45;
}

.list-row__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s-2);
}

.chart {
  padding: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--accent);
}

.chart__svg {
  display: block;
  width: 100%;
  height: 180px;
  overflow: visible;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-field__label { color: var(--text-2); font-size: var(--fs-sm); font-weight: 700; }

.form-field--check { justify-content: flex-start; }

.form-field__hint { color: var(--text-3); font-size: var(--fs-xs); line-height: 1.5; }

.auth-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  padding-block: var(--s-2);
  text-align: center;
}

.auth-card img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

/* Header account button: avatar + truncated name (name hidden below 600px). */
.auth-card__name {
  display: none;
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(img, span).auth-card__avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 800;
  line-height: 1;
  object-fit: cover;
  mix-blend-mode: normal;
}

:is(img, span).auth-card__avatar--lg { width: 48px; height: 48px; font-size: var(--fs-lg); }

.list-row__media:has(> .auth-card__avatar) { background: none; border-radius: 50%; }

.auth-card__google {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 44px;
}

.alert-channel-tab {
  padding: var(--s-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.alert-channel-tab.active { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- 13. Toast, PWA sheet, back-to-top, thumb bar ---------- */
.ux-toast {
  position: fixed;
  top: calc(var(--s-3) + env(safe-area-inset-top, 0px));
  inset-inline: var(--s-4);
  z-index: var(--z-toast);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--s-3);
  max-width: 420px;
  margin-inline: auto;
  padding: var(--s-3) var(--s-4);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--toast-bg);
  color: var(--toast-text);
  box-shadow: var(--shadow-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.2s ease, transform 0.25s var(--ease), visibility 0s linear 0.25s;
}

.ux-toast.visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.ux-toast[data-tone="success"] { border-inline-start-color: var(--success); }

.ux-toast[data-tone="error"] { border-inline-start-color: var(--danger); }

.toast__title { display: block; grid-column: 1; font-weight: 800; }

.toast__msg { display: block; grid-column: 1; opacity: 0.86; }

.toast__action {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding-inline: var(--s-3);
  border: 0;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--toast-text) 14%, transparent);
  color: var(--toast-text);
  font-size: var(--fs-xs);
  font-weight: 800;
  white-space: nowrap;
}

.pwa-install-overlay {
  position: fixed;
  bottom: calc(84px + var(--safe-b));
  inset-inline: var(--s-3);
  z-index: var(--z-pwa);
  max-width: 440px;
  margin-inline: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.3s var(--ease), visibility 0s linear 0.3s;
}

.pwa-install-overlay.visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.pwa-install-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
}

.pwa-install-card__head { display: flex; align-items: flex-start; gap: var(--s-3); }

.pwa-install-card__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.pwa-install-card__heading { flex: 1; min-width: 0; }

.pwa-install-card__title { font-size: var(--fs-md); font-weight: 800; line-height: 1.4; }

.pwa-install-card__sub { color: var(--text-3); font-size: var(--fs-xs); }

.pwa-install-card__text { color: var(--text-2); font-size: var(--fs-sm); }

.pwa-ios-tip {
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: var(--accent-soft);
  font-size: var(--fs-sm);
}

.pwa-ios-tip ol { margin-top: var(--s-1); padding-inline-start: 1.25em; }

.pwa-ios-tip svg { display: inline-block; vertical-align: -3px; color: var(--accent); }

.pwa-install-card__actions { display: flex; justify-content: flex-end; gap: var(--s-2); }

.back-to-top-btn {
  position: fixed;
  bottom: calc(84px + var(--safe-b));
  inset-inline-start: var(--s-4);
  z-index: var(--z-fab);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.25s var(--ease), visibility 0s linear 0.25s;
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

/* The install card sits on the same corner; hide the button (and take it out
   of the tab order) while the card is showing. */
body:has(.pwa-install-overlay.visible) .back-to-top-btn {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mobile-thumb-bar {
  position: fixed;
  bottom: calc(12px + var(--safe-b));
  inset-inline: 0;
  z-index: var(--z-thumb);
  display: flex;
  gap: var(--s-1);
  width: max-content;
  max-width: calc(100vw - 24px);
  margin-inline: auto;
  padding: var(--s-1);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-2);
  transition: transform 0.3s var(--ease), opacity 0.2s ease;
}

.mobile-thumb-bar.hidden { opacity: 0; transform: translateY(calc(100% + 24px)); pointer-events: none; }

.thumb-bar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 76px;
  height: 52px;
  padding-inline: var(--s-3);
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.2;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.thumb-bar-btn:active { background: var(--fill); color: var(--text); }

.thumb-bar-btn__icon { position: relative; display: grid; }

.thumb-bar-badge {
  position: absolute;
  top: -6px;
  inset-inline-end: -11px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding-inline: 4px;
  border: 2px solid var(--surface);
  border-radius: var(--r-pill);
  background: var(--danger);
  color: var(--on-accent);
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 1;
}

/* ---------- 14. Utilities and shared components ---------- */
.num { unicode-bidi: isolate; font-variant-numeric: tabular-nums; }

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding-inline-start: 0;
  list-style: none;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}

.row--between { justify-content: space-between; }

.muted { color: var(--text-3); }

.small { font-size: var(--fs-xs); }

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

.btn-apple-primary,
.btn-apple-secondary,
.empty-state__action:is(a, button),
.error-state__action:is(a, button),
.error-state__retry:is(a, button),
.banner__action:is(a, button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--control-h);
  padding: 0 var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn-apple-primary,
.banner__action:is(a, button) {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
}

.btn-apple-primary:active,
.btn-apple-secondary:active,
.btn-apple-primary:active,
.btn-card-cta:active,
.btn-card-compare:active,
.apple-segment-item:active,
.sub-pill:active,
.comp-cat-btn:active,
.trending-chip:active,
.btn-wishlist:active { transform: scale(0.97); transition: transform 0.1s ease-out; }

.btn-apple-primary:disabled,
.btn-apple-secondary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.icon-btn {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.apple-input,
.apple-select {
  width: 100%;
  height: var(--control-h);
  padding-inline: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background-color: var(--surface);
  color: var(--text);
  font-size: var(--fs-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.apple-input::placeholder { color: var(--text-3); opacity: 1; }

.apple-select {
  -webkit-appearance: none;
  appearance: none;
  padding-inline-end: 36px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: left 14px center, left 19px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.apple-input:focus,
.apple-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.apple-input:disabled,
.apple-select:disabled { opacity: 0.55; cursor: not-allowed; }

.badge,
.badge-store,
.badge-green {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  height: 22px;
  padding-inline: var(--s-2);
  border-radius: var(--r-pill);
  background: var(--fill);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.badge--accent { background: var(--accent-soft); color: var(--accent); }

.badge--success,
.badge-green { background: var(--success-soft); color: var(--success); }

.badge--danger { background: var(--danger-soft); color: var(--danger); }

.badge--neutral { background: var(--fill); color: var(--text-2); }

.chip,
.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  height: 30px;
  padding-inline: var(--s-3);
  border: 0;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
}

.chip:has(.chip__remove),
.active-filter-chip:has(.chip-remove-btn) { padding-inline-end: 3px; }

.chip__remove,
.chip-remove-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 0.875rem;
  line-height: 1;
  transition: background-color 0.15s ease;
}

.banner,
.price-drop-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--r-lg);
}

.banner > svg { color: var(--accent); }

.banner__text {
  display: flex;
  flex: 1 1 220px;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.banner__text strong { color: var(--text); font-weight: 800; }

.banner__action { flex-shrink: 0; }

.empty-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  padding: calc(var(--s-8) + var(--s-2)) var(--s-4);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  text-align: center;
}

.empty-state__icon,
.error-state__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--s-1);
  border-radius: 50%;
  background: var(--fill);
  color: var(--text-3);
}

.error-state__icon { background: var(--danger-soft); color: var(--danger); }

.empty-state__title,
.error-state__title { font-size: var(--fs-md); font-weight: 800; }

.empty-state__text,
.error-state__text { max-width: 42ch; color: var(--text-2); font-size: var(--fs-sm); }

.empty-state__action,
.error-state__action,
.error-state__retry { margin-top: var(--s-2); }

/* ---------- 15. Breakpoints ---------- */
@media (min-width: 600px) {
  .auth-card__name { display: inline; }

  .hero { padding-block: var(--s-7) var(--s-6); }

  .site-footer__inner { grid-template-columns: 2fr 1fr 1fr; }

  .site-footer__brand { grid-column: auto; }

  .deals-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: var(--s-4); }

  .skeleton-card { min-height: 380px; }

  .store-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }

  .sheet {
    --sp-x: var(--s-6);
    --sp-y: var(--s-6);
    width: min(560px, calc(100% - 48px));
    margin: auto;
    padding-bottom: 0;
    border-radius: var(--r-lg);
  }

  .sheet--wide { width: min(880px, calc(100% - 48px)); }

  .sheet[open] { animation-name: sheetPop; }

  .sheet::before { display: none; }

  .sheet__header { padding-top: var(--s-5); }

  .list-row { grid-template-columns: 64px minmax(0, 1fr) auto; }

  .list-row__media { width: 64px; height: 64px; }

  .list-row__actions { grid-column: auto; }

  .offer-row > :is(a, button):last-child { flex: 0 0 auto; }

}

@media (min-width: 900px) {
  :root { --gutter: 24px; --control-h: 40px; }

  .nav-wishlist { display: inline-flex; }

  .apple-input,
  .apple-select { font-size: var(--fs-sm); }

  .hub-header { flex-direction: row; align-items: flex-end; justify-content: space-between; }

  .hub-header__actions { flex-shrink: 0; }

  .site-footer { padding-bottom: var(--s-6); }

  .mobile-thumb-bar { display: none; }

  .back-to-top-btn { bottom: calc(var(--s-6) + var(--safe-b)); inset-inline-start: var(--s-6); }

  .pwa-install-overlay {
    bottom: calc(var(--s-6) + var(--safe-b));
    inset-inline: auto var(--s-6);
    width: 400px;
  }

  /* Bottom corner opposite the install card and back-to-top button. */
  .ux-toast {
    top: auto;
    bottom: calc(var(--s-6) + var(--safe-b));
    inset-inline: var(--s-6) auto;
    width: 420px;
    margin-inline: 0;
    transform: translateY(12px);
  }

  /* Wrap the pill rows instead of hiding overflow behind an invisible scrollbar. */
  .category-scroll-container,
  .quick-sub-pills-bar,
  .comp-pills {
    flex-wrap: wrap;
    margin-inline: 0;
    padding-inline: 0;
    overflow: visible;
  }

  .apple-segmented-bar { flex: 1 1 auto; flex-wrap: wrap; min-width: 0; }
}

@media (min-width: 900px) and (hover: hover) {
  .filter-desktop-shortcut { display: block; }
}

@media (min-width: 1200px) {
  .deals-grid { grid-template-columns: repeat(4, 1fr); }

  .hero { padding-block: 48px 40px; }
}

/* Card internals follow the card's own width, not the viewport. */
@container card (min-width: 200px) {
  .card-store-sub { display: block; }

  .card-new-price { font-size: var(--fs-xl); }
}

@container card (min-width: 230px) {
  .card-body-compact { padding: var(--s-3) var(--s-4) var(--s-4); }

  .card-title-compact { font-size: var(--fs-md); }

  .card-cta-row.has-compare,
  .card-cta-row:has(> .btn-card-compare) { grid-template-columns: minmax(0, 1fr) auto; }
}

/* Hover effects only for precise pointers, so they never stick on touch. */
@media (hover: hover) and (pointer: fine) {
  .btn-apple-primary:hover,
  .banner__action:is(a, button):hover { background: var(--accent-strong); }

  .nav-icon-btn:hover { background: var(--fill); }

  .btn-apple-secondary:hover,
  .filter-more__summary:hover,
  .empty-state__action:is(a, button):hover,
  .error-state__action:is(a, button):hover,
  .error-state__retry:is(a, button):hover { border-color: var(--border-strong); background: var(--fill); }

  .apple-input:hover,
  .apple-select:hover { border-color: var(--border-strong); }

  .apple-segment-item:not(.active):hover,
  .comp-cat-btn:not(.active):hover,
  .sub-pill:not(.active):hover,
  .trending-chip:not(.active):hover { border-color: var(--border-strong); color: var(--text); }

  .master-tab-btn:hover { color: var(--text); }

  .deal-card:hover,
  .recent-card:hover { border-color: var(--border-strong); }

  .search-live__item:hover,
  .search-live__all:hover { background: var(--fill); }

  .btn-wishlist:hover { color: var(--danger); }

  .card-title-compact:hover { text-decoration: underline; text-underline-offset: 3px; }

  .btn-card-cta:hover { background: var(--text); color: var(--surface); }

  .btn-card-compare:hover,
  .pagination__btn:not([aria-current="page"]):not(:disabled):hover {
    border-color: var(--border-strong);
    background: var(--fill);
  }

  .results-bar__reset:hover,
  .clear-all-chips-btn:hover { background: var(--accent-soft); }

  .chip__remove:hover,
  .chip-remove-btn:hover { background: color-mix(in srgb, currentColor 16%, transparent); }

  .store-card:hover { border-color: var(--border-strong); }

  .store-card__link:hover,
  .offer-row a:hover { text-decoration: underline; }

  .h2h-card:hover { border-color: var(--border-strong); }

  .icon-btn:hover,
  .sheet__close:hover,
  .search-field__clear:hover { background: var(--fill-strong); color: var(--text); }

  .back-to-top-btn:hover { border-color: var(--border-strong); }

  .thumb-bar-btn:hover { background: var(--fill); }
}

/* Motion */
@keyframes heartPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

@keyframes shimmer {
  to { transform: translateX(-100%); }
}

@keyframes pulse {
  from { opacity: 1; }
  to { opacity: 0.45; }
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheetUp {
  from { transform: translateY(24%); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}

@keyframes sheetPop {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}


/* ---------- 16. Partner banner: AI & Things ---------- */
.partner {
  --brand-ink: #14005E;
  --brand-a: #6C2BFF;
  --brand-b: #7F86FF;
  --brand-c: #8DEBF3;
  position: relative;
  margin-block: var(--s-4) var(--s-3);
  border-radius: 18px;
  overflow: hidden;
  color: var(--brand-ink);
  background: linear-gradient(105deg, var(--brand-a) 0%, var(--brand-b) 45%, var(--brand-c) 100%);
  background-size: 180% 100%;
  animation: brandPan 14s ease-in-out infinite alternate, fadeUp 0.7s 0.15s var(--ease) both;
}

.partner__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
}

.partner__content { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }

.partner__logo { width: 76px; height: auto; }

/* Phones: logo, headline and actions only. */
.partner__text { display: none; }

.partner__title { font-size: var(--fs-lg); font-weight: 600; line-height: 1.35; text-wrap: balance; }

.partner__text { color: rgb(20 0 94 / 0.8); font-size: var(--fs-sm); }

.partner__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); margin-top: var(--s-1); }

.partner__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding-inline: var(--s-4);
  border-radius: var(--r-pill);
  background: var(--brand-ink);
  color: #FFFFFF;
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: transform 0.2s var(--ease), background-color 0.2s ease;
}

.partner__cta svg { transition: transform 0.25s var(--ease); }

.partner__link { color: var(--brand-ink); font-size: var(--fs-sm); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgb(20 0 94 / 0.35); }

.partner__art { display: none; }

.partner__art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  animation: floaty 7s ease-in-out infinite;
}

/* Product detail sheet */
.detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }

.detail__media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--img-bg);
  overflow: hidden;
  animation: fadeUp 0.45s var(--ease) both;
}

.detail__media img { width: 100%; height: 100%; padding: 8%; object-fit: contain; }

.detail__badge {
  position: absolute;
  top: var(--s-3);
  right: var(--s-3);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--danger);
  color: var(--on-accent);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.detail__info { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; animation: fadeUp 0.45s 0.06s var(--ease) both; }

.detail__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); color: var(--text-3); font-size: var(--fs-sm); }

.detail__store { color: var(--text); font-weight: 600; }

.detail__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

.detail__stock { margin-inline-start: auto; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; }

.detail__stock.is-in { background: var(--success-soft); color: var(--success); }

.detail__stock.is-out { background: var(--fill); color: var(--text-3); }

.detail__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-3); }

.detail__now { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }

.detail__was { color: var(--text-3); font-size: var(--fs-md); }

.detail__save,
.detail__hint { color: var(--text-2); font-size: var(--fs-sm); }

.detail__save strong { color: var(--success); font-weight: 600; }

.detail__hint strong { color: var(--text); font-weight: 600; }

.detail__facts { display: grid; margin: var(--s-1) 0 0; border-top: 1px solid var(--border); }

.detail__facts > div {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding-block: 10px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
}

.detail__facts dt { color: var(--text-3); }

.detail__facts dd { margin: 0; color: var(--text); font-weight: 500; text-align: end; }

.detail-offers { margin-top: var(--s-5); animation: fadeUp 0.45s 0.12s var(--ease) both; }

.detail-offers__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--s-2); }

.detail-offers__head h3 { font-size: var(--fs-md); font-weight: 600; }

.detail-offers__list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }

.detail-offer {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 36px;
  align-items: center;
  gap: var(--s-3);
  padding: 10px var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.detail-offer.is-current { border-color: var(--text); }

.detail-offer__rank { color: var(--text-3); text-align: center; }

.detail-offer:first-child .detail-offer__rank { color: var(--success); font-weight: 600; }

.detail-offer__store { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.detail-offer__price { font-weight: 600; }

.detail-offer__go {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text);
  transition: background-color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .detail-offer:hover { background: var(--surface-2); }

  .detail-offer__go:hover { background: var(--fill); }
}

@media (min-width: 600px) {
  .detail { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; }

  .detail__media { aspect-ratio: 1; }
}

/* Banner: rotating lines and timing dots */
.partner__rotator { display: grid; }

.partner__line {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
  pointer-events: none;
}

.partner__line.is-active { opacity: 1; transform: none; pointer-events: auto; }

.partner__dots {
  position: absolute;
  bottom: 10px;
  inset-inline-end: 50%;
  z-index: 2;
  display: flex;
  gap: 4px;
  transform: translateX(50%);
}

.partner__dots > span { width: 14px; height: 3px; border-radius: 2px; background: rgb(20 0 94 / 0.22); overflow: hidden; }

.partner__dots > span.is-active { width: 22px; background: rgb(20 0 94 / 0.22); }

.partner__dots > span.is-active::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: var(--brand-ink);
  transform-origin: right;
  animation: dotFill 4.5s linear both;
}

.partner.is-paused .partner__dots > span.is-active::after { animation-play-state: paused; }

@keyframes dotFill { from { transform: scaleX(0); } }

/* ---------- 17. Motion ---------- */
.hero__title { animation: fadeUp 0.6s var(--ease) both; }

.hero__stats { animation: fadeUp 0.6s 0.06s var(--ease) both; }

.search-field--hero { animation: fadeUp 0.6s 0.12s var(--ease) both; }

.search-field--hero .apple-input { transition: border-color 0.2s ease, box-shadow 0.25s var(--ease); }

.search-field--hero .apple-input:focus { border-color: var(--text); box-shadow: 0 0 0 4px var(--accent-ring), 0 12px 32px -18px rgb(14 14 12 / 0.35); outline: none; }

.deal-card { animation: cardIn 0.5s calc(var(--i, 0) * 35ms) var(--ease) both; }

.image-wrapper img { transition: transform 0.6s var(--ease); }

.recent-card,
.store-card { transition: border-color 0.15s ease, transform 0.2s var(--ease); }

.apple-segment-item,
.comp-cat-btn,
.sub-pill,
.trending-chip { transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease; }

.search-live__item { animation: fadeUp 0.28s calc(var(--n, 0) * 25ms) var(--ease) both; }

.nav-icon-btn svg { transition: transform 0.25s var(--ease); }

.nav-icon-btn__badge { animation: badgePop 0.35s var(--ease) both; }

@media (hover: hover) and (pointer: fine) {
  .deal-card:hover .image-wrapper img { transform: scale(1.04); }

  .nav-icon-btn:hover svg { transform: scale(1.08); }

  .partner__cta:hover { background: #22009A; }

  .partner__cta:hover svg { transform: translate(-2px, -2px); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes brandPan {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-8px) rotate(1.2deg); }
}

@keyframes badgePop {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

@media (min-width: 600px) {
  .partner__inner { grid-template-columns: auto minmax(0, 1fr) 104px; gap: var(--s-5); padding: var(--s-4) var(--s-6); }

  .partner__content { display: contents; }

  .partner__logo { grid-column: 1; grid-row: 1 / span 3; width: 96px; }

  .partner__title,
  .partner__text,
  .partner__actions { grid-column: 2; }

  .partner__text { display: block; }

  .partner__art { display: block; grid-column: 3; grid-row: 1 / span 3; }
}

@media (min-width: 900px) {
  .partner__inner { grid-template-columns: auto minmax(0, 1fr) auto 112px; column-gap: var(--s-6); padding: var(--s-4) 32px; }

  .partner__title { grid-row: 1; }

  .partner__text { grid-row: 2; }

  .partner__actions { grid-column: 3; grid-row: 1 / span 2; margin: 0; }

  .partner__art { grid-column: 4; grid-row: 1 / span 2; }
}

/* ---------- 18. Price bar ---------- */
.price-bar { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.price-bar__label {
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--fs-xs);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.price-bar__label .num { color: var(--text); font-weight: 600; }

.price-bar__track {
  position: relative;
  height: 6px;
  border-radius: var(--r-pill);
  /* Start side (right in RTL) is cheap. */
  background: linear-gradient(to left, var(--bar-cheap), var(--bar-mid) 55%, var(--bar-dear));
  opacity: 0.9;
}

.price-bar__dot {
  position: absolute;
  top: 50%;
  inset-inline-start: var(--pos);
  width: 14px;
  height: 14px;
  margin-inline-start: -7px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 1px rgb(14 14 12 / 0.12), 0 2px 6px rgb(14 14 12 / 0.25);
  transform: translateY(-50%);
  animation: dotIn 0.9s 0.15s var(--ease) both;
}

.price-bar__fill { display: none; }

/* Discount: the bar is the old price; the filled part is what you pay now. */
/* Hatched part = the amount saved; solid green = what you pay now. */
.price-bar--discount .price-bar__track {
  background: repeating-linear-gradient(135deg, rgb(34 160 107 / 0.22) 0 3px, rgb(34 160 107 / 0.07) 3px 7px);
  opacity: 1;
}

.price-bar--discount .price-bar__fill {
  display: block;
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--pos);
  border-radius: inherit;
  background: var(--bar-cheap);
  transform-origin: right;
  animation: fillIn 0.9s 0.15s var(--ease) both;
}

.price-bar__tick {
  position: absolute;
  top: 50%;
  inset-inline-start: var(--at);
  width: 2px;
  height: 12px;
  margin-inline-start: -1px;
  border-radius: 1px;
  background: rgb(14 14 12 / 0.35);
  transform: translateY(-50%);
}

.price-bar__ends {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.price-bar__ends b { color: var(--text); font-weight: 600; }

.price-bar--lg { gap: var(--s-2); padding: var(--s-3) var(--s-4) var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }

.price-bar--lg .price-bar__label { font-size: var(--fs-sm); white-space: normal; }

.price-bar--lg .price-bar__track { height: 8px; }

.price-bar--lg .price-bar__dot { width: 18px; height: 18px; margin-inline-start: -9px; }

@keyframes dotIn { from { inset-inline-start: 0; opacity: 0; } to { opacity: 1; } }

@keyframes fillIn { from { width: 0; } }

/* ---------- 19. Colour: categories, hero wash, accents ---------- */
[data-cat="all"] { --cat: var(--c-all); }
[data-cat="mobiles"] { --cat: var(--c-mobiles); }
[data-cat="pc"] { --cat: var(--c-pc); }
[data-cat="appliances"] { --cat: var(--c-appliances); }
[data-cat="xbox"] { --cat: var(--c-xbox); }
[data-cat="audio"] { --cat: var(--c-audio); }
[data-cat="beauty"] { --cat: var(--c-beauty); }

.apple-segment-item[data-cat]::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat);
  transition: background-color 0.2s ease, transform 0.25s var(--ease);
}

.apple-segment-item[data-cat].active {
  border-color: var(--cat);
  background: var(--cat);
  color: #FFFFFF;
}

.apple-segment-item[data-cat].active::before { background: #FFFFFF; transform: scale(0.75); }

.deal-card[data-cat] .card-store-sub:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-end: 6px;
  border-radius: 50%;
  background: var(--cat, var(--text-3));
  vertical-align: 0.1em;
}

/* No overflow clipping here: the search dropdown must float over the banner below. */
.hero {
  position: relative;
  z-index: 20;
  background:
    radial-gradient(55% 90% at 88% 0%, rgb(42 85 229 / 0.10), transparent 70%),
    radial-gradient(45% 80% at 8% 100%, rgb(224 102 26 / 0.08), transparent 70%),
    radial-gradient(40% 60% at 50% 120%, rgb(139 63 217 / 0.06), transparent 70%),
    var(--surface);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(14 14 12 / 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(14 14 12 / 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(70% 80% at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(70% 80% at 50% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}

.hero__inner { position: relative; }

.master-tab-btn::after { background: var(--brand); }

.master-tab-btn.active .master-tab-badge { color: var(--brand); }

.recent-strip__title::before,
.section-head__title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 0.9em;
  margin-inline-end: 8px;
  border-radius: 2px;
  background: var(--brand);
  vertical-align: -0.1em;
}

.search-field--hero .apple-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgb(42 85 229 / 0.14), 0 12px 32px -18px rgb(42 85 229 / 0.45); }

.badge-clean-lowest { background: var(--bar-cheap); color: #FFFFFF; }

.detail__stock.is-in { background: rgb(34 160 107 / 0.12); color: #13744C; }

@media (hover: hover) and (pointer: fine) {
  .apple-segment-item[data-cat]:not(.active):hover { border-color: var(--cat); color: var(--cat); }

  .apple-segment-item[data-cat]:not(.active):hover::before { transform: scale(1.25); }

  .deal-card:hover { border-color: color-mix(in srgb, var(--cat, var(--text)) 35%, var(--border)); }
}

/* ---------- 20. Price alert sheet ---------- */
.alert-sheet { display: flex; flex-direction: column; gap: var(--s-4); }

.alert-product {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.alert-product img { width: 56px; height: 56px; padding: 4px; border-radius: var(--r-sm); background: var(--img-bg); object-fit: contain; }

.alert-product__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); font-size: var(--fs-sm); font-weight: 500; line-height: 1.5; }

.alert-product__meta { margin-top: 2px; color: var(--text-3); font-size: var(--fs-xs); }

.alert-product__meta .num { color: var(--text); font-weight: 600; }

.alert-target { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); padding: var(--s-4) var(--s-3); border-radius: var(--r-lg); background: linear-gradient(180deg, var(--brand-soft), transparent); }

.alert-target__label { color: var(--text-2); font-size: var(--fs-sm); }

.alert-target__field { display: flex; align-items: center; gap: var(--s-3); }

.alert-target__input {
  width: 9.5ch;
  padding: 0;
  border: 0;
  border-bottom: 2px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.25rem);
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.02em;
  transition: border-color 0.2s ease;
}

.alert-target__input:focus { border-color: var(--brand); outline: none; }

.alert-target__input[aria-invalid="true"] { border-color: var(--danger); }

.alert-step {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.alert-step:active { transform: scale(0.92); }

.alert-target__delta { min-height: 1.5em; color: var(--text-2); font-size: var(--fs-sm); text-align: center; }

.alert-target__delta[data-tone="ok"] { color: #13744C; }

.alert-target__delta[data-tone="met"] { color: var(--brand); }

.alert-target__delta[data-tone="error"] { color: var(--danger); }

.alert-presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

.alert-preset {
  height: 32px;
  padding-inline: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  direction: ltr;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.alert-preset:active { transform: scale(0.95); }

.alert-preset.active { border-color: var(--brand); background: var(--brand); color: #FFFFFF; }

/* Where the target sits against today's price (end of the bar). */
.alert-meter {
  --target: 90%;
  position: relative;
  width: min(100%, 320px);
  height: 8px;
  margin-top: var(--s-2);
  border-radius: var(--r-pill);
  background: repeating-linear-gradient(135deg, rgb(42 85 229 / 0.16) 0 3px, rgb(42 85 229 / 0.05) 3px 7px);
}

.alert-meter__target {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--target);
  border-radius: inherit;
  background: linear-gradient(to left, var(--bar-cheap), var(--brand));
  transition: width 0.35s var(--ease);
}

.alert-meter__now {
  position: absolute;
  top: 50%;
  inset-inline-end: -2px;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--text);
  transform: translateY(-50%);
}

.alert-channels { display: flex; flex-direction: column; gap: var(--s-2); }

.alert-channel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.alert-channel--tg { display: block; padding: 0; }

.alert-channel--tg > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  list-style: none;
  cursor: pointer;
}

.alert-channel--tg > summary::-webkit-details-marker { display: none; }

.alert-channel--tg > summary::after { content: "⌄"; color: var(--text-3); transition: transform 0.2s ease; }

.alert-channel--tg[open] > summary::after { transform: rotate(180deg); }

.alert-tg { display: flex; flex-direction: column; gap: var(--s-2); padding: 0 var(--s-3) var(--s-3); }

.alert-tg .row { display: flex; gap: var(--s-2); }

.alert-tg .apple-input { flex: 1; min-width: 0; }

.alert-channel__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--fill); color: var(--text); }

.alert-channel--tg .alert-channel__icon { background: #E8F4FC; color: #229ED9; }

.alert-channel__body { display: flex; flex-direction: column; min-width: 0; font-size: var(--fs-xs); color: var(--text-3); }

.alert-channel__body b { color: var(--text); font-size: var(--fs-sm); font-weight: 600; }

.alert-channel[data-tone="on"] .alert-channel__icon { background: rgb(34 160 107 / 0.12); color: #13744C; }

.alert-channel[data-tone="on"] #pushStatusLabel { color: #13744C; }

.alert-channel[data-tone="idle"] .alert-channel__icon { animation: ring 2.4s ease-in-out infinite; }

.alert-list { border-top: 1px solid var(--border); padding-top: var(--s-3); font-size: var(--fs-sm); }

.alert-list > summary { color: var(--text-2); cursor: pointer; }

.alert-list ul { display: grid; gap: 6px; margin: var(--s-3) 0 0; padding: 0; list-style: none; }

.alert-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; align-items: center; gap: var(--s-2); }

.alert-list__title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); }

.alert-list__target { color: var(--text-2); font-weight: 600; }

.alert-list__remove { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); }

.results-bar__fix {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@keyframes ring {
  0%, 70%, 100% { transform: rotate(0); }
  75% { transform: rotate(-12deg); }
  85% { transform: rotate(10deg); }
  92% { transform: rotate(-5deg); }
}

/* ---------- 21. Phones: every width from 320px up, portrait and landscape ---------- */
:root { --gutter: clamp(12px, 4vw, 24px); }

.container { padding-inline: max(var(--gutter), env(safe-area-inset-left), env(safe-area-inset-right)); }

/* iOS zooms into any field under 16px: keep every text field at 16px on touch screens. */
@media (pointer: coarse) {
  .apple-input,
  .apple-select,
  .search-field .apple-input,
  .range-pair .apple-input,
  .alert-tg .apple-input { font-size: 16px; }
}

@media (max-width: 599px) {
  .hero { padding-block: var(--s-5) var(--s-4); }

  .hero__title { font-size: clamp(1.55rem, 1.1rem + 3.6vw, 2rem); }

  .hero__stats { margin-top: var(--s-2); gap: var(--s-4); }

  .search-field--hero { margin-top: var(--s-4); }

  .search-field--hero .apple-input { height: 52px; padding-inline: 46px; }

  .search-field--hero .search-field__icon { inset-inline-start: 16px; }

  .search-suggestions { max-height: min(62dvh, 520px); }

  .master-tab-bar { justify-content: stretch; gap: 0; }

  .master-tab-btn { flex: 1; justify-content: center; height: 46px; font-size: var(--fs-sm); }

  .deals-grid { gap: 10px; }

  .card-body-compact { gap: 6px; padding: 10px 10px 12px; }

  .card-title-compact { font-size: 0.8125rem; }

  .card-new-price { font-size: var(--fs-md); }

  .btn-card-cta,
  .btn-card-compare { height: 36px; font-size: 0.8125rem; }

  .btn-wishlist { width: 34px; height: 34px; }

  .sheet { max-height: 92dvh; }

  .detail { gap: var(--s-3); }

  .detail__media { aspect-ratio: 16 / 10; max-height: 34dvh; }

  .detail__now { font-size: 1.75rem; }

  .detail-offer { grid-template-columns: 24px minmax(0, 1fr) auto 32px; gap: var(--s-2); padding: 8px 10px; }

  .sheet__footer > .btn-apple-primary { flex: 1 1 100%; order: -1; }

  .sheet__footer > .btn-apple-secondary:not(.sheet__icon-btn) { flex: 1; }

  .recent-card { width: 120px; }

  .site-footer__stats dd { font-size: var(--fs-lg); }

  .site-footer__radar { width: 260px; top: -40px; inset-inline-end: -90px; }
}

/* Small phones (iPhone SE 1st gen, older Androids). */
@media (max-width: 359px) {
  .brand-word span { display: none; }

  .hero__stats { font-size: var(--fs-xs); }

  .filter-toolbar__sort .apple-select { min-width: 92px; padding-inline: 10px 28px; }

  :root { --summary-w: 88px; }

  .card-store-sub { display: none; }

  .results-bar__word { display: none; }

  .price-bar__label { font-size: 0.6875rem; }

  .partner__actions { gap: var(--s-3); }

  .partner__link:last-child { display: none; }

  .mobile-thumb-bar .thumb-bar-btn { min-width: 64px; }
}

/* Large phones get roomier cards. */
@media (min-width: 400px) and (max-width: 599px) {
  .deals-grid { gap: 12px; }

  .card-title-compact { font-size: var(--fs-sm); }
}

/* Phones held sideways: short screens, so trim vertical chrome. */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --header-h: 52px; }

  .hero { padding-block: var(--s-3); }

  .hero__title { font-size: 1.5rem; }

  .hero__stats { display: none; }

  .search-field--hero { margin-top: var(--s-3); }

  .search-field--hero .apple-input { height: 46px; }

  .partner__art { display: none; }

  .deals-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

  .mobile-thumb-bar { bottom: calc(6px + var(--safe-b)); }

  .thumb-bar-btn { min-height: 44px; }

  .sheet { max-height: 96dvh; }

  .detail { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }

  .detail__media { aspect-ratio: 1; max-height: 60dvh; }
}

/* ---------- 22. Infinite scroll and lazy images ---------- */
.load-more { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); padding-block: var(--s-6) var(--s-4); }

.load-more__info { color: var(--text-3); font-size: var(--fs-sm); }

.load-more__info .num { color: var(--text); font-weight: 600; }

.load-more__track { width: min(240px, 60%); height: 4px; overflow: hidden; border-radius: var(--r-pill); background: var(--fill); }

.load-more__track > span { display: block; width: var(--p); height: 100%; border-radius: inherit; background: linear-gradient(to left, var(--brand), var(--c-xbox)); transition: width 0.5s var(--ease); }

.load-more__btn {
  height: 44px;
  padding-inline: var(--s-6);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.load-more__btn:active { transform: scale(0.97); }

.load-more__end { color: var(--text-3); font-size: var(--fs-xs); }

/* Photos fade in when decoded; until then the frame shimmers. */
.image-wrapper img,
.recent-card img,
.detail__media img,
.h2h-card img { opacity: 0; transition: opacity 0.45s var(--ease), transform 0.6s var(--ease); }

.image-wrapper img.is-loaded,
.recent-card img.is-loaded,
.detail__media img.is-loaded,
.h2h-card img.is-loaded { opacity: 1; }

.image-wrapper:has(img:not(.is-loaded))::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(14 14 12 / 0.05), transparent);
  background-size: 200% 100%;
  animation: shimmerPan 1.2s ease-in-out infinite;
}

@keyframes shimmerPan { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Long lists: let the browser skip layout for cards far off screen. */
.deals-grid > .deal-card { content-visibility: auto; contain-intrinsic-size: auto 420px; }

@media (hover: hover) and (pointer: fine) {
  .load-more__btn:hover { border-color: var(--text); background: var(--fill); }
}

/* ---------- 23. Store comparison page ---------- */
.hub-hero {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-4);
  padding: var(--s-5);
  overflow: hidden;
  border-radius: 18px;
  color: #F4F1FF;
  background:
    radial-gradient(70% 140% at 100% 0%, rgb(123 60 255 / 0.55), transparent 60%),
    radial-gradient(60% 120% at 0% 100%, rgb(141 235 243 / 0.28), transparent 60%),
    #0D0238;
  animation: fadeUp 0.5s var(--ease) both;
}

.hub-hero::after {
  content: "";
  position: absolute;
  top: -70px;
  inset-inline-start: -70px;
  width: 220px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgb(141 235 243 / 0.28), transparent 25%);
  animation: sweep 7s linear infinite;
  pointer-events: none;
}

.hub-hero__text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: var(--s-3); }

.hub-hero__title { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); font-weight: 600; letter-spacing: -0.01em; }

.hub-stats { display: flex; flex-wrap: wrap; gap: var(--s-5); margin: 0; }

.hub-stats > div { display: flex; flex-direction: column-reverse; }

.hub-stats dt { color: rgb(244 241 255 / 0.65); font-size: var(--fs-xs); }

.hub-stats dd {
  margin: 0;
  background: linear-gradient(90deg, #8DEBF3, #C9B6FF);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.2;
}

.hub-stats dd.is-loading:empty { min-width: 3em; background: rgb(244 241 255 / 0.15); }

.hub-hero__actions { position: relative; z-index: 1; display: flex; gap: var(--s-2); }

.hub-hero__actions .btn-apple-secondary { border-color: rgb(244 241 255 / 0.25); background: rgb(244 241 255 / 0.1); color: #F4F1FF; }

.hub-tools { display: flex; flex-direction: column; gap: var(--s-3); margin-bottom: var(--s-3); }

.hub-tools__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); }

.hub-tools__row .comp-pills { flex: 1 1 320px; min-width: 0; }

.hub-tools__selects { display: flex; gap: var(--s-2); }

.hub-select { position: relative; display: inline-flex; align-items: center; }

.hub-select > svg { position: absolute; inset-inline-start: 12px; color: var(--text-3); pointer-events: none; }

.hub-select .apple-select { width: auto; min-width: 140px; padding-inline-start: 34px; border-radius: var(--r-pill); }

.comp-cat-btn[data-cat]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cat, var(--text)); }

.comp-cat-btn[data-cat].active { border-color: var(--cat, var(--text)); background: var(--cat, var(--text)); color: #FFFFFF; }

.comp-cat-btn[data-cat].active::before { background: #FFFFFF; }

.hub-count { min-height: 1.4em; margin-bottom: var(--s-2); color: var(--text-3); font-size: var(--fs-sm); }

.h2h-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--s-4); }

.cmp-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  cursor: pointer;
  animation: cardIn 0.5s calc(var(--i, 0) * 40ms) var(--ease) both;
  transition: border-color 0.2s ease, box-shadow 0.25s var(--ease);
}

.cmp-card__top { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: var(--s-3); }

.cmp-card__media { display: grid; place-items: center; width: 76px; height: 76px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--img-bg); overflow: hidden; }

.cmp-card__media img { width: 100%; height: 100%; padding: 8px; object-fit: contain; transition: opacity 0.45s var(--ease), transform 0.6s var(--ease); }

.cmp-card__head { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.cmp-card__chips { display: flex; flex-wrap: wrap; gap: 6px; }

.cmp-chip { padding: 1px 8px; border-radius: var(--r-pill); background: var(--fill); color: var(--text-2); font-size: var(--fs-xs); font-weight: 500; }

.cmp-chip--stores { background: color-mix(in srgb, var(--cat, var(--brand)) 12%, white); color: var(--cat, var(--brand)); }

.cmp-card__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-md); font-weight: 600; line-height: 1.45; }

.cmp-card__save { display: flex; align-items: baseline; gap: 6px; color: var(--text-2); font-size: var(--fs-sm); }

.cmp-card__save strong { color: #13744C; font-size: var(--fs-lg); font-weight: 600; }

.cmp-card__save > span { padding: 0 6px; border-radius: var(--r-pill); background: rgb(34 160 107 / 0.12); color: #13744C; font-size: var(--fs-xs); font-weight: 600; }

.cmp-card__save--flat { color: var(--text-3); }

.cmp-card__offers { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }

.cmp-offer {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--s-2);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: var(--fs-sm);
}

.cmp-offer.is-best { background: rgb(34 160 107 / 0.09); }

.cmp-offer__rank { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); color: var(--text-3); font-size: var(--fs-xs); }

.cmp-offer.is-best .cmp-offer__rank { background: var(--bar-cheap); color: #FFFFFF; }

.cmp-offer__store { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); }

.cmp-offer__price { font-weight: 600; }

.cmp-offer__delta { min-width: 4.5em; color: var(--text-3); font-size: var(--fs-xs); text-align: end; }

.cmp-offer.is-best .cmp-offer__delta { color: #13744C; font-weight: 600; }

.cmp-card__more { color: var(--text-3); font-size: var(--fs-xs); }

.cmp-card__actions { display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px; gap: var(--s-2); margin-top: auto; }

.cmp-card__actions > * { justify-content: center; min-height: 42px; padding-inline: 0; border-radius: var(--r-pill); }

.cmp-card__actions .btn-apple-primary { padding-inline: var(--s-4); }

/* Comparison sheet */
.cmp-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); margin-bottom: var(--s-5); }

.cmp-hero__media { display: grid; place-items: center; aspect-ratio: 16 / 10; max-height: 30dvh; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--img-bg); overflow: hidden; }

.cmp-hero__media img { width: 100%; height: 100%; padding: 6%; object-fit: contain; }

.cmp-hero__body { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }

.cmp-hero__price { display: flex; flex-direction: column; gap: 2px; }

.cmp-hero__label { color: var(--text-3); font-size: var(--fs-sm); }

.cmp-hero__value { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }

.cmp-hero__store { color: var(--text-2); font-size: var(--fs-sm); }

.cmp-hero__save {
  display: inline-flex;
  align-self: flex-start;
  align-items: baseline;
  gap: 6px;
  margin-block: var(--s-1) var(--s-2);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: rgb(34 160 107 / 0.1);
  color: #13744C;
  font-size: var(--fs-sm);
}

.cmp-hero__save strong { font-size: var(--fs-md); font-weight: 600; }

.cmp-offers__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }

.cmp-offers__head h3 { font-size: var(--fs-md); font-weight: 600; }

.cmp-rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }

.cmp-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  grid-template-areas: "rank info total" "rank actions actions";
  align-items: center;
  gap: 6px var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  animation: fadeUp 0.4s calc(var(--i, 0) * 40ms) var(--ease) both;
}

.cmp-row.is-best { border-color: var(--bar-cheap); background: rgb(34 160 107 / 0.05); }

.cmp-row__rank { grid-area: rank; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--fill); color: var(--text-2); font-weight: 600; }

.cmp-row.is-best .cmp-row__rank { background: var(--bar-cheap); color: #FFFFFF; }

.cmp-row__info { grid-area: info; display: flex; flex-direction: column; min-width: 0; }

.cmp-row__store { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--fs-sm); font-weight: 600; }

.cmp-row__meta { color: var(--text-3); font-size: var(--fs-xs); }

.cmp-row__total { grid-area: total; display: flex; flex-direction: column; align-items: flex-end; }

.cmp-row__total strong { font-size: var(--fs-md); font-weight: 600; }

.cmp-row__delta { color: var(--text-3); font-size: var(--fs-xs); }

.cmp-row.is-best .cmp-row__delta { color: #13744C; font-weight: 600; }

.cmp-row__actions { grid-area: actions; display: flex; justify-content: flex-end; gap: var(--s-2); }

.cmp-row__actions > a { min-height: 36px; padding-inline: var(--s-4); border-radius: var(--r-pill); font-size: var(--fs-sm); }

.cmp-row__details { padding: 0 var(--s-2); border: 0; background: none; color: var(--brand); font-size: var(--fs-sm); font-weight: 500; }

.cmp-specs { margin-top: var(--s-5); }

.cmp-specs h3 { margin-bottom: var(--s-3); font-size: var(--fs-md); font-weight: 600; }

@media (min-width: 600px) {
  .hub-hero { padding: var(--s-6) 28px; }

  .cmp-hero { grid-template-columns: 200px minmax(0, 1fr); align-items: start; }

  .cmp-hero__media { aspect-ratio: 1; max-height: none; }

  .cmp-row { grid-template-columns: 30px minmax(0, 1fr) auto auto; grid-template-areas: "rank info total actions"; }
}

@media (max-width: 599px) {
  .hub-hero__actions { width: 100%; }

  .hub-hero__actions .btn-apple-secondary { flex: 1; justify-content: center; }

  .hub-tools__selects { width: 100%; }

  .hub-tools__selects .hub-select { flex: 1; }

  .hub-select .apple-select { width: 100%; min-width: 0; }
}

@media (hover: hover) and (pointer: fine) {
  .cmp-card:hover { border-color: color-mix(in srgb, var(--cat, var(--brand)) 40%, var(--border)); box-shadow: 0 18px 40px -24px rgb(14 14 12 / 0.28); }

  .cmp-card:hover .cmp-card__media img { transform: scale(1.06); }

  .cmp-row:not(.is-best):hover { border-color: var(--border-strong); }

  .cmp-row__details:hover { text-decoration: underline; }
}

/* ---------- 24. Deal rail, freshness, similar products ---------- */
.deal-rail { margin-bottom: var(--s-5); }

.recent-strip__title.deal-rail__title::before { background: var(--danger); }

.deal-rail__card { position: relative; width: 150px; animation: fadeUp 0.45s calc(var(--i, 0) * 40ms) var(--ease) both; }

.deal-rail__badge {
  position: absolute;
  top: 12px;
  right: 12px; /* physical on purpose: the badge carries dir="ltr" */
  z-index: 1;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--danger);
  color: #FFFFFF;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.deal-rail__save { color: #13744C; font-size: var(--fs-xs); }

.deal-rail__save b { font-weight: 600; }

.hero__fresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
}

.hero__fresh::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bar-cheap);
  box-shadow: 0 0 0 0 rgb(34 160 107 / 0.5);
  animation: livePulse 2.2s ease-out infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgb(34 160 107 / 0.45); }
  70% { box-shadow: 0 0 0 7px rgb(34 160 107 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(34 160 107 / 0); }
}

.detail-similar { margin-top: var(--s-5); }

.detail-similar h3 { margin-bottom: var(--s-3); font-size: var(--fs-md); font-weight: 600; }

.detail-similar .recent-strip__list { margin: 0 calc(-1 * var(--sp-x, var(--s-4))); padding-inline: var(--sp-x, var(--s-4)); }

.detail-similar .recent-card { width: 128px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Translucent chrome falls back to solid when the user asks for less transparency */
@media (prefers-reduced-transparency: reduce) {
  .apple-nav,
  .mobile-thumb-bar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Footer legal links and plain-text dialogs */
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.prose { display: grid; gap: var(--s-3); color: var(--text-2); font-size: var(--fs-sm); line-height: 1.8; }

/* Never use the loader or the section after it as the scroll anchor: new cards must push
   them down, otherwise the loader stays in view and batches load without end. */
#paginationControls,
#storesDirectory { overflow-anchor: none; }
