/* assets/chrome.css — shared shell for the content pages
   (wishlist, contact, about, faq, privacy, categories, account, order-detail).
   Depends on assets/tokens.css (colors/typography). */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ar);
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2 { text-wrap: balance; }
:is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 8px;
}
.latin { font-family: var(--font-latin); }
.muted { color: var(--muted); }
.w400 { font-weight: 400; } .w500 { font-weight: 500; }
.w600 { font-weight: 600; } .w700 { font-weight: 700; } .w900 { font-weight: 900; }

.skip-link {
  position: absolute; inset-inline-start: 8px; top: -52px; z-index: 300;
  background: var(--surface); color: var(--deep);
  padding: 10px 16px; border-radius: 0 0 10px 10px;
  font-weight: 700; text-decoration: none;
  box-shadow: 0 6px 18px rgba(42, 13, 64, .18);
  transition: top .18s ease;
}
.skip-link:focus { top: 0; outline: 2px solid var(--primary); outline-offset: 2px; }

.container {
  width: 100%; max-width: 1320px;
  margin-inline: auto; padding-inline: clamp(20px, 4vw, 40px);
}

/* ---- morphing top navigation ---- */
.topnav {
  position: fixed; inset-inline: 0; top: 0; z-index: 60;
  height: 72px;
  margin-inline: auto;
  border: 1px solid transparent;
  background: transparent;
}
.topnav.ready {
  transition:
    width .6s cubic-bezier(.22, 1, .36, 1),
    max-width .6s cubic-bezier(.22, 1, .36, 1),
    height .6s cubic-bezier(.22, 1, .36, 1),
    top .6s cubic-bezier(.22, 1, .36, 1),
    margin-inline .6s cubic-bezier(.22, 1, .36, 1),
    border-radius .6s cubic-bezier(.22, 1, .36, 1),
    border-color .6s cubic-bezier(.22, 1, .36, 1),
    background .6s cubic-bezier(.22, 1, .36, 1),
    box-shadow .6s cubic-bezier(.22, 1, .36, 1),
    backdrop-filter .6s cubic-bezier(.22, 1, .36, 1);
}
.topnav.is-top {
  top: 0; height: 72px; width: 100%; max-width: none;
  margin-inline: 0; border-radius: 0;
  background: transparent; border-color: transparent; box-shadow: none;
}
.topnav.is-compact,
.topnav.is-expanded {
  top: 12px; height: 52px;
  width: min(44rem, calc(100% - 24px));
  margin-inline: auto; border-radius: 26px;
  border-color: color-mix(in srgb, var(--ink) 16%, transparent);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 12px 32px -12px color-mix(in srgb, var(--ink) 28%, transparent);
}
.topnav.is-expanded { width: min(75rem, calc(100% - 24px)); }
.topnav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; flex-direction: column; line-height: 1.1; }
.brand-ar { font-size: 22px; font-weight: 900; }
.brand-latin { font-size: 11px; letter-spacing: .04em; color: var(--muted); }
.nav-links {
  display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px);
  transition: opacity .15s ease, visibility 0s linear .15s;
}
.topnav.is-compact .nav-links { opacity: 0; visibility: hidden; pointer-events: none; }
.topnav.is-expanded .nav-links {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity .35s ease .12s, visibility 0s linear .12s;
}
.nav-links a {
  font-size: 15px; font-weight: 500; padding: 6px 2px;
  position: relative; border-block-end: 1.5px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.nav-links a::after {
  content: ""; position: absolute; inset-inline-start: 50%;
  bottom: 0; translate: -50% -4px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); opacity: 0; transition: opacity .25s ease;
}
.nav-links a:hover,
.nav-links a.is-active,
.nav-links a[aria-current="page"] { color: var(--primary); border-color: var(--primary); }
.nav-links a.is-active::after,
.nav-links a[aria-current="page"]::after { opacity: 1; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
    .topnav-inner { min-width: 0; }
    .topnav .brand,
    .topnav .nav-actions,
    .topnav .nav-actions .icon-btn { flex: 0 0 auto; }
    .topnav .nav-links { flex: 1 1 0%; min-width: 0; overflow: hidden; }
    .topnav.is-compact .nav-links { flex-basis: 0%; width: 0; }
    /* Phone fit: keep the same 5 icon-btns + brand inside the morph pill at every scroll point */
    @media (max-width: 480px) {
      .topnav .container { padding-inline: 14px; }
      .topnav-inner { gap: 12px; }
      .topnav .brand { padding: 4px 8px; }
      .topnav .brand-ar { font-size: 18px; }
      .topnav .nav-actions { gap: 7px; }
      .topnav .nav-actions .icon-btn { width: 40px; height: 40px; }
      .topnav .nav-actions .icon-btn svg { width: 19px; height: 19px; }
    }
    @media (max-width: 400px) {
      .topnav .container { padding-inline: 12px; }
      .topnav-inner { gap: 10px; }
      .topnav .brand { padding: 4px 6px; }
      .topnav .brand-ar { font-size: 16px; }
      .topnav .nav-actions { gap: 5px; }
      .topnav .nav-actions .icon-btn { width: 36px; height: 36px; }
      .topnav .nav-actions .icon-btn svg { width: 17px; height: 17px; }
    }
    @media (max-width: 340px) {
      .topnav .container { padding-inline: 10px; }
      .topnav-inner { gap: 8px; }
      .topnav .brand { padding: 3px 5px; }
      .topnav .brand-ar { font-size: 15px; }
      .topnav .nav-actions { gap: 4px; }
      .topnav .nav-actions .icon-btn { width: 34px; height: 34px; }
      .topnav .nav-actions .icon-btn svg { width: 16px; height: 16px; }
    }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink);
  transition: background .2s ease, color .2s ease;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); }
