/* جوهرة بغداد للغذاء الصحي - واجهة المتجر */

/* ------------------------------------------------------------------ خطوط */

@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/tajawal-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/tajawal-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/tajawal-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/tajawal-800.woff2') format('woff2');
}

:root {
  --green-900: #071A13;
  --green-800: #0d2a1f;
  --green-700: #1B4332;
  --green-600: #256B4C;
  --green-500: #358763;
  --green-50: #eef5f1;

  --gold: #E8C547;
  --gold-hover: #d4b234;
  /* لون ذهبي داكن بما يكفي ليكون مقروءا فوق الأبيض */
  --gold-text: #8A6A08;

  --ink: #16211c;
  --muted: #5d6b64;
  /* أفتح درجة تبقى مقروءة فوق الأبيض وخلفية الصفحة معا */
  --muted-soft: #66756d;
  --line: #dfe5e1;
  --line-strong: #c3cec8;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --success-bg: #e3f4e8;
  --success-ink: #14532d;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(7, 26, 19, .07);
  --shadow: 0 3px 14px rgba(7, 26, 19, .08);
  --shadow-lg: 0 12px 32px rgba(7, 26, 19, .14);
  --focus: 0 0 0 3px rgba(53, 135, 99, .45);

  --header-h: 138px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
ul { list-style: none; }

/* حلقة تركيز موحدة لمستخدمي لوحة المفاتيح */
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 18px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- الترويسة */

.topbar {
  background: var(--green-900);
  color: rgba(255, 255, 255, .88);
  font-size: 13.5px;
  padding: 8px 0;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.topbar a { padding: 2px 0; transition: color .15s; }
.topbar a:hover { color: var(--gold); }
.topbar-links { display: flex; gap: 18px; align-items: center; }
.topbar-links a[href^="tel:"] { font-weight: 700; color: var(--gold); }
.topbar-links a { display: inline-flex; align-items: center; gap: 5px; }
.topbar-links a svg { width: 14px; height: 14px; fill: currentColor; }
.topbar-links a.is-active { color: var(--gold); font-weight: 700; }
.topbar-sep { width: 1px; height: 14px; background: rgba(255, 255, 255, .2); }
.topbar-cta {
  background: rgba(232, 197, 71, .16);
  color: var(--gold);
  padding: 4px 12px !important;
  border-radius: 999px;
  font-weight: 700;
}
.topbar-cta:hover { background: rgba(232, 197, 71, .28); color: var(--gold); }

.header {
  background: var(--green-700);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 14px rgba(7, 26, 19, .22);
}
.header .container {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand img {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #fff;
  padding: 4px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-text strong { display: block; font-size: 18px; font-weight: 800; line-height: 1.3; }
.brand-text span { display: block; font-size: 11px; color: var(--gold); letter-spacing: 3px; line-height: 1.2; }

/* حقل البحث: الغلاف هو ما يحمل الاستدارة، فيعمل في الاتجاهين دون قلب الزوايا */
.search-form {
  flex: 1;
  max-width: 540px;
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(7, 26, 19, .18);
  transition: box-shadow .18s;
}
.search-form:focus-within { box-shadow: 0 0 0 3px rgba(232, 197, 71, .6); }
.search-form input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 12px 20px;
  font-size: 15px;
  background: transparent;
  color: var(--ink);
}
.search-form input::placeholder { color: var(--muted-soft); }
.search-form button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: var(--gold);
  color: var(--green-900);
  font-weight: 700;
  font-size: 15px;
  padding: 0 24px;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
.search-form button:hover { background: var(--gold-hover); }
.search-form button svg { width: 18px; height: 18px; fill: currentColor; }

.header-actions { display: flex; align-items: center; gap: 9px; margin-inline-start: auto; }
.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, transform .12s;
}
.header-btn:hover { background: rgba(255, 255, 255, .26); }
.header-btn:active { transform: translateY(1px); }
.header-btn svg { width: 19px; height: 19px; fill: currentColor; }
.header-btn.is-cart { background: var(--gold); color: var(--green-900); font-weight: 700; }
.header-btn.is-cart:hover { background: var(--gold-hover); }
.cart-count {
  background: var(--green-900);
  color: var(--gold);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  padding: 0 6px;
  line-height: 1;
  transition: transform .2s ease;
}
.cart-count.bump { animation: cartBump .35s ease; }
@keyframes cartBump {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.35); }
}

