/**
 * تحذير: هذا الملف موجود للتوافق فقط.
 * استخدم pharma-bundle.css في المشاريع الجديدة.
 * سيُحذف في v3.0
 */ 
/* shop-bundle.css — الصيدلية | نسخة احترافية */

/* ─── CSS Variables ────────────────────────────────────────────── */
:root {
  --em:      #00875a;
  --em-d:    #006644;
  --em-l:    #00a86e;
  --em-gl:   #e6f5ef;
  --em-gl2:  #d1fae5;
  --navy:    #0a1628;
  --navy-2:  #1e293b;
  --text:    #334155;
  --muted:   #64748b;
  --border:  #e2e8f0;
  --bg:      #f8fafc;
  --white:   #ffffff;
  --danger:  #ef4444;
  --warn:    #f59e0b;
  --info:    #3b82f6;
  --shop-btn-r: 14px;
  --touch-min: 48px;
  --r-sm:    8px;
  --r-md:    12px;
  --r-lg:    16px;
  --r-xl:    20px;
  --r-full:  9999px;
  --sh:      0 2px 8px rgba(0,0,0,.08);
  --sh-lg:   0 12px 36px rgba(0,0,0,.12);
  --sh-em:   0 6px 20px rgba(0,135,90,.22);
  --tr:      all .2s ease;
  --pc-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --pc-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --g-bg:    linear-gradient(135deg,#f1f5f9,#e2e8f0);
  /* أزرار طلب واتساب — لون أوضح وظل أقوى */
  --wa-cta-grad: linear-gradient(135deg, #22c55e 0%, #10b981 42%, #0d9488 78%, #0f766e 100%);
  --wa-cta-grad-strong: linear-gradient(135deg, #16a34a 0%, #059669 40%, #0d9488 82%, #115e59 100%);
  --wa-cta-shadow: 0 8px 30px rgba(16, 185, 129, 0.48), 0 2px 0 rgba(255, 255, 255, 0.22) inset;
  --wa-cta-shadow-lg: 0 14px 44px rgba(16, 185, 129, 0.52), 0 2px 0 rgba(255, 255, 255, 0.28) inset;
}

/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg);
  color: var(--navy);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  direction: rtl;
  min-height: 100vh;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ─── Product Grid — نفس الشبكة على كل الشاشات (auto-fit + minmax) ─── */
.pgrid6 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  align-items: stretch;
}

/* بطاقات الأقسام (صفحة categories — رسم من main.js) */
.cat-card-item {
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s ease,
    border-color 0.28s ease;
}
@media (hover: hover) and (pointer: fine) {
  .cat-card-item:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 135, 90, 0.35) !important;
    box-shadow:
      0 4px 6px -1px rgba(15, 23, 42, 0.05),
      0 16px 40px -10px rgba(0, 135, 90, 0.14);
  }
}

/* ─── Product Card ──────────────────────────────────────────────── */
.pc {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  isolation: isolate;
  transition:
    box-shadow 0.35s var(--pc-ease),
    transform 0.38s var(--pc-ease-out),
    border-color 0.28s var(--pc-ease),
    z-index 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .pc:hover {
    z-index: 3;
    box-shadow:
      0 8px 22px -4px rgba(15, 23, 42, 0.1),
      0 2px 8px rgba(15, 23, 42, 0.04);
    transform: translateY(-4px) scale(1.01);
    border-color: #e2e8f0;
  }
  .pc:hover .pc-img::after {
    opacity: 1;
  }
  .pc:hover .pc-img-el {
    transform: scale(1.05);
  }
  .pc:hover .pc-ico-fallback {
    transform: scale(1.04);
  }
}
.pc:focus-within {
  border-color: rgba(0, 135, 90, 0.35);
  box-shadow:
    0 0 0 3px rgba(0, 168, 110, 0.12),
    0 10px 28px -8px rgba(15, 23, 42, 0.08);
}

.pc-top {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.pc-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
}

/* صورة المنتج — أعلى الكارد، ارتفاع ثابت، contain */
.pc-img {
  width: 100%;
  flex: 0 0 200px;
  height: 200px;
  min-height: 200px;
  max-height: 200px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
/* متصفحات قديمة — نفس الارتفاع الثابت */
@supports not (aspect-ratio: 1) {
  .pc-img {
    position: relative;
  }
  .pc-img .pc-img-el,
  .pc-img .pc-ico-fallback {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
  }
}
.pc-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(10, 22, 40, 0.06) 100%);
  opacity: 0;
  transition: opacity 0.35s var(--pc-ease);
  pointer-events: none;
  z-index: 1;
}
.pc-img-el {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  flex-shrink: 0;
  transition: transform 0.55s var(--pc-ease-out), opacity 0.35s ease;
}

