/* =====================================================================
   ثيم تمور نجدية: طبقة التصميم فوق ثيم Soft.
   تُحمَّل بعد ملفات Soft كلها، فتتقدم عليها عند التعارض.
   البادئة dn- لكل صنف ومتغير جديد حتى لا تتصادم مع Soft.
   أصل التصميم: mockup/ في مجلد المشروع.
   ===================================================================== */

:root {
  /* ألوان العلامة */
  --dn-navy: #1f1c4a;          /* 1.0.12: كحلي المتجر نفسه كما في شريطه العلوي وتذييله السابقين؛ أبيض عليه 15.9:1 */
  --dn-green: #9cb06e;         /* زخرفة ومساحات فقط؛ أبيض عليه 2.4:1 ممنوع */
  --dn-green-dark: #4f6b2a;    /* أبيض عليه 6.1:1 */

  /* النص */
  --dn-text: #23262f;          /* على الأبيض 15.1:1 */
  --dn-text-muted: #5b6170;    /* على الأبيض 6.2:1 */
  --dn-sale: #c62828;          /* على الأبيض 5.6:1 */
  --dn-star: #b45309;

  /* الخلفيات */
  --dn-bg: #ffffff;
  --dn-bg-section: #f3f6ec;
  --dn-bg-hero: #eef3e2;
  --dn-border: #dfe4d3;

  /* زر الشراء */
  --dn-cta-bg: var(--dn-navy);
  --dn-cta-bg-hover: #161436;
  --dn-cta-text: #ffffff;

  /* المقاسات */
  --dn-tap: 44px;
  --dn-tap-primary: 48px;
  --dn-radius: 14px;      /* البطاقات والصور والمربعات */
  --dn-radius-sm: 12px;   /* الأزرار والحقول ومربع البحث */
  --dn-gutter: 16px;
  --dn-focus: 3px solid var(--dn-navy);

  /* سلّم الخط (بكسل ثابت، لأن Soft يجعل rem = 12px) */
  --dn-fs-xs: 14px;
  --dn-fs-sm: 15px;
  --dn-fs-base: 16px;
  --dn-fs-md: 18px;
  --dn-fs-lg: 20px;
  --dn-fs-xl: 22px;
  --dn-lh: 1.6;

  /* لون Soft الأساسي: يأخذ الكحلي بدل لون العلامة في لوحة زد، حتى يحقق التباين */
  --primary-color: var(--dn-navy);
  --text-color-primary-bg: #ffffff;
  --primary-color-op-5: rgba(31, 28, 74, 0.05);
}

/* ===== الأساس ===== */
body {
  font-size: var(--dn-fs-base);
  line-height: var(--dn-lh);
  color: var(--dn-text);
  background: var(--dn-bg);
}
:focus-visible { outline: var(--dn-focus); outline-offset: 2px; }
.dn-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.dn-num { font-variant-numeric: lining-nums tabular-nums; }

/* أزرار Soft الأساسية: كحلي بنص أبيض */
.btn-primary,
.btn-primary:not(:disabled):not(.disabled):active {
  background-color: var(--dn-cta-bg);
  border-color: var(--dn-cta-bg);
  color: var(--dn-cta-text);
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--dn-cta-bg-hover);
  border-color: var(--dn-cta-bg-hover);
  color: var(--dn-cta-text);
}
.btn-outline-primary {
  color: var(--dn-navy);
  border-color: var(--dn-navy);
}

/* ===== تقويس موحّد لعناصر Soft (زواياها حادة في الأصل) ===== */
.search-input-input,
.lg-search-div .form-control,
.sm-search-div .search-input-input { border-radius: var(--dn-radius-sm) !important; }
.form-control,
.custom-select,
select.select-quantity { border-radius: var(--dn-radius-sm); }
.btn-primary,
.btn-outline-primary,
.btn-filter,
.btn-product-card-out-of-stock,
.btn-product-card-select-variant,
.product-card-add-to-cart,
.btn-add-to-cart,
.btn-buy-now,
.more-button { border-radius: var(--dn-radius-sm) !important; }
.dropdown-menu { border-radius: var(--dn-radius-sm); overflow: hidden; }
.modal-content { border-radius: 16px; }
.products-details-page .carousel-img,
.products-details-page .thumb-image-a img,
.products-details-page .image-link img { border-radius: var(--dn-radius); }
.products-details-page .icon-heart-mask { border-radius: var(--dn-radius-sm) !important; }

