/* صفحة المنتج: إخفاء عداد الكمية (العداد يبقى في السلة) */
[data-quantity-wrapper],
[data-qty-input="sticky-qty"] {
  display: none !important;
}

/* صفحة المنتج والسلة: إخفاء القائمة والروابط والبحث والمسار */
:is(body[data-template="product_details"], body[data-template="cart_page"]) header button[aria-label="Toggle menu"],
:is(body[data-template="product_details"], body[data-template="cart_page"]) header a[class*="hover:underline"],
:is(body[data-template="product_details"], body[data-template="cart_page"]) [data-search-trigger],
:is(body[data-template="product_details"], body[data-template="cart_page"]) main > section:has(nav[aria-label="breadcrumb"]),
body[data-template="product_details"] .mt-12:has([data-products-carousel="related-products"]),
body[data-template="cart_page"] main a[href="https://tadabbar.store/"],
#progressive_discount {
  display: none !important;
}

/* شريط الإعلانات وأيقونات الدفع: تظهر بس ما تنضغط (الشعار صار ينضغط ويودي للرئيسية) */
:is(body[data-template="product_details"], body[data-template="cart_page"]) footer a[href="/shipping-and-payment"] {
  pointer-events: none !important;
}

/* الشريط المتحرك في كل الصفحات: نص عادي، مو رابط */
a[href="/products"] {
  pointer-events: none !important;
  text-decoration: none !important;
  cursor: default !important;
}

/* الرئيسية: إخفاء عرض الكل وتسوق الآن والقائمة والبحث (أثناء اختبار السعر) */
body[data-template="home"] main a[href="/products"],
body[data-template="home"] header button[aria-label="Toggle menu"],
body[data-template="home"] [data-search-trigger] {
  display: none !important;
}

/* صفحة المنتج: الترتيب = الحبة/الحبتين ثم الهدية ثم أضف للسلة ثم Apple Pay */
body[data-template="product_details"] .space-y-4:has(> .product-options) {
  display: flex !important;
  flex-direction: column;
}
body[data-template="product_details"] .space-y-4 > .product-options {
  order: -1;
}
body[data-template="product_details"] [data-product-actions] ~ * {
  order: 2;
}
body[data-template="product_details"] #apple_pay_quick_checkout_widget {
  order: 1 !important;
}

/* الشريط السفلي: Apple Pay جنب "أضف للسلة"، يطلع وينزل مع الشريط */
body[data-template="product_details"] #sticky-cta .size-16 {
  display: none;
}
@keyframes tdb-pay-up {
  from { transform: translateY(81px); }
  to   { transform: translateY(0); }
}
body[data-template="product_details"]:has(#sticky-cta:not(.hidden)) #apple_pay_quick_checkout_widget {
  position: fixed !important;
  left: 16px;
  bottom: 16px;
  width: 109px;
  height: 48px;
  overflow: hidden;
  direction: ltr;
  border-radius: 4px;
  z-index: 45;
  margin: 0 !important;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: tdb-pay-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body[data-template="product_details"]:has(#sticky-cta.translate-y-full:not(.hidden)) #apple_pay_quick_checkout_widget {
  transform: translateY(81px);
}
body[data-template="product_details"]:has(#sticky-cta:not(.hidden)) #apple_pay_quick_checkout_widget :is(.kit-container, .kit-container > *, apple-pay-button, button, iframe) {
  display: block !important;
  width: 109px !important;
  max-width: 109px !important;
  height: 48px !important;
  min-height: 0 !important;
  margin: 0 !important;
  --apple-pay-button-width: 109px;
  --apple-pay-button-height: 48px;
  --apple-pay-button-border-radius: 4px;
}
body[data-template="product_details"]:has(#sticky-cta:not(.hidden)) #sticky-cta [data-sticky-cta-in-stock] {
  padding-inline-end: 137px;
}
body[data-template="product_details"]:has(#sticky-cta:not(.hidden)) #sticky-cta :is([data-sticky-cta-name], [data-sticky-cta-options]) {
  display: none;
}

/* صفحة المنتج: التقييمات تحت تمارا (السكربت ينقلها)، بشكل مختصر */
#product-form > #reviews > div {
  margin-top: 8px !important;
  gap: 12px !important;
}
#product-form > #reviews h2 {
  font-size: 18px !important;
}
#product-form > #reviews > div > div:nth-child(2) > div:nth-child(2),
#product-form > #reviews > div > div:nth-child(2) :is(button, a.btn),
#product-form > #reviews > div > div:nth-child(2) p,
#product-form > #reviews > div > div:nth-child(3) {
  display: none !important;
}
/* صفحة المنتج: إخفاء سهم الصور المعطّل (يظهر باهت يمين الصورة الأولى) */
body[data-template="product_details"] :is(.product-gallery__prev, .product-gallery__next):disabled {
  display: none !important;
}
/* صفحة المنتج: سطر المبيعات كشارة فوق السعر */
body[data-template="product_details"] .tdb-sold {
  display: inline-block;
  background: rgba(224, 164, 58, 0.12);
  border: 1px solid #d4a843;
  border-radius: 999px;
  padding: 4px 14px;
  margin: 0 !important;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.5;
  width: fit-content;
}