/* ========================================
   SHUNET — Design Tokens & Shop Detail Page
   Drop into your PHP template's <head>:
   <link rel="stylesheet" href="/assets/css/shunet-detail.css">
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Brand colors */
  --bg: #f5f1ea;
  --paper: #fbf8f3;
  --ink: #1c1a16;
  --ink-2: #4a463e;
  --ink-3: #8a8479;
  --line: #e5dfd3;
  --line-2: #efeae0;
  --sage: #8aa97a;
  --sage-deep: #5a7a4d;
  --sage-soft: #e8efe1;
  --clay: #c97a4a;
  --clay-soft: #f5e3d6;
  --gold: #c9a04a;
  --plum: #7a4a6a;
  --berry: #b85a6a;

  /* Brand colors for messaging */
  --ig-grad: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  --tg-grad: linear-gradient(135deg, #2aabee, #229ed9);
  --wa: #25d366;
  --bale: #1e88e5;
  --rubika-grad: linear-gradient(135deg, #ff7a4d, #e84a3a);
}

/* ===== Reset & base ===== */
* { box-sizing: border-box; }
body.shunet-detail {
  margin: 0;
  background: var(--bg);
  font-family: 'Vazirmatn', system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  direction: rtl;
}

.shunet-detail .mono { font-family: 'JetBrains Mono', monospace; }
.shunet-detail button { font-family: inherit; cursor: pointer; }
.shunet-detail svg { display: block; }

/* ===== Page container ===== */
.shunet-detail .page {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  padding-bottom: 100px; /* room for sticky CTA */
}

/* ===== Top nav (header) ===== */
.shunet-detail .topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.shunet-detail .topnav .brand {
  font-weight: 800; font-size: 20px; letter-spacing: -0.01em;
}
.shunet-detail .topnav .back-pill {
  background: var(--paper); border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.shunet-detail .topnav .lang {
  display: flex; background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px;
  font-size: 11px;
}
.shunet-detail .topnav .lang a {
  padding: 4px 9px; border-radius: 999px; color: var(--ink-3);
  text-decoration: none;
}
.shunet-detail .topnav .lang a.on { background: var(--sage-soft); color: var(--sage-deep); font-weight: 700; }

/* ===== Cover hero ===== */
.shunet-detail .cover {
  height: 280px; position: relative; overflow: hidden;
}
.shunet-detail .cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.shunet-detail .cover .cover-fallback {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #c97a4a 0%, #8a3a2a 50%, #5a2a1a 100%);
}
.shunet-detail .cover .grain {
  position: absolute; inset: 0; opacity: 0.4;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 4px);
}
.shunet-detail .cover .ribbon {
  position: absolute; top: 16px; inset-inline-end: -2px;
  background: var(--sage-deep); color: white;
  padding: 5px 12px 5px 14px;
  border-radius: 6px 0 0 6px;
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 5px;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(90,122,77,0.4);
}

/* ===== Shop header card (overlaps cover) ===== */
.shunet-detail .shop-header {
  position: relative; z-index: 10;
  margin: -56px 16px 0;
  background: var(--paper);
  border-radius: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 16px 32px -16px rgba(60,40,20,0.18);
}
.shunet-detail .shop-header .top-row {
  display: flex; gap: 14px; align-items: flex-start;
}
.shunet-detail .shop-av {
  width: 64px; height: 64px; border-radius: 16px;
  border: 4px solid var(--paper);
  margin-top: -36px;
  box-shadow: 0 6px 16px rgba(60,40,20,0.18);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 800; color: white;
  flex-shrink: 0;
  /* color set inline per shop, e.g. style="background: linear-gradient(...)" */
}
.shunet-detail .shop-av img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 12px;
}
.shunet-detail .shop-meta { flex: 1; min-width: 0; padding-top: 2px; }
.shunet-detail .shop-name {
  font-size: 18px; font-weight: 800; letter-spacing: -0.01em;
  margin: 0 0 3px; line-height: 1.2;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.shunet-detail .vcheck {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--sage-deep); color: white;
  flex-shrink: 0;
}
.shunet-detail .vcheck svg { width: 9px; height: 9px; }
.shunet-detail .shop-handle {
  font-size: 12px; color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  direction: ltr; text-align: right; unicode-bidi: embed;
}
.shunet-detail .shop-pills {
  display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap;
}
.shunet-detail .pill {
  font-size: 10px; padding: 3px 8px; border-radius: 999px;
  font-weight: 600;
}
.shunet-detail .pill--clay { background: var(--clay-soft); color: var(--clay); }
.shunet-detail .pill--gold { background: #f5ecd6; color: #8a6a2a; }
.shunet-detail .pill--plum { background: #f0e2ec; color: var(--plum); }
.shunet-detail .pill--sage { background: var(--sage-soft); color: var(--sage-deep); }
.shunet-detail .pill--neutral { background: var(--bg); color: var(--ink-2); }

/* Stats strip */
.shunet-detail .stats {
  display: flex; padding-top: 14px; margin-top: 14px;
  border-top: 1px solid var(--line-2);
}
.shunet-detail .stat {
  flex: 1; text-align: center; position: relative;
}
.shunet-detail .stat + .stat::before {
  content: ''; position: absolute; right: 0; top: 4px; bottom: 4px;
  width: 1px; background: var(--line-2);
}
.shunet-detail .stat .v {
  font-size: 17px; font-weight: 800; letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: 3px;
}
.shunet-detail .stat .v.muted { color: var(--ink-3); font-weight: 700; }
.shunet-detail .stat .v.like-color { color: var(--sage-deep); }
.shunet-detail .stat .v svg.star { width: 13px; height: 13px; color: var(--gold); }
.shunet-detail .stat .l {
  font-size: 10px; color: var(--ink-3); margin-top: 2px;
}

/* ===== Sections ===== */
.shunet-detail .section { padding: 18px 16px 0; }
.shunet-detail .section-title {
  font-size: 11px; font-weight: 700; margin: 0 0 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); font-family: 'JetBrains Mono', monospace;
}

/* About */
.shunet-detail .about-text {
  font-size: 14px; line-height: 1.7; color: var(--ink-2);
}
.shunet-detail .about-text .more {
  color: var(--sage-deep); font-weight: 600; cursor: pointer;
  background: none; border: 0; padding: 0; font-family: inherit;
}

/* Info grid */
.shunet-detail .info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.shunet-detail .info-cell {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
}
.shunet-detail .info-cell .ic {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg); display: grid; place-items: center;
  color: var(--ink-2); flex-shrink: 0;
}
.shunet-detail .info-cell .ic svg { width: 16px; height: 16px; }
.shunet-detail .info-cell .k {
  font-size: 9px; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: 0.06em; font-family: 'JetBrains Mono', monospace;
}
.shunet-detail .info-cell .v {
  font-size: 13px; font-weight: 700; color: var(--ink);
  margin-top: 1px; line-height: 1.3;
}