/* ===== شريط الإعلان ===== */
.announcement-bar .announcement-text {
  font-size: var(--dn-fs-xs) !important;
  font-weight: 500;
  line-height: 1.45;
}
.announcement-bar a { display: inline-flex; align-items: center; min-height: 32px; }
/* 1.0.13: على الجوال مساحة لزر الإغلاق في جهته (يسار العربية ويمين الإنجليزية) حتى لا يلامس آخر النص؛ الكمبيوتر بلا تغيير.
   وإذا انقسم النص سطرين على الشاشات الضيقة توازن السطران بدل كلمة وحيدة في السطر الثاني (المتصفحات القديمة تتجاهل السطر) */
@media (max-width: 767.98px) {
  .announcement-bar > .container { padding-inline-end: 34px; }
  .announcement-bar .announcement-text { text-wrap: balance; }
}

/* ===== الترويسة ===== */
.search-header {
  background: var(--header-primary-color, var(--dn-bg));
  border-bottom: 1px solid var(--dn-border);
}
/* الشعار: !important لأن القالب يضع max-height: 100% تنسيقاً مضمّناً فيكبر الشعار ويغطي البحث */
.search-header .header-logo a { height: auto !important; display: flex !important; align-items: center; }
/* أيقونات الترويسة (القائمة، الرجوع، البحث، السلة): كحلية دائماً.
   بلا هذا تأخذ لون النص على الخلفية الأساسية (أبيض) فتختفي على الترويسة البيضاء حين لا تُضبط ألوان الرأس. */
.search-header .header-theme-icon-primary,
.search-header .header-theme-icon-primary::before,
.search-header .header-theme-icon-primary [class^="path"],
.search-header .header-theme-icon-primary [class^="path"]::before {
  color: var(--dn-navy) !important;
}
/* شريط الحساب واللغة والدولة */
.account-area .account-btn,
.account-area .account-btn span,
.language-currency .c-btn,
.language-currency .c-btn span { font-size: var(--dn-fs-xs) !important; }
/* أرقام الضريبة والسجل في أسفل التذييل */
.vat-crn-sections .vat-number span,
.vat-crn-sections .maroof-icon span,
.vat-crn-sections .maroof-icon div { font-size: var(--dn-fs-xs) !important; }
.search-header .image-logo { max-height: 64px !important; max-width: 260px; width: auto !important; height: auto; }
/* حاوية الشعار في Soft عرضها 20% من الترويسة (222 بكسل على 1456)، والشعار أعرض فيدخل على البحث:
   الحاوية تأخذ عرض الشعار نفسه، والبحث يتقلص بدلها (فُحص في معاينة زد: الشعار 224×56 والفاصل 30 بكسل) */
.search-header .header-logo { flex: 0 0 auto !important; width: auto !important; max-width: none !important; }
@media (min-width: 992px) {
  .search-header .header-logo { margin-inline-end: 24px; }
  .search-header .image-logo { max-height: 56px !important; max-width: 240px !important; }
}
/* Soft يضيف حشوة 10px أعلى وأسفل الشعار على الجوال فيظهر بارتفاع 20px؛ تُلغى ويُكبَّر */
@media (max-width: 991.98px) {
  .search-header .image-logo { padding: 0 !important; max-height: 44px !important; max-width: 190px !important; }
}
.cart-badge {
  background: var(--dn-navy) !important;
  color: #fff !important;
  font-size: var(--dn-fs-xs) !important;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  line-height: 22px;
  border-radius: 11px;
  text-align: center;
}
@media (max-width: 991.98px) {
  .search-header-bar { min-height: 60px; }
  .search-header .ic,
  .search-header .ic-menu-back,
  .search-header .sm-search-icon,
  .search-header .a-shopping-cart {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: var(--dn-tap);
    min-height: var(--dn-tap);
  }
  .search-header .header-theme-icon-primary { font-size: 24px; }
  .sm-search-div .search-input-input {
    min-height: var(--dn-tap);
    font-size: var(--dn-fs-base); /* 16 يمنع تكبير الصفحة تلقائياً في آيفون */
  }
}