.pc-ico-fallback {
  font-size: clamp(2rem, 12vw, 3.25rem);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--g-bg);
  flex-shrink: 0;
  transition: transform 0.55s var(--pc-ease-out);
}

/* شارات المخزون */
.pc-stock-badge {
  position: absolute;
  bottom: 8px;
  inset-inline-end: 8px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 800;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.22s var(--pc-ease), box-shadow 0.22s ease;
}
.pc:hover .pc-stock-badge {
  transform: translateY(-1px);
}
.pc-stock-badge--out { background: #fee2e2; color: var(--danger); }
.pc-stock-badge--low { background: #fef3c7; color: #b45309; }

/* معلومات المنتج — مسافة كافية تحت زر + السلة المطلق حتى لا يغطي الاسم */
.pc-info {
  padding-block-start: 44px;
  padding-block-end: 10px;
  padding-inline-end: 14px;
  padding-inline-start: max(14px, 58px);
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  text-align: start;
  position: relative;
  z-index: 1;
  overflow: visible;
}
.pc-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--em);
  background: var(--em-gl);
  padding: 3px 9px;
  border-radius: var(--r-full);
  display: inline-block;
  align-self: flex-start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* لا تُصغَّر إلى صفر مع margin-top:auto على السعر — يُبقى مساحة سطرَين للعنوان */
  flex-shrink: 0;
  min-height: calc(1.5em * 2);
  word-break: break-word;
  overflow-wrap: break-word;
}
.pc-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.45em);
  word-break: break-word;
}
.pc-price-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px 10px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 8px;
  min-width: 0;
  row-gap: 6px;
}
.pc-price { font-size: 15px; font-weight: 900; color: var(--em); flex: 0 0 auto; }
.pc-old   {
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
  text-decoration: line-through;
  opacity: 0.7;
  flex: 0 0 auto;
}
.pc-disc  {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--danger);
  background: #fee2e2;
  padding: 2px 7px;
  border-radius: var(--r-full);
  flex: 0 0 auto;
}

