/* ==========================================================================
   شارك واكسب — مركز المشاركة، نافذة الشبكات، بطاقة الستوري ولوحة الأبطال
   ========================================================================== */

/* ---------- أزرار ونقاط فصفحات المنتج والتعاونية ---------- */
.pdp-share-btn.primary {
  background: var(--grad-warm);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 26px -14px rgba(var(--terracotta-rgb), .7);
}
.pdp-share-btn.primary:hover { color: #fff; transform: translateY(-2px); }
.share-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  font-size: .74rem;
  color: var(--muted);
}
.share-hint svg { color: var(--terracotta); flex: none; }
.coop-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .42);
  background: rgba(20, 14, 9, .28);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  transition: .18s;
}
.coop-share-btn:hover { background: rgba(255, 255, 255, .18); border-color: #fff; }

/* ---------- نافذة المشاركة الموحّدة ---------- */
.share-sheet-modal { width: min(560px, 100%); }
.share-sheet h2 { margin: 6px 0 4px; font-size: 1.45rem; }
.share-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 10px;
  border-radius: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.share-preview img,
.share-preview-mark {
  width: 62px;
  height: 62px;
  border-radius: 13px;
  object-fit: cover;
  flex: none;
}
.share-preview-mark {
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--olive), #2f3b22);
  color: #f1e8d2;
}
.share-preview-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.share-preview-copy strong { font-size: .9rem; }
.share-preview-copy small { color: var(--muted); font-size: .74rem; }
.share-net-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 14px;
}
.share-net {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 4px 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: .72rem;
  font-weight: 700;
  transition: .16s;
}
.share-net:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: var(--shadow-sm); }
.sn-ic {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  color: var(--ink);
}
.share-net small { color: var(--success); font-size: .62rem; }
.share-net.wa .sn-ic { background: rgba(37, 211, 102, .16); color: #128c4a; }
.share-net.fb .sn-ic { background: rgba(24, 119, 242, .14); color: #1877f2; }
.share-net.tg .sn-ic { background: rgba(42, 171, 238, .16); color: #1d8fc7; }
.share-net.x .sn-ic { background: rgba(42, 33, 24, .1); color: var(--ink); }
.share-net.mail .sn-ic { background: rgba(216, 154, 43, .18); color: var(--terracotta); }
.share-link-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.share-link-row .input {
  flex: 1;
  min-width: 170px;
  direction: ltr;
  text-align: left;
  font-size: .78rem;
  letter-spacing: .01em;
}
.share-sheet-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.share-soft-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--ink-2);
  font-size: .74rem;
  font-weight: 700;
  transition: .16s;
}
.share-soft-btn:hover { border-color: var(--terracotta); color: var(--terracotta); background: var(--bg-2); }

/* ---------- بطاقة الستوري ---------- */
.story-modal-wrap .modal { width: min(560px, 100%); }
.story-modal h2 { margin: 6px 0 4px; font-size: 1.4rem; }
.story-preview-host {
  display: grid;
  place-items: center;
  min-height: 240px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 20px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.story-preview-canvas {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  display: block;
}
.story-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .82rem;
  padding: 30px 0;
}
.story-modal .modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- مركز المشاركة ---------- */
.share-page {
  padding-top: 16px;
  padding-bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.share-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(80% 90% at 94% 0%, rgba(216, 154, 43, .34), transparent 56%),
    radial-gradient(70% 80% at 0% 100%, rgba(184, 81, 46, .34), transparent 60%),
    linear-gradient(158deg, #1c130d 0%, #2a1a10 52%, #3a2214 100%);
  color: #f7efe1;
  padding: clamp(24px, 4vw, 50px);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 26px;
  align-items: center;
  box-shadow: var(--shadow-md);
  isolation: isolate;
}
.share-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .38;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cg fill='none' stroke='%23d89a2b' stroke-opacity='.2' stroke-width='1.4'%3E%3Cpath d='M75 18l14 30 33 4-24 23 6 33-29-16-29 16 6-33-24-23 33-4z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 150px 150px;
  mask-image: radial-gradient(80% 80% at 80% 20%, #000, transparent 72%);
  -webkit-mask-image: radial-gradient(80% 80% at 80% 20%, #000, transparent 72%);
}
.share-hero-copy .eyebrow {
  color: var(--saffron);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.share-hero h1 {
  color: #fff;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.1;
  margin: 12px 0 14px;
}
.share-hl {
  color: var(--saffron);
  position: relative;
}
.share-hl::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 2px;
  height: 8px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(216, 154, 43, .55), rgba(184, 81, 46, .35));
  z-index: -1;
}
.share-hero p {
  color: rgba(247, 239, 225, .78);
  font-size: .95rem;
  max-width: 58ch;
}
.share-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.share-hero .btn-ghost { color: #f7efe1; border-color: rgba(255, 255, 255, .32); }
.share-hero .btn-ghost:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.share-hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.shs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 106px;
  padding: 11px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .13);
  backdrop-filter: blur(6px);
}
.shs strong { font-size: 1.5rem; color: #fff; line-height: 1.15; }
.shs span { font-size: .68rem; color: rgba(247, 239, 225, .66); }
.share-hero-art { position: relative; min-height: 290px; }
.sha-orb {
  position: absolute;
  top: 4%;
  right: 4%;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(216, 154, 43, .6), rgba(184, 81, 46, .3) 58%, transparent 76%);
  filter: blur(2px);
}
.sha-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-4deg);
  width: 196px;
  padding: 22px 18px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  background: linear-gradient(150deg, rgba(255, 255, 255, .19), rgba(255, 255, 255, .06));
  border: 1px solid rgba(255, 255, 255, .26);
  backdrop-filter: blur(12px);
  box-shadow: 0 26px 60px -30px #000;
}
.sha-ic { color: var(--saffron); display: flex; margin-bottom: 4px; }
.sha-card strong { font-size: 2.35rem; color: #fff; line-height: 1; }
.sha-card span:last-child { font-size: .7rem; color: rgba(247, 239, 225, .74); }
.sha-chip {
  position: absolute;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #f7efe1;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}
.sha-chip-a { top: 12px; inset-inline-end: 0; }
.sha-chip-b { bottom: 16px; inset-inline-start: 0; }
.sha-chip-c { bottom: -8px; inset-inline-end: 18px; }

.share-link-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 22px;
  padding: clamp(20px, 3vw, 30px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.slc-copy h2 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin: 6px 0 8px; }
.slc-copy p { color: var(--muted); font-size: .84rem; }
.slc-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-2);
  font-size: .76rem;
  color: var(--ink-2);
}
.slc-code strong { color: var(--terracotta); letter-spacing: .08em; }
.slc-actions { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.slc-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--muted);
  font-size: .72rem;
}
.slc-hint svg { flex: none; margin-top: 3px; }