/* ===== التذييل ===== */
.footer-store-section { font-size: var(--dn-fs-sm); }
.footer-about-us-links-div h2 { font-size: var(--dn-fs-md); font-weight: 700; }
.footer-about-us-links-div p { font-size: var(--dn-fs-sm); line-height: 1.7; margin-bottom: 0; }
.footer-about-us-links-div p a { display: inline-flex; align-items: center; min-height: var(--dn-tap); }
.footer-store-section .social-icons a { min-width: var(--dn-tap); min-height: var(--dn-tap); display: inline-flex; align-items: center; justify-content: center; }
.footer-copyrights, .vat-number, .maroof-icon { font-size: var(--dn-fs-xs); }

/* ===== عناوين الأقسام ===== */
.dn-section { padding: 24px 0; }
.dn-section--tint { background: var(--dn-bg-section); }
.dn-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.dn-section-title {
  font-size: var(--dn-fs-lg);
  font-weight: 700;
  line-height: 1.35;
  color: var(--dn-navy);
  margin: 0;
}
.dn-section-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--dn-tap);
  font-weight: 700;
  font-size: var(--dn-fs-sm);
  color: var(--dn-green-dark);
  text-decoration: none;
}
.dn-section-link:hover { color: var(--dn-navy); text-decoration: underline; }
/* 1.0.14: زر «عرض الكل» ثانٍ أسفل منتجات القسم في المنتصف (خيار more_bottom في «قائمة المنتجات»)، والرابط العلوي باقٍ */
.dn-section-more { display: flex; justify-content: center; margin-top: 16px; }
.dn-section-more .dn-btn { min-width: 200px; padding: 0 28px; }

/* 1.0.13: قسم «شركائنا» من Soft (شعارات العملاء) بمقاس عناوين أقسام القالب وهوامشها بدل 27 بكسل */
.dn-partners .section-slider-padding-space { padding-top: 24px; padding-bottom: 24px; }
.dn-partners .section-title {
  font-size: var(--dn-fs-lg);
  font-weight: 700;
  line-height: 1.35;
  color: var(--dn-navy);
  margin: 0 0 14px;
  text-transform: none;
}

/* ===== الأزرار الجديدة ===== */
.dn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--dn-tap);
  padding: 0 18px;
  border-radius: var(--dn-radius);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: var(--dn-fs-base);
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  white-space: normal;
}
.dn-btn--cta { background: var(--dn-cta-bg); color: var(--dn-cta-text); }
.dn-btn--cta:hover, .dn-btn--cta:focus { background: var(--dn-cta-bg-hover); color: var(--dn-cta-text); text-decoration: none; }
.dn-btn--outline { background: var(--dn-bg); color: var(--dn-navy); border-color: var(--dn-navy); }
.dn-btn--outline:hover { background: var(--dn-bg-section); color: var(--dn-navy); }
.dn-btn--block { width: 100%; }

/* ===== السلايدر ===== */
.dn-hero { background: var(--dn-bg); border-bottom: 1px solid var(--dn-border); }
.dn-hero__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.dn-hero__track::-webkit-scrollbar { display: none; }
.dn-slide {
  position: relative;
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  min-height: 300px;
  scroll-snap-align: start;
  /* بلا scroll-snap-stop: always حتى تقفز النقاط والتقليب التلقائي من 3 إلى 1 مباشرة */
  border-bottom: 4px solid var(--dn-green);
}
.dn-slide--bg-hero { background: var(--dn-bg-hero); }
.dn-slide--bg-section { background: var(--dn-bg-section); }
.dn-slide--bg-white { background: var(--dn-bg); }
.dn-slide__inner {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr minmax(120px, 42%);
  align-items: center;
  gap: 12px;
  padding: 18px var(--dn-gutter);
}
.dn-slide__chip {
  display: inline-block;
  background: var(--dn-green);
  color: var(--dn-navy);      /* 6.3:1 */
  font-weight: 700;
  font-size: var(--dn-fs-xs);
  padding: 2px 10px;
  border-radius: var(--dn-radius-sm);   /* سطر واحد يبقى كبسولة، وسطران لا يتشوّهان */
  margin-bottom: 8px;
}
.dn-slide__title { font-size: 26px; font-weight: 700; line-height: 1.3; color: var(--dn-navy); margin: 0; }
.dn-slide__sub { margin: 6px 0 10px; font-size: var(--dn-fs-sm); color: var(--dn-text); }
.dn-slide__note { margin: 0 0 12px; font-size: var(--dn-fs-md); font-weight: 700; color: var(--dn-text); }
/* صور المنتجات خلفيتها بيضاء: تُدمج في لون الشريحة (multiply) بدل مربع أبيض فوق خلفية ملونة */
.dn-slide__media img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: transparent;
  mix-blend-mode: multiply;
}
/* شريحة الصورة الكاملة */
.dn-slide--image { min-height: 0; display: block; }
.dn-slide__link { display: block; position: relative; text-decoration: none; }
.dn-slide__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  object-fit: cover;
}
/* 1.0.11: من 768 يُعرض بنر الكمبيوتر (7:3)، فتطابق النسبة مصدر الصورة ولا يُقص على الأجهزة اللوحية */
@media (min-width: 768px) { .dn-slide__img { aspect-ratio: 7 / 3; } }
.dn-slide__tag {
  position: absolute;
  inset-inline-start: var(--dn-gutter);
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--dn-tap);
  max-width: calc(100% - 2 * var(--dn-gutter));
  padding: 0 14px;
  border-radius: 999px;
  background: var(--dn-navy);
  color: #fff;
  font-weight: 700;
  font-size: var(--dn-fs-sm);
  line-height: 1.35;
}
.dn-slide__tag svg { width: 18px; height: 18px; flex: none; }
[dir="ltr"] .dn-slide__tag svg { transform: scaleX(-1); }

