/* The navigation shared by every customer page: the floating bottom bar (phones), the header bar (wide screens, from 1024px,
   chosen by this media query and nothing else) and the small "‹ رجوع" back button. Logical properties only, so English flips by itself. */
:root {
  --s-blue: #0155ee;
  --s-lime: #a4fc01;
  --s-bg: #f6f5f3;
  --s-ink: #0b1b3f;
  --s-muted: #7e8aa6;
  --s-line: #eef1f6;
  --s-field: #eef3fe;
  --s-chip: #d5dcea;
  --s-green: #2f6b00;
  --s-red: #e5484d;
}

/* ---------- the back button: top, at the reading start (right in Arabic, left in English) ---------- */
.page-back { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 12px 0 8px; border-radius: 12px; background: var(--s-field); color: var(--s-blue); font: inherit; font-size: 12px; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; flex: none; -webkit-tap-highlight-color: transparent; }
.page-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.page-back:dir(ltr) { padding: 0 8px 0 12px; }
svg.back-ic:dir(ltr) { transform: scaleX(-1); }
.page-back.on-hero { background: rgb(255 255 255 / 18%); color: #fff; }
.page-back:focus-visible { outline: 2px solid var(--s-blue); outline-offset: 2px; }
.page-back.on-hero:focus-visible { outline-color: #fff; }

/* ---------- the bottom bar (phones) ---------- */
body.has-nav:not(.shop) { padding-bottom: 96px; }
.nav { position: fixed; bottom: 14px; inset-inline: 14px; max-width: 402px; margin: 0 auto; height: 66px; border-radius: 22px; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 12px 30px rgba(11, 27, 63, 0.14); display: flex; align-items: center; padding: 0 6px; z-index: 20; font-family: 'Alexandria', system-ui, sans-serif; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; font-weight: 500; color: #8a93a6; position: relative; text-decoration: none; }
.nav a.on { color: var(--s-blue); font-weight: 700; }
.nav a .ic { position: relative; display: flex; }
.nav svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav .count, .site-bar .count { position: absolute; top: -6px; inset-inline-start: -8px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--s-lime); color: var(--s-ink); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.nav .count[hidden], .site-bar .count[hidden] { display: none; }

/* ---------- the header bar (hidden on phones) ---------- */
.site-bar { display: none; }

@media (min-width: 1024px) {
  .nav { display: none; }
  body.has-nav:not(.shop) { padding-bottom: 0; }
  .site-bar { display: block; position: sticky; top: 0; z-index: 30; background: #fff; box-shadow: 0 4px 14px rgba(11, 27, 63, 0.06); font-family: 'Alexandria', system-ui, sans-serif; color: var(--s-ink); }
  .site-bar-in { max-width: 1280px; margin: 0 auto; height: 72px; padding: 0 24px; display: flex; align-items: center; gap: 22px; }
  .bar-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; flex: none; max-width: 260px; }
  .bar-logo { width: 42px; height: 42px; border-radius: 14px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(1, 85, 238, 0.18); overflow: hidden; flex: none; }
  .bar-logo img { width: 100%; height: 100%; object-fit: contain; }
  .bar-logo svg { width: 22px; height: 22px; fill: none; stroke: var(--s-blue); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .bar-logo svg[hidden] { display: none; }
  .bar-name { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bar-search { flex: 1; min-width: 200px; max-width: 560px; margin-inline: auto; }
  .bar-search .shop-search { position: relative; height: 46px; border-radius: 14px; background: var(--s-field); display: flex; align-items: center; gap: 10px; padding: 0 14px; color: var(--s-blue); margin: 0; }
  .bar-search .shop-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--s-ink); outline: none; }
  .bar-search .shop-search input::placeholder { color: var(--s-muted); }
  .bar-search svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
  .bar-links { display: flex; align-items: center; gap: 4px; flex: none; }
  .bar-links a { height: 40px; padding: 0 14px; border-radius: 12px; display: flex; align-items: center; font-size: 14px; font-weight: 600; color: #4a5575; text-decoration: none; }
  .bar-links a:hover { background: var(--s-field); }
  .bar-links a.on { color: var(--s-blue); background: var(--s-field); font-weight: 700; }
  .bar-lang { flex: none; display: flex; }
  .bar-cart { position: relative; width: 44px; height: 44px; border-radius: 14px; background: var(--s-field); color: var(--s-blue); display: flex; align-items: center; justify-content: center; flex: none; text-decoration: none; }
  .bar-cart.on { background: var(--s-blue); color: #fff; }
  .bar-cart svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .bar-cart .count { top: -5px; }
  .site-bar :focus-visible { outline: 2px solid var(--s-blue); outline-offset: 2px; }
}
@media (min-width: 1024px) and (max-width: 1179px) {
  .bar-name { display: none; }
  .bar-links a { padding: 0 10px; }
  .site-bar-in { gap: 14px; padding: 0 16px; }
}

/* A customer dialog or sheet without a header of its own gets the same "‹ back" pill (injected by dialog-back.js). */
.dlg-backbar { position: sticky; top: 0; z-index: 3; display: flex; padding: 8px 12px; background: #fff; }
.dlg-backbar .back-btn { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 12px 0 8px; border: 0; border-radius: 12px; background: var(--s-field, #eef3fe); color: var(--s-blue, #0155ee); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.dlg-backbar .back-btn:dir(ltr) { padding: 0 8px 0 12px; }
.dlg-backbar .back-btn svg { width: 18px; height: 18px; }
html[dir="ltr"] .dlg-backbar .back-ic { transform: scaleX(-1); }