.share-progress-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.share-progress {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .8rem; font-weight: 700; }
.sp-head span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.sp-head svg { color: var(--terracotta); }
.sp-head strong { color: var(--terracotta); font-size: .82rem; }
.sp-bar {
  height: 8px;
  margin: 10px 0 8px;
  border-radius: 99px;
  background: var(--bg-2);
  overflow: hidden;
}
.sp-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--grad-warm);
  transition: width .5s cubic-bezier(.2, .7, .3, 1);
}
.share-progress small { color: var(--muted); font-size: .7rem; }

.share-panel {
  padding: clamp(18px, 3vw, 26px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.share-panel .section-head { margin-bottom: 16px; }
.share-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.share-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  text-align: start;
  transition: .16s;
}
.share-channel:hover { transform: translateY(-2px); border-color: var(--terracotta); box-shadow: var(--shadow-sm); }
.sc-ic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  flex: none;
}
.sc-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sc-text strong { font-size: .8rem; white-space: nowrap; }
.sc-text small { font-size: .64rem; color: var(--success); font-weight: 700; }
.share-channel.wa .sc-ic { background: rgba(37, 211, 102, .15); color: #128c4a; }
.share-channel.fb .sc-ic { background: rgba(24, 119, 242, .13); color: #1877f2; }
.share-channel.tg .sc-ic { background: rgba(42, 171, 238, .15); color: #1d8fc7; }
.share-channel.x .sc-ic { background: rgba(42, 33, 24, .1); color: var(--ink); }
.share-channel.mail .sc-ic { background: rgba(216, 154, 43, .18); color: var(--terracotta); }

.share-two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.rule-list { display: flex; flex-direction: column; gap: 10px; }
.rule-row { display: flex; align-items: flex-start; gap: 11px; }
.rule-row > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.rule-row strong { font-size: .84rem; }
.rule-row small { color: var(--muted); font-size: .74rem; line-height: 1.65; }
.rr-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--bg-2);
  color: var(--ink-2);
}
.rr-badge.terra { background: rgba(184, 81, 46, .13); color: var(--terracotta); }
.rr-badge.olive { background: var(--olive-soft, rgba(79, 91, 54, .14)); color: var(--olive); }
.rr-badge.saffron { background: rgba(216, 154, 43, .18); color: #a97615; }
.rr-badge.ink { background: rgba(42, 33, 24, .1); color: var(--ink); }
.share-value-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: .73rem;
}
.share-value-note svg { color: var(--terracotta); flex: none; }
.share-story-lead { color: var(--muted); font-size: .8rem; margin-bottom: 12px; }
.story-inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.story-inline-host { margin-top: 12px; }
.story-inline-host:empty { display: none; }
.story-inline-canvas {
  width: 100%;
  max-width: 270px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}

.share-board { display: flex; flex-direction: column; gap: 8px; }
.board-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bg-2);
  font-size: .82rem;
}
.board-row.me { background: rgba(216, 154, 43, .16); border: 1px solid rgba(216, 154, 43, .38); }
.board-rank {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface);
  font-size: .78rem;
  font-weight: 800;
  color: var(--muted);
  flex: none;
}
.board-rank.top-1 { background: linear-gradient(140deg, #f4cf74, #d89a2b); color: #3a2606; }
.board-rank.top-2 { background: linear-gradient(140deg, #e7e2d6, #bcb6a6); color: #3a352b; }
.board-rank.top-3 { background: linear-gradient(140deg, #e2b28c, #b9784a); color: #3a2412; }
.board-name { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-visits { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.board-pts { color: var(--terracotta); font-size: .8rem; white-space: nowrap; }

.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
}
.rr-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  color: var(--ink-2);
  flex: none;
}
.rr-copy { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.rr-copy strong { font-size: .8rem; }
.rr-copy small { color: var(--muted); font-size: .68rem; }
.rr-pts { font-weight: 800; font-size: .82rem; color: var(--muted); }
.rr-pts.plus { color: var(--success); }

/* ---------- بطاقة الولاء فالحساب + لافتة الدعوة ---------- */
.loyalty-share-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(216, 154, 43, .16), rgba(184, 81, 46, .1));
  border: 1px solid rgba(216, 154, 43, .32);
}
.lsc-ic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--terracotta);
  flex: none;
}
.lsc-copy { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 170px; }
.lsc-copy strong { font-size: .84rem; }
.lsc-copy small { color: var(--muted); font-size: .72rem; }
.invite-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(216, 154, 43, .18), rgba(184, 81, 46, .1));
  border: 1px dashed rgba(184, 81, 46, .45);
}
.ib-ic { color: var(--terracotta); display: flex; flex: none; }
.invite-banner div { display: flex; flex-direction: column; gap: 2px; }
.invite-banner strong { font-size: .82rem; }
.invite-banner small { color: var(--muted); font-size: .72rem; }
.share-nav-btn { color: var(--terracotta); }

@media (max-width: 960px) {
  .share-hero { grid-template-columns: 1fr; }
  .share-hero-art { min-height: 230px; max-width: 420px; margin: 0 auto; width: 100%; }
  .share-link-card { grid-template-columns: 1fr; }
  .share-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .share-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .share-progress-grid { grid-template-columns: 1fr; }
  .share-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-hero { padding: 22px 18px; }
  .share-hero-stats { gap: 8px; }
  .shs { flex: 1; min-width: 92px; padding: 10px 12px; }
  .share-link-row .input { min-width: 100%; }
  .board-visits { display: none; }
}
@media (max-width: 430px) {
  .share-net-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