/* زر إضافة للسلة */
.pc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 14px;
  background: var(--em);
  color: white;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  width: 100%;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    background 0.25s var(--pc-ease),
    transform 0.22s var(--pc-ease-out),
    box-shadow 0.28s var(--pc-ease);
}
.pc-btn:not(:disabled)::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -65%;
  width: 55%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 42%,
    rgba(255, 255, 255, 0.38) 50%,
    rgba(255, 255, 255, 0.06) 58%,
    transparent 100%
  );
  transform: skewX(-14deg);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
}
.pc-btn:hover:not(:disabled)::before {
  opacity: 1;
  animation: pharma-sheen 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.pc-btn:not(:hover):not(:disabled)::before,
.pc-btn:disabled::before {
  animation: none;
  opacity: 0;
  left: -65%;
}
.pc-btn:hover:not(:disabled) {
  background: var(--em-d);
  transform: translateY(-2px);
  box-shadow: var(--sh-em);
}
.pc-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 2px 10px rgba(0, 100, 70, 0.22);
}
.pc-btn--disabled, .pc-btn:disabled {
  background: #f1f5f9;
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* زر الإعجاب */
.pc-like {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(226, 232, 240, 0.95);
  color: #2563eb;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 3;
  transition:
    background 0.22s ease,
    transform 0.26s var(--pc-ease-out),
    box-shadow 0.26s ease,
    border-color 0.22s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.pc-like:hover {
  background: #fff;
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-color: var(--border);
}
.pc-like.liked { color: #e11d48; }
.pc-like__ico { display: block; }
.pc-like.liked .pc-like__path {
  fill: currentColor;
  stroke: none;
}

/* فقاعات قلوب عند الإعجاب — تُنشأ من JS */
.pc-like-bubble {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10060;
  pointer-events: none;
  font-size: clamp(13px, 3.2vw, 18px);
  line-height: 1;
  opacity: 0.96;
  filter: drop-shadow(0 2px 4px rgba(225, 29, 72, 0.35));
  will-change: transform, opacity;
  --dx: 0px;
  --dy: -80px;
  --rot: 0deg;
  animation: pc-like-bubble-rise 1s cubic-bezier(0.22, 0.85, 0.35, 1) forwards;
}
@keyframes pc-like-bubble-rise {
  0% {
    transform: translate(-50%, -50%) translate(0, 0) scale(0.45) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(1.05) rotate(var(--rot));
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pc-like-bubble {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    opacity: 0 !important;
  }
}

.pc-media-block {
  position: relative;
  flex-shrink: 0;
  z-index: 0;
  overflow: visible;
}
.pc-link--media {
  display: block;
  text-decoration: none;
  color: inherit;
}
.pc-link--body {
  display: block;
  text-decoration: none;
  color: inherit;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  z-index: 2;
  overflow: visible;
}
/* بطاقة المنتج: لا تضغط منطقة الاسم/السعر إلى صفر (مشكلة شائعة على الموبايل داخل شبكة) */
.pc.pc--product .pc-link.pc-link--body {
  flex: 0 0 auto;
  min-height: min-content;
  align-self: stretch;
}

.pc-fab-cart {
  position: absolute;
  bottom: -18px;
  inset-inline-start: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #2563eb;
  color: #fff;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.42);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.pc-fab-cart:hover:not(:disabled) {
  transform: scale(1.06);
  background: #1d4ed8;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.5);
}
.pc-fab-cart:active:not(:disabled) {
  transform: scale(0.98);
}
.pc-fab-cart--disabled,
.pc-fab-cart:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.pc-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 12px;
  margin-top: auto;
  flex-shrink: 0;
  border-top: 1px solid #f1f5f9;
  background: #fff;
}
.pc-footer__tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pc-wa-fab {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.pc-wa-fab:hover:not(:disabled) {
  transform: scale(1.06);
  filter: brightness(1.05);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.55);
}
.pc-wa-fab:active:not(:disabled) {
  transform: scale(0.97);
}
.pc-wa-fab--disabled,
.pc-wa-fab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.pc-footer__rating {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  line-height: 1.2;
}
.pc-footer__reviews {
  color: #94a3b8;
  font-weight: 600;
  font-size: 12px;
}
.pc-footer__score {
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.pc-footer__star {
  color: #f97316;
  font-size: 16px;
  line-height: 1;
}

.pc-footer--skel {
  min-height: 40px;
}
.pc-footer--skel .skel-line {
  height: 12px;
  border-radius: 8px;
  max-width: 42%;
}
.pc-footer--skel .skel-line:first-child {
  max-width: 38%;
}
.skel-fab {
  position: absolute;
  bottom: -18px;
  inset-inline-start: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  z-index: 2;
}

/* شارة البيع */
.pc-badge-sale {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: var(--r-full);
  z-index: 2;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
  transition: transform 0.24s var(--pc-ease-out), box-shadow 0.24s ease;
}
.pc:hover .pc-badge-sale {
  transform: scale(1.03);
}

/* ─── بطاقة منتج: عمود ثابت — منطقة صورة واضحة ثم معلومات ثم أزرار (لا تداخل) ─── */
.pc.pc--product {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: visible;
}
.pc.pc--product .pc-top {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.pc.pc--product .pc-link {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: visible;
}
.pc.pc--product .pc-info {
  flex: 0 0 auto;
  flex-shrink: 0;
  min-height: min-content;
  overflow: visible;
}
.pc.pc--product .pc-img {
  flex: 0 0 200px;
  width: 100%;
  align-self: stretch;
  height: 200px;
  min-height: 200px;
  max-height: 200px;
  position: relative;
  z-index: 0;
}
.pc.pc--product .pc-footer {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.pc.pc--product.pc--skel .pc-img.skel-shimmer {
  aspect-ratio: unset;
  flex: 0 0 200px;
  height: 200px;
  min-height: 200px;
  max-height: 200px;
}

/* ─── صور ديناميكية: object-fit موحّد + بدائل السلة ─────── */
img.img-cover {
  object-fit: cover;
  object-position: center center;
}

.srch-thumb {
  display: block;
}

.cs-item-img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 56px;
  font-size: 28px;
}

/* تكبير صورة المنتج (CSP — بدون onerror مضمّن) */
.img-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(10, 22, 40, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px));
  cursor: zoom-out;
}
.img-modal.open {
  display: flex;
}
.img-modal__img,
.img-modal img#imgModalImg {
  max-width: min(92vw, 960px);
  max-height: min(85vh, 900px);
  width: auto;
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  cursor: default;
}
.img-modal-x {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 0px));
  inset-inline-start: max(16px, env(safe-area-inset-left, 0px));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 10051;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, background 0.2s ease;
}
.img-modal-x:hover {
  transform: scale(1.06);
  background: #fff;
}

/* صور مشابهة في صفحة المنتج */
.similar-grid .sim-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.similar-grid .sim-img img.img-cover {
  width: 100%;
  height: 100%;
}
@supports not (aspect-ratio: 1) {
  .similar-grid .sim-img {
    height: 0;
    padding-bottom: 100%;
    position: relative;
  }
  .similar-grid .sim-img > img.img-cover {
    position: absolute;
    left: 0;
    top: 0;
  }
}