/* -------------------------------------------------------------- التنبيهات المنبثقة (Toast) */

.toast-container {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-end: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(340px, calc(100vw - 40px));
}
.toast {
  background: var(--green-900);
  color: #fff;
  border-inline-start: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .22s ease, transform .22s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-error { background: #7d1a15; border-color: var(--danger); }

button.is-loading { opacity: .7; cursor: progress; }

.navbar { background: var(--green-800); }
.navbar .container {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.navbar .container::-webkit-scrollbar { display: none; }
.navbar a {
  color: rgba(255, 255, 255, .9);
  padding: 12px 15px;
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
}
.navbar a:hover { color: var(--gold); background: rgba(255, 255, 255, .06); }
.navbar a.is-active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 700; }

/* --------------------------------------------------------------- الواجهة */

.hero {
  background:
    radial-gradient(1100px 480px at 78% -14%, rgba(232, 197, 71, .16), transparent 62%),
    linear-gradient(158deg, var(--green-900) 0%, var(--green-700) 52%, var(--green-800) 100%);
  color: #fff;
  padding: 68px 0;
  text-align: center;
}
.hero .since {
  display: inline-block;
  color: var(--gold);
  letter-spacing: 5px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(232, 197, 71, .45);
  border-radius: 999px;
  padding: 4px 18px;
  margin-bottom: 20px;
}
.hero h1 { font-size: clamp(27px, 4.6vw, 44px); font-weight: 800; line-height: 1.35; margin-bottom: 14px; }
.hero p { max-width: 740px; margin: 0 auto 28px; font-size: 17px; color: rgba(255, 255, 255, .93); }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* --------------------------------------------------------------- الأزرار */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
  text-align: center;
  transition: background .16s, border-color .16s, color .16s, transform .12s, box-shadow .16s;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }

.btn-gold { background: var(--gold); color: var(--green-900); }
.btn-gold:hover { background: var(--gold-hover); box-shadow: 0 6px 18px rgba(232, 197, 71, .32); }

.btn-green { background: var(--green-600); color: #fff; }
.btn-green:hover { background: var(--green-700); box-shadow: 0 6px 18px rgba(27, 67, 50, .28); }

.btn-outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .75); }
.btn-outline:hover { background: rgba(255, 255, 255, .14); border-color: #fff; }

.btn-ghost { background: var(--surface); color: var(--green-700); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--green-600); background: var(--green-50); }

.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: #fbd9d5; }

.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { padding: 14px 32px; font-size: 16.5px; }

.btn:disabled, .btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* -------------------------------------------------------------- الأقسام */

.section { padding: 50px 0; }
.section + .section { padding-top: 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.section-head h1, .section-head h2 {
  font-size: clamp(21px, 2.6vw, 26px);
  font-weight: 800;
  color: var(--green-700);
  line-height: 1.4;
}
.section-head h1::after, .section-head h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  margin-top: 8px;
}
.section-head > a {
  color: var(--green-600);
  font-weight: 700;
  font-size: 14.5px;
  white-space: nowrap;
}
.section-head > a:hover { color: var(--green-700); text-decoration: underline; }

.count-badge {
  display: inline-block;
  vertical-align: middle;
  margin-inline-start: 10px;
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 13px;
  font-weight: 700;
}

/* قسم منتجات فئة كاملة على الصفحة الرئيسية */
.cat-section { scroll-margin-top: calc(var(--header-h) + 16px); }
.cat-section + .cat-section { border-top: 1px solid var(--line); padding-top: 40px; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.chip {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--green-700);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .14s, border-color .14s, color .14s;
}
.chip:hover { background: var(--green-700); border-color: var(--green-700); color: #fff; }

.section-more { display: flex; justify-content: center; margin-top: 24px; }

/* ------------------------------------------------------ بطاقات الأقسام */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.cat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green-500);
}
.cat-card-media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(148deg, var(--green-700), var(--green-500));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.cat-card-media img { width: 100%; height: 100%; object-fit: cover; }
.cat-card-media span { color: #fff; font-size: 38px; font-weight: 800; }
.cat-card-body { padding: 15px 17px 17px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.cat-card-body h3 { font-size: 15.5px; font-weight: 700; line-height: 1.55; color: var(--ink); }
.cat-card-count { font-size: 13px; color: var(--muted); }
.cat-card-subs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.cat-card-subs span {
  font-size: 11.5px;
  background: var(--green-50);
  color: var(--green-700);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
}

/* ------------------------------------------------------ بطاقات المنتجات */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 18px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green-500);
}
.product-card-media { aspect-ratio: 1; background: #f1f4f2; overflow: hidden; display: block; }
.product-card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.product-card:hover .product-card-media img { transform: scale(1.06); }

.product-card-body {
  padding: 14px 15px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}
.product-card-cat {
  font-size: 12px;
  color: var(--gold-text);
  font-weight: 700;
  line-height: 1.5;
}
/* الاسم يظهر كاملا: أسماء المنتجات هنا وصفية وطويلة ولا يصح قصها */
.product-card-body h3 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink);
}
.product-card-body h3 a:hover { color: var(--green-600); }