/* Channels */
.shunet-detail .channels-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.shunet-detail .channels-head h3 { margin: 0; }
.shunet-detail .channels-head .count {
  font-size: 10px; color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
}
.shunet-detail .channels {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
}
.shunet-detail .channel {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; transition: all 0.15s;
  text-decoration: none; color: inherit;
}
.shunet-detail .channel:hover { transform: translateY(-1px); border-color: var(--ink); }
.shunet-detail .channel:active { transform: scale(0.97); }
.shunet-detail .channel .br {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  overflow: hidden;
}
.shunet-detail .channel .br svg { width: 36px; height: 36px; border-radius: 10px; }
.shunet-detail .channel .lbl { font-size: 12px; font-weight: 600; }
.shunet-detail .channel .sub { font-size: 9px; color: var(--ink-3); font-family: 'JetBrains Mono', monospace; direction: ltr; unicode-bidi: embed; }

/* Vote bar */
.shunet-detail .votes {
  margin: 16px 16px 0;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.shunet-detail .votes .q {
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.shunet-detail .votes .q .s { font-size: 10px; color: var(--ink-3); font-weight: 500; }
.shunet-detail .vote-btns { display: flex; gap: 6px; }
.shunet-detail .vote-btns button {
  border: 1px solid var(--line); background: var(--bg);
  padding: 6px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 700;
  color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all 0.15s;
}
.shunet-detail .vote-btns button.is-up { color: var(--sage-deep); border-color: var(--sage-soft); background: var(--sage-soft); }
.shunet-detail .vote-btns button.is-down { color: var(--berry); border-color: #f4d6da; background: #fbeaec; }
.shunet-detail .vote-btns svg { width: 12px; height: 12px; }

/* Reviews empty */
.shunet-detail .reviews-empty {
  margin: 16px 16px 0;
  padding: 14px;
  background: var(--paper); border: 1px dashed var(--line);
  border-radius: 14px;
  display: flex; align-items: center; gap: 12px;
}
.shunet-detail .reviews-empty .ic {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--bg); display: grid; place-items: center;
  color: var(--ink-3); flex-shrink: 0;
}
.shunet-detail .reviews-empty .tx { flex: 1; }
.shunet-detail .reviews-empty .tx h4 { font-size: 14px; font-weight: 700; margin: 0 0 2px; }
.shunet-detail .reviews-empty .tx p { font-size: 12px; color: var(--ink-3); margin: 0; line-height: 1.5; }
.shunet-detail .reviews-empty .btn {
  background: var(--ink); color: var(--paper);
  border: 0; padding: 7px 12px; border-radius: 9px;
  font-weight: 600; font-size: 12px;
}

/* ===== Sticky CTA ===== */
.shunet-detail .sticky-cta {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: rgba(251,248,243,0.96);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(env(safe-area-inset-bottom, 16px) + 16px);
  display: flex; gap: 8px;
  z-index: 80;
}
.shunet-detail .sticky-cta .secondary {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: all 0.15s;
}
.shunet-detail .sticky-cta .secondary svg { width: 18px; height: 18px; }
.shunet-detail .sticky-cta .secondary.is-active { color: var(--berry); background: #fbeaec; border-color: #f4d6da; }
.shunet-detail .sticky-cta .primary {
  flex: 1;
  background: linear-gradient(135deg, #f09433 0%, #dc2743 50%, #bc1888 100%);
  color: white; border: 0;
  padding: 12px;
  border-radius: 12px;
  font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
  box-shadow: 0 8px 20px -8px rgba(220,39,67,0.45);
  transition: all 0.15s;
}
.shunet-detail .sticky-cta .primary:active { transform: scale(0.97); }
.shunet-detail .sticky-cta .primary svg { width: 16px; height: 16px; }

/* ===== Toast ===== */
.shunet-detail .toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 12px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 12px 24px rgba(0,0,0,0.3);
  z-index: 200;
  animation: shunet-toast-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes shunet-toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== Responsive ===== */
@media (min-width: 520px) {
  .shunet-detail .page { box-shadow: 0 0 60px rgba(0,0,0,0.05); }
}