/* ─── Skeleton Loaders ──────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skel-shimmer {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-md);
}
.pc--skel .pc-img.skel-shimmer {
  aspect-ratio: 4 / 5;
  min-height: 140px;
  max-height: 260px;
  height: auto;
  border-radius: 0;
}
@supports not (aspect-ratio: 1) {
  .pc--skel .pc-img.skel-shimmer {
    height: 190px;
    padding-bottom: 0;
  }
}
.skel-line        { height: 12px; margin-bottom: 8px; }
.skel-line--sm    { width: 50%; }
.skel-line--md    { width: 80%; height: 16px; }
.skel-line--price { width: 40%; height: 18px; }
.skel-btn         { height: 44px; border-radius: 0; }

/* ─── Reveal Animation ──────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* لمعان خفيف يمر على الأزرار (micro-interaction) */
@keyframes pharma-sheen {
  0% {
    left: -65%;
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    left: 125%;
    opacity: 0.85;
  }
}

.reveal { opacity: 0; }
.reveal.in { animation: fadeInUp .4s ease forwards; }

/* ─── Empty State ───────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state__icon { font-size: 52px; margin-bottom: 14px; }
.empty-state__msg  { color: var(--muted); font-size: 15px; }

/* ─── Toast ─────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--navy-2);
  color: white;
  padding: 12px 24px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 700;
  z-index: 9999;
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast--error { background: var(--danger); }
.toast--info  { background: var(--info); }

/* ─── Cart Sidebar ──────────────────────────────────────────────── */
.cs {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 100%;
  max-width: 420px;
  background: white;
  z-index: 8001;
  display: flex;
  flex-direction: column;
  /* مغلقة: إزاحة بعرض الشاشة + إخفاء — يتفادى بقاء شريط أبيض/هيدر السلة على الموبايل (RTL) */
  transform: translate3d(100vw, 0, 0);
  visibility: hidden;
  transition: transform .35s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .35s;
  box-shadow: var(--sh-lg);
  direction: rtl;
  pointer-events: none;
}
.cs.open {
  transform: translate3d(0, 0, 0);
  visibility: visible;
  transition: transform .35s cubic-bezier(.4, 0, .2, 1), visibility 0s linear 0s;
  pointer-events: auto;
}

.cs-ov { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 8000; display: none; }
.cs-ov.open { display: block; }

.cs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  font-size: 16px;
}
.cs-body { flex: 1; overflow-y: auto; padding: 16px; }
.cs-ft {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cs-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 15px; }

/* سلة: عنصر (اسم/سعر أوضح، أزرار +/− وحذف بحجم لمس ~44px) */
.cs-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.cs-item-img {
  width: 72px;
  height: 72px;
  border-radius: var(--r-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--g-bg);
}
.cs-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cs-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 2px;
}
.cs-item-name {
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--navy, #0f172a);
  word-break: break-word;
}
.cs-item-price-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.cs-item-subtotal {
  font-size: 16px;
  color: #047857;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.cs-item-unit-meta {
  font-size: 12.5px;
  font-weight: 700;
  color: #64748b;
  line-height: 1.2;
}
.cs-slot-notice {
  font-size: 13px;
  font-weight: 800;
  color: #92400e;
  background: rgba(254, 243, 199, 0.72);
  border: 1px solid rgba(180, 83, 9, 0.28);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  text-align: center;
  line-height: 1.4;
}
.cs-item-price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cs-item-price-old {
  font-size: 13.5px;
  font-weight: 700;
  color: #94a3b8;
  text-decoration: line-through;
}
.cs-qty,
.cs-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  flex-shrink: 0;
}
.cs-qty button,
.cs-item-qty button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--tr);
  -webkit-tap-highlight-color: transparent;
}
.cs-qty button:hover,
.cs-item-qty button:hover {
  background: var(--em-gl);
  border-color: var(--em);
}
.cs-qty button:focus-visible,
.cs-item-qty button:focus-visible {
  outline: 2px solid var(--em);
  outline-offset: 2px;
}
.cs-qty span,
.cs-item-qty span {
  font-weight: 900;
  min-width: 28px;
  text-align: center;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.cs-item-del {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin-top: 0;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--tr);
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}
.cs-item-del:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #dc2626;
}
.cs-item-del:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

