/* ===================================================================
   هدياتي — hadaytae.com  ·  ثيم رائد
   النسخة 2: تنسيق الصفحة الرئيسية + جمالية بطاقات المنتجات
   يُلصق في: لوحة سلة ← التصميم ← تعديل الثيم ← أكواد مخصصة ← CSS
   يستبدل النسخة السابقة بالكامل. امسح القديم والصق هذا مكانه.
   مبني على متغيرات الثيم نفسها، فلا يكسر الاتجاه RTL ولا الوضع الداكن.
   =================================================================== */

:root {
  --h-brand:        var(--color-primary, #e0aec5);
  --h-brand-dark:   var(--color-primary-dark, #ba889f);
  --h-brand-light:  var(--color-primary-light, #ffd4eb);
  --h-brand-tint:   #fbeef3;
  --h-brand-border: #f1d6e0;
  --h-deep:         #9c6a80;

  --h-ink:     #1f1f1f;
  --h-body:    #4a4a4a;
  --h-muted:   #8b8b8b;
  --h-line:    #ededed;
  --h-surface: #ffffff;

  --h-radius:   16px;
  --h-radius-s: 10px;
  --h-shadow:   0 1px 2px rgba(31,31,31,.04);
  --h-shadow-h: 0 14px 30px rgba(156,106,128,.16);

  --h-gap:    56px;
  --h-gap-sm: 32px;
}

/* ===================================================================
   القسم أ — تخطيط الصفحة الرئيسية
   =================================================================== */

.index .s-block {
  padding-block: var(--h-gap);
  margin-block: 0;
}

.index .s-block--full-bg { padding-block: calc(var(--h-gap) + 8px); }

.index .s-block--fixed-banner { padding-block: 0 var(--h-gap-sm); }

.index .s-block--fixed-banner img {
  width: 100%;
  height: auto;
  border-radius: var(--h-radius);
  display: block;
}

.index .s-block--features { padding-block: var(--h-gap-sm); }

/* ---------- عناوين الأقسام ---------- */

.index .s-block__title,
.index .s-slider-block__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-block-end: 24px;
  padding-block-end: 14px;
  border-block-end: 1px solid var(--h-line);
}

.index .s-block__title h2,
.index .s-slider-block__title h2 {
  position: relative;
  margin: 0;
  padding-inline-start: 14px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--h-ink);
}

.index .s-block__title h2::before,
.index .s-slider-block__title h2::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 4px;
  width: 4px;
  border-radius: 4px;
  background: var(--h-brand);
}

.index .s-block__display-all {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--h-brand-border);
  border-radius: 999px;
  background: var(--h-brand-tint);
  font-size: 13px;
  font-weight: 700;
  color: var(--h-deep);
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}

.index .s-block__display-all:hover {
  background: var(--h-brand);
  color: #fff;
}

/* ---------- تسوّق حسب القسم ---------- */

.index .s-block--categories .slide--cat-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 10px;
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius);
  background: var(--h-surface);
  box-shadow: var(--h-shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.index .s-block--categories .slide--cat-entry:hover {
  transform: translateY(-4px);
  border-color: var(--h-brand-border);
  box-shadow: var(--h-shadow-h);
}

.index .s-block--categories .slide--cat-entry img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--h-brand-tint);
  margin-block-end: 10px;
}

.index .s-block--categories .slide--cat-entry:hover img { border-color: var(--h-brand); }

.index .s-block--categories .slide--cat-entry h2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  color: var(--h-body);
}

/* ---------- شريط المزايا ---------- */

.index .s-block--features__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius);
  background: var(--h-surface);
  box-shadow: var(--h-shadow);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.index .s-block--features__item:hover {
  border-color: var(--h-brand-border);
  box-shadow: var(--h-shadow-h);
}

.index .s-block--features__item h3,
.index .s-block--features__item h4 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 700;
  color: var(--h-ink);
}

.index .s-block--features__item p,
.index .s-block--features__item span {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--h-muted);
}

/* ---------- شريط الماركات ---------- */

.index .s-block--logos-slider { background: var(--h-brand-tint) !important; }

.index .s-block--logos-slider .brand-item {
  border-radius: var(--h-radius);
  background: #fff;
  transition: transform .25s ease, box-shadow .25s ease;
}

.index .s-block--logos-slider .brand-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--h-shadow-h);
}

.index .s-block--logos-slider img {
  max-height: 56px;
  width: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: .72;
  transition: filter .25s ease, opacity .25s ease;
}

