/* Add custom CSS styles below */ 
/* Add custom CSS styles below */ 
.pay-mahally_customer_wallet {
    display: none !important;
}

.majaly-trust-badges {
  /* === لون هوية مجالي — غيّر هنا فقط === */
  --mtb-accent: #c9a961;          /* ذهبي فاخر (اقتراح) */
  --mtb-accent-soft: rgba(201, 169, 97, 0.12);

  /* لايت مود */
  --mtb-bg: #ffffff;
  --mtb-border: #ececec;
  --mtb-title: #1a1a1a;
  --mtb-desc: #6b7280;
  --mtb-shadow: 0 10px 25px rgba(201, 169, 97, 0.15);

  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 28px 0;
  direction: rtl;
}

/* دارك مود — تلقائي من المتصفح */
@media (prefers-color-scheme: dark) {
  .majaly-trust-badges {
    --mtb-bg: #1f2937;
    --mtb-border: #374151;
    --mtb-title: #f9fafb;
    --mtb-desc: #9ca3af;
    --mtb-shadow: 0 10px 25px rgba(0,0,0,0.4);
  }
}

/* دارك مود — لو القالب يطبقه عبر class */
.dark .majaly-trust-badges,
[data-theme="dark"] .majaly-trust-badges,
.theme-dark .majaly-trust-badges,
body.dark-mode .majaly-trust-badges {
  --mtb-bg: #1f2937;
  --mtb-border: #374151;
  --mtb-title: #f9fafb;
  --mtb-desc: #9ca3af;
  --mtb-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.mtb-item {
  background: var(--mtb-bg);
  border: 1px solid var(--mtb-border);
  border-radius: 14px;
  padding: 22px 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.mtb-item::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--mtb-accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.mtb-item:hover {
  transform: translateY(-4px);
  border-color: var(--mtb-accent);
  box-shadow: var(--mtb-shadow);
}

.mtb-item:hover::before { opacity: 1; }

.mtb-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  color: var(--mtb-accent);
  background: var(--mtb-accent-soft);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
}

.mtb-icon svg { width: 100%; height: 100%; }

.mtb-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--mtb-title);
}

.mtb-desc {
  font-size: 12px;
  color: var(--mtb-desc);
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .majaly-trust-badges {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 20px 0;
  }
  .mtb-item { padding: 18px 10px; }
  .mtb-icon { width: 40px; height: 40px; }
  .mtb-title { font-size: 13px; }
  .mtb-desc { font-size: 11px; }
}
(function () {
  const FIX_CSS = `
    .s-fast-checkout-button,
    button.s-fast-checkout-button {
      background-color: #3a6494 !important;
      border: 1px solid #3a6494 !important;
      color: #ffffff !important;
      transition: background-color .2s ease, border-color .2s ease;
    }
    .s-fast-checkout-button:hover,
    button.s-fast-checkout-button:hover {
      background-color: #2d5380 !important;
      border-color: #2d5380 !important;
    }
    .s-fast-checkout-button,
    .s-fast-checkout-button * {
      color: #ffffff !important;
    }
    .s-fast-checkout-button svg,
    .s-fast-checkout-button svg path,
    .s-fast-checkout-button svg g path {
      fill: #ffffff !important;
      color: #ffffff !important;
    }
    ::slotted(*) {
      color: #ffffff !important;
    }
  `;

  function injectInto(root) {
    if (!root) return;
    if (root.querySelector && root.querySelector('style[data-majaly-fc-fix]')) return;
    if (root.querySelector && !root.querySelector('.s-fast-checkout-button')) return;
    const style = document.createElement('style');
    style.setAttribute('data-majaly-fc-fix', '1');
    style.textContent = FIX_CSS;
    root.appendChild(style);
  }

  function walk() {
    // 1) الـ document نفسه (لو الزر خارج Shadow DOM)
    if (document.querySelector('.s-fast-checkout-button')) {
      if (!document.head.querySelector('style[data-majaly-fc-fix]')) {
        const s = document.createElement('style');
        s.setAttribute('data-majaly-fc-fix', '1');
        s.textContent = FIX_CSS;
        document.head.appendChild(s);
      }
    }

    // 2) كل العناصر اللي عندها shadowRoot — نحقن داخل كل واحد
    document.querySelectorAll('*').forEach(el => {
      if (el.shadowRoot) {
        injectInto(el.shadowRoot);
        // بعض المكونات تكون متداخلة (nested) — افحص داخل الـ shadow أيضاً
        el.shadowRoot.querySelectorAll('*').forEach(inner => {
          if (inner.shadowRoot) injectInto(inner.shadowRoot);
        });
      }
    });
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', walk);
  } else {
    walk();
  }

  // راقب الـ DOM للمكونات اللي تتحمّل لاحقاً
  new MutationObserver(walk).observe(document.body, { childList: true, subtree: true });
})();

/* المحتوى داخل الـ slot (في Light DOM) */
salla-mini-checkout-widget [slot="widget-label"],
salla-mini-checkout-widget [slot="widget-label"] *,
salla-mini-checkout-widget .s-add-product-button-mini-checkout-content,
salla-mini-checkout-widget .s-add-product-button-mini-checkout-content * {
  color: #ffffff !important;
  fill: #ffffff !important;
}

salla-mini-checkout-widget [slot="widget-label"] svg,
salla-mini-checkout-widget [slot="widget-label"] svg path {
  fill: #ffffff !important;
}