.dn-hero__controls { display: flex; align-items: center; justify-content: center; gap: 4px; }
.dn-hero__dots { display: flex; }
.dn-dot {
  width: 32px;
  height: var(--dn-tap);
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.dn-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--dn-text-muted);
  transition: width .2s ease, background-color .2s ease;
}
.dn-dot[aria-current="true"]::before { width: 22px; background: var(--dn-navy); }
.dn-icon-btn {
  width: var(--dn-tap);
  height: var(--dn-tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--dn-navy);
  border-radius: var(--dn-radius-sm);
  cursor: pointer;
}
.dn-icon-btn svg { width: 18px; height: 18px; }
.dn-pause .dn-i-play { display: none; }
.dn-pause[data-playing="false"] .dn-i-pause { display: none; }
.dn-pause[data-playing="false"] .dn-i-play { display: block; }
[dir="ltr"] .dn-i-play { transform: scaleX(-1); }   /* زر التشغيل يتجه يميناً في الإنجليزية */

@media (min-width: 992px) {
  .dn-slide { min-height: 420px; }
  .dn-slide__inner { max-width: 1140px; margin: 0 auto; grid-template-columns: 1fr 40%; gap: 40px; padding: 32px 15px; }
  .dn-slide__title { font-size: 40px; }
  .dn-slide__sub { font-size: var(--dn-fs-md); }
  .dn-slide__img { aspect-ratio: 7 / 3; }
}

/* ===== التصنيفات بنمط القصص ===== */
.dn-stories { padding: 24px 0 8px; }
.dn-stories__strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 8px var(--dn-gutter);
  margin: 0;
  list-style: none;
  scrollbar-width: none;
}
.dn-stories__strip::-webkit-scrollbar { display: none; }
.dn-stories__strip li { scroll-snap-align: start; flex: none; }
.dn-story {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 84px;
  min-height: var(--dn-tap);
  text-decoration: none !important;
  color: var(--dn-text);
  border-radius: var(--dn-radius-sm);
}
.dn-story__ring {
  position: relative;
  display: block;
  width: 72px;
  height: 72px;
  margin-top: 4px;
}
/* الإطار: غامق متدرّج لما لم يُفتح */
.dn-story__ring::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--dn-navy), var(--dn-green-dark), var(--dn-green), var(--dn-green-dark), var(--dn-navy));
}
.dn-story__img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fff;
  background: #fff;
}
.dn-story__img img,
.dn-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* صور التصنيفات الحالية مكتوب في أسفلها الاسم: نكبّرها من الأعلى فيُقتطع الاسم */
.dn-crop img { transform: scale(1.45); transform-origin: 50% 5%; }
/* ما فُتح: إطار رمادي رفيع واسم باهت */
.dn-story[data-seen="true"] .dn-story__ring::before { inset: -2px; background: var(--dn-border); }
.dn-story[data-seen="true"] .dn-story__name { color: var(--dn-text-muted); }
.dn-story.is-opening .dn-story__ring::before {
  inset: -4px;
  background: conic-gradient(from 0deg, var(--dn-navy), var(--dn-green-dark), var(--dn-green), transparent 70%, var(--dn-navy));
  animation: dn-spin .7s linear infinite;
}
@keyframes dn-spin { to { transform: rotate(1turn); } }
/* 1.0.12: شارة قصيرة أسفل الدائرة (مثل «جديد») على طريقة القصص، وتختفي بعد أن يفتح الزائر الدائرة */
.dn-story__badge {
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  z-index: 1;
  min-width: 36px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  white-space: nowrap;
  color: #fff;
  background: var(--dn-sale);   /* أبيض عليه 5.6:1 */
  border: 2px solid #fff;
  border-radius: 999px;
}
.dn-story[data-seen="true"] .dn-story__badge { display: none; }
.dn-story__name {
  font-size: var(--dn-fs-xs);
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
}
@media (min-width: 992px) {
  .dn-stories__strip { justify-content: center; flex-wrap: wrap; overflow: visible; }
  .dn-story { width: 104px; }
  .dn-story__ring { width: 88px; height: 88px; }
}