.cs-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.cs-empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ─── Modal ─────────────────────────────────────────────────────── */
.mb-ov {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 7000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.mb {
  background: var(--white);
  border-radius: var(--r-xl);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  direction: rtl;
}

/* ─── Forms ─────────────────────────────────────────────────────── */
.fr label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 5px;
}
.fr input, .fr textarea, .fr select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  color: var(--navy);
  background: white;
  transition: var(--tr);
  direction: rtl;
}
.fr input:focus, .fr textarea:focus, .fr select:focus {
  outline: none;
  border-color: var(--em);
  box-shadow: 0 0 0 3px rgba(0,135,90,.12);
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 22px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: var(--tr);
}
.btn--primary   { background: var(--em); color: white; }
.btn--primary:hover { background: var(--em-d); }
.btn--ghost     { background: transparent; color: var(--em); border: 1.5px solid var(--em); }
.btn--ghost:hover { background: var(--em-gl); }
.btn--danger    { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn--danger:hover { background: #fef2f2; }
.btn--wa        { background: #25d366; color: white; }
.btn--wa:hover  { background: #1ea856; }
.btn:disabled   { opacity: .55; cursor: not-allowed; }

/* ─── Cart badge ────────────────────────────────────────────────── */
.cart-badge {
  display: none;
  position: absolute;
  top: -6px;
  inset-inline-end: -6px;
  width: 19px;
  height: 19px;
  background: var(--danger);
  color: white;
  font-size: 10.5px;
  font-weight: 800;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
}

/* ─── Pager (قديم — بدون ترقيم مرقم؛ الشبكة تستخدم .pager-wrap--numbered في store-enhancements) ─── */
.pager-wrap:not(.pager-wrap--numbered) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 0 8px;
}
.pager-btn {
  padding: 9px 22px;
  background: var(--em);
  color: white;
  border: none;
  border-radius: var(--r-full);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--tr);
}
.pager-btn:hover { background: var(--em-d); }
.pager-info { color: var(--muted); font-size: 13px; }

/* ─── WhatsApp Float ────────────────────────────────────────────── */
#wa-float {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 56px;
  height: 56px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  z-index: 500;
  box-shadow: 0 4px 16px rgba(37,211,102,.4);
  transition: var(--tr);
  text-decoration: none;
}
#wa-float:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(37,211,102,.5); }

/* ─── Back to Top ───────────────────────────────────────────────── */
#toTopBtn {
  position: fixed;
  bottom: 90px;
  left: 24px;
  width: 50px;
  height: 50px;
  background: var(--navy-2);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 499;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  cursor: pointer;
}

/* ─── Responsive — مسافات طفيفة فقط (الشبكة والبطاقات موحّدة أعلاه) ─── */
@media (max-width: 768px) {
  .cs { max-width: 100%; }
  .mb { padding: 22px 18px; max-height: 95vh; }
}

/* ════════════════════════════════════════════════════════════════
   إضافات v3.0 — تحسينات UX/UI/RTL/Performance
   ════════════════════════════════════════════════════════════════ */

/* ─── Global Loader (مُنشأ بواسطة app.js) ───────────────────── */
#_globalLoader {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  /* لا يحجب النقر/السحب على السلايدر والصفحة */
  pointer-events: none;
}
.gl-spin {
  width: 44px; height: 44px;
  border: 4px solid rgba(0,135,90,.15);
  border-top-color: var(--em, #00875A);
  border-radius: 50%;
  animation: _glspin .7s linear infinite;
}
@keyframes _glspin { to { transform: rotate(360deg); } }

/* ─── Toast رسائل محسَّنة ───────────────────────────────────── */
#_toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy, #0a1628);
  color: #7fffc4;
  padding: 13px 28px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  border: 1px solid rgba(0,168,110,.25);
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  text-align: center;
  direction: rtl;
}
#_toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#_toast.toast--error   { background: #1a0505; color: #fca5a5; border-color: rgba(239,68,68,.3); }
#_toast.toast--info    { background: #0a1628; color: #93c5fd; border-color: rgba(59,130,246,.3); }

/* ─── بطاقة المنتج — تأكيدات إضافية ───────────────────────── */
.pc { cursor: default; }
.pc-link { cursor: pointer; }
.pc-btn  { cursor: pointer; }

/* placeholder موحد للصور المكسورة */
.pc-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--g-bg, #f0faf5);
  font-size: 2.5rem;
  color: var(--muted, #94a3b8);
}

/* ─── Reveal Animation محسَّنة ──────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .4s ease, transform .4s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ─── RTL — المحاذاة عبر logical properties أعلاه ─────────── */

/* ─── Empty State محسَّن ─────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
  color: var(--muted, #64748b);
}
.empty-state__icon, .empty-state .ei {
  font-size: 52px;
  line-height: 1;
  opacity: .7;
}
.empty-state__msg, .empty-state p {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted, #64748b);
  margin: 0;
}

/* ─── صفحة القسم category.html — رأس القسم + شبكة الأقسام الفرعية ─ */
.main {
  max-width: 1280px;
  margin-inline: auto;
  padding: 12px max(14px, env(safe-area-inset-right, 14px)) 48px max(14px, env(safe-area-inset-left, 14px));
}

#catHdr {
  margin-bottom: 8px;
}

.cat-hdr-skel {
  text-align: center;
  padding: 28px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  margin-bottom: 16px;
}
.cat-hdr-skel__ico {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: linear-gradient(110deg, #e2e8f0, #f1f5f9);
  animation: subcat-skel-pulse 1.2s ease-in-out infinite;
}
@keyframes subcat-skel-pulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

.cat-hdr {
  text-align: center;
  padding: 28px 20px 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f0faf7 55%, #ecfdf5 100%);
  border: 1px solid rgba(0, 135, 90, 0.14);
  border-radius: var(--r-xl);
  box-shadow: var(--sh);
  margin-bottom: 20px;
}

.cat-hdr-ico {
  font-size: clamp(2.5rem, 7vw, 3rem);
  line-height: 1;
  margin-bottom: 12px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.06));
}

