:root {
  --ds-page: #ffffff;
  --ds-sand: #f3f3f4;
  --ds-ink: #161619;
  --ds-ink-2: rgba(22,22,25,.68);
  --ds-red: #c8102e;
  --ds-red-dark: #a00d25;
  --ds-hairline: rgba(22,22,25,.09);
  --ds-border: rgba(22,22,25,.22);
  --ds-raised: #f5f5f6;
  --ds-body: #161619;
  --serif: Georgia, 'Noto Naskh Arabic', 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Arabic', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ds-sand);
  color: var(--ds-body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}
img { max-width: 100%; }
.card {
  background: var(--ds-page);
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  border-radius: 20px 20px 0 0;
  margin-top: 16px;
  min-height: calc(100vh - 16px);
  box-shadow: 0 1px 3px rgba(22,22,25,.06);
}
@media (min-width: 768px) {
  .card { margin: 40px auto; border-radius: 24px; padding: 48px 56px 56px; min-height: calc(100vh - 80px); }
}

/* Header */
.hdr { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.hdr::before { content: ''; position: absolute; }
.hdr-brand { position: relative; }
.hdr-brand::before { content: ''; display: block; width: 44px; height: 4px; background: var(--ds-red); border-radius: 2px; margin-bottom: 12px; }
.hdr-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.25;
  color: var(--ds-ink);
  margin: 0 0 2px;
}
@media (min-width: 768px) { .hdr-title { font-size: 38px; } }
.hdr-fact { color: var(--ds-ink-2); font-size: 14px; margin: 0; }
.lang-btn {
  flex-shrink: 0;
  border: 1px solid var(--ds-border);
  border-radius: 999px;
  background: #fff;
  color: var(--ds-ink);
  font: inherit;
  font-size: 13.5px;
  padding: 7px 16px;
  min-height: 40px;
  cursor: pointer;
}
.lang-btn:hover { border-color: var(--ds-ink); }

/* Nav */
.file-nav { display: flex; flex-wrap: wrap; gap: 20px; border-bottom: 1px solid var(--ds-hairline); margin-bottom: 28px; }
.file-nav a { padding: 10px 0; color: var(--ds-ink-2); text-decoration: none; font-size: 15px; }
.file-nav a.active { color: var(--ds-ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ds-red); }
@media (max-width: 600px) { .file-nav a { display: inline-flex; align-items: center; min-height: 44px; } }

/* Groups */
.grp { margin-top: 36px; }
.grp:first-of-type { margin-top: 0; }
.grp-label { color: var(--ds-red); font-size: 13px; font-weight: 600; letter-spacing: .04em; margin: 0 0 2px; }
.grp-heading {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.35;
  color: var(--ds-ink);
  margin: 0 0 14px;
}
@media (min-width: 768px) { .grp-heading { font-size: 28px; } }

/* Fields */
.field { margin-bottom: 16px; }
.field-label { display: block; color: var(--ds-ink-2); font-size: 14px; margin-bottom: 6px; }
.field-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ds-border);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--ds-body);
}
.field-input:focus { outline: 2px solid var(--ds-red); outline-offset: 1px; }

/* Chips (filters) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chips-label { width: 100%; color: var(--ds-ink-2); font-size: 14px; margin-bottom: 2px; }
.chip {
  border: 1px solid var(--ds-border);
  border-radius: 999px;
  padding: 8px 16px;
  background: #fff;
  color: var(--ds-body);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  min-height: 40px;
}
.chip.active { background: var(--ds-ink); border-color: var(--ds-ink); color: #fff; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  padding: 11px 20px;
  min-height: 44px;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  background: none;
}
.btn-primary { background: var(--ds-red); color: #fff; }
.btn-primary:hover { background: var(--ds-red-dark); }
.btn-secondary { background: #fff; border-color: var(--ds-border); color: var(--ds-body); }
.btn-secondary:hover { border-color: var(--ds-ink); }
.btn-ghost { background: transparent; color: var(--ds-ink-2); }
.btn-compact { padding: 8px 16px; min-height: 40px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }

/* Captions, facts, callouts, lists */
.cap { color: var(--ds-ink-2); font-size: 13.5px; margin: 10px 0; }
.facts { margin: 14px 0; }
.fact { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--ds-hairline); }
.fact:last-child { border-bottom: 0; }
.fact-label { color: var(--ds-ink-2); }
.fact-value { color: var(--ds-ink); font-weight: 500; text-align: end; }
.callout { background: var(--ds-raised); border-inline-start: 3px solid var(--ds-red); border-radius: 12px; padding: 16px 18px; margin: 14px 0; }
.callout-title { color: var(--ds-ink); font-weight: 600; margin: 0 0 4px; }
.callout p:last-child, .callout-title + p { margin: 0; color: var(--ds-ink-2); }
.numlist { margin: 0; padding: 0; list-style: none; counter-reset: nl; }
.numlist li { counter-increment: nl; display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ds-hairline); }
.numlist li:last-child { border-bottom: 0; }
.numlist li::before { content: counter(nl, arabic-indic) '.'; color: var(--ds-red); font-weight: 600; flex-shrink: 0; }
html[dir="ltr"] .numlist li::before { content: counter(nl) '.'; }

