/* ==========================================================================
   wishlist-bridge.css — جسر بين ترميز إضافة YITH WooCommerce Wishlist
   وتصميم زر المفضلة في شريط الشراء (مربّع 58×58 بأيقونة فقط).
   شركة السرعة المطلقة | كل القيم من tokens.css — RTL.

   نفس نمط digits-bridge.css: الإضافة تملك السلوك، والثيم يملك الشكل. لا
   نعدّل قوالب الإضافة (ستُمحى مع أي تحديث) — نعيد تنسيق مخرجاتها فقط.

   ⚠ الترميز الحقيقي في YITH 4.17 ليس قوالب templates/add-to-wishlist*.php
   القديمة (تلك بقيت في الإضافة لكنها ليست ما يُصيَّر فعليًا) بل مُصيِّر
   "block" أحدث تمّ التحقّق منه على الصفحة الحيّة:
     div.yith-add-to-wishlist-button-block
       button.yith-wcwl-add-to-wishlist-button
         div.yith-wcwl-icon-svg__wrapper > svg.yith-wcwl-icon   ← أيقونة SVG لا <i>
         span.yith-wcwl-add-to-wishlist-button__label
   لذلك لا تُبنَ أي قاعدة هنا على <a> أو على .yith-wcwl-add-button.
   ========================================================================== */

/* الألوان تُضبط عبر متغيّرات الإضافة نفسها، لا بمحاولة التغلّب على قواعدها.
   قاعدتها الافتراضية (زر داكن #333 بنص أبيض) هي:
     .yith-wcwl-add-to-wishlist-button:is(button):not(.yith-wcwl-theme-button-style)
   بوزن (0,2,1) — أثقل من أي `.wrapper .button` بسيط، فمحاولة تجاوزها
   بالوزن تتحوّل إلى سباق تخصيص. لكنها تقرأ قيمها من custom properties،
   والمتغيّرات تورَّث، فيكفي إعادة تعريفها هنا: قاعدة الإضافة نفسها تُصيّر
   عندئذٍ ألواننا. هذا هو منفذ التخصيص المقصود من الإضافة، ويبقى صالحًا بعد
   أي تحديث لملفّها لأننا لا نلمس مُحدِّداتها إطلاقًا. */
.product-purchase__icon--wishlist {
  --color-add-to-wishlist-background: transparent;
  --color-add-to-wishlist-border: transparent;
  --color-add-to-wishlist-text: var(--color-text);
  --color-add-to-wishlist-background-hover: transparent;
  --color-add-to-wishlist-border-hover: transparent;
  --color-add-to-wishlist-text-hover: var(--color-primary);
  --add-to-wishlist-icon-color: var(--color-text);
  --added-to-wishlist-icon-color: var(--color-primary);
  --rounded-corners-radius: var(--radius-md);
}
/* تمرير لون التمرير (hover) الخاص بالمربّع إلى أيقونة الإضافة: قاعدتها
   .yith-...--icon-button:hover تعيد فرض --add-to-wishlist-icon-color، فبدل
   مصارعتها نعيد تعريف المتغيّر نفسه عند تمرير المؤشّر على الغلاف. */
.product-purchase__icon--wishlist:hover {
  --add-to-wishlist-icon-color: var(--color-primary);
}

/* الغلاف .product-purchase__icon--wishlist (من inc/wishlist.php) هو المربّع
   نفسه ويرث مظهره من .product-purchase__icon في product-summary.css. طبقات
   الإضافة تتمدّد داخله حتى تكون كامل المساحة قابلة للنقر لا الأيقونة وحدها. */
.product-purchase__icon--wishlist .yith-add-to-wishlist-button-block {
  display: contents;
}
/* المُحدِّد يطابق شكل مُحدِّد الإضافة (‎:is/:not‎) عمدًا ليتفوّق عليه بوزن
   (0,3,1) بلا !important — الهندسة فقط (حشوة/إطار/تمدّد)، أما الألوان
   فبالمتغيّرات أعلاه. */
.product-purchase__icon--wishlist
  .yith-wcwl-add-to-wishlist-button:is(button):not(.yith-wcwl-theme-button-style) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border-width: 0;
  cursor: pointer;
}

/* أيقونة الإضافة SVG بـ stroke="currentColor"، فتأخذ لون المربّع تلقائيًا؛
   يبقى ضبط الحجم ليطابق أيقونة fa الأصلية في التصميم (18px). */
.product-purchase__icon--wishlist .yith-wcwl-icon-svg__wrapper {
  display: inline-flex;
}
.product-purchase__icon--wishlist .yith-wcwl-icon {
  width: var(--fs-md);
  height: var(--fs-md);
}

/* التصميم يطلب أيقونة بلا نص. النص يبقى في DOM لا يُحذف: هو الاسم المتاح
   الوحيد للزر لقارئات الشاشة، وتبدّله الإضافة نفسها بين "إضافة/إزالة" حسب
   الحالة — إخفاؤه بـ display:none كان سيسلب الزر اسمه. نفس أداة الإخفاء
   المتاح في wc-native.css (.screen-reader-text). */
.product-purchase__icon--wishlist .yith-wcwl-add-to-wishlist-button__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* حالة "مضاف بالفعل" لا تحتاج قاعدة هنا: الإضافة تبدّل الأيقونة إلى قلب
   مصمت عبر AJAX وتلوّنها بـ --added-to-wishlist-icon-color، وهو معرَّف
   أعلاه بلون العلامة التجارية. */