.cat-hdr-media {
  width: min(200px, 52vw);
  aspect-ratio: 1;
  margin: 0 auto 14px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(0, 135, 90, 0.14);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  background: var(--white);
}

.cat-hdr-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.cat-hdr-name {
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 8px;
  line-height: 1.35;
}

.cat-hdr-desc {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.subcat-sec {
  margin-bottom: 28px;
}

.subcat-sec__title {
  font-size: 16px;
  font-weight: 900;
  color: var(--navy);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subcat-sec__title-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--em);
  flex-shrink: 0;
}

.subcat-sec__title-ico svg {
  display: block;
}

.subcat-sec__hint {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.5;
}

.subcat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 520px) {
  .subcat-grid {
    grid-template-columns: 1fr;
  }
}

/* بطاقة قسم فرعي — صف أفقي: أيقونة + نصوص (زر أو رابط) */
a.subcat-chip {
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}

.subcat-chip {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  text-align: right;
  font-family: inherit;
  direction: rtl;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, background 0.2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  min-height: 0;
  -webkit-tap-highlight-color: transparent;
}

.subcat-chip:hover {
  border-color: rgba(0, 135, 90, 0.4);
  box-shadow: var(--sh-em);
  transform: translateY(-2px);
}

.subcat-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 168, 110, 0.25);
  border-color: var(--em);
}

.subcat-chip--active {
  border-color: var(--em);
  background: linear-gradient(135deg, rgba(0, 168, 110, 0.1), #ffffff);
  box-shadow: 0 0 0 2px rgba(0, 135, 90, 0.12);
}

.subcat-chip__ico {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  line-height: 1;
  background: linear-gradient(145deg, rgba(0, 168, 110, 0.14), rgba(0, 168, 110, 0.05));
  border-radius: 14px;
  border: 1px solid rgba(0, 135, 90, 0.12);
}

.subcat-chip__ico span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  line-height: 1;
}

.subcat-chip__ico--svg {
  color: rgba(15, 23, 42, 0.42);
}

.subcat-chip__ico--svg svg {
  display: block;
}

.subcat-chip:hover .subcat-chip__ico--svg {
  color: var(--em);
}

