:root {
  --green: #25d366;
  --green-hover: #1ebe5d;
  --accent: #1e88e5;
  --card: #fff;
  --text: #222;
  --muted: #666;
  --border: #eaeaea;
  --shadow: 0 16px 46px rgba(0, 0, 0, 0.18);
}

/* ===== Dark Mode (حسب طلبك) ===== */
.title-share-wrap.sb-dark,
.sb-modal.sb-dark {
  --accent: #0071fd;
  --card: #2a2a2a;
  --text: #ffffff;
  --muted: #ffffff;
  --border: #4a4a4a;
  --shadow: 0 16px 46px rgb(4 4 4 / 55%);
}
.sb-modal.sb-dark .sb-card {
  background: var(--card);
  color: var(--text);
}
.sb-modal.sb-dark .sb-head {
  background: linear-gradient(
      0deg,
      rgba(0, 113, 253, 0.08),
      rgba(0, 113, 253, 0.08)
    ),
    var(--card);
  border-bottom: 1px solid var(--border);
}
.sb-modal.sb-dark .sb-sub {
  color: var(--muted);
}
.sb-modal.sb-dark .sb-close {
  background: #3a3a3a;
  color: #fff;
}
.sb-modal.sb-dark .sb-option {
  background: #242424;
  border-color: var(--border);
}
.sb-modal.sb-dark .sb-option:hover {
  background: #202020;
  border-color: #5a5a5a;
}

/* شريط التحميل في الداكن (حسب طلبك) */
.sb-modal.sb-dark .sb-loading {
  background: #0f1b31;
  border: 1px solid #22365a;
  color: #9fc1ff;
}

/* ❗️خلفية بيضاء لرموز SVG داخل بطاقات الخيارات فقط في الداكن */
.sb-modal.sb-dark .sb-option svg {
  background: #fff;
  border-radius: 4px;
  padding: 1px;
}

/* زر “شير” صغير جنب عنوان المنتج */
.title-share-wrap {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 8px;
  vertical-align: middle;
}
#share-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}
/* SVG للزر الرئيسي بدون خلفية */
#share-trigger svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}

#share-trigger:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.08);
}
@media (max-width: 600px) {
  .title-share-wrap {
    margin-inline-start: 6px;
  }
  #share-trigger {
    width: 24px;
    height: 24px;
  }
  #share-trigger svg {
    width: 16px;
    height: 16px;
  }
}

/* ===== Modal ===== */
.sb-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.sb-modal.active {
  display: block;
}
.sb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.sb-card {
  position: relative;
  max-width: 640px;
  margin: 7vh auto;
  background: var(--card);
  border-radius: 16px;
  padding: 0;
  box-shadow: var(--shadow);
  direction: rtl;
  color: var(--text);
  overflow: hidden;
}

.sb-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px 10px 14px;
  padding-inline-end: 50px;
  background: linear-gradient(
      0deg,
      rgba(30, 136, 229, 0.06),
      rgba(30, 136, 229, 0.06)
    ),
    #fff;
  border-bottom: 1px solid var(--border);
}
.sb-ico,
.sb-ico * {
  fill: currentColor !important;
}
.sb-head .sb-ico {
  width: 18px;
  height: 18px;
  color: var(--accent);
  margin-top: 2px;
}
.sb-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  font-family: unset;
}
.sb-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.5;
}

.sb-body {
  padding: 12px 14px 14px;
}

.sb-close {
  position: absolute;
  inset-inline-end: 8px;
  top: 8px;
  z-index: 1;
  border: 0;
  background: #f3f4f6;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 28px;
}
.sb-close:hover {
  background: #e7e9ee;
}

.sb-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fbff;
  border: 1px solid #e7f0ff;
  border-radius: 10px;
  color: #245aa6;
  font-size: 12.5px;
  margin: 6px 0 12px;
}
.sb-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #d0e3ff;
  border-top-color: var(--accent);
  animation: sbSpin 0.8s linear infinite;
}
@keyframes sbSpin {
  to {
    transform: rotate(360deg);
  }
}

.sb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 700px) {
  .sb-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.sb-option {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.1s ease;
}
.sb-option:hover {
  background: #f6f9ff;
  border-color: #dfeaff;
  transform: translateY(-1px);
}
.sb-option .sb-ico {
  width: 18px;
  height: 18px;
  color: #111;
}
.sb-option .title {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.25;
}
.sb-option .note {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.25;
}
.sb-option[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

.sb-badge {
  display: inline-block;
  min-width: 16px;
  padding: 0 6px;
  line-height: 16px;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  vertical-align: middle;
}

.sb-alert {
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 10px;
  background: #f7f7f7;
  color: #444;
}