.product-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  flex-wrap: wrap;
}
.product-price strong { font-size: 19px; color: var(--green-700); font-weight: 800; }
.product-price .unit { font-size: 12.5px; color: var(--muted); }
.product-price del { font-size: 13.5px; color: var(--muted); }

.badge-sale, .badge-out {
  position: absolute;
  inset-block-start: 11px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  z-index: 1;
  line-height: 1.5;
}
.badge-sale { inset-inline-start: 11px; background: var(--danger); color: #fff; }
.badge-out { inset-inline-end: 11px; background: rgba(7, 26, 19, .82); color: #fff; }

/* ---------------------------------------------------------- صفحة المنتج */

.product-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; }
.product-detail-media {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: sticky;
  top: calc(var(--header-h) + 14px);
}
.product-detail-media img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.product-detail h1 { font-size: clamp(22px, 3vw, 29px); font-weight: 800; line-height: 1.5; margin-bottom: 10px; }
.product-detail .sub { color: var(--gold-text); font-weight: 700; font-size: 14.5px; margin-bottom: 14px; }

.price-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin: 20px 0;
}
.price-box .amount { font-size: 32px; font-weight: 800; color: var(--green-700); line-height: 1.3; }
.price-box del { color: var(--muted); font-size: 18px; margin-inline-start: 10px; }