.subcat-chip__media {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0, 135, 90, 0.12);
  background: var(--white);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.subcat-chip__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.subcat-chip__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.subcat-chip__name {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.5;
  display: block;
  width: 100%;
  overflow: visible;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.subcat-chip__meta {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.prods-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.prods-hdr h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: var(--navy);
}

.prods-hdr span {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.err-box {
  padding: 22px 18px;
  text-align: center;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--r-lg);
  color: #b91c1c;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.5;
}

/* ─── Lazy-load fade-in ──────────────────────────────────────── */
img[loading="lazy"] {
  transition: opacity .3s ease;
}

/* ─── Focus Visible — Accessibility ─────────────────────────── */
:focus-visible {
  outline: 2.5px solid var(--em, #00875A);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─── Reduced Motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .pc:hover,
  .pc:focus-within {
    transform: none;
    box-shadow: var(--sh);
  }
  .cat-card-item:hover {
    transform: none;
    box-shadow: none;
  }
  .p-sec-fade {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .pc-btn:not(:disabled)::before,
  .wabtn::before,
  .ckbtn::before,
  .canbtn::before,
  .hdr-wa-primary::before {
    display: none !important;
  }
  .pc:hover .pc-img-el,
  .pc:hover .pc-ico-fallback { transform: none; }
  .pc:hover .pc-img::after { opacity: 0; }
  .pc-btn:hover:not(:disabled) { transform: none; box-shadow: none; }
  .pc-btn:active:not(:disabled) { transform: none; }
  .wabtn:hover,
  .wabtn:active,
  .ckbtn:hover,
  .ckbtn:active,
  .canbtn:hover,
  .canbtn:active,
  .hdr-wa-primary:hover,
  .hdr-wa-primary:active {
    transform: none;
    box-shadow: none;
    filter: none;
  }
  .cs-btn-secondary:active {
    transform: none;
  }
  .pc-like:hover { transform: none; }
  .pc:hover .pc-badge-sale,
  .pc:hover .pc-stock-badge { transform: none; }
}

/* ─── Scrollbar محسَّن ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,135,90,.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,135,90,.5); }

/* ─── Shop chrome: هيدر / فوتر / طبقات (صفحات تعتمد على shop-bundle فقط) ─── */

.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: var(--white);
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
}

.topbar {
  background: linear-gradient(90deg, var(--em-d) 0%, var(--em) 100%);
  color: #f8fafc;
  font-size: 12.5px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.tb-in {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px max(14px, env(safe-area-inset-right, 14px)) 8px max(14px, env(safe-area-inset-left, 14px));
  flex-wrap: wrap;
}

.tb-l,
.tb-r {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.hdr-in--modern {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  padding: 12px max(14px, env(safe-area-inset-right, 14px)) 14px max(14px, env(safe-area-inset-left, 14px));
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-width: 0;
}

.logo-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
}

.logo-txt strong {
  font-size: 15px;
  font-weight: 900;
  color: var(--navy);
}

.logo-txt span,
.ft-brand-url {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.hdr-search {
  flex: 1 1 220px;
  min-width: 0;
}

.srch-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
}

.srch-bar {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 54px 0 16px;
  border: 2px solid var(--border);
  border-radius: var(--shop-btn-r);
  font-size: 15px;
  font-weight: 500;
  color: var(--navy);
  background: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.srch-bar::placeholder {
  color: #64748b;
  font-weight: 500;
}
.srch-bar:focus {
  outline: none;
  border-color: rgba(0, 135, 90, 0.45);
  box-shadow: 0 0 0 4px rgba(0, 168, 110, 0.12);
}

.srch-btn {
  position: absolute;
  inset-inline-end: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--shop-btn-r);
  background: var(--em);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.srch-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-50%) scale(1.04);
}

.srch-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 300;
  max-height: min(320px, 50vh);
  overflow-y: auto;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  display: none;
}

.srch-suggest:not(:empty) {
  display: block;
}

.hdr-r {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hdr-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pref-btn {
  min-height: var(--touch-min);
  padding: 10px 16px;
  border-radius: var(--shop-btn-r);
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.pref-btn:hover {
  border-color: rgba(0, 135, 90, 0.35);
  transform: translateY(-1px);
}

.cart-btn-hdr {
  position: relative;
  width: var(--touch-min);
  height: var(--touch-min);
  border-radius: var(--shop-btn-r);
  border: 1.5px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.cart-btn-hdr:hover {
  border-color: rgba(0, 135, 90, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.cart-badge {
  position: absolute;
  top: -4px;
  inset-inline-start: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--em);
  color: white;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hdr-wa-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: max(52px, var(--touch-min));
  padding: 13px 26px;
  border-radius: var(--shop-btn-r);
  background: var(--wa-cta-grad-strong);
  border: 2px solid rgba(255, 255, 255, 0.42);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #fff !important;
  box-shadow: var(--wa-cta-shadow);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.hdr-wa-primary::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -65%;
  width: 55%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 42%,
    rgba(255, 255, 255, 0.38) 50%,
    rgba(255, 255, 255, 0.06) 58%,
    transparent 100%
  );
  transform: skewX(-14deg);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
}
.hdr-wa-primary:hover::before {
  opacity: 1;
  animation: pharma-sheen 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hdr-wa-primary:not(:hover)::before {
  animation: none;
  opacity: 0;
  left: -65%;
}
.hdr-wa-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
  box-shadow: var(--wa-cta-shadow-lg);
}
.hdr-wa-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 3px 14px rgba(37, 211, 102, 0.35);
}

footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.88);
  margin-top: 40px;
  padding: 40px max(16px, env(safe-area-inset-right, 16px)) 20px max(16px, env(safe-area-inset-left, 16px));
}

.ft-in {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px 24px;
}

.ft-brand p {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
}

.ft-col h4 {
  font-size: 14px;
  font-weight: 900;
  margin: 0 0 12px;
  color: white;
}

.ft-col a {
  display: block;
  font-size: 14px;
  padding: 4px 0;
  color: rgba(255, 255, 255, 0.82);
}

.ft-bot {
  max-width: 1200px;
  margin: 24px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.wa {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 20px));
  inset-inline-start: max(16px, env(safe-area-inset-left, 16px));
  z-index: 5000;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-lg);
}

.to-top {
  position: fixed;
  bottom: max(88px, calc(env(safe-area-inset-bottom, 0px) + 88px));
  inset-inline-start: max(16px, env(safe-area-inset-left, 16px));
  z-index: 4990;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--navy);
  color: white;
  font-size: 21px;
  font-weight: 800;
  box-shadow: var(--sh);
  cursor: pointer;
}

/* طبقة خلف السلة — كانت بدون display:none فتدفع المحتوى */
.co {
  position: fixed;
  inset: 0;
  z-index: 7999;
  background: rgba(15, 23, 42, 0.48);
  display: none;
  backdrop-filter: blur(2px);
}

.co.open {
  display: block;
}

/* نافذة تأكيد الطلب — كانت display:block افتراضياً فتظهر نموذج الطلب داخل تدفق الصفحة */
#mo {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 8500;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 16px)) max(16px, env(safe-area-inset-right, 16px)) max(16px, env(safe-area-inset-bottom, 16px)) max(16px, env(safe-area-inset-left, 16px));
  background: rgba(10, 22, 40, 0.55);
  backdrop-filter: blur(5px);
  overflow-y: auto;
  box-sizing: border-box;
}