.index .s-block--logos-slider .brand-item:hover img {
  filter: grayscale(0);
  opacity: 1;
}

/* ---------- آراء العملاء ---------- */

.index .s-block--testimonials {
  background: var(--h-brand-tint);
  border-radius: var(--h-radius);
}

/* ===================================================================
   القسم ب — جمالية بطاقة المنتج
   تنطبق في كل صفحات المتجر: الرئيسية والتصنيفات والبحث وصفحة المنتج
   =================================================================== */

.s-product-card-entry {
  position: relative;
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius);
  background: var(--h-surface);
  overflow: hidden;
  box-shadow: var(--h-shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.s-product-card-entry:hover {
  transform: translateY(-6px);
  border-color: var(--h-brand-border);
  box-shadow: var(--h-shadow-h);
}

/* ---------- لوحة الصورة ---------- */

/* خلفية متدرّجة خفيفة: تحوّل صور الاستوديو البيضاء إلى بلاطة مصمّمة
   بدل مساحة بيضاء ضائعة، وتوحّد الإحساس البصري بين كل المنتجات */
.s-product-card-entry .s-product-card-image {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, #fbf8f9 0%, #f5eef1 100%);
  overflow: hidden;
}

.s-product-card-entry .s-product-card-image > a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.s-product-card-entry .s-product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8%;
  transition: transform .45s cubic-bezier(.2,.7,.3,1);
}

.s-product-card-entry:hover .s-product-card-image img { transform: scale(1.07); }

/* ---------- شارة العرض ---------- */

/* كانت عنابية داكنة تصطدم بالوردي — تصبح بلون الهوية */
.s-product-card-promotion-title {
  background: var(--h-deep) !important;
  color: #fff !important;
  padding: 5px 12px !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: 0 4px 10px rgba(156,106,128,.28);
  /* أعلى اليمين في RTL، وزر المفضلة يبقى وحده أعلى اليسار بلا تصادم */
  inset-inline-start: 10px !important;
  inset-inline-end: auto !important;
  top: 10px !important;
}

/* ---------- زر المفضلة ---------- */

.s-product-card-entry .s-product-card-wishlist-btn {
  border-radius: 50% !important;
  border-color: transparent !important;
  background: rgba(255,255,255,.92) !important;
  box-shadow: 0 2px 8px rgba(31,31,31,.08);
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.s-product-card-entry .s-product-card-wishlist-btn:hover {
  background: var(--h-brand) !important;
  color: #fff !important;
  transform: scale(1.08);
}

/* ---------- المحتوى ---------- */

.s-product-card-entry .s-product-card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 16px 18px;
}

/* اسم الماركة يصعد فوق اسم المنتج كسطر تمهيدي — أسلوب المتاجر العالمية */
.s-product-card-entry .s-product-card-content-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.s-product-card-entry .s-product-card-content-subtitle {
  order: -1;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  line-height: 1.4;
  color: var(--h-deep);
  opacity: 1 !important;
}

.s-product-card-content-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--h-ink);
}

.s-product-card-content-title a { color: inherit; }
.s-product-card-entry:hover .s-product-card-content-title a { color: var(--h-deep); }

/* ---------- السعر والتقييم ---------- */

.s-product-card-entry .s-product-card-content-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.s-product-card-price,
.s-product-card-sale-price h4 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--h-ink);
}

.s-product-card-price i,
.s-product-card-sale-price i { opacity: .55; }

/* السعر المخفّض: الحالي بلون الهوية، والقديم رمادي مشطوب بجانبه */
.s-product-card-sale-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.s-product-card-sale-price h4 { color: var(--h-deep); }

.s-product-card-sale-price span {
  font-size: 13px;
  font-weight: 500;
  color: var(--h-muted);
  text-decoration: line-through;
}

.s-product-card-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #fff8ec;
  font-size: 12.5px;
  font-weight: 700;
  color: #9a7433;
}

/* ---------- زر الإضافة للسلة ---------- */

