/* ===== الألوان والمتغيرات ===== */
:root {
  --header-bg: #131921;
  --nav-bg: #232f3e;
  --accent: #febd69;
  --accent-hover: #f3a847;
  --orange: #ff9900;
  --back-top: #37475a;
  --back-top-hover: #485769;
  --footer-bg: #232f3e;
  --footer-bottom: #131a22;
  --text: #0f1111;
  --text-light: #ddd;
  --page-bg: #eaeded;
  --radius: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* إطار التحويم بنفس أسلوب المتاجر الكبرى */
.hover-box { border: 1px solid transparent; border-radius: 2px; padding: 6px 8px; }
.hover-box:hover { border-color: #fff; }

.mobile-only { display: none !important; }

/* ===== الهيدر ===== */
.site-header { background: var(--header-bg); color: #fff; position: sticky; top: 0; z-index: 50; }

.header-main {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  min-height: 60px;
  position: relative;
}
.header-spacer { flex: 1; }

/* زر البحث */
.search-toggle { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
.search-toggle svg { width: 24px; height: 24px; }
.search-toggle .ico-close { display: none; }
.search-toggle[aria-expanded="true"] { background: var(--nav-bg); border-color: var(--accent); }
.search-toggle[aria-expanded="true"] .ico-search { display: none; }
.search-toggle[aria-expanded="true"] .ico-close { display: block; }

/* لوحة البحث المنسدلة */
.search-panel {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--nav-bg);
  padding: 16px max(16px, 5vw) 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  z-index: 60;
  opacity: 0; visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.search-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }
.search-suggest {
  max-width: 900px; margin: 12px auto 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13px;
}
.search-suggest span { color: #ccc; }
.search-suggest a {
  border: 1px solid #4a5868; border-radius: 999px;
  padding: 4px 12px; color: #fff;
}
.search-suggest a:hover { border-color: var(--accent); color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .search-panel { transition: none; } }

.logo { display: flex; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.logo-text { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -.5px; }
.logo-dot { width: 9px; height: 9px; background: var(--orange); border-radius: 50%; margin-bottom: 4px; }

.two-line { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.two-line small { font-size: 12px; color: #ccc; }
.two-line strong { font-size: 14px; font-weight: 700; }


/* البحث */
.search {
  flex: 1;
  display: flex;
  height: 40px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  max-width: 900px;
  margin: 0 auto;
}
.search:focus-within { box-shadow: 0 0 0 3px var(--orange); }
.search-cat {
  background: #e6e6e6;
  border: 0;
  border-left: 1px solid #cdcdcd;
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  max-width: 120px;
}
.search-cat:hover { background: #d4d4d4; color: #000; }
.search input {
  flex: 1;
  border: 0;
  outline: 0;
  padding: 0 10px;
  font: inherit;
  font-size: 16px; /* 16px أو أكثر يمنع الزوم التلقائي في آيفون */
  min-width: 0;
  width: 100%;
}
.search-btn {
  background: var(--accent);
  width: 46px;
  display: grid;
  place-items: center;
  color: #333;
  flex-shrink: 0;
}
.search-btn:hover { background: var(--accent-hover); }


.cart { display: flex; align-items: flex-end; gap: 2px; }
.cart-icon { position: relative; display: inline-flex; }
.cart-icon svg { width: 36px; height: 36px; stroke-width: 1.6; }
.cart-count {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-30%);
  color: var(--orange);
  font-weight: 800;
  font-size: 16px;
}
.cart strong { font-size: 14px; margin-bottom: 3px; }

.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; flex-shrink: 0; }
.icon-btn svg { width: 26px; height: 26px; }

/* ===== نافذة الأقسام (Popup) ===== */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(15,17,17,.6);
  opacity: 0; visibility: hidden; transition: .25s; z-index: 90;
}
.drawer {
  position: fixed; z-index: 100;
  top: 50%; left: 50%;
  width: min(1000px, calc(100% - 48px));
  max-height: 80dvh;
  background: #fff; color: var(--text);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  transform: translate(-50%, -50%) scale(.94);
  transition: opacity .25s, transform .25s, visibility .25s;
}
body.drawer-open { overflow: hidden; }
body.drawer-open .drawer-overlay { opacity: 1; visibility: visible; }
body.drawer-open .drawer { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }

.drawer-head {
  background: var(--header-bg); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 10px 10px;
  flex-shrink: 0;
}
.drawer-head h2 { font-size: 17px; font-weight: 700; }
.drawer-close {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
}
.drawer-close:hover { background: rgba(255,255,255,.12); }
.drawer-body {
  flex: 1; overflow-y: auto;
  padding: 18px;
  background: var(--page-bg);
}

/* 5 أقسام في كل صف على كل الأجهزة = 4 صفوف كاملة */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.cat-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid #e3e6e6;
  min-width: 0;
  transition: box-shadow .2s, transform .2s;
}
.cat-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.12); transform: translateY(-2px); }
.cat-card:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.cat-img {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  padding-top: 100%; /* مربع بنسبة 1:1 */
  flex-shrink: 0;
  background: #f7f8f8;
  overflow: hidden;
}
.cat-img img {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px); height: calc(100% - 20px);
  object-fit: contain;
}
.cat-name {
  padding: 9px 6px;
  text-align: center;
  font-size: 14px; font-weight: 700;
  line-height: 1.3;
  border-top: 1px solid #eef0f0;
  display: flex; align-items: center; justify-content: center;
  flex: 1 0 auto;
  min-height: 2.6em;
  position: relative; z-index: 1;
  background: #fff;
  overflow-wrap: anywhere;
}

/* الجوال: عرض 100% ويظهر من الأسفل */
@media (max-width: 768px) {
  .drawer {
    top: 50%; left: 0;
    width: 100%;
    max-height: 85dvh;
    border-radius: 14px;
    transform: translateY(-50%) scale(.92);
  }
  body.drawer-open .drawer { transform: translateY(-50%) scale(1); }
  .drawer-body { padding: 10px 10px 14px; }
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .cat-card { border-radius: 8px; }
  .cat-card:hover { transform: none; }
  .cat-img img { inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
  .cat-name { font-size: 11.5px; padding: 6px 3px; font-weight: 600; }
}
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-overlay, .cat-card { transition: none; } }

/* أقسام فرعية داخل نافذة الأقسام */
.drawer-back { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; margin-inline-end: 4px; flex: none; }
.drawer-back:hover { background: rgba(255,255,255,.12); }
.drawer-back svg { width: 22px; height: 22px; }
.drawer-head h2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-card.has-sub { padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: center; }
.cat-name small { display: block; font-size: 11px; font-weight: 500; color: #565959; margin-top: 2px; }
.cat-name:has(small) { flex-direction: column; }
.cat-ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; color: #b0b5b5; }
.cat-all {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px;
  padding: 12px 14px; background: #fff; border: 1px solid #e3e6e6; border-radius: 8px; font-weight: 700; color: #007185;
}
.cat-all:hover { background: #f7fafa; }
.cat-all svg { width: 18px; height: 18px; flex: none; }
.cat-grid.slide-in { animation: catIn .28s ease-out; }
.cat-grid.slide-back { animation: catBack .28s ease-out; }
@keyframes catIn { from { opacity: 0; transform: translateX(-24px); } }
@keyframes catBack { from { opacity: 0; transform: translateX(24px); } }
@media (max-width: 768px) {
  .cat-name small { font-size: 10px; }
  .cat-ph { font-size: 24px; }
  .cat-all { padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .cat-grid.slide-in, .cat-grid.slide-back { animation: none; } }

/* ===== الصفحة الرئيسية: البنر ===== */
.home { flex: 1; }
.hero {
  background: linear-gradient(135deg, #232f3e 0%, #37475a 55%, #ff9900 160%);
  color: #fff;
}
.hero-in {
  max-width: 1500px;
  margin: 0 auto;
  min-height: 260px;
  padding: 44px max(28px, 4vw) 120px;   /* المساحة السفلية تركب عليها البطاقات */
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px;
}
.hero h1 { font-size: clamp(26px, 4vw, 42px); line-height: 1.2; font-weight: 800; text-wrap: balance; }
.hero p { color: #e3e6e6; max-width: 420px; font-size: 15px; line-height: 1.7; }
.hero-btn {
  background: #f1f2f4; color: #111;
  padding: 10px 22px; border-radius: 10px;
  font-weight: 700; font-size: 15px;
  transition: background .15s, transform .15s;
}
.hero-btn:hover { background: #fff; transform: translateY(-1px); }
.hero-btn:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
@media (max-width: 768px) {
  .hero-in { min-height: 220px; padding: 32px 20px 110px; }
}

/* ===== بطاقات الأقسام (تركب على أسفل البنر) ===== */
.acr-wrap { max-width: 1500px; margin: 0 auto; padding: 0 max(16px, 2vw); }
.acr {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
  margin: -100px 0 16px; position: relative; z-index: 2;
}
.ac { background: #fff; border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; min-width: 0; }
.ac h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; line-height: 1.35; }
.ag { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; }
.ag a { color: var(--text); font-size: 12px; min-width: 0; }
.ag a:hover small { color: #c7511f; }
.atl {
  display: block; width: 100%; aspect-ratio: 1; max-width: 100%;
  border: 1px solid #eee; border-radius: 4px; background: #fff; overflow: hidden;
}
.atl img { width: 100%; height: 100%; object-fit: contain; padding: 6px; transition: transform .25s; }
.ag a:hover .atl img { transform: scale(1.04); }
.ag small { display: block; margin-top: 4px; line-height: 1.35; overflow-wrap: anywhere; }
.lk { color: #007185; font-size: 14px; margin-top: 12px; display: inline-block; align-self: flex-start; }
.lk:hover { color: #c7511f; text-decoration: underline; }
@media (max-width: 1024px) {
  .acr { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: -90px; }
}
@media (max-width: 768px) {
  .acr-wrap { padding: 0 10px; }
  .acr { gap: 10px; }
  .ac { padding: 10px; }
  .ac h3 { font-size: 15px; margin-bottom: 8px; }
  .ag { gap: 8px; }
  .ag small { font-size: 11px; }
  .lk { font-size: 13px; margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { .atl img { transition: none; } }

/* ===== صفوف المنتجات (بأسلوب أمازون) ===== */
.rows-wrap { max-width: 1500px; margin: 0 auto; padding: 0 max(16px, 2vw); display: grid; gap: 16px; }
.prow { background: #fff; border-radius: 8px; padding: 12px 12px 10px; min-width: 0; }
.prow-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.prow-head h2 { font-size: 21px; font-weight: 700; }
/* «عرض الكل» على اليسار */
.prow-all {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 6px 10px 6px 14px; border-radius: 999px;
  border: 1px solid #d5d9d9; background: #fff;
  color: #007185; font-size: 13px; font-weight: 700;
  transition: background .15s, border-color .15s, color .15s;
}
.prow-all svg { width: 16px; height: 16px; stroke-width: 2.4; transition: transform .15s; }
.prow-all:hover { background: #f0f8fa; border-color: #007185; color: #005f6b; }
.prow-all:hover svg { transform: translateX(-3px); }
.prow-all:focus-visible { outline: 2px solid #e77600; outline-offset: 2px; }
.prow-scroll { position: relative; }
.prow-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 200px; gap: 8px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding-bottom: 4px;
  scrollbar-width: none;            /* إخفاء شريط التمرير */
}
.prow-track::-webkit-scrollbar { display: none; }
.prow-arrow {
  position: absolute; top: 70px; z-index: 3;
  width: 44px; height: 88px; display: grid; place-items: center;
  background: rgba(255,255,255,.95); border: 1px solid #d5d9d9; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(15,17,17,.15); color: #0f1111;
}
.prow-arrow:hover { background: #fff; border-color: #a2a6ac; }
.prow-arrow svg { width: 26px; height: 26px; stroke-width: 2.2; }
.prow-arrow.prev { right: -4px; }
.prow-arrow.next { left: -4px; }

.pc {
  scroll-snap-align: start; display: flex; flex-direction: column; min-width: 0;
  border: 1px solid #e3e6e6; border-radius: 8px; padding: 6px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.pc:hover { border-color: #c4c8c8; box-shadow: 0 4px 14px rgba(15,17,17,.08); }
.pc-img {
  position: relative; display: block; aspect-ratio: 1; max-width: 100%;
  background: #f7f8f8; border-radius: 6px; overflow: hidden;
}
.pc-img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; mix-blend-mode: multiply; transition: transform .25s; }
.pc-img:hover img { transform: scale(1.04); }
.pc-badge {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  background: #cc0c39; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 3px;
}
.pc-badge.best { background: #e47911; }
.pc-body { display: flex; flex-direction: column; gap: 4px; padding: 8px 4px 2px; flex: 1; }
.pc-name {
  font-size: 14px; line-height: 1.45; color: #0f1111;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em;
}
.pc-name:hover { color: #c7511f; }
.pc-prices { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pc-off { color: #cc0c39; font-size: 18px; font-weight: 400; direction: ltr; unicode-bidi: isolate; }
.pc-price { display: inline-flex; align-items: flex-start; direction: ltr; color: #0f1111; font-variant-numeric: tabular-nums; }
.pc-cur { font-size: 12px; margin-top: 4px; margin-right: 3px; }
.pc-whole { font-size: 24px; font-weight: 500; line-height: 1; }
.pc-fils { font-size: 12px; margin-top: 2px; }
.pc-old { font-size: 12px; color: #565959; }
.pc-old s { font-variant-numeric: tabular-nums; }
.pc-stock { font-size: 12px; font-weight: 700; }
.pc-stock.low { color: #c45500; }
.pc-stock.out { color: #b12704; }
.pc-add:disabled:not(.loading) { background: #f0f2f2; border-color: #e3e6e6; color: #8a8f8f; cursor: not-allowed; }
.pc-add {
  margin-top: auto; height: 34px; border-radius: 999px;
  background: #ffd814; border: 1px solid #fcd200; color: #0f1111; font-size: 13px; font-weight: 600;
  transition: background .15s;
}
.pc-add:hover { background: #f7ca00; }
.pc-add.done { background: #e3f5ef; border-color: #a8d5b9; color: #067d62; }
.pc-add { display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .2s, color .2s, border-color .2s, transform .15s; }
.pc-add:active { transform: scale(.97); }
.pc-add.loading { background: #fff3c4; border-color: #f5d76e; color: #6b5300; cursor: progress; }
.pc-add.done { animation: addpop .35s ease; }
.pc-spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(107, 83, 0, .25); border-top-color: #6b5300;
  animation: pcspin .7s linear infinite;
}
@keyframes pcspin { to { transform: rotate(360deg); } }
@keyframes addpop { 40% { transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .pc-spin { animation-duration: 1.6s; } .pc-add.done { animation: none; } }
.pc-add:focus-visible { outline: 3px solid #e77600; outline-offset: 2px; }

/* ===== نافذة «تمت الإضافة إلى السلة» ===== */
.cart-pop {
  position: fixed; z-index: 300;
  top: calc(env(safe-area-inset-top, 0px) + 72px); left: 16px;
  width: min(360px, calc(100vw - 32px));
  background: #fff; color: var(--text);
  border: 1px solid #d5d9d9; border-radius: 12px;
  box-shadow: 0 14px 40px rgba(15,17,17,.22);
  padding: 14px 14px 16px; overflow: hidden;
  transform: translateX(calc(-100% - 24px)); visibility: hidden;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), visibility .35s;
}
.cart-pop.on { transform: none; visibility: visible; }
.cart-pop.out { transform: translateX(calc(-100% - 24px)); visibility: hidden; transition: transform .4s ease-in, visibility .4s; }
.cp-head { display: flex; align-items: center; gap: 8px; }
.cp-head b { flex: 1; font-size: 15px; color: #067d62; }
.cp-ok { width: 24px; height: 24px; border-radius: 50%; background: #067d62; color: #fff; display: grid; place-items: center; flex: none; }
.cp-ok svg { width: 15px; height: 15px; stroke-width: 3; }
.cp-x { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #565959; flex: none; }
.cp-x:hover { background: #f0f2f2; color: var(--text); }
.cp-x svg { width: 16px; height: 16px; }
.cp-item { display: flex; gap: 12px; align-items: center; margin: 12px 0; padding: 10px; background: #f7f8f8; border-radius: 8px; }
.cp-img { width: 60px; height: 60px; flex: none; background: #fff; border: 1px solid #e3e6e6; border-radius: 6px; overflow: hidden; }
.cp-img img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.cp-info { min-width: 0; }
.cp-name { font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cp-price { display: block; margin-top: 3px; font-weight: 700; font-size: 14px; direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.cp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cp-btn {
  height: 38px; border-radius: 999px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  white-space: nowrap; font-size: 13px; font-weight: 700; transition: background .15s;
}
.cp-continue { background: #fff; border: 1px solid #d5d9d9; color: var(--text); }
.cp-continue:hover { background: #f7f8f8; }
.cp-cart { background: #ffd814; border: 1px solid #fcd200; color: #0f1111; }
.cp-cart:hover { background: #f7ca00; }
.cp-btn:focus-visible, .cp-x:focus-visible { outline: 2px solid #e77600; outline-offset: 2px; }
/* شريط العد التنازلي (5 ثوانٍ) */
.cp-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--orange); transform-origin: left; transform: scaleX(0); }
.cart-pop.on .cp-bar { animation: cpbar 5s linear forwards; }
.cart-pop.paused .cp-bar { animation-play-state: paused; }
@keyframes cpbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.cart.bump .cart-icon { animation: bump .45s; }
@keyframes bump { 30% { transform: scale(1.18); } }

/* أقسام الشبكة (بدون تمرير): 6 في الديسكتوب، 4 في التابلت، 2 في الجوال */
.prow-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.prow-grid .pc { scroll-snap-align: none; }
@media (max-width: 1100px) { .prow-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 768px) { .prow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; } }

@media (max-width: 1024px) { .prow-arrow { display: none; } }
@media (max-width: 768px) {
  .rows-wrap { padding: 0 10px; gap: 10px; }
  .prow { padding: 10px 8px 8px; }
  .prow-head h2 { font-size: 18px; }
  .prow-track { grid-auto-columns: 44%; gap: 6px; }
  .pc-name { font-size: 13px; }
  .pc { padding: 5px; }
  .pc-whole { font-size: 20px; }
  .pc-off { font-size: 15px; }
  .cart-pop { top: calc(env(safe-area-inset-top, 0px) + 68px); left: 10px; width: calc(100vw - 20px); }
}
@media (prefers-reduced-motion: reduce) { .pc-img img, .prow-track, .cart-pop, .cart-pop.out { transition: none; scroll-behavior: auto; } }

/* مساحة مؤقتة */
.page-placeholder { flex: 1; display: grid; place-items: center; min-height: 50vh; color: #777; font-size: 16px; }

/* ===== الفوتر ===== */
.site-footer { background: var(--footer-bg); color: #fff; margin-top: 40px; }

.back-to-top {
  display: block; text-align: center;
  background: var(--back-top);
  padding: 15px; font-size: 13px; font-weight: 600;
}
.back-to-top:hover { background: var(--back-top-hover); }

.footer-links {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), auto);
  justify-content: center;
  gap: 40px 80px;
  padding: 40px 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.footer-col h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; display: flex; justify-content: space-between; }
.footer-col .chev { display: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--text-light); font-size: 14px; }
.footer-col a:hover { text-decoration: underline; }

.footer-mid {
  border-top: 1px solid #3a4553;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 28px 20px; text-align: center;
}
.footer-mid:empty, .footer-links:empty { display: none; }
.footer-selectors { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.selector {
  border: 1px solid #848688; border-radius: 3px;
  padding: 6px 12px; font-size: 13px; color: #ccc;
}
.selector:hover { border-color: #fff; color: #fff; }

.footer-bottom {
  background: var(--footer-bottom);
  padding: 26px 20px 30px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.social { display: flex; gap: 12px; }
.social a {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid #3a4553; color: #ccc;
}
.social a:hover { color: var(--orange); border-color: var(--orange); }
.social svg { width: 18px; height: 18px; }
.legal { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.legal a { font-size: 12px; color: var(--text-light); }
.legal a:hover { text-decoration: underline; }
.copy { font-size: 12px; color: #999; }

/* ===== تابلت وآيباد (حتى 1024px) ===== */
@media (max-width: 1024px) {
  .orders { display: none !important; }
  .search-cat { max-width: 70px; }
  .footer-links { grid-template-columns: repeat(2, 1fr); gap: 30px 40px; max-width: 600px; }
}

/* ===== جوال (حتى 768px) ===== */
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }

  .header-main {
    flex-wrap: nowrap;
    padding: 6px 6px;
    gap: 0;
  }
  .header-main .hover-box { padding: 6px 4px; }
  .search-toggle { width: 40px; }
  .header-main .logo { margin-left: auto; }
  .logo-text { font-size: 22px; }

  .account-mobile { align-items: center; gap: 4px; }
  .account-mobile small { font-size: 13px; }
  .account-mobile svg { width: 26px; height: 26px; }

  .cart-icon svg { width: 34px; height: 34px; }

  .header-main .header-spacer { display: none; }
  .search-panel { padding: 12px; }
  .search { height: 44px; border-radius: 8px; width: 100%; }
  .search input, .search-cat { font-size: 16px; }
  .search-cat { display: none; }
  .search input { order: -1; }



  /* الفوتر كأكورديون */
  .footer-links { grid-template-columns: 1fr; gap: 0; padding: 10px 0; }
  .footer-col { border-bottom: 1px solid #3a4553; }
  .footer-col h3 { padding: 16px 20px; margin: 0; cursor: pointer; }
  .footer-col .chev { display: inline; transition: transform .2s; }
  .footer-col ul { max-height: 0; overflow: hidden; transition: max-height .3s ease; padding: 0 20px; }
  .footer-col.open ul { max-height: 300px; padding-bottom: 10px; }
  .footer-col.open .chev { transform: rotate(180deg); }
  .footer-col li { margin-bottom: 0; }
  .footer-col a { display: block; padding: 8px 0; }

  .footer-mid { gap: 20px; flex-direction: column; }
}

@media (max-width: 380px) {
  .account-mobile small { display: none; }
}

/* ===== نافذة تسجيل الدخول (Popup) ===== */
[hidden] { display: none !important; }

.auth-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,17,17,.6);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.auth-overlay.open { opacity: 1; visibility: visible; }
body.auth-open { overflow: hidden; }

.auth-modal {
  position: relative;
  background: #fff; color: var(--text);
  width: 100%; max-width: 440px;
  max-height: calc(100dvh - 32px); overflow-y: auto;
  border-radius: 14px;
  padding: 36px 32px 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
  transform: scale(.94); transition: transform .2s;
}
.auth-overlay.open .auth-modal { transform: none; }

.auth-close {
  position: absolute; top: 12px; left: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: #555;
}
.auth-close:hover { background: #f0f2f2; color: #000; }
.auth-close svg { width: 20px; height: 20px; }

/* ===== مكوّن الدخول / التسجيل (مشترك بين النافذة والصفحة) ===== */
.auth-box { color: var(--text); }
.auth-brand { display: flex; align-items: flex-end; justify-content: center; gap: 2px; margin-bottom: 6px; }
.auth-title { text-align: center; font-size: 22px; margin: 8px 0 4px; }
.auth-sub { text-align: center; color: #565959; font-size: 14px; margin-bottom: 18px; }

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #f0f2f2; border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.auth-tab { padding: 10px; border-radius: 8px; font-weight: 700; font-size: 14px; color: #565959; transition: background .15s; }
.auth-tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.15); }

.auth-form { display: none; flex-direction: column; gap: 16px; }
.auth-form.active { display: flex; }

.method-link {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: -6px;
  font-size: 13px; font-weight: 600; color: #007185;
  padding: 2px 0;
}
.method-link svg { width: 16px; height: 16px; }
.method-link:hover span { text-decoration: underline; color: #c7511f; }
.method-link:focus-visible { outline: 2px solid #e77600; outline-offset: 2px; border-radius: 4px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }

.field input:not([type="checkbox"]) {
  width: 100%; height: 48px;
  border: 1px solid #c4c8c8; border-radius: 10px;
  padding: 0 14px; font: inherit; font-size: 16px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #9aa0a0; }
.field input:focus { outline: 0; border-color: #e77600; box-shadow: 0 0 0 3px rgba(228,121,17,.22); }
.field.invalid input, .field.invalid .phone-field { border-color: #cc0c39; }
.err { display: none; color: #cc0c39; font-size: 12px; }
.field.invalid .err, .terms-err.show { display: block; }
#loginEmail, #regEmail { direction: ltr; text-align: left; }
#loginEmail::placeholder, #regEmail::placeholder { text-align: left; }

/* كلمة المرور */
.pass-wrap { position: relative; }
.pass-wrap input { padding-left: 48px !important; }
.toggle-pass {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 8px;
  display: grid; place-items: center; color: #6f7373;
}
.toggle-pass:hover { background: #f0f2f2; color: var(--text); }
.toggle-pass svg { width: 20px; height: 20px; }
.toggle-pass.on { color: #e77600; }

.strength { display: flex; align-items: center; gap: 10px; }
.strength .bar { display: flex; gap: 4px; flex: 1; max-width: 140px; }
.strength .bar i { flex: 1; height: 4px; border-radius: 4px; background: #e3e6e6; transition: background .2s; }
.strength-label { font-size: 12px; color: #6f7373; }
.strength[data-level="1"] .bar i:nth-child(1) { background: #cc0c39; }
.strength[data-level="2"] .bar i:nth-child(-n+2) { background: #f0a020; }
.strength[data-level="3"] .bar i { background: #067d62; }

/* ===== حقل الجوال مع رمز الدولة (الرمز على اليسار) ===== */
.phone-field {
  position: relative;
  direction: ltr;
  display: flex; align-items: stretch;
  height: 48px;
  border: 1px solid #c4c8c8; border-radius: 10px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.phone-field:focus-within { border-color: #e77600; box-shadow: 0 0 0 3px rgba(228,121,17,.22); }
.field .phone-field input {
  flex: 1; min-width: 0;
  height: 100%;
  border: 0 !important; box-shadow: none !important;
  border-radius: 0 10px 10px 0;
  direction: ltr; text-align: left;
  letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
  padding: 0 12px;
}
.cc { position: static; display: flex; }
.cc-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 0 10px 0 12px;
  background: #f7f8f8;
  border-right: 1px solid #e3e6e6;
  border-radius: 10px 0 0 10px;
  font-size: 15px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.cc-btn:hover { background: #eef0f0; }
.cc-btn:focus-visible { outline: 2px solid #e77600; outline-offset: -2px; }
.cc-chev { width: 14px; height: 14px; color: #6f7373; transition: transform .2s; }
.phone-field.cc-open .cc-chev { transform: rotate(180deg); }

.cc-flag { display: inline-flex; flex-shrink: 0; }
.cc-flag svg {
  width: 24px; height: 16px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.12);
  stroke: none;
}

.cc-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid #d5d9d9; border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,.16);
  padding: 6px;
  display: none;
}
.phone-field.cc-open .cc-list { display: block; }
.cc-list li {
  direction: rtl;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  cursor: pointer; font-size: 15px;
}
.cc-list li:hover, .cc-list li:focus { background: #f3f4f4; outline: 0; }
.cc-list li[aria-selected="true"] { background: #fff8ec; }
.cc-list li[aria-selected="true"] .cc-name { font-weight: 700; }
.cc-name { flex: 1; }
.cc-num { color: #565959; font-variant-numeric: tabular-nums; }
.cc-dial, .cc-num { direction: ltr; unicode-bidi: isolate; }
.cc-list li[aria-selected="true"]::after {
  content: ""; width: 7px; height: 12px; margin-inline-start: 2px;
  border: solid #e77600; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: #e77600; }
.link { color: #007185; }
.link:hover { color: #c7511f; text-decoration: underline; }

.btn-primary {
  height: 48px; border-radius: 999px;
  background: #ffd814; border: 1px solid #fcd200;
  font-weight: 700; font-size: 15px; color: var(--text);
  transition: background .15s;
}
.btn-primary:hover { background: #f7ca00; }
.btn-primary:focus-visible { outline: 3px solid #e77600; outline-offset: 2px; }

.form-msg { display: none; font-size: 13px; padding: 10px 12px; border-radius: 8px; background: #e6f4ea; color: #067d62; border: 1px solid #a8d5b9; }
.form-msg.show { display: block; }
.switch { text-align: center; font-size: 13px; color: #565959; border-top: 1px solid #e7e7e7; padding-top: 16px; }
.switch a { color: #007185; font-weight: 700; }

/* ===== صفحة الحساب ===== */
.account-page {
  flex: 1;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 40px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px));
}
.account-card {
  width: 100%; max-width: 980px;
  display: grid; grid-template-columns: 1fr 1.15fr;
  background: #fff;
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 10px 40px rgba(15,17,17,.12);
}
.account-aside {
  background: linear-gradient(160deg, #2c3b4e 0%, var(--header-bg) 75%);
  color: #fff;
  padding: 44px 40px;
  display: flex; flex-direction: column; gap: 18px;
  position: relative; overflow: hidden;
}
.account-aside::after {
  content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%;
  left: -110px; bottom: -120px;
  background: radial-gradient(circle, rgba(255,153,0,.28), transparent 70%);
}
.account-aside .logo { align-self: flex-start; }
.account-aside h1 { font-size: 28px; line-height: 1.35; text-wrap: balance; margin-top: 18px; }
.account-aside > p { color: #c9d1da; font-size: 15px; }
.perks { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.perks li { display: flex; gap: 12px; align-items: flex-start; }
.perk-ico {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(255,153,0,.16); color: var(--orange);
}
.perk-ico svg { width: 16px; height: 16px; stroke-width: 2.6; }
.perks strong { display: block; font-size: 15px; }
.perks small { color: #aeb8c3; font-size: 13px; }
.aside-foot { margin-top: auto; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: #c9d1da; position: relative; z-index: 1; }
.ship-flags { display: flex; gap: 8px; flex-wrap: wrap; }
.ship-flags .cc-flag svg { width: 28px; height: 19px; }

.account-card > .auth-box { padding: 44px 48px 36px; }
.account-card .auth-brand { display: none; }
.account-card .auth-title { text-align: right; margin-top: 0; }
.account-card .auth-sub { text-align: right; }

@media (max-width: 860px) {
  .account-page { padding-top: 20px; padding-bottom: 32px; }
  .account-card { grid-template-columns: 1fr; max-width: 520px; border-radius: 14px; }
  .account-aside { display: none; }
  .account-card > .auth-box { padding: 30px 22px 26px; }
  .account-card .auth-brand { display: flex; }
  .account-card .auth-title, .account-card .auth-sub { text-align: center; }
}

/* النافذة على الجوال: في المنتصف مع مسافة عن الحواف */
@media (max-width: 768px) {
  .auth-overlay {
    padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
  }
  .auth-modal { padding: 32px 20px 24px; transform: scale(.92); }
}
@media (prefers-reduced-motion: reduce) { .auth-overlay, .auth-modal { transition: none; } }

/* الحسابات متوقفة من لوحة التحكم */
.auth-off { text-align: center; padding: 18px 12px; border-radius: 10px; background: #f7f8f8; border: 1px solid #e3e6e6; }
.auth-off b { display: block; font-size: 16px; margin-bottom: 4px; }
.auth-off p { color: #565959; font-size: 14px; }

/* ===== شريط التنقل السفلي (الجوال فقط) ===== */
.nbar { display: none; }
@media (max-width: 768px) {
  /* مساحة للشريط داخل الفوتر الداكن حتى لا يغطي آخر سطر */
  .footer-bottom { padding-bottom: calc(30px + 54px + env(safe-area-inset-bottom, 0px)); }
  .nbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: flex; justify-content: space-around;
    background: #fff; border-top: 1px solid #d5d9d9;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
  }
  .nbar a {
    position: relative; flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    font-size: 10.5px; font-weight: 700; color: #565959;
  }
  .nbar .ni { position: relative; width: 44px; height: 26px; display: grid; place-items: center; }
  .nbar svg { width: 20px; height: 20px; stroke-width: 1.8; }
  .nbar a.on { color: #007185; }
  .nbar a.on::before { content: ""; position: absolute; top: -4px; left: 22%; right: 22%; height: 3px; background: #007185; border-radius: 0 0 3px 3px; }
  .nbar a:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
  .nbar b {
    position: absolute; top: -3px; inset-inline-end: 4px;
    min-width: 15px; height: 15px; padding: 0 3px; border-radius: 99px;
    background: var(--orange); color: #131921; font-size: 9px; font-weight: 800;
    display: grid; place-items: center;
  }
  .nbar b:empty { display: none; }
}

/* ===== السلة (تُفتح من جهة اليسار) ===== */
.cart-overlay {
  position: fixed; inset: 0; z-index: 250; background: rgba(15,17,17,.55);
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.cart-overlay.open { opacity: 1; visibility: visible; }
body.cart-open { overflow: hidden; }
.cart-drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 260;
  width: min(420px, 100%);
  background: #fff; color: var(--text);
  display: flex; flex-direction: column;
  box-shadow: 8px 0 30px rgba(0,0,0,.25);
  padding-top: env(safe-area-inset-top, 0px);
  transform: translateX(-100%); visibility: hidden;
  transition: transform .32s cubic-bezier(.2,.8,.2,1), visibility .32s;
}
.cart-drawer.open { transform: none; visibility: visible; }

.cd-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--header-bg); color: #fff;
}
.cd-head h2 { font-size: 18px; font-weight: 700; }
.cd-count { font-weight: 400; color: #ccc; font-size: 15px; }
.cd-close { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.cd-close:hover { background: rgba(255,255,255,.12); }
.cd-close svg { width: 20px; height: 20px; }

.cd-body { flex: 1; overflow-y: auto; padding: 8px 16px; }
.cd-list { display: flex; flex-direction: column; }
.cd-item {
  position: relative;
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 0; border-bottom: 1px solid #e7e7e7;
  transition: opacity .2s, transform .2s;
}
.cd-item.removing { opacity: 0; transform: translateX(-20px); }
.cd-img { width: 66px; height: 66px; flex: none; border: 1px solid #e3e6e6; border-radius: 8px; background: #f7f8f8; overflow: hidden; }
.cd-img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; mix-blend-mode: multiply; }
.cd-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cd-name { padding-left: 34px; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cd-unit { font-size: 12px; color: #565959; direction: ltr; text-align: right; }
.cd-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.cd-qty { display: inline-flex; align-items: center; border: 1px solid #d5d9d9; border-radius: 999px; overflow: hidden; background: #fff; }
.cd-qty button { width: 30px; height: 30px; font-size: 18px; font-weight: 700; color: var(--text); line-height: 1; }
.cd-qty button:hover:not(:disabled) { background: #f0f2f2; }
.cd-qty button:disabled { color: #c4c8c8; cursor: not-allowed; }
.cd-qty .q-val { min-width: 32px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; border-inline: 1px solid #e7e7e7; line-height: 30px; }
.cd-line { font-size: 15px; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cd-del { position: absolute; top: 6px; left: 0; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #565959; }
.cd-del:hover { background: #fde8e2; color: #b12704; }
.cd-del svg { width: 18px; height: 18px; }

.cd-empty { display: none; text-align: center; padding: 60px 16px; color: #565959; }
.cd-empty svg { width: 64px; height: 64px; color: #c4c8c8; margin-bottom: 10px; stroke-width: 1.4; }
.cd-empty b { display: block; font-size: 17px; color: var(--text); margin-bottom: 4px; }
.cart-drawer.is-empty .cd-empty { display: block; }
.cart-drawer.is-empty .cd-sum, .cart-drawer.is-empty .cd-note, .cart-drawer.is-empty .cd-checkout { display: none; }
.cart-drawer.is-empty .cd-actions { grid-template-columns: 1fr; }

.cd-foot {
  border-top: 1px solid #e3e6e6; background: #f7f8f8;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
}
.cd-sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; }
.cd-total { font-size: 20px; direction: ltr; font-variant-numeric: tabular-nums; }
.cd-note { font-size: 12px; color: #565959; margin: 4px 0 12px; }
.cd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cd-btn {
  height: 44px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; white-space: nowrap; padding: 0 10px; transition: background .15s;
}
.cd-continue { background: #fff; border: 1px solid #d5d9d9; color: var(--text); }
.cd-continue:hover { background: #f0f2f2; }
.cd-checkout { background: #ffd814; border: 1px solid #fcd200; color: #0f1111; }
.cd-checkout:hover { background: #f7ca00; }
.cd-full {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; margin-top: 8px; border-radius: 999px;
  background: #067d62; border: 1px solid #056b54; color: #fff;
  font-size: 14px; font-weight: 700; transition: background .15s;
}
.cd-full svg { width: 18px; height: 18px; stroke-width: 2.2; }
.cd-full:hover { background: #056b54; }
.cd-full:focus-visible { outline: 2px solid #e77600; outline-offset: 2px; }
.cart-drawer.is-empty .cd-full { display: none; }
.cd-btn:focus-visible, .cd-close:focus-visible, .cd-del:focus-visible, .cd-qty button:focus-visible { outline: 2px solid #e77600; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .cart-drawer, .cart-overlay, .cd-item { transition: none; } }

/* ===== صفحة سلة المشتريات ===== */
.cart-page { flex: 1; }
.cpg-wrap { max-width: 1400px; margin: 0 auto; padding: 16px max(16px, 2vw) 24px; display: grid; gap: 16px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #565959; }
.crumbs a { color: #007185; }
.crumbs a:hover { text-decoration: underline; color: #c7511f; }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.cart-main { display: grid; gap: 16px; min-width: 0; }
.cbox { background: #fff; border-radius: 8px; padding: 18px 20px; min-width: 0; }
.cbox-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #e7e7e7; }
.cbox-head h1 { font-size: 26px; font-weight: 700; }
.cbox-title { font-size: 20px; font-weight: 700; padding-bottom: 10px; border-bottom: 1px solid #e7e7e7; }
.link-btn { color: #007185; font-size: 13px; padding: 2px 0; }
.link-btn:hover { color: #c7511f; text-decoration: underline; }
.link-btn:focus-visible, .btn-outline:focus-visible, .btn-yellow:focus-visible, .coupon-btn:focus-visible { outline: 2px solid #e77600; outline-offset: 2px; }


/* عناوين الأعمدة (الديسكتوب) */
.cart-cols {
  display: grid; grid-template-columns: minmax(0, 1fr) 120px 110px; gap: 16px;
  padding: 12px 0 8px; font-size: 13px; color: #565959; border-bottom: 1px solid #e7e7e7;
}
.cart-cols span:not(:first-child) { text-align: center; }
.cart-cols span:last-child { text-align: left; }

/* المنتج في السلة */
.citems { display: flex; flex-direction: column; }
.citem {
  display: grid; grid-template-columns: 110px minmax(0, 1fr) 120px 110px; gap: 16px; align-items: start;
  padding: 16px 0; border-bottom: 1px solid #e7e7e7; transition: opacity .2s, transform .2s;
}
.citems.saved .citem { grid-template-columns: 90px minmax(0, 1fr); }
.citem.removing { opacity: 0; transform: translateX(-20px); }
.ci-img { display: block; aspect-ratio: 1; max-width: 100%; background: #f7f8f8; border: 1px solid #e3e6e6; border-radius: 8px; overflow: hidden; }
.ci-img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; mix-blend-mode: multiply; }
.ci-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ci-name { font-size: 16px; line-height: 1.45; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ci-name:hover { color: #c7511f; }
.ci-stock { font-size: 12px; color: #067d62; font-weight: 600; }
.ci-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.ci-price b { font-size: 15px; direction: ltr; }
.ci-price s { font-size: 12px; color: #565959; direction: ltr; }
.ci-save { font-size: 12px; font-weight: 700; color: #cc0c39; }
.ci-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; color: #d5d9d9; font-size: 13px; flex-wrap: wrap; }
.ci-qty { display: flex; justify-content: center; padding-top: 2px; }
.ci-line { font-size: 17px; text-align: left; direction: ltr; font-variant-numeric: tabular-nums; padding-top: 6px; white-space: nowrap; }
.btn-outline {
  height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid #d5d9d9; background: #fff;
  font-size: 13px; font-weight: 700; color: var(--text);
}
.btn-outline:hover { background: #f7f8f8; }
.cart-subline { text-align: left; font-size: 17px; padding-top: 14px; }
.cart-subline b { direction: ltr; display: inline-block; font-variant-numeric: tabular-nums; }

/* السلة الفارغة */
.cart-empty { text-align: center; padding: 48px 16px 32px; color: #565959; }
.cart-empty svg { width: 72px; height: 72px; color: #c4c8c8; stroke-width: 1.3; margin-bottom: 12px; }
.cart-empty h2 { font-size: 22px; color: var(--text); margin-bottom: 6px; }
.cart-empty p { margin-bottom: 18px; }
.btn-yellow {
  display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 28px;
  border-radius: 999px; background: #ffd814; border: 1px solid #fcd200; color: #0f1111; font-weight: 700; font-size: 15px;
  transition: background .15s;
}
.btn-yellow:hover { background: #f7ca00; }
.btn-yellow:disabled { opacity: .5; cursor: not-allowed; }

/* ملخص الطلب */
.cart-summary { position: sticky; top: 76px; display: grid; gap: 16px; }
.sum h2 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.sum-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.sum-select { width: 100%; height: 40px; border: 1px solid #c4c8c8; border-radius: 8px; padding: 0 10px; font: inherit; font-size: 16px; background: #fff; }
.sum-select:focus { outline: 0; border-color: #e77600; box-shadow: 0 0 0 3px rgba(231,118,0,.22); }
.sum-eta { font-size: 12px; color: #565959; margin: 5px 0 12px; }
.sum-rows { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid #e7e7e7; }
.sum-rows div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.sum-rows dt span { color: #565959; font-size: 12px; }
.sum-rows dd { direction: ltr; font-variant-numeric: tabular-nums; }
.sum-rows .disc dd { color: #067d62; font-weight: 700; }
.sum-rows .free { color: #067d62; font-weight: 700; }
.sum-rows .total { border-top: 1px solid #e7e7e7; padding-top: 10px; margin-top: 2px; }
.sum-rows .total dt, .sum-rows .total dd { font-size: 19px; font-weight: 800; }
.sum-rows .total dd { color: #b12704; }
.sum-vat { font-size: 12px; color: #565959; margin-bottom: 14px; }
.coupon { margin-bottom: 14px; }
.coupon-row { display: flex; gap: 6px; }
.coupon-input { flex: 1; min-width: 0; height: 40px; border: 1px solid #c4c8c8; border-radius: 8px; padding: 0 12px; font: inherit; font-size: 16px; text-transform: uppercase; direction: ltr; text-align: left; }
.coupon-input:focus { outline: 0; border-color: #e77600; box-shadow: 0 0 0 3px rgba(231,118,0,.22); }
.coupon-btn { height: 40px; padding: 0 16px; border-radius: 8px; background: var(--nav-bg); color: #fff; font-weight: 700; font-size: 14px; }
.coupon-btn:hover { background: var(--header-bg); }
.coupon-msg { font-size: 12px; margin-top: 6px; min-height: 0; }
.coupon-msg.ok { color: #067d62; font-weight: 600; }
.coupon-msg.err { color: #b12704; }
.checkout-btn { width: 100%; }
.checkout-msg { font-size: 12px; color: #565959; text-align: center; margin-top: 6px; min-height: 0; }
.secure { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: #565959; margin: 12px 0 8px; }
.secure svg { width: 14px; height: 14px; }
.pay-methods { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pm { font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 4px; border: 1px solid #e3e6e6; background: #fff; letter-spacing: .3px; }
.pm.knet { color: #00529b; } .pm.visa { color: #1a1f71; font-style: italic; } .pm.mc { color: #eb001b; } .pm.apple { color: #000; } .pm.cod { color: #565959; font-weight: 700; }
.help b { display: block; font-size: 15px; margin-bottom: 4px; }
.help p { font-size: 13px; color: #565959; }

/* شريط الدفع الثابت (الجوال) */
.cart-sticky { display: none; }

@media (max-width: 1024px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr); }
  .cart-summary { position: static; }
}
@media (max-width: 768px) {
  .cpg-wrap { padding: 10px 10px 16px; gap: 10px; }
  .cbox { padding: 14px 12px; }
  .cbox-head h1 { font-size: 21px; }
  .cart-cols { display: none; }
  .citem {
    grid-template-columns: 84px minmax(0, 1fr);
    grid-template-areas: "img info" "img qty";
    gap: 6px 12px; padding: 12px 0;
  }
  .citem .ci-img { grid-area: img; }
  .citem .ci-info { grid-area: info; }
  .citem .ci-qty { grid-area: qty; justify-content: space-between; align-items: center; }
  .citem .ci-line { position: absolute; }
  .citem { position: relative; }
  .citem .ci-line { left: 0; bottom: 16px; padding: 0; font-size: 16px; }
  .citems.saved .citem { grid-template-areas: "img info"; grid-template-columns: 70px minmax(0, 1fr); }
  .ci-name { font-size: 14px; }
  .cart-subline { font-size: 15px; }
  .cart-sticky {
    position: fixed; left: 0; right: 0; z-index: 44;
    bottom: calc(54px + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; background: #fff; border-top: 1px solid #d5d9d9; box-shadow: 0 -4px 14px rgba(0,0,0,.08);
  }
  .cart-sticky[hidden] { display: none; }
  .cart-sticky small { display: block; font-size: 11px; color: #565959; }
  .cart-sticky b { font-size: 18px; direction: ltr; display: block; text-align: right; font-variant-numeric: tabular-nums; }
  .cart-sticky .btn-yellow { height: 42px; padding: 0 20px; font-size: 14px; }
  .cart-page { padding-bottom: 64px; }
}
@media (prefers-reduced-motion: reduce) { .citem { transition: none; } }

/* ===== صفحة إتمام الطلب ===== */
.sum-rows .later { color: #565959; font-size: 13px; }
.checkout-btn.disabled { opacity: .5; pointer-events: none; }
.co-form { display: grid; gap: 14px; }
.co-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.co-title h1 { font-size: 26px; font-weight: 700; }
.co-secure { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #067d62; font-weight: 600; }
.co-secure svg { width: 16px; height: 16px; }
.co-step h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.co-num {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--header-bg); color: #fff; font-size: 14px; font-weight: 800;
}

/* طريقة الشراء */
.co-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.co-choice {
  position: relative; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 16px 10px; border: 2px solid #e3e6e6; border-radius: 10px; background: #fff;
  transition: border-color .15s, background .15s;
}
.co-choice:hover { border-color: #c4c8c8; }
.co-choice input { position: absolute; opacity: 0; pointer-events: none; }
.co-choice svg { width: 28px; height: 28px; color: #565959; margin-bottom: 4px; }
.co-choice b { font-size: 15px; }
.co-choice small { font-size: 12px; color: #565959; line-height: 1.4; }
.co-choice.selected { border-color: #e77600; background: #fff8ec; }
.co-choice.selected svg { color: #e77600; }
.co-choice:focus-within { outline: 2px solid #e77600; outline-offset: 2px; }

/* الحقول */
.co-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.co-full { grid-column: 1 / -1; }
.co-half { min-width: 0; }
.co-step .field select, .co-step .field textarea {
  width: 100%; border: 1px solid #c4c8c8; border-radius: 10px; padding: 0 14px;
  font: inherit; font-size: 16px; background: #fff; color: var(--text);
}
.co-step .field select { height: 48px; }
.co-step .field textarea { padding: 10px 14px; resize: vertical; min-height: 64px; }
.co-step .field select:focus, .co-step .field textarea:focus { outline: 0; border-color: #e77600; box-shadow: 0 0 0 3px rgba(228,121,17,.22); }
.co-step .field.invalid select, .co-step .field.invalid textarea { border-color: #cc0c39; }
.co-step .opt { color: #565959; font-weight: 400; font-size: 12px; }
.co-step .hint { font-size: 12px; color: #565959; }
.co-step .field.invalid .hint { display: none; }
#coEmail { direction: ltr; text-align: left; }

/* خيارات التوصيل والدفع */
.co-options { display: grid; gap: 10px; }
.co-option {
  position: relative; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: 2px solid #e3e6e6; border-radius: 10px; background: #fff;
  transition: border-color .15s, background .15s;
}
.co-option:hover { border-color: #c4c8c8; }
.co-option input { position: absolute; opacity: 0; pointer-events: none; }
.co-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #a6a6a6; flex: none; display: grid; place-items: center; }
.co-option.selected { border-color: #e77600; background: #fff8ec; }
.co-option.selected .co-radio { border-color: #e77600; }
.co-option.selected .co-radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #e77600; }
.co-option:focus-within { outline: 2px solid #e77600; outline-offset: 2px; }
.co-opt-txt { flex: 1; display: flex; flex-direction: column; }
.co-opt-txt b { font-size: 15px; }
.co-opt-txt small { font-size: 13px; color: #565959; }
.co-opt-price { font-weight: 800; font-size: 16px; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.co-opt-ico { width: 28px; height: 28px; color: #067d62; flex: none; }
.co-notes { margin-top: 14px; }

/* ملخص الطلب في صفحة الدفع */
.co-sum-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.co-sum-head h2 { margin-bottom: 0; }
.co-items { display: flex; flex-direction: column; gap: 10px; max-height: 300px; overflow-y: auto; padding: 4px 0 12px; }
.co-items li { display: flex; align-items: center; gap: 10px; }
.co-thumb { position: relative; width: 52px; height: 52px; flex: none; border: 1px solid #e3e6e6; border-radius: 8px; background: #f7f8f8; }
.co-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; mix-blend-mode: multiply; }
.co-thumb b {
  position: absolute; top: -7px; left: -7px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 99px; background: #565959; color: #fff; font-size: 11px; display: grid; place-items: center;
}
.co-iname { flex: 1; min-width: 0; font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.co-iprice { font-size: 13px; font-weight: 700; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.co-err { font-size: 13px; color: #b12704; text-align: center; margin-top: 6px; min-height: 0; }
.checkout-btn .pc-spin, .cart-sticky .pc-spin { border-color: rgba(15,17,17,.2); border-top-color: #0f1111; margin-left: 8px; }

/* تم الطلب */
.co-done { max-width: 640px; width: 100%; margin: 10px auto; text-align: center; padding: 34px 24px; }
.co-done-ico { width: 64px; height: 64px; border-radius: 50%; background: #067d62; color: #fff; display: grid; place-items: center; margin: 0 auto 14px; }
.co-done-ico svg { width: 34px; height: 34px; stroke-width: 3; }
.co-done h1 { font-size: 24px; margin-bottom: 6px; }
.co-done > p { color: #565959; }
.co-done > p b { color: var(--text); direction: ltr; unicode-bidi: isolate; }
.co-done-info { text-align: right; margin: 18px 0; border: 1px solid #e3e6e6; border-radius: 10px; }
.co-done-info div { display: flex; justify-content: space-between; gap: 14px; padding: 12px 14px; border-top: 1px solid #e3e6e6; font-size: 14px; }
.co-done-info div:first-child { border-top: 0; }
.co-done-info dt { color: #565959; flex: none; }
.co-done-info dd { font-weight: 600; text-align: left; }
.co-done-note { margin-bottom: 18px; font-size: 14px; }
.co-done-note b { direction: ltr; unicode-bidi: isolate; }

@media (max-width: 768px) {
  .co-title h1 { font-size: 21px; }
  /* الخيارات الثلاثة جنب بعض على الجوال أيضاً */
  .co-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .co-choice { padding: 12px 4px; gap: 2px; }
  .co-choice svg { width: 24px; height: 24px; margin-bottom: 2px; }
  .co-choice b { font-size: 13px; line-height: 1.3; }
  .co-choice small { font-size: 10.5px; line-height: 1.35; }
  .co-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .co-half { grid-column: auto; }
  .co-done { padding: 26px 16px; }
}

/* ===== حقول الإدخال بأسلوب أمازون: إطار رمادي وظل داخلي خفيف ===== */
.field input:not([type="checkbox"]),
.phone-field,
.co-step .field select,
.co-step .field textarea,
.coupon-input {
  border: 1px solid #888c8c;
  border-top-color: #7a7e7e;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 17, 17, .15);
}
.field .phone-field input { box-shadow: none !important; border: 0 !important; }
.field input:not([type="checkbox"]):hover,
.phone-field:hover,
.co-step .field select:hover,
.co-step .field textarea:hover,
.coupon-input:hover { border-color: #6f7373; }
/* عند الكتابة: إطار أزرق مخضر وهالة خفيفة مثل أمازون */
.field input:not([type="checkbox"]):focus,
.phone-field:focus-within,
.co-step .field select:focus,
.co-step .field textarea:focus,
.coupon-input:focus {
  outline: 0;
  border-color: #007185;
  box-shadow: 0 0 0 3px #c8f3fa, inset 0 1px 2px rgba(15, 17, 17, .15);
}
.field.invalid input:not([type="checkbox"]),
.field.invalid .phone-field,
.co-step .field.invalid select,
.co-step .field.invalid textarea {
  border-color: #cc0c39;
  box-shadow: 0 0 0 3px rgba(204, 12, 57, .12), inset 0 1px 2px rgba(15, 17, 17, .15);
}
.cc-btn { border-radius: 8px 0 0 8px; }

/* ===== نتائج البحث المباشر ===== */
.search-results {
  max-width: 900px; margin: 10px auto 0;
  background: #fff; color: var(--text);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  max-height: min(62vh, 520px); overflow-y: auto; padding: 6px;
}
.sr-count { font-size: 12px; color: #565959; padding: 6px 10px 4px; }
.sr-empty { padding: 18px 14px; text-align: center; color: #565959; font-size: 14px; }
.sr-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 8px; cursor: default;
}
.sr-item:hover, .sr-item[aria-selected="true"] { background: #f3f4f4; }
.sr-img { width: 58px; height: 58px; flex: none; border: 1px solid #e3e6e6; border-radius: 8px; background: #f7f8f8; overflow: hidden; }
.sr-img img { width: 100%; height: 100%; object-fit: contain; padding: 3px; mix-blend-mode: multiply; }
.sr-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sr-name { color: var(--text); font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-name mark { background: #fff1b8; color: inherit; border-radius: 2px; padding: 0 1px; }
.sr-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.sr-stock { font-weight: 700; }
.sr-stock.in { color: #067d62; }
.sr-stock.low { color: #c45500; }
.sr-stock.out { color: #b12704; }
.sr-sec { color: #565959; padding-inline-start: 8px; border-inline-start: 1px solid #d5d9d9; }
.sr-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.sr-price { font-size: 15px; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr-side s { font-size: 11px; color: #565959; direction: ltr; }
.sr-add {
  min-width: 72px; height: 30px; padding: 0 12px; border-radius: 999px;
  background: #ffd814; border: 1px solid #fcd200; color: #0f1111; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.sr-add:hover:not(:disabled) { background: #f7ca00; }
.sr-add:disabled { background: #f0f2f2; border-color: #e3e6e6; color: #8a8f8f; cursor: not-allowed; }
.sr-add.loading { background: #fff3c4; }
.sr-add.done { background: #e3f5ef; border-color: #a8d5b9; color: #067d62; }
.sr-add:focus-visible { outline: 2px solid #e77600; outline-offset: 2px; }
@media (max-width: 768px) {
  .search-results { margin-top: 8px; max-height: 60vh; padding: 4px; }
  .sr-item { gap: 10px; padding: 8px 6px; }
  .sr-img { width: 52px; height: 52px; }
  .sr-name { font-size: 13px; }
  .sr-sec { display: none; }
  .sr-add { min-width: 60px; height: 28px; padding: 0 10px; }
}

.sr-all {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 6px 4px 4px; height: 42px; border-radius: 8px;
  background: #f0f8fa; border: 1px solid #cfe7ed; color: #007185; font-size: 14px; font-weight: 700;
}
.sr-all:hover { background: #e3f2f6; border-color: #007185; }
.sr-all svg { width: 16px; height: 16px; stroke-width: 2.4; }
.sr-all:focus-visible { outline: 2px solid #e77600; outline-offset: 2px; }

/* ===== صفحة نتائج البحث ===== */
.sp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sp-head h1 { font-size: 22px; font-weight: 700; }
.sp-head h1 .sp-q { color: #c45500; }
.sp-count { font-size: 13px; color: #565959; margin-top: 2px; }
.sp-tools { display: flex; align-items: center; gap: 8px; }
.sp-sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #565959; }
.sp-sort select {
  height: 36px; border: 1px solid #d5d9d9; border-radius: 8px; padding: 0 10px; font: inherit; font-size: 14px;
  background: #f0f2f2; color: var(--text); box-shadow: 0 2px 5px rgba(15,17,17,.08); cursor: pointer;
}
.sp-sort select:focus { outline: 2px solid #e77600; outline-offset: 1px; }
.sp-filter-btn {
  display: none; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid #d5d9d9; background: #fff; font-size: 14px; font-weight: 700;
}
.sp-filter-btn svg { width: 18px; height: 18px; }
.sp-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.sp-filters { position: sticky; top: 76px; padding: 16px; }
.spf-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.spf-head b { font-size: 16px; }
.spf-group { border: 0; border-top: 1px solid #e7e7e7; padding: 12px 0 4px; margin: 0; min-width: 0; }
.spf-group legend { font-size: 14px; font-weight: 700; padding: 0; margin-bottom: 8px; float: right; width: 100%; }
.spf-group legend + * { clear: both; }
.spf-check { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0; cursor: pointer; }
.spf-check input { width: 17px; height: 17px; accent-color: #e77600; }
.spf-n { color: #565959; font-size: 12px; }
.spf-none { color: #565959; font-size: 13px; }
.spf-price { display: flex; align-items: center; gap: 6px; }
.spf-price input {
  width: 100%; min-width: 0; height: 36px; border: 1px solid #888c8c; border-radius: 8px; padding: 0 10px;
  font: inherit; font-size: 15px; box-shadow: inset 0 1px 2px rgba(15,17,17,.15); direction: ltr; text-align: left;
}
.spf-price input:focus { outline: 0; border-color: #007185; box-shadow: 0 0 0 3px #c8f3fa, inset 0 1px 2px rgba(15,17,17,.15); }
.spf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.spf-chips button { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid #d5d9d9; background: #fff; }
.spf-chips button:hover { border-color: #a6a6a6; }
.spf-chips button.on { border-color: #e77600; background: #fff8ec; color: #c45500; font-weight: 700; }
.spf-apply { display: none; width: 100%; margin-top: 14px; }
.sp-results { min-width: 0; }
.sp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; padding: 10px; border-radius: 8px; }
.sp-empty { text-align: center; padding: 44px 16px; color: #565959; }
.sp-empty svg { width: 64px; height: 64px; color: #c4c8c8; stroke-width: 1.4; margin-bottom: 10px; }
.sp-empty h2 { font-size: 20px; color: var(--text); margin-bottom: 6px; }
.sp-suggest { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; font-size: 14px; }
.sp-suggest a { padding: 5px 14px; border-radius: 999px; border: 1px solid #d5d9d9; color: #007185; font-weight: 600; }
.sp-suggest a:hover { border-color: #007185; background: #f0f8fa; }

@media (min-width: 1300px) { .sp-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1024px) {
  .sp-layout { grid-template-columns: minmax(0, 1fr); }
  .sp-filter-btn { display: inline-flex; }
  .sp-filters { position: static; display: none; }
  .sp-filters.open { display: block; }
  .spf-apply { display: flex; }
  .sp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .sp-head { padding: 12px; }
  .sp-head h1 { font-size: 18px; }
  .sp-tools { width: 100%; justify-content: space-between; }
  .sp-sort span { display: none; }
  .sp-sort select { max-width: 200px; }
  .sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 6px; }
}

/* ===== تسوق حسب العلامة التجارية ===== */
.brands { margin-top: 16px; }
.brand-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.brand-tile {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px 10px 12px; border: 1px solid #e3e6e6; border-radius: 12px; background: #fff;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.brand-tile:hover { border-color: #c4c8c8; box-shadow: 0 6px 18px rgba(15,17,17,.1); transform: translateY(-2px); }
.brand-tile:focus-visible { outline: 3px solid #e77600; outline-offset: 2px; }
.brand-logo {
  width: 100%; max-width: 150px; aspect-ratio: 1; border-radius: 16px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(15,17,17,.12);
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-name { display: flex; flex-direction: column; align-items: center; font-size: 15px; font-weight: 700; line-height: 1.3; }
.brand-name small { font-size: 12px; font-weight: 500; color: #565959; direction: ltr; }
@media (max-width: 768px) {
  .brands { margin-top: 10px; }
  .brand-grid { gap: 8px; }
  .brand-tile { padding: 10px 6px 8px; gap: 6px; border-radius: 10px; }
  .brand-logo { border-radius: 12px; }
  .brand-name { font-size: 12px; }
  .brand-name small { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) { .brand-tile { transition: none; } }

/* زر «عرض كل الشركات» */
.brands-all { background: linear-gradient(180deg, #fff, #f7fafa); }

/* ===== صفحة العلامات التجارية ===== */
.bp-hero {
  border-radius: 12px; padding: 30px 24px; color: #fff; text-align: center;
  background: linear-gradient(135deg, #232f3e 0%, #37475a 55%, #ff9900 160%);
}
.bp-hero h1 { font-size: 28px; font-weight: 800; }
.bp-hero p { color: #e3e6e6; margin-top: 6px; }
.bp-total { display: inline-block; margin-top: 12px; padding: 4px 14px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: 13px; font-weight: 700; }
.bp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.bp-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  background: #fff; border: 1px solid #e3e6e6; border-radius: 14px; padding: 0 16px 18px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.bp-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(15,17,17,.12); border-color: color-mix(in srgb, var(--brand) 45%, #e3e6e6); }
.bp-card:focus-visible { outline: 3px solid #e77600; outline-offset: 3px; }
.bp-band { align-self: stretch; height: 70px; margin: 0 -16px; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #131921)); }
.bp-logo {
  width: 104px; height: 104px; margin-top: -52px; border-radius: 22px; overflow: hidden;
  border: 4px solid #fff; box-shadow: 0 6px 16px rgba(15,17,17,.18); background: #fff;
}
.bp-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bp-names { display: flex; flex-direction: column; margin-top: 2px; }
.bp-names b { font-size: 19px; }
.bp-names small { font-size: 13px; color: #565959; direction: ltr; }
.bp-desc { font-size: 13px; color: #565959; line-height: 1.6; min-height: 3.2em; }
.bp-count { font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: #f0f2f2; color: var(--text); }
.bp-btn {
  margin-top: 4px; display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 999px;
  background: #ffd814; border: 1px solid #fcd200; color: #0f1111; font-size: 13px; font-weight: 700;
  transition: background .15s;
}
.bp-btn svg { width: 16px; height: 16px; stroke-width: 2.4; transition: transform .15s; }
.bp-card:hover .bp-btn { background: #f7ca00; }
.bp-card:hover .bp-btn svg { transform: translateX(-3px); }
@media (max-width: 1024px) { .bp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) {
  .bp-hero { padding: 22px 16px; }
  .bp-hero h1 { font-size: 22px; }
  .bp-grid { gap: 10px; }
  .bp-card { padding: 0 10px 14px; gap: 6px; border-radius: 12px; }
  .bp-band { height: 52px; margin: 0 -10px; }
  .bp-logo { width: 76px; height: 76px; margin-top: -38px; border-radius: 18px; border-width: 3px; }
  .bp-names b { font-size: 15px; }
  .bp-desc { font-size: 11.5px; }
  .bp-btn { height: 34px; padding: 0 10px; font-size: 11.5px; }
  .brands-all { font-size: 12px; padding: 5px 8px 5px 12px; }
}
@media (prefers-reduced-motion: reduce) { .bp-card, .bp-btn svg { transition: none; } }

/* ===== طرق الدفع أسفل الفوتر ===== */
.pay-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pb {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 32px; min-width: 62px; padding: 0 10px; border-radius: 6px;
  background: #fff; color: #0f1111; box-shadow: 0 1px 3px rgba(0,0,0,.35);
  font-weight: 800; font-size: 14px; letter-spacing: .3px; direction: ltr; user-select: none;
}
.pb-knet { color: #00529b; font-size: 15px; gap: 0; }
.pb-knet b { color: #f7a81b; font-weight: 900; }
.pb-visa { color: #1a1f71; font-style: italic; font-size: 17px; font-weight: 900; letter-spacing: .5px; }
.pb-mc { gap: 3px; padding: 0 8px; }
.pb-mc svg { width: 30px; height: 20px; }
.pb-mc small { font-size: 9.5px; font-weight: 700; color: #231f20; letter-spacing: 0; }
.pb-apple { background: #000; color: #fff; font-size: 15px; font-weight: 600; gap: 2px; }
.pb-apple svg { width: 16px; height: 16px; margin-top: -2px; }
@media (max-width: 768px) {
  .pay-badges { gap: 6px; }
  .pb { height: 28px; min-width: 54px; padding: 0 8px; font-size: 13px; }
  .pb-visa { font-size: 15px; }
}

/* ===== صفحة المنتج (مثل التصميم المرجعي) ===== */
.crumbs { flex-wrap: wrap; min-width: 0; }
.crumbs b { color: var(--text); font-weight: 600; }
.crumb-cur { min-width: 0; max-width: min(42ch, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
/* الصور */
.pd-gallery { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 80px; min-width: 0; }
.pd-wrap { position: relative; touch-action: pan-y; }
.pd-main {
  position: relative; aspect-ratio: 1; max-width: 100%; overflow: hidden; cursor: zoom-in;
  background: #fff; border: 1px solid #d5d9d9; border-radius: 8px;
}
.pd-main img { width: 100%; height: 100%; object-fit: contain; padding: 7%; transition: transform .25s ease; }
.pd-main.zooming img { transform: scale(2); }
.pd-main img.slide { animation: pdslide .5s cubic-bezier(.25,.8,.25,1); }
@keyframes pdslide { from { opacity: 0; translate: var(--dx) 0; } to { opacity: 1; translate: 0 0; } }
.pd-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #111;
  background: rgba(255,255,255,.75); border: 1px solid rgba(255,255,255,.9);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(17,17,17,.08), 0 8px 20px rgba(17,17,17,.15);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.pd-arrow:hover { background: #fff; }
.pd-arrow svg { width: 22px; height: 22px; stroke-width: 2.4; }
.pd-arrow-r { right: 10px; } .pd-arrow-l { left: 10px; }
.pd-arrow:focus-visible { outline: 2px solid #e77600; outline-offset: 2px; }
.pd-count {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 2; direction: ltr;
  font-size: 12px; font-weight: 700; background: rgba(255,255,255,.8); padding: 3px 12px; border-radius: 99px;
  box-shadow: 0 0 0 1px rgba(17,17,17,.08); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.pd-thumbs { display: flex; gap: 10px; }
.pd-thumb { width: 72px; height: 72px; padding: 0; border-radius: 4px; overflow: hidden; background: #fff; border: 1px solid rgba(17,17,17,.14); }
.pd-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.pd-thumb.on { box-shadow: 0 0 0 2px #111; }
.pd-thumb:focus-visible { outline: 2px solid #e77600; outline-offset: 2px; }
/* بطاقة المعلومات */
.pd-info { min-width: 0; background: #fff; border: 1px solid #d5d9d9; border-radius: 8px; padding: 22px; display: flex; flex-direction: column; }
.pd-tag { align-self: flex-start; margin-bottom: 8px; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 99px; background: #cc0c39; color: #fff; }
.pd-tag.best { background: #e47911; }
.pd-title { font-size: 24px; line-height: 1.35; margin-bottom: 8px; }
.pd-brand { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: #4b5563; margin-bottom: 8px; }
.pd-brand img { width: 32px; height: 32px; border-radius: 7px; object-fit: contain; background: #fff; border: 1px solid #e5e7eb; }
.pd-brand:hover { color: #c45500; }
.pd-sku { font-size: 13px; color: #6b7280; margin-bottom: 10px; }
.pd-sku span { direction: ltr; unicode-bidi: isolate; }
.pd-price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.pd-price { font-size: 30px; font-weight: 800; direction: ltr; font-variant-numeric: tabular-nums; }
.pd-old { color: #6b7280; direction: ltr; font-variant-numeric: tabular-nums; }
.pd-off { font-style: normal; background: #111; color: #fff; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; }
.pd-stock { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.pd-stock.in { color: #067d62; } .pd-stock.low { color: #c45500; } .pd-stock.out { color: #b12704; }
.pd-short { font-size: 14px; line-height: 1.8; color: #374151; margin-bottom: 10px; }
.pd-features { font-size: 14px; margin-bottom: 14px; }
.pd-features li { padding: 5px 0; }
.pd-features li::before { content: "✓"; font-weight: 800; margin-inline-end: 8px; color: #067d62; }
.pd-versions { margin-bottom: 12px; }
.pd-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.pd-ver-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-ver { padding: 7px 14px; border: 1px solid #d5d9d9; border-radius: 8px; font-size: 13px; background: #fff; }
.pd-ver:hover { border-color: #a6a6a6; }
.pd-ver.on { border-color: #111; box-shadow: 0 0 0 1px #111; font-weight: 700; }
.pd-buy-row { display: flex; gap: 10px; margin-bottom: 10px; }
.pd-qty { display: flex; align-items: center; height: 54px; border-radius: 8px; background: #f0f2f2; border: 1px solid #d5d9d9; flex: none; }
.pd-qty button { width: 46px; height: 100%; font-size: 22px; color: var(--text); }
.pd-qty button:disabled { color: #b5b9b9; cursor: not-allowed; }
.pd-qty span { min-width: 42px; text-align: center; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pd-add {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 54px; padding: 0 10px;
  font-size: 16px; font-weight: 700; border-radius: 8px; background: #ffd814; border: 1px solid #fcd200; color: #0f1111;
  transition: background .15s;
}
.pd-add svg { width: 20px; height: 20px; stroke-width: 1.9; }
.pd-add:hover:not(:disabled) { background: #f7ca00; }
.pd-add.done { background: #067d62; border-color: #067d62; color: #fff; }
.pd-add:disabled, .pd-now:disabled { opacity: .5; cursor: not-allowed; }
.pd-add .pc-spin { border-color: rgba(15,17,17,.2); border-top-color: #0f1111; }
.pd-now {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 54px; border-radius: 8px;
  font-size: 16px; font-weight: 700; color: #fff;
  background: #067d62; border: 1px solid #067d62;
  transition: background .15s;
}
.pd-now svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.pd-now:hover:not(:disabled) { background: #056b54; }
.pd-add:focus-visible, .pd-now:focus-visible, .pd-qty button:focus-visible { outline: 2px solid #e77600; outline-offset: 2px; }
.pd-msg { font-size: 13px; margin: 10px 0 0; text-align: center; }
.pd-msg:empty { display: none; }
.pd-msg a { color: #007185; font-weight: 600; text-decoration: underline; }
/* الوصف والمواصفات */
.pd-card { background: #fff; border: 1px solid #d5d9d9; border-radius: 8px; padding: 18px; }
.pd-tabs { display: flex; gap: 6px; background: #f0f2f2; padding: 4px; border-radius: 8px; margin-bottom: 18px; }
.pd-tabs button { flex: 1; padding: 10px; border-radius: 6px; font-weight: 700; color: #6b7280; transition: background .2s, color .2s; }
.pd-tabs button.on { background: #fff; color: #0f1111; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.pd-tabs button:focus-visible { outline: 2px solid #e77600; outline-offset: 1px; }
.pd-desc { font-size: 14px; line-height: 1.8; color: #374151; }
.pd-specs { width: 100%; border-collapse: collapse; }
.pd-specs td { padding: 10px 12px; border-bottom: 1px solid rgba(17,17,17,.08); font-size: 14px; }
.pd-specs td:first-child { color: #6b7280; width: 38%; }
.pd-specs tr:last-child td { border-bottom: 0; }
.pd-rows { display: grid; gap: 16px; }

@media (max-width: 900px) {
  .pd { grid-template-columns: minmax(0, 1fr); }
  .pd-gallery { position: static; }
}
@media (max-width: 768px) {
  .pd { gap: 14px; }
  .pd-main { cursor: default; }
  .pd-arrow { width: 36px; height: 36px; }
  .pd-thumb { width: 62px; height: 62px; }
  .pd-info { padding: 16px; }
  .pd-title { font-size: 19px; }
  .pd-price { font-size: 26px; }
  .pd-card { padding: 14px 12px; }
  .pd-rows { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { .pd-main img { transition: none; } .pd-main img.slide { animation: none; } }

/* ===== معرض الصور بملء الشاشة ===== */
html.lb-lock, html.lb-lock body { overflow: hidden; }
.lb {
  position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column;
  background: #0f1111; color: #fff; opacity: 0; transition: opacity .2s ease;
}
.lb.open { opacity: 1; }
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); flex: none; }
.lb-count { font-size: 14px; font-weight: 700; direction: ltr; font-variant-numeric: tabular-nums; }
.lb-zoom { display: flex; gap: 8px; }
.lb-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); transition: background .15s;
}
.lb-btn:hover:not(:disabled) { background: rgba(255,255,255,.24); }
.lb-btn:disabled { opacity: .35; cursor: default; }
.lb-btn:focus-visible { outline: 2px solid #ffd814; outline-offset: 2px; }
.lb-btn svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.lb-stage {
  flex: 1; min-height: 0; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
  touch-action: none; cursor: zoom-in; user-select: none; -webkit-user-select: none; padding: 0 16px;
}
.lb-stage.zoomed { cursor: grab; }
.lb-stage.zoomed:active { cursor: grabbing; }
.lb-stage img {
  max-width: min(100%, 900px); max-height: 100%; object-fit: contain; background: #fff; border-radius: 8px;
  transform-origin: center; will-change: transform; -webkit-user-drag: none;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; z-index: 2;
  background: rgba(15,17,17,.55); border-color: rgba(255,255,255,.28); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.lb-nav:hover:not(:disabled) { background: rgba(15,17,17,.75); }
.lb-nav:active { transform: translateY(-50%) scale(.92); }
.lb-prev { right: 16px; } .lb-next { left: 16px; }
.lb-thumbs {
  flex: none; display: flex; justify-content: center; gap: 10px; padding: 12px 16px;
  padding-bottom: max(14px, env(safe-area-inset-bottom)); overflow-x: auto; scrollbar-width: none;
}
.lb-thumbs::-webkit-scrollbar { display: none; }
.lb-thumbs button { flex: none; width: 64px; height: 64px; padding: 0; border-radius: 6px; overflow: hidden; background: #fff; opacity: .55; transition: opacity .15s; border: 0; }
.lb-thumbs button img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.lb-thumbs button:hover { opacity: .85; }
.lb-thumbs button.on { opacity: 1; box-shadow: 0 0 0 2px #ffd814; }
.lb-thumbs button:focus-visible { outline: 2px solid #ffd814; outline-offset: 2px; }
.pd-main { cursor: zoom-in; }
@media (max-width: 768px) {
  .lb-nav { width: 40px; height: 40px; }
  .lb-prev { right: 8px; } .lb-next { left: 8px; }
  .lb-stage { padding: 0; }
  .lb-stage img { border-radius: 0; }
  .lb-thumbs button { width: 54px; height: 54px; }
  .lb-btn { width: 40px; height: 40px; }
  .pd-main { cursor: pointer; }
}
@media (prefers-reduced-motion: reduce) { .lb { transition: none; } }
.sr-name:hover { color: #c7511f; text-decoration: underline; }
.cp-qty { font-size: 12px; font-weight: 500; color: #565959; margin-inline-start: 8px; padding-inline-start: 8px; border-inline-start: 1px solid #d5d9d9; }
.brand-ph { display: grid; place-items: center; width: 100%; height: 100%; font-size: 15px; font-weight: 800; color: #565959; direction: ltr; }

/* وصف المنتج من محرر لوحة التحكم */
.pd-rich { line-height: 1.9; color: #1f2937; overflow-wrap: anywhere; }
.pd-rich > * + * { margin-top: .8em; }
.pd-rich h2 { font-size: 20px; } .pd-rich h3 { font-size: 17px; } .pd-rich h4 { font-size: 15px; }
.pd-rich ul, .pd-rich ol { padding-inline-start: 1.4em; }
.pd-rich ul { list-style: disc; } .pd-rich ol { list-style: decimal; }
.pd-rich a { color: #007185; text-decoration: underline; }
.pd-rich img { max-width: 100%; height: auto; border-radius: 8px; }
.pd-rich blockquote { border-inline-start: 4px solid #d5d9d9; padding: 4px 14px; color: #4b5563; background: #f7f8f8; border-radius: 0 6px 6px 0; }
.pd-rich pre { background: #0f1111; color: #f3f4f6; padding: 12px; border-radius: 8px; overflow-x: auto; direction: ltr; text-align: left; font-size: 13px; }
.pd-rich iframe.ql-video { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 8px; }
.pd-rich .ql-align-center { text-align: center; } .pd-rich .ql-align-right { text-align: right; }
.pd-rich .ql-align-left { text-align: left; } .pd-rich .ql-align-justify { text-align: justify; }
.pd-rich .ql-direction-rtl { direction: rtl; }
.pd-rich .ql-size-small { font-size: .8em; } .pd-rich .ql-size-large { font-size: 1.4em; } .pd-rich .ql-size-huge { font-size: 2em; }
.pd-rich .ql-indent-1 { padding-inline-start: 2em; }
.pd-rich .ql-indent-2 { padding-inline-start: 4em; }
.pd-rich .ql-indent-3 { padding-inline-start: 6em; }
.pd-rich .ql-indent-4 { padding-inline-start: 8em; }
.pd-rich .ql-indent-5 { padding-inline-start: 10em; }
.pd-rich .ql-indent-6 { padding-inline-start: 12em; }
.pd-rich .ql-indent-7 { padding-inline-start: 14em; }
.pd-rich .ql-indent-8 { padding-inline-start: 16em; }
/* بطاقات الأقسام بدون البنر فوقها (ترتيب من واجهة المتجر) */
.acr-solo .acr { margin-top: 16px !important; }
.atl-ph { display: grid; place-items: center; width: 100%; height: 100%; font-size: 28px; color: #b0b5b5; background: #f7f8f8; }

/* ===== صفحة القسم ===== */
.cg-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cg-img { width: 64px; height: 64px; flex: none; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid #e3e6e6; }
.cg-img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.cg-subs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 4px; scrollbar-width: thin; }
.cg-sub { flex: none; width: 128px; display: grid; justify-items: center; gap: 4px; padding: 10px 8px; background: #fff; border: 1px solid #e3e6e6; border-radius: 10px; text-align: center; color: var(--text); transition: box-shadow .2s, border-color .2s; }
.cg-sub:hover { border-color: #c7511f; box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.cg-sub:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.cg-sub-img { width: 84px; height: 84px; border-radius: 8px; background: #f7f8f8; overflow: hidden; display: grid; place-items: center; }
.cg-sub-img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.cg-sub-img b { font-size: 30px; color: #b0b5b5; }
.cg-sub-name { font-size: 14px; font-weight: 700; line-height: 1.3; }
.cg-sub small { font-size: 11.5px; color: #565959; }
.cg-more { display: block; margin: 16px auto 0; padding: 10px 28px; border-radius: 20px; border: 1px solid #d5d9d9; background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.cg-more:hover { background: #f7fafa; }
.category-page .sp-suggest .link-btn { font: inherit; }
@media (max-width: 768px) {
  .cg-img { width: 48px; height: 48px; }
  .cg-sub { width: 104px; padding: 8px 6px; }
  .cg-sub-img { width: 64px; height: 64px; }
  .cg-sub-name { font-size: 12.5px; }
}

/* ===== حالة المتجر: مغلق للزوار / الشراء متوقف ===== */
body.site-closed { overflow: hidden; }
.closed-screen { position: fixed; inset: 0; z-index: 2000; background: #eaeded; display: grid; place-items: center; padding: 20px; }
.closed-box { width: min(480px, 100%); background: #fff; border-radius: 14px; padding: 34px 26px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.closed-logo { display: inline-flex; align-items: flex-end; gap: 3px; margin-bottom: 18px; color: #0f1111; }
.closed-logo .logo-text { font-size: 30px; font-weight: 800; color: #0f1111; }
.closed-box svg { width: 54px; height: 54px; fill: none; stroke: #e77600; stroke-width: 1.6; stroke-linejoin: round; margin: 0 auto 10px; display: block; }
.closed-box h1 { font-size: 24px; margin-bottom: 8px; }
.closed-box p { color: #4b5563; line-height: 1.8; }
.closed-box a { display: inline-block; margin-top: 14px; color: #007185; font-weight: 600; }
.admin-note { position: sticky; top: 0; z-index: 200; background: #fff1db; color: #7a3e00; text-align: center; font-size: 13px; font-weight: 600; padding: 8px 12px; border-bottom: 1px solid #f5c98b; }
.admin-note a { color: #007185; text-decoration: underline; }
.buy-off-note { max-width: 1500px; margin: 12px auto 0; padding: 12px 16px; border-radius: 10px; background: #fff1db; border: 1px solid #f5c98b; color: #7a3e00; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; width: calc(100% - max(32px, 4vw)); }
.buy-off-note b { font-size: 15px; }
.purchase-off .pc-add, .purchase-off .sr-add, .purchase-off .pd-buy-row, .purchase-off .pd-now,
.purchase-off .pd-label:has(+ .pd-buy-row), .purchase-off .cd-checkout, .purchase-off #checkoutBtn,
.purchase-off #stickyCheckout, .purchase-off .cp-cart { display: none !important; }
.co-ship-note { font-size: 13px; color: #565959; margin: -4px 0 10px; }
.co-ship-off { padding: 12px; border-radius: 8px; background: #fde8e2; color: #b12704; font-weight: 600; }

/* ===== حسابات العملاء ===== */
.form-msg.bad { background: #fde8e2; color: #b12704; border-color: #f5b5a4; }
.form-msg.ok { background: #e6f4ea; color: #067d62; border-color: #a8d5b9; }
.bad-text { color: #b12704; }
.auth-box.panel-on > :not(.auth-panel):not(.auth-brand) { display: none !important; }
.auth-panel { text-align: center; display: grid; gap: 12px; }
.auth-panel h3 { font-size: 20px; }
.auth-panel p { color: #4b5563; line-height: 1.8; font-size: 14px; }
.auth-panel .ap-hint { font-size: 13px; color: #6b7280; }
.auth-panel .ap-ico { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: #fff1db; display: grid; place-items: center; }
.auth-panel .ap-ico svg { width: 32px; height: 32px; fill: none; stroke: #e77600; stroke-width: 1.7; stroke-linejoin: round; }
.auth-panel .ap-form { text-align: right; display: grid; gap: 12px; }
.auth-panel .link-btn { justify-self: center; }

/* لوحة العميل */
.account-page:has(.acct:not([hidden])) { display: block; padding-top: 24px; }
.acct { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; width: 100%; }
.acct-side { background: #fff; border: 1px solid #e3e6e6; border-radius: 12px; padding: 16px; position: sticky; top: 80px; }
.acct-hello { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px solid #eef0f0; min-width: 0; }
.acct-hello > div { min-width: 0; }
.acct-hello b { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-hello small { display: block; color: #6b7280; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.acct-av { width: 46px; height: 46px; border-radius: 50%; background: #febd69; color: #131921; font-weight: 800; font-size: 20px; display: grid; place-items: center; flex: none; }
.acct-nav { display: grid; gap: 2px; }
.acct-nav a, .acct-nav button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: #0f1111; font: inherit; font-size: 15px; background: none; border: 0; cursor: pointer; text-align: right; width: 100%; }
.acct-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }
.acct-nav a:hover, .acct-nav button:hover { background: #f7f8f8; }
.acct-nav a.on { background: #fff1db; color: #7a3e00; font-weight: 700; }
.acct-nav a.danger { color: #b12704; }
.acct-nav a:focus-visible, .acct-nav button:focus-visible { outline: 2px solid #e77600; outline-offset: 1px; }
.acct-main { min-width: 0; display: grid; gap: 14px; }
.acct-panel { background: #fff; border: 1px solid #e3e6e6; border-radius: 12px; padding: 20px; }
.acct-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.acct-head h1 { font-size: 22px; }
.acct-banner { padding: 12px 16px; border-radius: 10px; font-size: 14px; line-height: 1.7; }
.acct-banner.ok { background: #e6f4ea; color: #067d62; border: 1px solid #a8d5b9; }
.acct-banner.bad { background: #fde8e2; color: #b12704; border: 1px solid #f5b5a4; }
.ac-empty { text-align: center; padding: 30px 10px; display: grid; justify-items: center; gap: 8px; }
.ac-empty svg { width: 54px; height: 54px; fill: none; stroke: #b0b5b5; stroke-width: 1.4; }
.ac-empty b { font-size: 17px; }
.ac-empty p { color: #6b7280; font-size: 14px; max-width: 360px; line-height: 1.7; }
.ac-empty .btn-yellow { margin-top: 6px; }
.ac-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; background: #eef0f0; color: #374151; white-space: nowrap; }
.ac-pill.st-new { background: #e3eefa; color: #0b5cad; }
.ac-pill.st-processing { background: #fff1db; color: #b25e00; }
.ac-pill.st-shipped { background: #efe7fb; color: #6b3fc7; }
.ac-pill.st-completed, .ac-pill.st-default { background: #e6f4ea; color: #067d62; }
.ac-pill.st-cancelled, .ac-pill.st-refunded { background: #fde8e2; color: #b12704; }
.ac-orders { list-style: none; display: grid; gap: 10px; }
.ac-order { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid #e3e6e6; border-radius: 10px; background: #fff; font: inherit; color: inherit; cursor: pointer; text-align: right; }
.ac-order:hover { border-color: #c7511f; }
.ac-o-imgs { display: flex; flex: none; }
.ac-o-imgs img, .ac-o-imgs i { width: 46px; height: 46px; object-fit: contain; border: 1px solid #eef0f0; border-radius: 6px; background: #fff; margin-inline-start: -10px; display: block; }
.ac-o-imgs img:first-child { margin-inline-start: 0; }
.ac-o-info { flex: 1; min-width: 0; display: grid; }
.ac-o-info small { color: #6b7280; font-size: 12.5px; }
.ac-o-total { flex: none; }
.ac-back { margin-bottom: 10px; }
.ac-o-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.ac-o-head small { color: #6b7280; }
.ac-track { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin: 10px 0 22px; counter-reset: s; }
.ac-track li { position: relative; text-align: center; display: grid; justify-items: center; gap: 4px; font-size: 13px; color: #6b7280; }
.ac-track li span { width: 22px; height: 22px; border-radius: 50%; background: #e5e7eb; border: 3px solid #fff; box-shadow: 0 0 0 2px #e5e7eb; position: relative; z-index: 1; }
.ac-track li::before { content: ""; position: absolute; top: 10px; right: 50%; width: 100%; height: 3px; background: #e5e7eb; }
.ac-track li:first-child::before { display: none; }
.ac-track li.done { color: #067d62; }
.ac-track li.done span { background: #067d62; box-shadow: 0 0 0 2px #067d62; }
.ac-track li.done::before { background: #067d62; }
.ac-track li.now b { font-weight: 800; }
.ac-track small { font-size: 11px; color: #6b7280; }
.acct-panel h3 { font-size: 15px; margin: 14px 0 8px; }
.ac-items { list-style: none; display: grid; gap: 8px; }
.ac-items li { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid #eef0f0; border-radius: 8px; }
.ac-i-img { width: 54px; height: 54px; flex: none; border-radius: 6px; background: #f7f8f8; overflow: hidden; }
.ac-i-img img { width: 100%; height: 100%; object-fit: contain; }
.ac-i-name { flex: 1; min-width: 0; display: grid; font-size: 14px; }
.ac-i-name small { color: #6b7280; font-size: 12px; }
.ac-o-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ac-o-cols p { color: #374151; line-height: 1.8; font-size: 14px; }
.ac-sum { display: grid; gap: 4px; font-size: 14px; margin-bottom: 6px; }
.ac-sum div { display: flex; justify-content: space-between; }
.ac-sum .t { font-weight: 800; border-top: 1px solid #eef0f0; padding-top: 6px; }
.ac-warn { padding: 12px 14px; border-radius: 8px; background: #fde8e2; color: #b12704; line-height: 1.7; }
.ac-warn p { color: #7f1d1d; font-size: 14px; }
.ac-addrs { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ac-addrs li { border: 1px solid #e3e6e6; border-radius: 10px; padding: 14px; display: grid; gap: 4px; font-size: 14px; color: #374151; align-content: start; }
.ac-addrs li.def { border-color: #e77600; box-shadow: 0 0 0 1px #e77600; }
.ac-a-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #0f1111; margin-bottom: 4px; }
.ac-a-notes { color: #6b7280; font-size: 13px; }
.ac-a-act { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px solid #eef0f0; }
.link-btn.danger { color: #b12704; }
.ac-form { display: grid; gap: 14px; max-width: 560px; }
.ac-addr-form { max-width: none; border: 1px solid #e3e6e6; border-radius: 10px; padding: 16px; }
.ac-addr-form h2 { font-size: 17px; }
.ac-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.ac-wide { grid-column: 1 / -1; }
.ac-form select, .ac-form textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #a6a6a6; border-radius: 4px; background: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.5), 0 1px 0 rgba(0,0,0,.07) inset; }
.ac-form .field[hidden] { display: none; }
.ac-form .opt { color: #6b7280; font-weight: 400; font-size: 12px; }
.ac-note { color: #6b7280; font-size: 12px; }
.ac-labels { display: flex; gap: 8px; flex-wrap: wrap; }
.ac-labels label { cursor: pointer; }
.ac-labels input { position: absolute; opacity: 0; }
.ac-labels span { display: inline-block; padding: 7px 14px; border: 1px solid #d5d9d9; border-radius: 18px; font-size: 14px; }
.ac-labels input:checked + span { border-color: #e77600; background: #fff1db; font-weight: 700; }
.ac-labels input:focus-visible + span { outline: 2px solid #e77600; outline-offset: 2px; }
.ac-actions { display: flex; align-items: center; gap: 14px; }
.ac-actions .btn-primary { width: auto; padding: 0 26px; }
.btn-danger { height: 44px; padding: 0 22px; border-radius: 22px; border: 1px solid #b12704; background: #b12704; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.btn-danger:hover { background: #8f1f03; }
.btn-danger:disabled, .ac-actions .btn-primary:disabled { opacity: .6; cursor: wait; }
.acct-bye { grid-column: 1 / -1; text-align: center; padding: 60px 16px; background: #fff; border-radius: 12px; display: grid; gap: 16px; justify-items: center; }
@media (max-width: 860px) {
  .acct { grid-template-columns: minmax(0, 1fr); }
  .acct-side { position: static; padding: 12px; }
  .acct-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .acct-nav a, .acct-nav button { flex-direction: column; gap: 4px; font-size: 12px; padding: 8px 4px; text-align: center; justify-content: center; border: 1px solid #eef0f0; }
  .acct-panel { padding: 14px; }
  .ac-grid, .ac-o-cols { grid-template-columns: minmax(0, 1fr); }
  .ac-order { flex-wrap: wrap; }
  .ac-o-info { flex: 1 1 calc(100% - 80px); }
  .ac-track li { font-size: 11px; }
}
.co-who { font-size: 15px; color: #374151; }
.co-pay-none { margin: 0; padding: 12px 14px; border-radius: 10px; background: #fff4e5; color: #8a4b00; border: 1px solid #f3c27a; font-size: 14px; font-weight: 600; }
.cg-desc { margin: 4px 0 2px; color: #565959; font-size: 14px; line-height: 1.6; }
.cg-brand .cg-img { width: 88px; height: 64px; }
.cg-brand .cg-img img { padding: 6px; }
@media (max-width: 640px) { .cg-brand .cg-img { width: 64px; height: 48px; } }

/* ===== صفحة «تم الطلب بنجاح» والفاتورة ===== */
.od-wrap { max-width: 980px; margin: 0 auto; display: grid; gap: 14px; }
.od-loading { display: grid; place-items: center; gap: 14px; padding: 70px 20px; text-align: center; color: #565959; }
.od-spinner, .co-load-spin { width: 46px; height: 46px; border-radius: 50%; border: 4px solid #e7e9ec; border-top-color: #febd69; animation: odSpin .8s linear infinite; }
@keyframes odSpin { to { transform: rotate(360deg); } }
.od-error { text-align: center; padding: 40px 20px; }
.od-error h1 { font-size: 22px; margin: 10px 0 6px; }
.od-error p { color: #565959; margin: 0 0 18px; }
.od-x svg { width: 56px; height: 56px; fill: none; stroke: #b12704; stroke-width: 1.8; stroke-linecap: round; }
#odBody { display: grid; gap: 14px; opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease; }
.od-in #odBody { opacity: 1; transform: none; }

.od-hero { text-align: center; padding: 30px 20px 26px; }
.od-check svg { width: 72px; height: 72px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.od-check circle { stroke: #067d62; stroke-width: 3; fill: #e6f4ef; stroke-dasharray: 151; stroke-dashoffset: 151; }
.od-check path { stroke: #067d62; stroke-width: 4; stroke-dasharray: 40; stroke-dashoffset: 40; }
.od-in .od-check circle { animation: odDraw .6s ease forwards; }
.od-in .od-check path { animation: odDraw .4s .45s ease forwards; }
@keyframes odDraw { to { stroke-dashoffset: 0; } }
.od-hero h1 { margin: 10px 0 6px; font-size: 26px; color: #067d62; }
.od-hero > p { margin: 0 auto; max-width: 520px; color: #333; line-height: 1.7; }
.od-num { display: inline-flex; align-items: center; gap: 8px; margin: 16px 0 4px; padding: 8px 14px; border-radius: 10px; background: #f7f8f8; border: 1px dashed #c7cbcb; }
.od-num span { color: #565959; font-size: 13px; }
.od-num b { font-size: 18px; letter-spacing: .5px; }
.od-copy { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; }
.od-copy:hover { background: #e7e9ec; }
.od-copy svg { width: 17px; height: 17px; fill: none; stroke: #565959; stroke-width: 1.8; }
.od-copy.ok svg { stroke: #067d62; }
.od-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.od-actions .btn-yellow { display: inline-flex; align-items: center; gap: 8px; width: auto; padding: 0 20px; }
.od-actions .btn-yellow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.od-btn { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 20px; border: 1px solid #d5d9d9; background: #fff; font-size: 14px; font-weight: 600; }
.od-btn:hover { background: #f7fafa; }

.od-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.od-card h2 { margin: 0; font-size: 17px; }
.od-card h3 { margin: 18px 0 6px; font-size: 14px; color: #565959; }
.od-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.od-pill { padding: 4px 10px; border-radius: 12px; font-size: 12.5px; font-weight: 700; background: #e3eefa; color: #0b5cad; }
.od-pill.st-processing { background: #fff1db; color: #b25e00; }
.od-pill.st-on_hold { background: #f1ecfb; color: #5b3aa8; }
.od-pill.st-shipped { background: #e4f3fb; color: #0e6b96; }
.od-pill.st-completed { background: #e6f4ef; color: #067d62; }
.od-pill.st-cancelled, .od-pill.st-refunded { background: #fde8e2; color: #b12704; }
.od-track { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.od-track li { position: relative; padding: 0 30px 18px 0; min-height: 40px; }
.od-track li:last-child { padding-bottom: 0; min-height: 0; }
.od-track li::before { content: ""; position: absolute; right: 9px; top: 20px; bottom: 0; width: 2px; background: #e3e6e6; }
.od-track li:last-child::before { display: none; }
.od-track li.done::before { background: #067d62; }
.od-dot { position: absolute; right: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #c7cbcb; background: #fff; }
.od-track li.done .od-dot { border-color: #067d62; background: #067d62 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center/14px no-repeat; }
.od-track li.now .od-dot { border-color: #e77600; box-shadow: 0 0 0 4px rgba(231, 118, 0, .18); background: #e77600; }
.od-track b { display: block; font-size: 14.5px; color: #0f1111; }
.od-track li:not(.done):not(.now) b { color: #8a8f8f; font-weight: 600; }
.od-track small { display: block; color: #565959; font-size: 12.5px; margin-top: 2px; }
.od-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 14px; background: #f1ecfb; color: #5b3aa8; }
.od-note.st-cancelled, .od-note.st-refunded { background: #fde8e2; color: #b12704; }
.od-date { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 10px; background: #f0f8f5; }
.od-cal { width: 42px; height: 42px; flex: none; border-radius: 10px; background: #fff; display: grid; place-items: center; }
.od-cal svg { width: 22px; height: 22px; fill: none; stroke: #067d62; stroke-width: 1.8; stroke-linecap: round; }
.od-date b { display: block; font-size: 16px; color: #067d62; }
.od-date small { display: block; color: #565959; font-size: 13px; margin-top: 2px; }
.od-card address { font-style: normal; line-height: 1.8; font-size: 14px; color: #333; }

/* الفاتورة */
.inv { padding: 0; overflow: hidden; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 24px; background: linear-gradient(135deg, #232f3e, #37475a); color: #fff; }
.inv-store { display: flex; gap: 12px; align-items: center; min-width: 0; }
.inv-logo { width: 46px; height: 46px; flex: none; border-radius: 12px; background: #febd69; color: #232f3e; display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.inv-store b { display: block; font-size: 18px; }
.inv-store small { display: block; color: #d5dbe1; font-size: 12.5px; margin-top: 3px; word-break: break-word; }
.inv-meta { text-align: left; }
.inv-meta h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: 1px; color: #febd69; }
.inv-meta dl { margin: 0; display: grid; gap: 2px; font-size: 13px; }
.inv-meta dl div { display: flex; gap: 8px; justify-content: flex-end; }
.inv-meta dt { color: #c9d1d9; }
.inv-meta dd { margin: 0; font-weight: 700; }
.inv-parties { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 20px 24px; border-bottom: 1px solid #eaeded; }
.inv-parties h3 { margin: 0 0 6px; font-size: 12px; color: #8a8f8f; text-transform: uppercase; letter-spacing: .5px; }
.inv-parties p { margin: 0; font-size: 13.5px; line-height: 1.75; color: #333; }
.inv-paystate { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 10px; background: #fff1db; color: #b25e00; font-size: 12px; font-weight: 700; }
.inv-paystate.paid { background: #e6f4ef; color: #067d62; }
.inv-table-wrap { padding: 6px 24px 0; }
.inv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.inv-table th { text-align: center; font-size: 12.5px; color: #565959; font-weight: 700; padding: 12px 8px; border-bottom: 2px solid #232f3e; white-space: nowrap; }
.inv-table td { text-align: center; padding: 12px 8px; border-bottom: 1px solid #eaeded; vertical-align: middle; white-space: nowrap; }
.inv-table .inv-c-prod { text-align: right; white-space: normal; width: 55%; }
.inv-table .inv-c-total { text-align: left; font-weight: 700; }
.inv-prod { display: flex; align-items: center; gap: 10px; }
.inv-prod img, .inv-prod i { width: 44px; height: 44px; flex: none; border-radius: 6px; border: 1px solid #eaeded; object-fit: contain; background: #fff; }
.inv-prod a { color: #0f1111; font-weight: 600; }
.inv-prod a:hover { color: #c7511f; }
.inv-prod small { display: block; color: #565959; font-size: 12px; margin-top: 2px; }
.inv-sku { text-align: right; }
.inv-bottom { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 16px 24px 20px; }
.inv-notes { margin: 0; flex: 1; font-size: 13.5px; color: #333; background: #f7f8f8; border-radius: 8px; padding: 10px 12px; line-height: 1.7; }
.inv-sum { margin: 0 0 0 0; margin-inline-start: auto; width: min(320px, 100%); display: grid; gap: 8px; font-size: 14px; }
.inv-sum div { display: flex; justify-content: space-between; gap: 12px; }
.inv-sum dt { color: #565959; }
.inv-sum dd { margin: 0; font-weight: 600; }
.inv-disc dd { color: #067d62; }
.inv-total { margin-top: 4px; padding: 12px 14px; border-radius: 10px; background: #232f3e; color: #fff; }
.inv-total dt { color: #fff; font-weight: 700; }
.inv-total dd { font-size: 18px; font-weight: 800; color: #febd69; }
.inv-foot { padding: 12px 24px; background: #f7f8f8; color: #565959; font-size: 12.5px; text-align: center; border-top: 1px solid #eaeded; }

@media (max-width: 760px) {
  .od-grid { grid-template-columns: 1fr; }
  .od-hero h1 { font-size: 22px; }
  .inv-head { flex-direction: column; padding: 18px 16px; }
  .inv-meta { text-align: right; }
  .inv-meta dl div { justify-content: flex-start; }
  .inv-parties { grid-template-columns: 1fr; padding: 16px; gap: 12px; }
  .inv-table-wrap { padding: 0 16px; }
  .inv-table thead { display: none; }
  .inv-table tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; padding: 12px 0; border-bottom: 1px solid #eaeded; }
  .inv-table td { border: 0; padding: 0; text-align: right; font-size: 13px; }
  .inv-table td.inv-c-prod { grid-column: 1 / -1; width: auto; margin-bottom: 6px; }
  .inv-table td[data-l]::before { content: attr(data-l); display: block; color: #8a8f8f; font-size: 11.5px; }
  .inv-table .inv-c-total { text-align: left; }
  .inv-bottom { flex-direction: column; padding: 14px 16px 16px; }
  .inv-sum { width: 100%; }
}

/* طباعة الفاتورة فقط */
@media print {
  @page { size: A4; margin: 12mm; }
  html, body { background: #fff !important; }
  body * { visibility: hidden; }
  .inv, .inv * { visibility: visible; }
  .inv { position: absolute; inset: 0 0 auto 0; border: 0; box-shadow: none; }
  .inv-head, .inv-total { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .inv-prod a { color: #000; }
}

/* تأكيد الطلب: التحميل والفشل في صفحة الدفع */
.co-load { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 16px; background: rgba(15, 17, 17, .55); backdrop-filter: blur(2px); opacity: 0; transition: opacity .2s; }
.co-load.show { opacity: 1; }
.co-load-box { width: min(420px, 100%); background: #fff; border-radius: 14px; padding: 28px 22px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.co-load-box .co-load-spin { margin: 0 auto 14px; }
.co-load-box h2 { margin: 0 0 4px; font-size: 18px; }
.co-load-box p { margin: 0; color: #565959; font-size: 14px; line-height: 1.7; }
.co-load-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; text-align: right; font-size: 13.5px; color: #8a8f8f; }
.co-load-steps li { display: flex; align-items: center; gap: 8px; transition: color .2s; }
.co-load-steps li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #d5d9d9; flex: none; }
.co-load-steps li.on { color: #0f1111; }
.co-load-steps li.on::before { border-color: #e77600; border-top-color: transparent; animation: odSpin .7s linear infinite; }
.co-load-steps li.done { color: #067d62; }
.co-load-steps li.done::before { border-color: #067d62; background: #067d62; animation: none; }
.co-fail-ico svg { width: 60px; height: 60px; fill: none; stroke: #b12704; stroke-width: 1.8; stroke-linecap: round; }
.co-fail-ico circle { fill: #fde8e2; }
.co-load-box.fail h2 { color: #b12704; margin-top: 8px; }
.co-fail-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; text-align: right; max-height: 40vh; overflow: auto; }
.co-fail-list li { padding: 10px 12px; border-radius: 8px; background: #fff7f5; border: 1px solid #f6d3c8; font-size: 13.5px; }
.co-fail-list li b { display: block; color: #0f1111; }
.co-fail-list li span { color: #b12704; }
.co-fail-actions { display: grid; gap: 8px; margin-top: 16px; }
.co-fail-actions .btn-yellow { width: 100%; }
.co-fail-actions .od-btn { justify-content: center; }
.ac-pill.st-on_hold { background: #f1ecfb; color: #5b3aa8; }
.ac-inv { margin-inline-start: auto; font-size: 13px; }
.inv-logo.has-img { background: #fff; padding: 3px; overflow: hidden; }
.inv-logo.has-img img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; }

/* بطاقات التحميل حتى تصل المنتجات من قاعدة البيانات */
.pc-skel { pointer-events: none; }
.pc-skel .pc-img, .pc-skel .pc-body i, .skel-box { display: block; background: linear-gradient(90deg, #eef0f0 25%, #f7f8f8 50%, #eef0f0 75%); background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; border-radius: 8px; }
.pc-skel .pc-img { aspect-ratio: 1; }
.pc-skel .pc-body i { height: 12px; margin: 10px 0 0; }
.pc-skel .pc-body i.s { width: 50%; height: 16px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-title { width: 180px; height: 22px; margin-bottom: 12px; }
.ac-skel .ag span { display: block; aspect-ratio: 1; }
.cat-skel { pointer-events: none; }
.cat-skel .cat-img { aspect-ratio: 1; }
.cat-skel > .skel-box:last-child { height: 12px; margin-top: 8px; }
.cat-none { grid-column: 1 / -1; color: #565959; text-align: center; padding: 20px 0; }
.brand-skel { min-height: 120px; }
.cg-deals .cg-img { display: grid; place-items: center; background: #fde8e2; border-color: #f6c9bc; }
.cg-deals .cg-img svg { width: 34px; height: 34px; fill: none; stroke: #c7511f; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* «أعلمني عند التوفر» */
.pd-notify { margin-top: 12px; padding: 14px; border: 1px solid #f3c27a; border-radius: 12px; background: #fffaf0; }
.pd-notify-h { display: flex; align-items: center; gap: 8px; font-size: 16px; color: #0f1111; }
.pd-notify-h svg { width: 22px; height: 22px; fill: none; stroke: #e77600; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pd-notify p { margin: 6px 0 10px; font-size: 14px; color: #565959; line-height: 1.7; }
.pd-notify-row { display: flex; gap: 8px; }
.pd-notify-row input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid #c7cbcb; border-radius: 10px; font: inherit; font-size: 15px; background: #fff; }
.pd-notify-row input:focus { outline: none; border-color: #e77600; box-shadow: 0 0 0 3px rgba(231, 118, 0, .15); }
.pd-notify-row button { height: 44px; padding: 0 20px; border: 0; border-radius: 10px; background: #232f3e; color: #fff; font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-width: 96px; }
.pd-notify-row button:hover { background: #37475a; }
.pd-notify-msg { display: block; margin-top: 8px; font-size: 13.5px; }
.pd-notify-msg:empty { display: none; }
.pd-notify-msg.ok { color: #067d62; font-weight: 600; }
.pd-notify-msg.bad { color: #b12704; }
.pd-notify.done .pd-notify-row { display: none; }

/* البحث: روابط الأقسام المطابقة */
.sr-cats, .sp-cats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sr-cats { padding: 10px 14px; border-bottom: 1px solid #eee; font-size: 13px; }
.sr-cats span, .sp-cats span { color: #565959; }
.sr-cats a, .sp-cats a { padding: 4px 10px; border-radius: 14px; background: #f0f8ff; color: #007185; font-weight: 600; font-size: 13px; }
.sr-cats a:hover, .sp-cats a:hover { background: #e3f1fb; }
.sp-cats { margin-bottom: 12px; padding: 10px 14px; background: #fff; border-radius: 8px; }


/* ===== شعار المتجر (من الإعدادات) والفوتر الحقيقي ===== */
.logo.has-logo { align-items: center; gap: 8px; }
.logo-img { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; background: #fff; flex: none; }
.logo.has-logo .logo-dot { display: none; }
.site-footer .logo-img { width: 40px; height: 40px; }
.ft-about { margin: 0; max-width: 560px; color: #d5dbe1; font-size: 14px; line-height: 1.8; }
.ft-contact { margin: 0; font-size: 14px; color: #d5dbe1; }
.ft-contact a { color: #febd69; }
.site-footer [hidden] { display: none !important; }
.pb-cod { gap: 6px; padding: 0 12px; color: #0f1111; font-size: 13px; font-weight: 700; }
.pb-cod svg { width: 20px; height: 20px; fill: none; stroke: #067d62; stroke-width: 1.8; }

/* ===== صفحات المتجر (من نحن، الخصوصية…) ===== */
.pg-wrap { max-width: 880px; margin: 0 auto; }
.pg-article { padding: 28px 30px; }
.pg-title { margin: 0 0 18px; font-size: 26px; line-height: 1.4; padding-bottom: 14px; border-bottom: 3px solid #febd69; }
.pg-body { font-size: 16px; line-height: 2; color: #1f2937; }
.pg-body h2 { font-size: 21px; margin: 26px 0 8px; color: #0f1111; }
.pg-body h3 { font-size: 18px; margin: 22px 0 6px; color: #0f1111; }
.pg-body p { margin: 0 0 12px; }
.pg-body ul, .pg-body ol { margin: 0 0 14px; padding-inline-start: 22px; }
.pg-body li { margin-bottom: 4px; }
.pg-body a { color: #007185; text-decoration: underline; text-underline-offset: 3px; }
.pg-body img { max-width: 100%; height: auto; border-radius: 8px; }
.pg-body blockquote { margin: 14px 0; padding: 10px 14px; border-inline-start: 4px solid #febd69; background: #fffaf0; border-radius: 6px; }
.pg-table { overflow-x: auto; margin: 10px 0 18px; border: 1px solid #e5e7eb; border-radius: 10px; }
.pg-table table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.pg-table th { background: #232f3e; color: #fff; padding: 10px 12px; text-align: right; font-weight: 700; white-space: nowrap; }
.pg-table td { padding: 10px 12px; border-top: 1px solid #eef0f0; vertical-align: top; }
.pg-table tr:nth-child(even) td { background: #f9fafa; }
.pg-contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 14px 0 20px; }
.pg-btn { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #d5d9d9; border-radius: 12px; background: #fff; color: #0f1111 !important; text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.pg-btn:hover { border-color: #e77600; box-shadow: 0 4px 14px rgba(0, 0, 0, .06); }
.pg-btn svg { width: 26px; height: 26px; flex: none; fill: none; stroke: #232f3e; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pg-btn span { display: flex; flex-direction: column; line-height: 1.5; min-width: 0; }
.pg-btn b { font-size: 15px; }
.pg-btn small { color: #565959; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.pg-wa { background: #f0fbf4; border-color: #b7e4c7; }
.pg-wa svg { stroke: #128c7e; }
.pg-updated { margin: 22px 0 0; color: #8a8f8f; font-size: 13px; }
.pg-updated:empty { display: none; }
@media (max-width: 640px) {
  .pg-article { padding: 20px 16px; }
  .pg-title { font-size: 22px; }
  .pg-body { font-size: 15px; }
}

/* البنر الرئيسي من لوحة التحكم */
.hero.has-img { background-image: linear-gradient(90deg, rgba(15, 17, 17, .15), rgba(15, 17, 17, .72)), var(--hero-img); background-size: cover; background-position: center; }
.hero-skel { display: inline-block; width: min(420px, 70vw); height: 36px; opacity: .25; }
.hero-skel.s { width: min(320px, 60vw); height: 16px; }
a.hero-btn { display: inline-flex; align-items: center; }
.pg-body ul { list-style: disc; }
.pg-body ol { list-style: decimal; }
.pg-body li::marker { color: #e77600; }
.co-who-flash { animation: coWho 1.6s ease; border-radius: 6px; }
@keyframes coWho { 0% { background: #e6f4ef; } 100% { background: transparent; } }
.acct-loading { display: grid; place-items: center; min-height: 50vh; }
.acct-loading[hidden] { display: none; }

/* ===== الديسكتوب (أكبر من 1024px): مربع البحث ظاهر في الهيدر بدل القائمة المنسدلة ===== */
@media (min-width: 1025px) {
  .header-main { gap: 10px; padding: 8px 16px; }
  .header-main .header-spacer, .search-toggle { display: none; }
  .search-panel {
    position: relative; top: auto; left: auto; right: auto;
    flex: 1; max-width: 860px; margin: 0 auto;
    background: none; padding: 0; box-shadow: none;
    opacity: 1; visibility: visible; transform: none; transition: none;
  }
  .search { height: 42px; max-width: none; margin: 0; }
  .search input { font-size: 15px; padding: 0 14px; }
  /* النتائج والاقتراحات تظهر تحت المربع */
  .search-results {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    margin: 0; max-width: none; z-index: 70;
  }
  .search-suggest {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 69;
    max-width: none; margin: 0; padding: 12px 14px; border-radius: 10px;
    background: var(--nav-bg); box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
  }
  .search-panel:focus-within .search-suggest:not([hidden]):not(:empty),
  .search-suggest:hover:not([hidden]):not(:empty) { display: flex; }
}
/* صور الوصف والصفحات: كل صورة في سطرها مع مسافة تحتها */
.pd-rich img, .pg-body img { display: block; max-width: 100%; height: auto; margin: 0 auto 16px; border-radius: 8px; }
.pd-rich p:has(> img:only-child), .pg-body p:has(> img:only-child) { margin-bottom: 4px; }
.auth-sub:empty { display: none; }
.auth-title { margin-bottom: 16px; }