#mo .mb {
  margin: auto;
}

.cs-hd {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.cs-hd-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
}

.cs-hd-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.cs-hd-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: var(--navy);
}

.cs-hd-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.cs-hd .cls {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
}

.mo-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.wabtn,
.canbtn {
  flex: 1 1 140px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: none;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.2s var(--pc-ease-out), box-shadow 0.22s ease, filter 0.2s ease;
}

.wabtn {
  background: var(--wa-cta-grad-strong);
  color: white;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.02em;
  padding: 15px 22px;
  min-height: 52px;
  border: 2px solid rgba(255, 255, 255, 0.32);
  box-shadow: var(--wa-cta-shadow);
}
.wabtn:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
  box-shadow: var(--wa-cta-shadow-lg);
}
.wabtn:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.canbtn {
  background: var(--border);
  color: var(--navy);
}
.canbtn:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
}
.canbtn:active {
  transform: translateY(1px) scale(0.985);
}

.ckbtn {
  width: 100%;
  padding: 14px;
  border-radius: var(--r-md);
  border: none;
  background: var(--em);
  color: white;
  font-weight: 900;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.2s var(--pc-ease-out), box-shadow 0.22s ease, filter 0.2s ease;
}
.ckbtn:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(0, 135, 90, 0.28);
}
.ckbtn:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 2px 12px rgba(0, 135, 90, 0.2);
}

.wabtn::before,
.ckbtn::before,
.canbtn::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -65%;
  width: 55%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 42%,
    rgba(255, 255, 255, 0.34) 50%,
    rgba(255, 255, 255, 0.05) 58%,
    transparent 100%
  );
  transform: skewX(-14deg);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
}
.canbtn::before {
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%
  );
}
.wabtn:hover::before,
.ckbtn:hover::before,
.canbtn:hover::before {
  opacity: 1;
  animation: pharma-sheen 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.wabtn:not(:hover)::before,
.ckbtn:not(:hover)::before,
.canbtn:not(:hover)::before {
  animation: none;
  opacity: 0;
  left: -65%;
}

.cs-btn-secondary {
  width: 100%;
  padding: 12px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: white;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.cs-btn-secondary:hover {
  border-color: rgba(0, 135, 90, 0.28);
  background: var(--g-bg, #f0faf5);
}
.cs-btn-secondary:active {
  transform: scale(0.987);
}

/* ─── Mobile: larger taps & readable type (≤640px) ─────────────── */
@media (max-width: 640px) {
  :root {
    --touch-min: 52px;
  }
  .hdr-wa-primary {
    font-size: 15px;
    padding: 12px 22px;
    min-height: 52px;
  }
  .srch-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
  }
  .ft-col a {
    padding: 12px 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* ملخص الطلب في نافذة التأكيد — نفس تنسيق رسالة واتساب */
.mo-sum-lines {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}
.mo-sum-item {
  margin-bottom: 14px;
}
.mo-sum-item:last-child {
  margin-bottom: 0;
}
.mo-sum-item > div {
  font-size: 13px;
  line-height: 1.5;
  color: var(--navy);
}
.mo-sum-strike {
  font-size: 12.5px;
  color: #94a3b8;
  text-decoration: line-through;
  font-weight: 700;
}

/* ─── Print ──────────────────────────────────────────────────── */
@media print {
  #_globalLoader, #_toast, #wa-float, #toTopBtn,
  .cs, .co, .p-hdr-r, #mo { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   Mobile / touch / أداء — يُحمّل مع كل صفحة تستخدم shop-bundle
   ═══════════════════════════════════════════════════════════════ */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* تقليل تأخير النقرة وتجنب التكبير المزدوج غير المقصود */
button,
[type="button"],
[type="submit"],
[role="button"],
.srch-btn,
.p-srch-btn,
.pref-btn,
.p-cart-btn,
.hdr-wa-primary,
.pc-fab-cart,
.pc-like,
.pc-wa-fab,
.p-nav-mob,
.p-hbtn,
.to-top,
.cart-btn-hdr,
.cs-hd .cls {
  touch-action: manipulation;
}

@media (hover: none) and (pointer: coarse) {
  body {
    -webkit-tap-highlight-color: rgba(0, 135, 90, 0.12);
  }
}

/* سلّة جانبية: تمرير سلس على iOS */
.cs,
.cs-ov {
  -webkit-overflow-scrolling: touch;
}

/* تخفيف رسوم باهظة على الهاتف */
@media (max-width: 767px) {
  .pc:hover {
    transform: none;
  }
  @media (hover: hover) and (pointer: fine) {
    .pc:hover {
      transform: translateY(-2px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
}
