/* ==========================================================================
   سنابل الخير — نظام التصميم
   الفكرة: "ليبل الرف". السعر بيظهر زي ما بيظهر على رف الهايبر ماركت:
   شريط أخضر فوق، السعر كبير، وفي العروض الليبل أصفر والسعر أحمر.
   كل الألوان والمقاسات في المتغيرات اللي تحت — غيّرها من هنا بس.
   ========================================================================== */

:root {
  --ink: #0f2a1d;
  --green: #16603a;
  --green-2: #1f7f4b;
  --green-deep: #0b3d25;
  --green-soft: #e6f2ea;
  --gold: #c79a1e;
  --gold-soft: #fff1bf;
  --red: #d32f2f;
  --red-soft: #fde7e5;
  --bg: #f2f5f3;
  --card: #ffffff;
  --line: #dce4df;
  --muted: #5b6f63;
  --shadow-s: 0 1px 2px rgba(15, 42, 29, 0.08);
  --shadow-m: 0 8px 24px rgba(15, 42, 29, 0.12);
  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --header-h: 112px;
  --gutter: 16px;
  --font: "Tajawal", system-ui, "Segoe UI", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
a { color: var(--green); }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.skip-link { position: fixed; top: -60px; inset-inline-start: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--r-s); }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ---------- أزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--r-m);
  border: 2px solid transparent; font-weight: 700; text-decoration: none;
  transition: transform 0.12s, background 0.15s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-deep); }
.btn-primary:hover { background: var(--green-2); }
.btn-primary:disabled { background: #8aa595; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--green); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green); }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: 0 4px 0 #8c6a0d; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 0.9rem; border-radius: 10px; }
.btn-block { display: flex; width: 100%; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none;
  border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.text-btn { background: none; border: 0; color: var(--green); font-weight: 700; padding: 8px 4px; text-decoration: underline; text-underline-offset: 3px; }
.text-btn.danger { color: var(--red); }

/* ---------- شريط تنبيه ---------- */
.notice-bar, .demo-bar {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  padding: 8px var(--gutter); font-size: 0.9rem; font-weight: 500;
  background: var(--gold-soft); color: #5a4300; text-align: center;
}
.notice-bar .icon { width: 1.1em; }
.demo-bar { background: var(--ink); color: var(--gold-soft); }

/* ---------- الهيدر ---------- */
.app-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--green-deep); color: #fff;
  box-shadow: 0 2px 0 var(--gold);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 10px 6px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { width: 44px; height: 44px; border-radius: 10px; background: #fff; padding: 2px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 1.15rem; font-weight: 800; }
.brand-text small { font-size: 0.75rem; color: var(--gold-soft); opacity: 0.9; }
.branch-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.3); color: #fff; font-weight: 700; font-size: 0.9rem;
}
.chip-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff8a80; }
.chip-dot.is-open { background: #7dff9a; }
.chip-state { font-weight: 400; opacity: 0.85; font-size: 0.8rem; }
.chip-chevron { width: 1em; height: 1em; }
.header-search { padding-bottom: 10px; }
.search-wrap { position: relative; }
.search-input {
  width: 100%; min-height: 46px; padding: 0 44px 0 44px; border-radius: 999px;
  border: 2px solid transparent; background: #fff; color: var(--ink);
}
.search-input:focus { outline: none; border-color: var(--gold); }
.search-icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; }
.search-clear { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.search-suggest {
  position: absolute; inset-inline: 0; top: calc(100% + 6px); background: #fff; color: var(--ink);
  border-radius: var(--r-m); box-shadow: var(--shadow-m); overflow: hidden; z-index: 40;
}
.suggest-item { display: flex; width: 100%; justify-content: space-between; gap: 12px; padding: 12px 16px; background: #fff; border: 0; border-bottom: 1px solid var(--line); text-align: start; }
.suggest-item:hover { background: var(--green-soft); }
.suggest-item small { color: var(--muted); }

/* شريط الأقسام الملزّق: بيظهر لما تعدّي صور الأقسام */
.cat-strip {
  position: sticky; top: var(--header-h); z-index: 25; background: #fff; border-bottom: 1px solid var(--line);
  transform: translateY(-110%); opacity: 0; pointer-events: none; height: 0; overflow: hidden;
  transition: transform 0.2s, opacity 0.2s;
}
.cat-strip.is-shown { transform: none; opacity: 1; pointer-events: auto; height: auto; overflow: visible; }
.cat-strip-inner { display: flex; gap: 8px; overflow-x: auto; padding: 8px var(--gutter); scrollbar-width: none; }
.cat-strip-inner::-webkit-scrollbar { display: none; }
.strip-chip { flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 500; white-space: nowrap; }
.strip-chip.is-active { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }

/* ---------- الهيرو ---------- */
.hero-wrap { padding-top: 16px; }
.hero { border-radius: var(--r-l); overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-s); }
.hero-bg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 7; object-fit: cover; background: var(--green-soft); }
.hero-body { padding: 14px 16px 16px; display: grid; gap: 6px; align-content: center; }
.hero h1 { font-size: 1.45rem; font-weight: 800; line-height: 1.25; }
.hero-meta { display: grid; gap: 4px; font-size: 0.92rem; color: var(--muted); }
.hero-meta span { display: flex; align-items: flex-start; gap: 8px; }
.hero-meta .icon { color: var(--green); margin-top: 4px; }
.hero .footer-state.is-open { color: var(--green); font-weight: 700; }
.hero-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.hero-actions .btn { min-height: 44px; }
.hero-rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin-top: 14px; scrollbar-width: none; }
.hero-rail::-webkit-scrollbar { display: none; }
.hero-slide { flex: 0 0 100%; scroll-snap-align: center; border-radius: var(--r-l); overflow: hidden; display: block; background: var(--green-soft); }
.hero-slide img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }

/* ---------- العناوين ---------- */
.section { padding-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title { font-size: 1.35rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 6px; height: 1.1em; border-radius: 3px; background: var(--gold); }
.section-hint { font-size: 0.85rem; color: var(--muted); }
.head-action { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--green); font-weight: 700; font-size: 0.85rem; }

/* ---------- الأقسام بالصور ---------- */
.cat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; padding-top: 28px; }
.cat-tile {
  position: relative; display: grid; justify-items: center; align-content: end; gap: 4px;
  min-height: 118px; padding: 0 6px 10px; border: 2px solid transparent; border-radius: var(--r-m);
  background: var(--tint, var(--green-soft)); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.9rem; text-align: center;
  transition: transform 0.15s, border-color 0.15s;
}
.cat-tile img { width: 84px; height: 84px; object-fit: contain; margin-top: -28px; filter: drop-shadow(0 6px 6px rgba(15, 42, 29, 0.2)); }
.cat-tile:hover { transform: translateY(-3px); }
.cat-tile.is-active { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.cat-tile--all { --tint: var(--green); color: #fff; }
.cat-tile--all .cat-all-mark { display: grid; place-items: center; width: 64px; height: 64px; margin-top: -10px; font-size: 1.7rem; }
.cat-tile--deals { --tint: var(--gold-soft); }
.cat-tile--deals img { width: 58px; height: 64px; margin-top: -18px; }
[data-tone="produce"] { --tint: #e1f2d6; } [data-tone="snacks"] { --tint: #fde5c4; } [data-tone="deli"] { --tint: #f8d6d2; }
[data-tone="frozen"] { --tint: #d6eaf6; } [data-tone="spices"] { --tint: #f1dfc9; } [data-tone="cheese"] { --tint: #fff0c2; }
[data-tone="grocery"] { --tint: #f3e5c0; } [data-tone="dairy"] { --tint: #dbe8f7; } [data-tone="coffee"] { --tint: #ebd8ca; }
[data-tone="bakery"] { --tint: #f7e3bd; } [data-tone="meat"] { --tint: #f8d5cf; } [data-tone="cleaning"] { --tint: #d3edf1; } [data-tone="drinks"] { --tint: #dbeaf9; }

/* ---------- القوايم الأفقية ---------- */
.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 12px; scrollbar-width: thin; }
.rail > * { scroll-snap-align: start; }
.rail-item { flex: 0 0 168px; }
.offer-card { flex: 0 0 min(62vw, 250px); display: block; border-radius: var(--r-m); overflow: hidden; box-shadow: var(--shadow-s); background: #fff; }
.offer-card img { width: 100%; height: auto; aspect-ratio: 1122 / 1402; object-fit: cover; }

/* ---------- كارت المنتج ---------- */
.products-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.product-card {
  position: relative; display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; transition: box-shadow 0.15s;
}
.product-card:hover { box-shadow: var(--shadow-m); }
.product-card.is-flash { animation: flash 1.4s; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 4px var(--gold); } 100% { box-shadow: none; } }
.product-media { position: relative; aspect-ratio: 1 / 1; background: var(--tint, #f6f8f6); }
.media-open { display: grid; place-items: center; width: 100%; height: 100%; padding: 0; border: 0; background: none; }
.media-open img { width: 100%; height: 100%; object-fit: cover; }
.product-media.is-category .media-open img { object-fit: contain; padding: 14%; filter: drop-shadow(0 6px 6px rgba(15, 42, 29, 0.18)); }
.product-badges { position: absolute; top: 8px; inset-inline-start: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; pointer-events: none; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 0.75rem; font-weight: 800; line-height: 1.5; }
.badge-offer { background: var(--red); color: #fff; }
.badge-new { background: var(--green); color: #fff; }
.badge-top { background: var(--gold); color: var(--ink); }
.badge-countdown { background: #fff; color: var(--red); border: 1px solid var(--red); }
.fav-btn { position: absolute; top: 6px; inset-inline-end: 6px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.92); display: grid; place-items: center; color: #8a9a90; box-shadow: var(--shadow-s); }
.fav-btn.is-fav { color: var(--red); }
.fav-btn.is-fav .icon { fill: currentColor; }
.soldout-overlay { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.7); display: grid; place-items: center; pointer-events: none; }
.soldout-overlay span { background: var(--ink); color: #fff; padding: 4px 14px; border-radius: 6px; font-weight: 800; }
.product-info { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 12px; flex: 1; }
.product-name-btn { background: none; border: 0; padding: 0; text-align: start; }
.product-name { font-size: 0.98rem; font-weight: 700; line-height: 1.35; min-height: 2.7em; }
.product-unit { font-size: 0.8rem; color: var(--muted); }
.product-note { font-size: 0.75rem; color: var(--muted); }
.product-actions { margin-top: auto; }
.card-action { width: 100%; }
.soldout-chip { display: inline-block; padding: 8px 14px; border-radius: 10px; background: #eceeed; color: var(--muted); font-weight: 700; }

/* ليبل الرف — العنصر المميز */
.shelf {
  position: relative; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px;
  padding: 8px 10px 6px; background: #fff; border: 1px solid var(--line);
  border-top: 5px solid var(--green); border-radius: 0 0 8px 8px;
}
.shelf .price { font-size: 1.45rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.shelf .price small { font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.shelf .old-price { font-size: 0.85rem; color: var(--muted); text-decoration: line-through; }
.shelf .price--ask { font-size: 0.95rem; font-weight: 700; color: var(--muted); }
.shelf.is-offer { background: var(--gold-soft); border-color: #e6c75a; border-top-color: var(--red); }
.shelf.is-offer .price { color: var(--red); }
.shelf.is-offer::after { content: ""; position: absolute; top: -5px; inset-inline-end: 10px; width: 14px; height: 5px; background: var(--gold); }

.qty-control { display: inline-flex; align-items: center; justify-content: space-between; width: 100%; min-height: 40px; border-radius: 10px; background: var(--green); color: #fff; overflow: hidden; }
.qty-control-sm { width: auto; gap: 2px; min-height: 36px; background: var(--green-soft); color: var(--green); }
.qty-btn { width: 44px; min-height: 40px; border: 0; background: transparent; color: inherit; font-size: 1.4rem; font-weight: 700; }
.qty-val { min-width: 28px; text-align: center; font-weight: 800; }

.controls-bar { padding-top: 22px; }
.filter-row { position: relative; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; align-items: center; scrollbar-width: none; }
.filter-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 0.9rem; font-weight: 500; }
.filter-chip:has(input:checked) { background: var(--green-soft); border-color: var(--green); font-weight: 700; }
.filter-chip input { accent-color: var(--green); width: 16px; height: 16px; }
.sort-select { min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: #fff; padding: 0 12px; }
.empty-state { padding: 28px 12px; text-align: center; color: var(--muted); }
.load-more-wrap { display: grid; place-items: center; padding: 18px 0 4px; }
.not-found { margin-top: 18px; padding: 16px; border: 2px dashed var(--line); border-radius: var(--r-m); background: #fff; text-align: center; color: var(--muted); }
.not-found a { font-weight: 800; }
.reorder-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding: 14px 16px; border-radius: var(--r-m); background: var(--green-soft); border: 1px solid #bcdcc7; }
.muted-dark, .muted { color: var(--muted); font-size: 0.9rem; }

/* ---------- شريط السلة ---------- */
.cart-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: 35; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); pointer-events: none; }
.cart-bar[hidden] { display: none; }
.cart-bar-btn {
  pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 560px; margin-inline: auto;
  min-height: 58px; padding: 0 18px; border: 0; border-radius: var(--r-m); background: var(--ink); color: #fff;
  box-shadow: 0 10px 28px rgba(8, 40, 24, 0.4); font-weight: 700;
}
.cart-bar-count { background: var(--gold); color: var(--ink); border-radius: 999px; padding: 2px 12px; font-weight: 800; }
.cart-bar-total { flex: 1; text-align: start; font-size: 1.05rem; }
.cart-bar-cta { color: var(--gold-soft); }
.to-top { position: fixed; inset-inline-start: 14px; bottom: 90px; z-index: 34; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; color: var(--green); box-shadow: var(--shadow-m); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.to-top.is-shown { opacity: 1; pointer-events: auto; }
.to-top .icon { transform: rotate(90deg); }
.help-tab { position: fixed; inset-inline-end: 14px; bottom: 90px; z-index: 34; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px 0 12px; border: 0; border-radius: 999px; background: #25a244; color: #fff; font-weight: 700; box-shadow: var(--shadow-m); }
.help-tab-icon { display: grid; }
@media (max-width: 639px) { .help-tab { padding: 0; width: 48px; justify-content: center; } .help-tab-text { display: none; } }

/* ---------- النوافذ (Sheets) ---------- */
dialog { border: 0; padding: 0; color: var(--ink); background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(8, 28, 18, 0.55); }
dialog[open] { display: block; }
.cart-dialog, .product-dialog, .weight-dialog, .help-dialog, .install-dialog {
  width: 100%; max-width: 560px; margin: auto auto 0; max-height: 92vh; overflow: auto; border-radius: var(--r-l) var(--r-l) 0 0; background: #fff;
  animation: sheet-in 0.22s ease-out;
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.cart-sheet, .product-sheet, .weight-sheet, .help-sheet { padding: 18px var(--gutter) calc(20px + env(safe-area-inset-bottom)); }
.help-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.help-head h2 { font-size: 1.3rem; font-weight: 800; }
.help-kicker { font-size: 0.8rem; color: var(--muted); }
.help-intro, .help-foot { color: var(--muted); font-size: 0.9rem; margin-block: 8px; }
.help-action { display: flex; align-items: center; gap: 12px; padding: 12px; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: var(--ink); }
.help-action strong { display: block; }
.help-action small { color: var(--muted); }
.help-action-icon { width: 42px; height: 42px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; flex: none; }
.help-action--wa .help-action-icon { background: #25a244; color: #fff; }

.cart-items { display: grid; gap: 0; }
.cart-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item-main { display: grid; gap: 2px; min-width: 0; }
.cart-item-side { display: grid; justify-items: end; gap: 6px; align-content: start; }
.cart-item-price { font-weight: 800; }
.cart-warn { color: var(--red); font-size: 0.85rem; font-weight: 700; }
.cart-summary { margin-top: 14px; padding: 14px; background: var(--bg); border-radius: var(--r-m); display: grid; gap: 6px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; }
.sum-row.is-good { color: var(--green); font-weight: 700; }
.sum-total { padding-top: 8px; border-top: 2px dashed var(--line); font-size: 1.15rem; font-weight: 800; }
.sum-note { font-size: 0.82rem; color: var(--muted); }
.cart-actions { display: grid; gap: 6px; margin-top: 14px; justify-items: center; }
.cart-actions .btn { width: 100%; }
.forgot-block { margin-top: 16px; }
.forgot-title { font-weight: 800; margin-bottom: 8px; }
.forgot-grid { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.forgot-item { flex: none; display: grid; gap: 2px; text-align: start; padding: 10px 12px; border: 1px dashed var(--green); border-radius: var(--r-m); background: #fff; }
.forgot-item small { color: var(--muted); }

.modal-product-media { position: relative; border-radius: var(--r-m); background: var(--tint, #f6f8f6); aspect-ratio: 4 / 3; overflow: hidden; cursor: zoom-in; display: grid; place-items: center; }
.modal-product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; }
.modal-product-media.is-category img { object-fit: contain; padding: 8%; }
.modal-product-media.is-zoomed { cursor: zoom-out; }
.modal-product-media.is-zoomed img { transform: scale(1.8); }
.modal-product-info { display: grid; gap: 10px; padding-top: 14px; }
.modal-desc { color: var(--muted); }
.modal-actions { display: flex; gap: 10px; align-items: center; }
.modal-actions .btn-primary { flex: 1; }
.modal-qty { width: 150px; flex: none; }

/* ---------- الفوتر ---------- */
.site-footer { margin-top: 40px; padding: 32px 0 120px; background: var(--green-deep); color: #d5e8dc; }
.footer-grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-brand img { width: 56px; height: 56px; border-radius: 12px; background: #fff; padding: 3px; }
.footer-brand strong { color: #fff; font-size: 1.2rem; }
.footer-col h3 { color: var(--gold); font-size: 1rem; margin-bottom: 6px; }
.footer-col p { font-size: 0.92rem; }
.footer-hours { display: grid; gap: 2px; font-size: 0.9rem; }
.footer-hours div { display: flex; justify-content: space-between; gap: 12px; max-width: 280px; }
.footer-hours .is-today { color: #fff; font-weight: 800; }
.footer-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin-inline-end: 14px; color: #fff; text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; padding: 0; }
.footer-state.is-open { color: #7dff9a; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #ff8a80; margin-inline-end: 6px; }
.is-open .status-dot { background: #7dff9a; }
.font-scale { display: inline-flex; gap: 6px; }
.font-scale button { min-width: 44px; min-height: 40px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.35); background: transparent; color: #fff; font-weight: 800; }
.footer-bottom { margin-top: 22px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.15); font-size: 0.82rem; opacity: 0.85; }

/* ---------- شاشة اختيار الفرع ---------- */
.branch-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--green-deep); color: #fff; }
.branch-brand { display: grid; justify-items: center; gap: 8px; padding: 34px var(--gutter) 8px; text-align: center; }
.branch-logo-wrap img { width: 100%; height: 100%; object-fit: contain; }
.branch-logo-wrap { width: 112px; height: 112px; border-radius: 28px; background: #fff; padding: 8px; box-shadow: 0 0 0 4px var(--gold); }
.store-title { font-size: 2rem; font-weight: 800; }
.store-tagline { color: var(--gold-soft); }
.branch-main { flex: 1; width: 100%; max-width: 760px; margin-inline: auto; padding: 18px var(--gutter) 24px; }
.branch-heading { text-align: center; margin-bottom: 16px; }
.branch-heading h2 { font-size: 1.4rem; font-weight: 800; }
.branch-heading p { color: #bcd8c8; font-size: 0.92rem; }
.branch-grid { display: grid; gap: 16px; }
.branch-card { display: block; border-radius: var(--r-l); overflow: hidden; background: #fff; color: var(--ink); text-decoration: none; box-shadow: var(--shadow-m); transition: transform 0.15s; }
.branch-card:hover { transform: translateY(-3px); }
.branch-cover { position: relative; aspect-ratio: 16 / 8; background: var(--green-soft); }
.branch-cover img { width: 100%; height: 100%; object-fit: cover; }
.branch-cover-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8, 40, 24, 0.5), transparent 55%); }
.status-pill { position: absolute; top: 12px; inset-inline-start: 12px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 999px; background: #fff; color: var(--red); font-weight: 800; font-size: 0.82rem; }
.status-pill.is-open { color: var(--green); }
.status-pill.is-open .status-dot { background: #1fb85a; }
.branch-body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.branch-name { font-size: 1.3rem; font-weight: 800; }
.branch-address, .branch-hours { display: flex; gap: 8px; color: var(--muted); font-size: 0.92rem; align-items: flex-start; pointer-events: none; }
.branch-address .icon, .branch-hours .icon { margin-top: 3px; color: var(--green); }
.branch-state-note { font-size: 0.85rem; color: var(--red); }
.branch-cta { margin-top: 8px; }
.branch-note { display: flex; justify-content: center; gap: 8px; margin-top: 16px; color: #bcd8c8; font-size: 0.88rem; }
.branch-footer { padding: 18px var(--gutter) 28px; text-align: center; color: #bcd8c8; font-size: 0.85rem; }
.branch-footer a { color: #fff; margin-inline: 10px; }

/* ---------- الإتمام ---------- */
.checkout-layout { display: grid; gap: 16px; padding-block: 18px 40px; }
.checkout-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; }
.checkout-card .section-title { margin-bottom: 14px; }
.field { display: grid; gap: 4px; margin-bottom: 14px; }
.field > label, .field-label { font-weight: 700; font-size: 0.92rem; }
.field-hint { font-size: 0.8rem; color: var(--muted); }
.input { width: 100%; min-height: 48px; padding: 10px 14px; border: 2px solid var(--line); border-radius: var(--r-m); background: #fff; }
textarea.input { resize: vertical; min-height: 84px; }
.input:focus { outline: none; border-color: var(--green); }
.has-error .input { border-color: var(--red); }
.field-error { color: var(--red); font-size: 0.85rem; font-weight: 700; min-height: 0; }
.field-error:empty { display: none; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; border: 2px solid var(--green); border-radius: var(--r-m); overflow: hidden; }
.seg label { display: grid; place-items: center; min-height: 48px; font-weight: 700; cursor: pointer; text-align: center; padding: 0 8px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--green); color: #fff; }
.seg label:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: -3px; }
.choice-list { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border: 2px solid var(--line); border-radius: var(--r-m); font-weight: 500; }
.choice:has(input:checked) { border-color: var(--green); background: var(--green-soft); font-weight: 700; }
.choice input { accent-color: var(--green); width: 18px; height: 18px; }
.addr-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.addr-chip { max-width: 100%; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--green); background: #fff; color: var(--green); font-size: 0.85rem; font-weight: 700; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.loc-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.loc-ok { color: var(--green); font-weight: 700; font-size: 0.88rem; }
.notice-inline { padding: 10px 14px; border-radius: var(--r-m); font-size: 0.9rem; margin-bottom: 12px; }
.notice-inline.warn { background: var(--red-soft); color: #7d1b17; }
.notice-inline.info { background: var(--gold-soft); color: #5a4300; }
.form-errors:empty { display: none; }
.slot-row { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

.thankyou-layout { padding-block: 28px 48px; max-width: 560px; }
.thankyou-card { text-align: center; display: grid; gap: 12px; }
.thankyou-icon { width: 72px; height: 72px; margin-inline: auto; border-radius: 50%; background: var(--green); color: #fff; font-size: 2rem; display: grid; place-items: center; box-shadow: 0 0 0 6px var(--green-soft); }
.thankyou-card h1 { font-size: 1.6rem; font-weight: 800; }
.thankyou-actions { display: grid; gap: 10px; margin-top: 6px; }
.order-preview { text-align: start; border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px 14px; }
.order-preview pre { white-space: pre-wrap; font-family: inherit; font-size: 0.88rem; margin: 10px 0 0; }

/* ---------- التثبيت ---------- */
.install-card {
  position: fixed; inset-inline: 12px; bottom: 12px; z-index: 60; max-width: 480px; margin-inline: auto;
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px;
  background: var(--ink); color: #fff; border-radius: var(--r-l); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  animation: sheet-in 0.3s ease-out;
}
.install-card img { width: 52px; height: 52px; border-radius: 12px; background: #fff; padding: 3px; }
.install-card strong { display: block; }
.install-card p { font-size: 0.85rem; color: #c4dccd; line-height: 1.5; }
.install-actions { display: grid; gap: 6px; }
.install-actions .btn { min-height: 40px; padding: 0 16px; }
.install-actions .text-btn { color: #c4dccd; text-align: center; }
.install-steps { grid-column: 1 / -1; font-size: 0.88rem; color: #e6f2ea; }

/* ---------- حالات عامة ---------- */
.toast { position: fixed; inset-inline: 0; top: 16px; margin-inline: auto; width: max-content; max-width: 90vw; z-index: 80; padding: 10px 20px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; opacity: 0; transform: translateY(-10px); transition: 0.25s; pointer-events: none; }
.toast.is-visible { opacity: 1; transform: none; }
.loading-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--green-deep); color: #fff; }
.loading-screen img { border-radius: 24px; background: #fff; padding: 8px; }
.loading-bar { width: 160px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.loading-bar span { display: block; width: 40%; height: 100%; background: var(--gold); border-radius: 3px; animation: load 1.1s infinite ease-in-out; }
@keyframes load { 0% { transform: translateX(120%); } 100% { transform: translateX(-250%); } }
.noscript { padding: 40px 20px; text-align: center; }

.error-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.error-card { max-width: 640px; width: 100%; background: #fff; border: 2px solid var(--red); border-radius: var(--r-l); padding: 24px; display: grid; gap: 10px; }
.error-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; }
.error-kicker { color: var(--red); font-weight: 800; }
.error-code { background: var(--ink); color: #e8f5ec; border-radius: var(--r-m); padding: 12px; direction: ltr; text-align: left; overflow-x: auto; }
.error-code-label { font-size: 0.8rem; color: var(--gold); }
.error-list { padding-inline-start: 20px; display: grid; gap: 6px; }
.error-list span { display: block; font-size: 0.8rem; color: var(--muted); direction: ltr; text-align: end; }
.error-hint, .error-file, .error-foot, .error-more { color: var(--muted); font-size: 0.9rem; }
.data-error-root[hidden] { display: none; }

/* ---------- شاشات أوسع ---------- */
@media (min-width: 640px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-tiles { grid-template-columns: repeat(5, 1fr); }
  .hero { display: grid; grid-template-columns: 1.1fr 1fr; }
  .hero-bg { aspect-ratio: auto; height: 100%; min-height: 220px; }
  .hero h1 { font-size: 1.8rem; }
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .cart-dialog, .product-dialog, .weight-dialog, .help-dialog { margin: auto; border-radius: var(--r-l); }
  .rail-item { flex-basis: 200px; }
}
@media (min-width: 960px) {
  .products-grid { grid-template-columns: repeat(5, 1fr); }
  .cat-tiles { grid-template-columns: repeat(7, 1fr); }
  .checkout-layout { grid-template-columns: 1.3fr 1fr; align-items: start; }
  .hero-slide { flex-basis: 48%; }
  .header-search { max-width: 720px; margin-inline: auto; }
  .header-inner { max-width: 1180px; }
  .branch-grid { grid-template-columns: 1fr 1fr; }
  .branch-page .branch-main { max-width: 960px; }
}
@media (max-width: 360px) {
  .brand-text small, .chip-state { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.weight-mode { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.weight-preview { padding: 10px 14px; border-radius: var(--r-m); background: var(--green-soft); margin-bottom: 8px; }
.weight-preview:empty { display: none; }

.chip-name, .brand-text strong { white-space: nowrap; }
@media (max-width: 420px) { .chip-state { display: none; } .brand-text small { display: none; } }