.icon-btn svg { width: 21px; height: 21px; }

.scroll-progress {
  position: fixed; inset-inline: 0; top: 0; z-index: 61; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform-origin: 0 50%; transform: scaleX(var(--sp, 0));
  will-change: transform; pointer-events: none;
}

/* ---- page shell ---- */
.page { padding-block-start: clamp(120px, 16vh, 170px); padding-block-end: clamp(64px, 8vw, 110px); }
.page-narrow { max-width: 900px; margin-inline: auto; }

.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  margin-block-end: 26px;
}
.crumbs a:hover { color: var(--primary); }
.crumbs .sep { color: color-mix(in srgb, var(--ink) 30%, transparent); }
.crumbs .here { color: var(--primary); font-weight: 700; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
}
.chip-soft { background: var(--primary-soft); color: var(--primary); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.page-head { text-align: center; margin-block-end: clamp(30px, 5vw, 46px); }
.page-head h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; margin-block-start: 18px; }
.page-head .lead { color: var(--muted); margin-block-start: 10px; font-size: 15px; max-width: 62ch; margin-inline: auto; }

.section { margin-block-start: clamp(34px, 5vw, 56px); }
.section > h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); font-weight: 800; }
.section > p { color: var(--muted); margin-block-start: 10px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: clamp(18px, 3vw, 30px);
  box-shadow: 0 18px 44px -22px rgba(30, 15, 46, .18);
}

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 13px 28px;
  border-radius: 999px; border: 1.5px solid transparent;
  font-family: var(--font-ar); font-size: 16px; font-weight: 700;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.btn + .btn { margin-inline-start: 8px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn-ghost { border-color: var(--border); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-accent { background: var(--accent); color: var(--deep); }
.btn-accent:hover { transform: translateY(-2px); }
.btn-sm { min-height: 42px; padding: 9px 18px; font-size: 14px; }

/* ---- empty state ---- */
.empty { text-align: center; padding-block: clamp(48px, 8vw, 90px); }
.empty-icon {
  width: 92px; height: 92px; margin-inline: auto;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
}
.empty-icon svg { width: 46px; height: 46px; }
.empty h2 { font-weight: 900; font-size: 1.4rem; margin-block-start: 22px; }
.empty p { color: var(--muted); margin-block-start: 8px; }
.empty .actions { margin-block-start: 26px; }

/* ---- forms ---- */
.field { display: grid; gap: 8px; }
.field + .field { margin-block-start: 16px; }
.field label { font-weight: 700; font-size: 14.5px; }
.field .hint { color: var(--muted); font-size: 12.5px; }
.control {
  width: 100%; min-height: 52px; padding: 12px 16px;
  background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--border); border-radius: 16px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
textarea.control { min-height: 140px; resize: vertical; }
.control:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-grid .field + .field { margin-block-start: 0; }

/* ---- footer ---- */
footer.site-foot { border-block-start: 1px solid var(--border); background: var(--surface); margin-block-start: clamp(48px, 8vw, 96px); }
.foot-grid {
  padding-block: clamp(30px, 4vw, 44px);
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; align-items: start;
}
.foot-brand-ar { font-weight: 900; font-size: 20px; }
.foot-note { color: var(--muted); font-size: 13px; margin-block-start: 6px; max-width: 40ch; }
.site-foot .foot-links { display: grid; gap: 6px; justify-items: start; }
.site-foot .foot-links a { color: var(--muted); font-size: 14px; font-weight: 600; padding: 3px 0; }
.site-foot .foot-links a:hover { color: var(--primary); }
.foot-legal { padding-block: 18px; border-block-start: 1px solid var(--border); color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .foot-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---- compact product cards (wishlist, categories, related) ---- */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px; }
.prod-grid.tight { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.prod-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease;
}
.prod-card:hover { transform: translateY(-4px); box-shadow: 0 24px 48px -28px rgba(30, 15, 46, .4); }
.prod-media { position: relative; aspect-ratio: 1 / 1; background: var(--surface-2); }
.prod-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.prod-hit { position: absolute; inset: 0; z-index: 1; -webkit-tap-highlight-color: transparent; }
.prod-body { display: grid; gap: 4px; padding: 12px 14px 16px; }
.prod-brand { color: var(--muted); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.prod-name { font-size: 14px; font-weight: 600; line-height: 1.4; }
.prod-name a { color: inherit; }
.prod-card:hover .prod-name a { color: var(--primary); }
.prod-price { font-size: 16px; font-weight: 800; }
.prod-price .curr { font-size: 11px; color: var(--muted); font-weight: 600; }
.add-btn {
  position: absolute; inset-block-start: 12px; inset-inline-end: 12px; z-index: 3;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--deep);
  box-shadow: 0 10px 22px -8px rgba(243, 144, 35, .7);
  transition: transform .25s ease;
}
.add-btn svg { width: 19px; height: 19px; }
.add-btn:hover { transform: scale(1.08); }
.prod-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-block-start: 6px; }
.link-btn {
  border: 0; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 700; padding: 4px 0; text-decoration: underline;
}
.link-btn:hover { color: #E11D48; }

/* ---- definition lists / info rows ---- */
.info-list { display: grid; gap: 14px; }
.info-list .row { display: grid; gap: 4px; }
.info-list dt { color: var(--muted); font-size: 13px; font-weight: 700; }
.info-list dd { margin: 0; font-size: 15px; }
.accent-line {
  display: grid; gap: 2px; padding-inline-start: 16px;
  border-inline-start: 3px solid var(--primary-soft);
}
.accent-line strong { font-size: 15px; }
.accent-line span { color: var(--muted); font-size: 13.5px; }