/* ===== مربعات الأقسام ===== */
.dn-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dn-tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dn-tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--dn-bg);
  border: 1px solid var(--dn-border);
  border-radius: var(--dn-radius);
  overflow: hidden;
  text-decoration: none !important;
  color: var(--dn-navy);
}
.dn-tile:hover { border-color: var(--dn-green-dark); color: var(--dn-navy); }
.dn-tile__media { display: block; aspect-ratio: 1 / 1; overflow: hidden; background: #fff; }
.dn-tile__name {
  display: block;
  min-height: var(--dn-tap);
  padding: 12px 8px;
  font-weight: 700;
  font-size: var(--dn-fs-sm);
  line-height: 1.35;
  text-align: center;
  border-top: 1px solid var(--dn-border);
}
@media (min-width: 768px) {
  .dn-tiles, .dn-tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 992px) {
  .dn-tiles, .dn-tiles--3 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
}

/* ===== قوائم المنتجات في الرئيسية ===== */
.dn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 768px) { .dn-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 992px) { .dn-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 20px; } }
.dn-hscroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 160px;
  gap: 12px;
  overflow-x: auto;
  margin: 0 calc(-1 * var(--dn-gutter));
  padding: 0 var(--dn-gutter) 4px;
  list-style: none;
  scroll-snap-type: x proximity;
}
.dn-hscroll > li { scroll-snap-align: start; }
@media (min-width: 992px) { .dn-hscroll { grid-auto-columns: 220px; gap: 20px; } }
/* 1.0.15: طريقة عرض ثالثة (mscroll): على الجوال صف واحد يُسحب أفقياً ببطاقات أصغر قليلاً (بطاقتان وطرف الثالثة)،
   بسحب المتصفح الأصلي بلا التقاط كشريط القالب السابق؛ الهامش السالب 15 يساوي حشو الحاوية فيمتد الشريط لحافتي الشاشة.
   ومن 768 فأكثر تبقى الشبكة صفاً واحداً ويُخفى ما زاد عنه، فيُرفع «أقصى عدد» للجوال دون أن تتعدد صفوف الكمبيوتر */