.qty-row { display: flex; gap: 12px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.qty-input {
  display: flex;
  align-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}
.qty-input button {
  width: 40px; height: 42px;
  border: none;
  background: transparent;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  color: var(--green-700);
  transition: background .14s;
}
.qty-input button:hover { background: var(--green-50); }
.qty-input input {
  width: 54px;
  text-align: center;
  border: none;
  outline: none;
  height: 42px;
  font-weight: 700;
  -moz-appearance: textfield;
}
.qty-input input::-webkit-outer-spin-button,
.qty-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.meta-list { display: grid; gap: 10px; margin-top: 20px; }
.meta-list li { display: flex; gap: 9px; font-size: 14.5px; color: var(--muted); flex-wrap: wrap; }
.meta-list strong { color: var(--ink); font-weight: 700; }
.meta-list a { color: var(--green-600); font-weight: 500; }
.meta-list a:hover { text-decoration: underline; }

.stock-yes { color: var(--green-600); font-weight: 700; }
.stock-no { color: var(--danger); font-weight: 700; }

.prose { line-height: 1.95; color: var(--ink); }
.prose p { margin-bottom: 12px; }
.prose p:last-child { margin-bottom: 0; }
.prose img { border-radius: var(--radius-sm); margin: 14px 0; }
.prose h3 { color: var(--green-700); font-size: 17px; margin-bottom: 10px; }
.prose ul, .prose ol { margin: 0 22px 12px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

/* -------------------------------------------------------------- تخطيطات */

.layout-split { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 26px; align-items: start; }
.layout-cart { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 26px; align-items: start; }

.sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  position: sticky;
  top: calc(var(--header-h) + 14px);
  max-height: calc(100vh - var(--header-h) - 28px);
  overflow-y: auto;
}
.sidebar h3 { font-size: 15.5px; font-weight: 800; color: var(--green-700); margin-bottom: 12px; }
.sidebar ul { display: grid; gap: 3px; }
.sidebar ul ul { margin-inline-start: 12px; margin-top: 3px; padding-inline-start: 10px; border-inline-start: 2px solid var(--line); }
.sidebar a {
  display: block;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  line-height: 1.55;
  transition: background .14s, color .14s;
}
.sidebar a:hover { background: var(--green-50); color: var(--green-700); }
.sidebar a.is-active { background: var(--green-700); color: #fff; font-weight: 700; }
.sidebar .sub a { font-size: 13.5px; color: var(--muted); }
.sidebar .sub a:hover { color: var(--green-700); }
.sidebar .sub a.is-active { color: #fff; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.card h3 { color: var(--green-700); font-size: 17px; font-weight: 800; margin-bottom: 14px; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
  padding: 18px 0;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--green-600); text-decoration: underline; }
.breadcrumb .sep { color: var(--muted-soft); }
.breadcrumb .current { color: var(--ink); font-weight: 500; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.result-count { color: var(--muted); font-size: 14.5px; }

/* -------------------------------------------------------------- النماذج */

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14.5px; font-weight: 700; margin-bottom: 7px; }
.field .req { color: var(--danger); }
.field input, .field select, .field textarea, select.control {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  outline: none;
  background: var(--surface);
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, select.control:focus {
  border-color: var(--green-500);
  box-shadow: var(--focus);
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.field .error { color: var(--danger); font-size: 13.5px; margin-top: 6px; font-weight: 500; }
.field .hint { color: var(--muted); font-size: 13px; margin-top: 5px; }
.field input.is-invalid, .field select.is-invalid, .field textarea.is-invalid { border-color: var(--danger); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-soft); }

/* سهم مخصص للقوائم المنسدلة، مع مراعاة الاتجاه */
.field select, select.control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%235d6b64' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  background-size: 12px;
  padding-inline-end: 14px;
  padding-inline-start: 38px;
  cursor: pointer;
}
select.control { width: auto; border-radius: 999px; padding-block: 9px; }

.checkbox-row { display: flex; gap: 9px; align-items: center; font-size: 14.5px; margin-bottom: 16px; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--green-600); cursor: pointer; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 15px;
  font-weight: 500;
  border-inline-start: 4px solid;
}
.alert-success { background: var(--success-bg); color: var(--success-ink); border-color: #1f8a4c; }
.alert-error { background: var(--danger-bg); color: #7d1a15; border-color: var(--danger); }
.alert-info { background: #e5f0fa; color: #0b3f66; border-color: #1a6fae; }

/* -------------------------------------------------------------- الجداول */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; min-width: 520px; }
table.data th, table.data td {
  padding: 13px 10px;
  text-align: start;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
  vertical-align: middle;
}
table.data th { color: var(--muted); font-weight: 700; font-size: 13.5px; }
table.data tbody tr:last-child td { border-bottom: none; }
.line-thumb {
  width: 60px; height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #f1f4f2;
  border: 1px solid var(--line);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 15px;
}
.summary-row.total {
  border-top: 2px solid var(--line);
  margin-top: 8px;
  padding-top: 15px;
  font-size: 20px;
  font-weight: 800;
  color: var(--green-700);
}
.free-tag { color: var(--green-600); font-weight: 700; }

.status-pill {
  display: inline-block;
  padding: 4px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.status-pending { background: #fdf0d0; color: #7a4c05; }
.status-processing { background: #dbe9fb; color: #17407e; }
.status-shipping { background: #e2e4fb; color: #33327e; }
.status-completed { background: var(--success-bg); color: #14532d; }
.status-cancelled { background: var(--danger-bg); color: #8c1d18; }

/* -------------------------------------------------------------- تتبع الطلب */

.track-form { display: flex; gap: 10px; }
.track-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
.track-form input:focus { outline: 2px solid var(--green-700); outline-offset: 1px; }
.track-form .btn { flex-shrink: 0; }

.tracker { display: flex; justify-content: space-between; gap: 4px; margin: 26px 0 6px; }
.tracker-step { flex: 1; position: relative; text-align: center; }
.tracker-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  inset-inline-start: 50%;
  width: 100%;
  height: 3px;
  background: var(--line);
  z-index: 0;
}
.tracker-step.is-done:not(:last-child)::after { background: var(--green-700); }
.tracker-dot {
  position: relative;
  z-index: 1;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  margin: 0 auto 9px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 3px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}
.tracker-step.is-done .tracker-dot { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.tracker-step.is-active .tracker-dot {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--green-900);
  box-shadow: 0 0 0 5px rgba(232, 197, 71, .28);
}
.tracker-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.4; }
.tracker-step.is-done .tracker-label,
.tracker-step.is-active .tracker-label { color: var(--ink); }

@media (max-width: 560px) {
  .tracker-label { font-size: 11.5px; }
  .track-form { flex-wrap: wrap; }
  .track-form .btn { flex: 1; justify-content: center; }
}

/* ------------------------------------------------------------ متفرقات */

.empty { text-align: center; padding: 58px 22px; color: var(--muted); }
.empty .icon { font-size: 44px; margin-bottom: 12px; opacity: .55; }
.empty h3 { font-size: 20px; color: var(--ink); margin-bottom: 8px; }
.empty p { margin-bottom: 20px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(224px, 1fr)); gap: 18px; }
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature .icon { font-size: 32px; margin-bottom: 12px; line-height: 1; }
.feature .icon:has(svg) {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-50), #fff);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.feature .icon svg { width: 28px; height: 28px; fill: var(--green-700); }
.feature:hover .icon:has(svg) { background: var(--green-700); border-color: var(--green-700); }
.feature:hover .icon:has(svg) svg { fill: var(--gold); }
.feature h3 { font-size: 16.5px; font-weight: 700; margin-bottom: 7px; color: var(--green-700); }
.feature p { font-size: 14.5px; color: var(--muted); line-height: 1.7; }

.faq-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--green-700);
  font-size: 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 22px; color: var(--gold-text); line-height: 1; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin-top: 10px; color: var(--muted); }

.pagination { display: flex; gap: 7px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: 14.5px;
  font-weight: 500;
  transition: border-color .14s, background .14s, color .14s;
}
.pagination a:hover { border-color: var(--green-600); background: var(--green-50); color: var(--green-700); }
.pagination .active span { background: var(--green-700); color: #fff; border-color: var(--green-700); font-weight: 700; }
.pagination .disabled span { color: var(--muted-soft); background: var(--bg); }

/* --------------------------------------------------------------- التذييل */

.footer {
  background: var(--green-900);
  color: rgba(255, 255, 255, .82);
  padding: 50px 0 0;
  margin-top: 56px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  padding-bottom: 36px;
}
.footer h4 { color: var(--gold); font-size: 15.5px; font-weight: 700; margin-bottom: 15px; }
.footer p { font-size: 14.5px; line-height: 1.8; }
.footer ul { display: grid; gap: 9px; font-size: 14.5px; }
.footer li { line-height: 1.6; }
.footer a { transition: color .15s; }
.footer a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding: 18px 0;
  text-align: center;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .62);
}

.wa-float {
  position: fixed;
  inset-block-end: 24px;
  inset-inline-start: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  z-index: 60;
  transition: transform .2s, box-shadow .2s;
}
.wa-float:hover { transform: scale(1.09); box-shadow: 0 8px 26px rgba(37, 211, 102, .5); }
.wa-float svg { width: 30px; height: 30px; fill: #fff; }

/* ------------------------------------------------------------- الاستجابة */

@media (max-width: 980px) {
  .layout-split, .layout-cart { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
  .product-detail { grid-template-columns: 1fr; gap: 24px; }
  .product-detail-media { position: static; }
}

@media (max-width: 760px) {
  :root { --header-h: 116px; }

  body { font-size: 15.5px; }

  .topbar { font-size: 12.5px; }
  .topbar .container { justify-content: center; text-align: center; }
  .topbar > .container > span { display: none; }

  .header .container { flex-wrap: wrap; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
  .search-form { order: 3; max-width: none; flex-basis: 100%; }
  .search-form input { padding: 11px 16px; }
  .search-form button { padding: 0 18px; }
  .header-actions { margin-inline-start: auto; }
  .brand img { width: 42px; height: 42px; }
  .brand-text strong { font-size: 15.5px; }

  .hero { padding: 44px 0; }
  .hero p { font-size: 15.5px; }
  .section { padding: 36px 0; }

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

  .product-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .product-card-body { padding: 12px; gap: 6px; }
  .product-card-body h3 { font-size: 14px; }
  .product-price strong { font-size: 17px; }
  .cat-card-subs { display: none; }

  .card { padding: 18px; }
  .price-box .amount { font-size: 27px; }
  .wa-float { width: 52px; height: 52px; inset-block-end: 18px; inset-inline-start: 18px; }
}

@media (max-width: 400px) {
  .product-grid, .cat-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