.s-product-card-entry .s-button-primary-outline {
  border-radius: 999px;
  border-color: var(--h-brand);
  font-weight: 700;
  color: var(--h-deep);
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.s-product-card-entry .s-button-primary-outline:hover {
  background: var(--h-brand);
  border-color: var(--h-brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(224,174,197,.45);
}

.s-product-card-entry .s-product-card-content-footer { margin-top: 2px; }

/* ---------- توحيد الارتفاع داخل الشرائط ---------- */

.s-block .swiper-wrapper { align-items: stretch; }
.s-block .swiper-slide   { height: auto; }

/* ===================================================================
   القسم ج — الجوال
   =================================================================== */

@media (max-width: 767px) {
  :root {
    --h-gap:    30px;
    --h-gap-sm: 20px;
  }

  .index .s-block          { padding-block: var(--h-gap); }
  .index .s-block--full-bg { padding-block: 34px; }
  .index .s-block--features{ padding-block: 22px; }

  /* ---- عناوين الأقسام: سطر واحد، والأسهم تُخفى لأن السحب باللمس أطبع ---- */

  .index .s-block__title,
  .index .s-slider-block__title {
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    margin-block-end: 14px;
    padding-block-end: 10px;
  }

  .index .s-slider-block__title-right { flex: 1 1 auto; min-width: 0; }
  .index .s-slider-block__title-left  { flex: 0 0 auto; }
  .index .s-slider-block__title-nav   { display: none; }

  .index .s-block__title h2,
  .index .s-slider-block__title h2 {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .index .s-block__display-all { padding: 5px 12px; font-size: 12px; }

  /* ---- تسوّق حسب القسم ----
     سلايدر سلة لا يتهيّأ على الجوال في هذا الثيم، فتتكدّس التصنيفات
     الثمانية عمودياً بارتفاع 1224 بكسل. نحوّل الحالة الاحتياطية إلى
     شبكة دوائر من أربعة أعمدة، فتصبح 255 بكسل.
     المحدّد :not(.swiper) يجعل القاعدة تتوقف تلقائياً لو هُيّئ السلايدر. */

  .index .s-block--categories salla-slider > div:not(.swiper) {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .index .s-block--categories .swiper-slide {
    width: auto !important;
    height: auto !important;
    min-width: 0;
  }

  .index .s-block--categories .slide--cat-entry {
    padding: 8px 3px;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .index .s-block--categories .slide--cat-entry:hover {
    transform: none;
    box-shadow: none;
  }

  .index .s-block--categories .slide--cat-entry img {
    width: 54px;
    height: 54px;
    margin-block-end: 7px;
  }

  .index .s-block--categories .slide--cat-entry h2 {
    font-size: 10.5px;
    line-height: 1.35;
    min-height: 2.7em;
  }

  .index .s-block--categories .s-slider-block__title-left { display: none; }

  /* ---- مزايا المتجر: ثلاثة أعمدة في سطر واحد ----
     الثيم يمنح العنصر الأول عمودين، فيُدفع الثالث لسطر ثانٍ. */

  .index .s-block--features .grid       { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .index .s-block--features .grid > *   { grid-column: span 1; }

  .index .s-block--features__item {
    flex-direction: column;
    text-align: center;
    gap: 4px;
    padding: 11px 4px;
  }

  .index .s-block--features__item .feature-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .index .s-block--features__item .feature-icon i { font-size: 18px; }

  .index .s-block--features__item h2 {
    margin: 0;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--h-ink);
  }

  .index .s-block--features__item p {
    margin: 0;
    font-size: 9.5px;
    line-height: 1.4;
    color: var(--h-muted);
  }

  /* ---- الماركات: ثلاثة أعمدة متساوية بدل موزاييك مكسور ---- */

  .index .s-block--logos-slider .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }

  .index .s-block--logos-slider .brand-item {
    grid-row: auto !important;
    height: 64px !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .index .s-block--logos-slider img { max-height: 32px; }

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

  .s-product-card-entry .s-product-card-content { padding: 12px 12px 14px; gap: 6px; }
  .s-product-card-content-title { font-size: 13px; }
  .s-product-card-entry .s-product-card-content-subtitle { font-size: 10px; letter-spacing: .8px; }
  .s-product-card-price,
  .s-product-card-sale-price h4 { font-size: 15px; }
  .s-product-card-entry:hover { transform: none; }
  .s-product-card-entry .s-product-card-image img { padding: 6%; }
}

/* عام */
.index .s-block img { max-width: 100%; }

/* ===================================================================
   القسم د — الهيدر والفوتر
   كانا أسودين بينما بقية المتجر وردي فاتح. يصيران بعمق اللون الوردي
   نفسه المستخدم في الشريط المتحرك وبنرات الماركات، فيتماسك المتجر.
   ملاحظة تقنية: الثيم يفرض الأسود عبر `body.footer-is-dark` و
   `body.topnav-is-dark`، وهما أعلى تحديداً، لذلك نسبق بـ body.
   أبقِ الوضع الداكن مفعّلاً في إعدادات الثيم، فنصوصه فاتحة أصلاً
   وتناسب هذه الخلفية.
   =================================================================== */

/* ---------- الشريط العلوي ---------- */

body.topnav-is-dark .top-navbar,
body .top-navbar {
  background: linear-gradient(90deg, #7d5266 0%, var(--h-deep) 100%) !important;
  color: #f7eef2 !important;
  border-bottom: 0 !important;
}

body .top-navbar a,
body .top-navbar span,
body .top-navbar p,
body .top-navbar button,
body .top-navbar i { color: #f7eef2 !important; }

body .top-navbar a:hover { color: #fff !important; }

body .top-navbar input {
  background: rgba(255,255,255,.14) !important;
  border: 1px solid rgba(255,255,255,.22) !important;
  border-radius: 999px !important;
  color: #fff !important;
}

body .top-navbar input::placeholder { color: rgba(255,255,255,.7) !important; }

/* ---------- القائمة الرئيسية ---------- */

#mainnav {
  border-bottom: 1px solid var(--h-brand-border) !important;
  box-shadow: 0 2px 10px rgba(156,106,128,.07) !important;
}

#mainnav .navbar-brand img { transition: transform .25s ease; }
#mainnav .navbar-brand:hover img { transform: scale(1.04); }

#mainnav i { transition: transform .25s ease, color .2s ease; }

#mainnav a:hover > i,
#mainnav button:hover i {
  color: var(--h-deep) !important;
  transform: translateY(-2px) scale(1.08);
}

#mainnav .s-count,
#mainnav .badge {
  background: var(--h-deep) !important;
  color: #fff !important;
}

/* روابط القائمة: خط سفلي يتمدد عند المرور */
#mainnav .mainMenu a,
#mainnav nav a { position: relative; }

#mainnav .mainMenu a::after,
#mainnav nav a::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: -3px;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: var(--h-brand);
  transition: width .25s ease;
}

#mainnav .mainMenu a:hover::after,
#mainnav nav a:hover::after { width: 100%; }

/* ---------- الفوتر ---------- */

body.footer-is-dark footer.store-footer,
body footer.store-footer {
  background: linear-gradient(170deg, var(--h-deep) 0%, #7d5266 55%, #6b4457 100%) !important;
  color: #f7eef2 !important;
}

body.footer-is-dark footer.store-footer .store-footer__inner,
body.footer-is-dark footer.store-footer > div { background: transparent !important; }

footer.store-footer .store-footer__inner { border-bottom: 1px solid rgba(255,255,255,.14); }

/* عناوين الأعمدة بنفس شريط العنوان المستخدم في الصفحة الرئيسية */
footer.store-footer h3 {
  position: relative;
  padding-inline-start: 13px;
  margin-bottom: 16px !important;
  font-size: 17px !important;
  color: #fff !important;
}

footer.store-footer h3::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 3px;
  background: var(--h-brand);
}

footer.store-footer a {
  color: rgba(255,255,255,.86) !important;
  transition: color .2s ease, padding-inline-start .2s ease;
}

footer.store-footer a:hover { color: #fff !important; }
footer.store-footer li > a:hover { padding-inline-start: 5px; }

footer.store-footer p,
footer.store-footer span,
footer.store-footer div { color: rgba(255,255,255,.8); }

footer.store-footer .copyright-text p { color: rgba(255,255,255,.62) !important; }

/* أيقونات التواصل دوائر */
footer.store-footer .contact-social a,
footer.store-footer [class*="social"] a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

footer.store-footer .contact-social a:hover,
footer.store-footer [class*="social"] a:hover {
  background: var(--h-brand);
  border-color: var(--h-brand);
  color: #7d5266 !important;
  transform: translateY(-2px);
}

/* شعارات وسائل الدفع تحتاج خلفية فاتحة لتُقرأ */
footer.store-footer salla-payments img {
  background: #fff;
  border-radius: 6px;
  padding: 3px;
}

@media (max-width: 767px) {
  footer.store-footer h3 { font-size: 15px !important; margin-bottom: 12px !important; }
  footer.store-footer .contact-social a,
  footer.store-footer [class*="social"] a { width: 34px; height: 34px; }
  #mainnav { border-bottom-width: 1px !important; }
}