.dn-grid.dn-grid--mscroll {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: clamp(140px, 40vw, 168px);
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  margin-inline: -15px;
  padding: 0 15px 4px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dn-grid--mscroll::-webkit-scrollbar { display: none; }
/* 1.0.16: الشريط نفسه على التابلت والكمبيوتر (3 أو 4 بطاقات وطرف التالية) ويُسحب بالماوس (dn-theme.js) */
@media (min-width: 768px) {
  .dn-grid.dn-grid--mscroll { grid-auto-columns: calc((100% - 60px) / 3.3); gap: 20px; margin-inline: 0; padding: 0 0 4px; cursor: grab; }
  .dn-grid--mscroll img { -webkit-user-drag: none; }
  .dn-grid--mscroll.is-dragging { cursor: grabbing; -webkit-user-select: none; user-select: none; }
}
@media (min-width: 992px) { .dn-grid.dn-grid--mscroll { grid-auto-columns: calc((100% - 80px) / 4.3); } }
.dn-more { margin-top: 16px; text-align: center; }

/* ===== بطاقة المنتج ===== */
.product-item.dn-card {
  display: flex;
  flex-direction: column;
  width: 100%;          /* custom.css في Soft يثبّت البطاقة على 135 بكسل */
  max-width: none;
  height: 100%;
  background: var(--dn-bg);
  border: 1px solid var(--dn-border);
  border-radius: var(--dn-radius);
  overflow: hidden;
  padding: 0;
  margin: 0;
}
.dn-card .add-to-wishlist { z-index: 2; }
.dn-card__media { position: relative; display: block; background: #fff; }
.dn-card__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}
.dn-card__media .product-card-bundle-offer { position: absolute; inset-inline-start: 8px; bottom: 8px; }
.dn-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 10px 0;
  flex: 1;
}
.dn-card__title {
  font-size: var(--dn-fs-sm);
  font-weight: 500;
  line-height: 1.45;
  margin: 0;
}
/* الاسم كاملاً حتى ثلاثة أسطر، والرابط بارتفاع لمس 44 على الأقل */
.dn-card__title a {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: max(var(--dn-tap), calc(2 * 1.45em));
  color: var(--dn-text);
  text-decoration: none;
}
.dn-card__title a:hover { color: var(--dn-navy); text-decoration: underline; }
.dn-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--dn-fs-xs);
  color: var(--dn-text-muted);
}
.dn-rating svg { width: 16px; height: 16px; color: var(--dn-star); flex: none; }
.dn-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  margin-top: auto;
}
.dn-price__now { font-size: var(--dn-fs-md); font-weight: 700; color: var(--dn-text); }
.dn-price__old { font-size: var(--dn-fs-xs); color: var(--dn-text-muted); text-decoration: line-through; }
.dn-price__off { font-size: var(--dn-fs-xs); font-weight: 700; color: var(--dn-sale); }
.dn-card__note { margin: 0; font-size: var(--dn-fs-xs); color: var(--dn-text-muted); }
.product-card-footer.dn-card__footer { padding: 8px 10px 12px; text-align: start; }
.dn-card__footer .dn-btn { width: 100%; font-size: var(--dn-fs-sm); padding: 0 8px; }
.dn-card__footer .dn-btn img { display: inline-block; }
.product-item-out-of-stock .dn-card__media img { opacity: .55; }

/* ===== صفحة التصنيف ===== */
.breadcrumb-section .breadcrumb { background: transparent; font-size: var(--dn-fs-xs); margin-bottom: 0; }
.breadcrumb-section .breadcrumb-item a {
  color: var(--dn-green-dark);
  display: inline-flex;
  align-items: center;
  min-height: var(--dn-tap);
}
.breadcrumb-section .breadcrumb-item.active { color: var(--dn-text-muted); display: inline-flex; align-items: center; }
.subTitle-detail .bread-title { font-size: 22px; font-weight: 700; color: var(--dn-navy); line-height: 1.35; }
.subTitle-detail .bread-text { font-size: var(--dn-fs-sm); color: var(--dn-text-muted); }
.products-filter .filter-result,
.products-filter .filter-order { font-size: var(--dn-fs-xs); color: var(--dn-text-muted); margin-bottom: 4px; }
.products-filter .btn-filter {
  min-height: var(--dn-tap);
  padding: 0 14px;
  border: 1px solid var(--dn-border);
  border-radius: var(--dn-radius);
  background: var(--dn-bg);
  color: var(--dn-navy);
  font-size: var(--dn-fs-sm);
  font-weight: 500;
}
.products-filter .dropdown-item { min-height: var(--dn-tap); display: flex; align-items: center; font-size: var(--dn-fs-sm); }
@media (max-width: 767.98px) {
  #products-list.products-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
    margin: 0;
  }
  #products-list.products-list > .prod-col {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}