/* Product grid */
.ds-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 16px; }
@media (min-width: 768px) { .ds-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
@media (max-width: 340px) { .ds-grid { gap: 10px; } }
.ds-card { display: flex; flex-direction: column; gap: 8px; }
.ds-photo-link { display: block; }
.ds-photo-wrap { position: relative; border-radius: 12px; overflow: hidden; background: var(--ds-raised); }
.ds-photo { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.ds-card-body { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ds-name { color: var(--ds-ink); font-weight: 600; text-decoration: none; }
a.ds-name:hover { text-decoration: underline; }
.ds-price { color: var(--ds-ink); font-weight: 600; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ds-card .ds-price { flex-direction: column; align-items: flex-start; gap: 2px; }
.ds-price-big { font-size: 19px; margin: 6px 0; }

/* Brand + soon chips */
.ds-brands { display: flex; flex-wrap: wrap; gap: 8px; }
.ds-brand-chip { border: 1px solid var(--ds-hairline); border-radius: 999px; padding: 6px 14px; color: var(--ds-ink-2); font-size: 14px; }
.ds-soon-chip { background: var(--ds-raised); border-color: transparent; }

/* Empty state */
.ds-empty { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin-top: 8px; }

/* Product detail */
.ds-detail-photo-wrap { position: relative; border-radius: 20px; overflow: hidden; background: var(--ds-raised); max-width: 480px; }
.ds-detail-photo { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.ds-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

/* Cart */
.ds-cart-list { display: flex; flex-direction: column; }
.ds-cart-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ds-hairline); }
.ds-cart-thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--ds-raised); flex-shrink: 0; }
.ds-cart-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ds-stepper { display: flex; align-items: center; gap: 10px; }
.ds-step-btn { width: 44px; height: 44px; border-radius: 6px; border: 1px solid var(--ds-border); background: var(--ds-page); color: var(--ds-ink); font-size: 18px; cursor: pointer; }
.ds-qty { min-width: 20px; text-align: center; font-weight: 600; color: var(--ds-ink); }
.ds-total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0 4px; font-weight: 600; color: var(--ds-ink); }

/* Order summary box */
.order-text { white-space: pre-wrap; background: var(--ds-raised); border-radius: 12px; padding: 14px 16px; font-size: 14px; color: var(--ds-ink); margin: 12px 0; }

/* Tracking */
.ds-track-lookup { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin-top: 16px; width: 100%; }
.ds-track-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; }
.ds-track-step { position: relative; display: flex; gap: 12px; padding: 0 0 20px; }
.ds-track-step:last-child { padding-bottom: 0; }
.ds-track-step::before { content: ''; position: absolute; top: 24px; bottom: 0; inset-inline-start: 11px; width: 2px; background: var(--ds-hairline); }
.ds-track-step:last-child::before { display: none; }
.ds-track-dot { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ds-hairline); background: var(--ds-page); color: #fff; font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.ds-track-done .ds-track-dot { border-color: var(--ds-red); background: var(--ds-red); }
.ds-track-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ds-track-label { color: var(--ds-ink-2); font-weight: 500; }
.ds-track-current { color: var(--ds-red); font-weight: 700; }
.ds-track-note { color: var(--ds-ink-2); font-size: 13px; }

/* Closing */
.closing { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--ds-hairline); color: var(--ds-ink-2); font-size: 13.5px; }

/* Store v2 additions */
.ds-badge { display: inline-block; background: var(--ds-raised); color: var(--ds-ink-2); border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.ds-photo-empty { display: flex; align-items: center; justify-content: center; background: var(--ds-raised); color: var(--ds-ink-2); font-size: 28px; font-family: var(--serif); }
img.ds-photo-empty { object-fit: cover; }
select.field-input { appearance: auto; }
input[type="file"].field-input { padding: 10px; }

.wa-float {
  position: fixed;
  bottom: 18px;
  inset-inline-end: 18px;
  z-index: 60;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}
.wa-float:hover { background: #1fb457; }