/* ===== شريط الثقة ===== */
.dn-trust {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dn-trust li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
/* الأيقونة المباشرة فقط: زد يستبدل «SAR» داخل النص برمز الريال (svg) فلا يرث شكل الأيقونة */
.dn-trust li > svg {
  width: 40px;
  height: 40px;
  padding: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--dn-bg);
  color: var(--dn-green-dark);
  border: 1px solid var(--dn-green);
}
@media (min-width: 768px) {
  .dn-trust { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .dn-dot::before { transition: none; }
  .dn-story.is-opening .dn-story__ring::before { animation: none; }
  .dn-hero__track, .dn-hscroll, .dn-stories__strip { scroll-behavior: auto; }
}

/* ===================================================================
   تجربة الشراء (1.0.7): كمية البطاقة، التوصيل المجاني، نافذة التأكيد،
   اقتراحات البحث، «عرض المزيد». السلوك في dn-cart.js وdn-theme.js وmain.js
   =================================================================== */

/* [hidden] يغلب display من Bootstrap على الأزرار */
.dn-card__footer [hidden], .dn-lm [hidden], .dn-lm[hidden], [data-dn-fs][hidden] { display: none !important; }

/* ===== كمية البطاقة «− 1 +» ===== */
.dn-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: var(--dn-tap);
  border: 1.5px solid var(--dn-navy);
  border-radius: var(--dn-radius-sm);
  background: var(--dn-bg);
  overflow: hidden;
}
.dn-step__btn {
  flex: none;
  width: var(--dn-tap);
  height: var(--dn-tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--dn-navy);
  cursor: pointer;
}
.dn-step__btn svg, .dn-qty__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.dn-step__btn:hover { background: var(--dn-bg-section); }
.dn-step__btn:focus-visible { outline: var(--dn-focus); outline-offset: -3px; }
.dn-step__btn:disabled { color: #9aa0ad; cursor: not-allowed; background: transparent; }
.dn-step__val { flex: 1; text-align: center; font-weight: 700; font-size: var(--dn-fs-base); color: var(--dn-navy); }
.dn-step[aria-busy="true"] { opacity: .6; }
.dn-step[aria-busy="true"] .dn-step__btn { pointer-events: none; }

/* ===== تقدّم التوصيل المجاني ===== */
.dn-fs { display: grid; gap: 8px; }
.dn-fs__msg { margin: 0; font-size: var(--dn-fs-sm); font-weight: 500; color: var(--dn-text); line-height: 1.5; }
.dn-fs__track { position: relative; height: 8px; border-radius: 999px; background: var(--dn-border); overflow: hidden; }
.dn-fs__fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: inherit; background: var(--dn-green-dark); transition: width .4s ease; }
.dn-fs[data-state="done"] .dn-fs__msg { color: var(--dn-green-dark); font-weight: 700; }
.dn-fs-cart {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: var(--dn-radius);
  background: var(--dn-bg-section);
  border: 1px solid var(--dn-border);
}
/* رسالة Soft أسفل الكوبون حلّ محلها الشريط أعلى السلة */
.cart-view .free-shipping-rule-section { display: none !important; }

/* ===== نافذة تأكيد الإضافة ===== */
.dn-sheet {
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--dn-radius);
  background: var(--dn-bg);
  color: var(--dn-text);
  box-shadow: 0 18px 48px rgba(31, 28, 74, .22);
}
.dn-sheet::backdrop { background: rgba(15, 22, 72, .45); }
.dn-sheet__panel { display: grid; gap: 16px; padding: 18px 18px 20px; }
.dn-sheet__head { display: flex; align-items: center; gap: 10px; }
.dn-sheet__check {
  flex: none;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--dn-green-dark);
  color: #fff;
}
.dn-sheet__check svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.dn-sheet__title { flex: 1; margin: 0; font-size: var(--dn-fs-md); font-weight: 700; color: var(--dn-navy); }
.dn-sheet__close {
  flex: none;
  width: var(--dn-tap);
  height: var(--dn-tap);
  margin-inline-end: -10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--dn-radius-sm);
  background: transparent;
  color: var(--dn-text);
  cursor: pointer;
}
.dn-sheet__close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.dn-sheet__close:hover { background: var(--dn-bg-section); }
.dn-sheet__item { display: flex; align-items: center; gap: 12px; }
.dn-sheet__img { flex: none; width: 64px; height: 64px; object-fit: cover; border-radius: var(--dn-radius-sm); border: 1px solid var(--dn-border); }
.dn-sheet__info { min-width: 0; }
.dn-sheet__name { margin: 0 0 4px; font-weight: 500; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dn-sheet__meta { margin: 0; font-size: var(--dn-fs-xs); color: var(--dn-text-muted); }
.dn-sheet__fs:empty { display: none; }
.dn-sheet__fs { padding: 12px 14px; border-radius: var(--dn-radius-sm); background: var(--dn-bg-section); }
.dn-sheet__total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; padding-top: 12px; border-top: 1px solid var(--dn-border); }
.dn-sheet__total strong { font-size: var(--dn-fs-md); color: var(--dn-navy); }
.dn-sheet__actions { display: grid; gap: 10px; }
.dn-sheet__actions .dn-btn { min-height: var(--dn-tap-primary); }
html.dn-sheet-open { overflow: hidden; }
@media (max-width: 575.98px) {
  /* على الجوال لوحة من أسفل الشاشة، وأزرارها في متناول الإبهام */
  .dn-sheet {
    max-width: none;
    margin: auto 0 0;
    border-radius: var(--dn-radius) var(--dn-radius) 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .dn-sheet[open] { animation: dn-sheet-up .25s ease-out; }
}
@keyframes dn-sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== اقتراحات البحث ===== */
.autocomplete .autocomplete-items {
  border: 0 !important;
  border-radius: 0 0 var(--dn-radius) var(--dn-radius);
  background: var(--dn-bg);
  box-shadow: 0 12px 32px rgba(31, 28, 74, .14);
  max-height: min(70vh, 520px);
  overflow-y: auto;
}
.autocomplete .autocomplete-items:empty { display: none; }
.autocomplete .autocomplete-items .dn-ac-row { border-bottom: 1px solid var(--dn-border); background: var(--dn-bg); }
.autocomplete .autocomplete-items .dn-ac-row:hover { background: var(--dn-bg-section); }
.autocomplete .autocomplete-items .dn-ac-row a.dn-ac-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--dn-text);
  text-decoration: none;
}
.dn-ac-thumb { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--dn-border); }
.dn-ac-thumb img { object-fit: contain !important; }
.dn-ac-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dn-ac-name { font-size: var(--dn-fs-sm); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dn-ac-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-weight: 700; color: var(--dn-navy); font-size: var(--dn-fs-sm); }
.dn-ac-now, .dn-ac-price del { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.dn-ac-price del { font-weight: 400; color: var(--dn-text-muted); font-size: var(--dn-fs-xs); }
.dn-ac-price svg { width: 0.9em; height: 0.9em; }
.autocomplete .autocomplete-items a.dn-ac-all {
  display: block;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--dn-navy);
  text-align: center;
}
.autocomplete .autocomplete-items .dn-ac-popular, .autocomplete .autocomplete-items .dn-ac-chips { background: transparent; border: 0; }
.autocomplete .autocomplete-items .dn-ac-popular { padding: 12px 14px 14px; }
.autocomplete .autocomplete-items .dn-ac-popular:hover, .autocomplete .autocomplete-items .dn-ac-chips:hover { background: transparent; }
.dn-ac-label { margin: 0 0 8px; font-size: var(--dn-fs-xs); color: var(--dn-text-muted); }
.dn-ac-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.autocomplete .autocomplete-items .dn-ac-chips a.dn-ac-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--dn-border);
  border-radius: 999px;
  background: var(--dn-bg-section);
  color: var(--dn-navy);
  font-size: var(--dn-fs-sm);
  font-weight: 500;
}
.autocomplete .autocomplete-items .dn-ac-chips a.dn-ac-chip:hover { border-color: var(--dn-navy); text-decoration: none; }
.dn-ac-none { margin: 0; padding: 14px 14px 0; color: var(--dn-text-muted); }

/* ===== «عرض المزيد» ===== */
#product-pagination.dn-lm-hidden { display: none; }
.dn-lm { display: grid; justify-items: center; gap: 10px; margin: 24px auto 8px; max-width: 360px; text-align: center; }
.dn-lm__status { margin: 0; font-size: var(--dn-fs-sm); color: var(--dn-text-muted); }
.dn-lm__bar { width: 200px; height: 4px; border-radius: 999px; background: var(--dn-border); overflow: hidden; }
.dn-lm__bar span { display: block; height: 100%; background: var(--dn-navy); border-radius: inherit; }
.dn-lm__btn { min-width: 220px; min-height: var(--dn-tap-primary); }
.dn-lm__btn[aria-busy="true"] { opacity: .7; cursor: progress; }

@media (prefers-reduced-motion: reduce) {
  .dn-fs__fill { transition: none; }
  .dn-sheet[open] { animation: none; }
}

/* ===== 1.0.9: النسخة الإنجليزية (من اليسار لليمين) ===== */
/* رمز الريال الذي يضعه زد داخل النص يبقى بحجم السطر */
.dn-trust li > span svg { display: inline-block; width: 0.9em; height: 0.9em; vertical-align: -0.1em; }
/* شارة زد («منتج مميز») في بداية السطر دائماً، والمفضلة في نهايته، فلا تتداخلان في الإنجليزية */
.dn-card .badge-name-product-card { inset-inline-start: 10px !important; inset-inline-end: auto !important; }
