/* =========================================================
   Shop / Courses / Cart - Shared Styles
   کافه رشد - تم طلایی/تیره
   ========================================================= */

:root {
  --bg: #050505;
  --surface: rgba(20, 20, 24, 0.6);
  --surface-2: #0E0E12;
  --border: rgba(212, 175, 55, 0.18);
  --border-strong: rgba(212, 175, 55, 0.45);
  --gold: #D4AF37;
  --gold-light: #F3E5AB;
  --gold-deep: #A8842A;
  --text: #F5F5F4;
  --text-muted: #A1A1AA;
  --success: #22C55E;
  --danger: #EF4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-gold: 0 0 40px rgba(212, 175, 55, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  font-family: 'Vazirmatn', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(circle at 12% 8%, rgba(212,175,55,.09), transparent 45%),
    radial-gradient(circle at 88% 92%, rgba(212,175,55,.06), transparent 45%),
    linear-gradient(180deg, #050505 0%, #0A0A0E 100%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(212,175,55,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,175,55,.03) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 78%);
  mask-image: radial-gradient(circle at center, black 30%, transparent 78%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* =========================================================
   TOPBAR
   ========================================================= */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 5, 5, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; gap: 16px; flex-wrap: wrap;
}
.logo {
  display: flex; align-items: center; gap: 12px;
  font-family: 'Cinzel', serif; font-weight: 700;
}
.logo-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(145deg, #0E0E12, #050505);
  border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-light); font-size: 14px; letter-spacing: 1px;
  box-shadow: var(--shadow-gold);
}
.logo-text {
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-size: 16px;
}

.nav-links {
  display: flex; align-items: center; gap: 4px;
  flex-wrap: wrap; justify-content: center;
}
.nav-link {
  padding: 8px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  transition: all .2s; white-space: nowrap;
}
.nav-link:hover { color: var(--gold-light); background: rgba(212,175,55,.08); }
.nav-link.active {
  color: var(--gold-light);
  background: rgba(212,175,55,.12);
  border: 1px solid var(--border);
}

.cart-pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, rgba(212,175,55,.18), rgba(212,175,55,.05));
  border: 1px solid var(--border-strong);
  color: var(--gold-light);
  transition: all .25s ease;
}
.cart-pill:hover {
  background: linear-gradient(135deg, rgba(212,175,55,.3), rgba(212,175,55,.12));
  box-shadow: 0 0 16px rgba(212,175,55,.35);
  transform: translateY(-1px);
  color: #FFF8DC;
}
.cart-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: var(--gold); color: #0A0A0E;
  font-size: 11px; font-weight: 800;
  box-shadow: 0 0 8px rgba(212,175,55,.6);
}

/* =========================================================
   LAYOUT
   ========================================================= */
.wrap {
  max-width: 1200px; margin: 0 auto;
  padding: 40px 24px 120px;
}

.page-head {
  text-align: center;
  margin-bottom: 36px;
  animation: fadeUp .7s cubic-bezier(.22,1,.36,1);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  color: var(--gold);
  background: rgba(212,175,55,.08);
  border: 1px solid var(--border-strong);
  padding: 5px 14px; border-radius: 999px; margin-bottom: 16px;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 8px var(--gold);
}
.page-head h1 {
  font-size: clamp(24px, 3.4vw, 36px); font-weight: 800;
  line-height: 1.35; margin-bottom: 10px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-head p {
  font-size: 14.5px; color: var(--text-muted);
  max-width: 620px; margin: 0 auto; line-height: 1.9;
}

/* =========================================================
   FILTERS
   ========================================================= */
.filters {
  display: flex; gap: 8px; margin-bottom: 30px;
  flex-wrap: wrap; justify-content: center;
  animation: fadeUp .8s cubic-bezier(.22,1,.36,1) .1s backwards;
}
.filter-btn {
  padding: 9px 18px; border-radius: 999px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all .22s ease;
}
.filter-btn:hover { color: var(--text); border-color: var(--border-strong); }
.filter-btn.active {
  background: linear-gradient(135deg, rgba(212,175,55,.18), rgba(212,175,55,.05));
  border-color: var(--border-strong);
  color: var(--gold-light);
  box-shadow: 0 4px 14px rgba(212,175,55,.15);
}

/* =========================================================
   PRODUCTS GRID
   ========================================================= */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.product-card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .35s cubic-bezier(.22,1,.36,1);
  display: flex; flex-direction: column;
  animation: fadeUp .6s cubic-bezier(.22,1,.36,1) backwards;
}
.product-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 50px rgba(0,0,0,.5), 0 0 40px rgba(212,175,55,.15);
}

.product-thumb {
  position: relative; aspect-ratio: 16/9;
  background: linear-gradient(135deg, #0E0E12, #050505);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.product-thumb::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(212,175,55,.18), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(212,175,55,.1), transparent 60%);
}
.product-thumb::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(212,175,55,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,175,55,.06) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: .5;
}
.product-thumb .thumb-icon {
  position: relative; z-index: 1;
  font-family: 'Cinzel', serif;
  font-size: 52px; font-weight: 800;
  color: var(--gold-light);
  text-shadow: 0 0 20px rgba(212,175,55,.5);
  letter-spacing: 2px;
  transition: transform .4s cubic-bezier(.22,1,.36,1);
}
.product-card:hover .thumb-icon { transform: scale(1.12) rotate(-3deg); }

.product-tag {
  position: absolute; top: 12px; right: 12px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .3px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(5,5,5,.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  color: var(--gold-light);
  z-index: 2;
}
.product-tag.free {
  background: linear-gradient(135deg, rgba(34,197,94,.25), rgba(34,197,94,.08));
  border-color: rgba(34,197,94,.55);
  color: #86EFAC;
}

.product-body {
  padding: 20px; flex: 1;
  display: flex; flex-direction: column;
}
.product-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  font-size: 11.5px; color: var(--text-muted);
}
.product-meta .dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: currentColor; opacity: .5;
}
.product-title {
  font-size: 15.5px; font-weight: 700; line-height: 1.55;
  color: var(--text); margin-bottom: 10px;
  transition: color .2s;
}
.product-card:hover .product-title { color: var(--gold-light); }
.product-desc {
  font-size: 12.5px; color: var(--text-muted);
  line-height: 1.85; margin-bottom: 16px; flex: 1;
}

.product-info-row {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px; font-size: 11.5px; color: var(--text-muted);
  padding: 10px 0; border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}
.product-info-row span { display: inline-flex; align-items: center; gap: 5px; }
.product-info-row svg { width: 13px; height: 13px; opacity: .8; }

.product-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.product-price { display: flex; flex-direction: column; gap: 3px; }
.product-price .label { font-size: 10.5px; color: var(--text-muted); }
.product-price .amount {
  font-family: 'Cinzel', var(--font, serif), serif;
  font-size: 18px; font-weight: 800;
  color: var(--gold-light);
  letter-spacing: .3px;
}
.product-price .amount.free {
  background: linear-gradient(135deg, #86EFAC, #22C55E);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.product-price .unit {
  font-family: 'Vazirmatn', sans-serif;
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  margin-right: 4px;
}

.btn-add {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #0A0A0E;
  font-size: 12.5px; font-weight: 700;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 6px 18px rgba(212,175,55,.22);
  white-space: nowrap;
}
.btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(212,175,55,.4);
  filter: brightness(1.05);
}
.btn-add:active { transform: translateY(0); }
.btn-add svg { width: 14px; height: 14px; }

.btn-add.free-btn {
  background: linear-gradient(135deg, rgba(34,197,94,.9), rgba(22,163,74,.95));
  box-shadow: 0 6px 18px rgba(34,197,94,.25);
  color: #052E16;
}
.btn-add.free-btn:hover { box-shadow: 0 10px 26px rgba(34,197,94,.45); }

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.empty-state svg {
  width: 60px; height: 60px; opacity: .35;
  color: var(--gold);
  margin-bottom: 16px;
}

/* =========================================================
   CART PAGE
   ========================================================= */
.cart-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .cart-grid { grid-template-columns: 1fr; }
}

.cart-list {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  animation: fadeUp .6s cubic-bezier(.22,1,.36,1);
}
.cart-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px;
  border-radius: var(--radius-sm);
  transition: background .2s;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item:hover { background: rgba(255,255,255,.02); }

.cart-thumb {
  width: 70px; height: 70px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #0E0E12, #050505);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif; font-weight: 800;
  color: var(--gold-light); font-size: 22px;
  position: relative; overflow: hidden;
}
.cart-thumb::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(212,175,55,.15), transparent 70%);
}

.cart-item-body { flex: 1; min-width: 0; }
.cart-item-title {
  font-size: 14px; font-weight: 700;
  margin-bottom: 5px; color: var(--text);
}
.cart-item-meta {
  font-size: 11.5px; color: var(--text-muted);
  display: flex; gap: 10px; flex-wrap: wrap;
}
.cart-item-price {
  font-family: 'Cinzel', serif;
  font-weight: 800; font-size: 15px;
  color: var(--gold-light);
  white-space: nowrap;
}
.cart-item-price.free { color: #86EFAC; }

.btn-remove {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 8px;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25);
  color: #FCA5A5; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.btn-remove:hover {
  background: rgba(239,68,68,.15);
  border-color: rgba(239,68,68,.5);
  transform: scale(1.06);
}
.btn-remove svg { width: 15px; height: 15px; }

/* Summary */
.summary {
  position: sticky; top: 90px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.5), var(--shadow-gold);
  animation: fadeUp .7s cubic-bezier(.22,1,.36,1) .15s backwards;
}
.summary::before {
  content: ""; position: absolute;
  top: 0; right: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .65;
}
.summary::after {
  content: ""; position: absolute;
  bottom: -70px; left: -70px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,.13), transparent 70%);
  pointer-events: none;
}
.summary-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700;
  margin-bottom: 20px; color: var(--gold-light);
  position: relative; z-index: 1;
}
.summary-title svg { width: 17px; height: 17px; color: var(--gold); }

.sum-lines {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 11px;
  margin-bottom: 18px;
}
.sum-line {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; font-size: 13px;
}
.sum-line .l { color: var(--text-muted); }
.sum-line .v { color: var(--text); font-weight: 600; white-space: nowrap; }

.sum-divider {
  height: 1px; margin: 4px 0 16px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  position: relative; z-index: 1;
}

.total-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 6px; position: relative; z-index: 1;
}
.total-row .label { font-size: 13.5px; font-weight: 600; color: var(--text-muted); }
.total-amount {
  font-family: 'Cinzel', serif; font-weight: 800;
  font-size: 26px; line-height: 1.1;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: .5px;
}
.total-unit {
  font-size: 11.5px; color: var(--text-muted);
  text-align: left; margin-bottom: 20px;
  position: relative; z-index: 1;
}

.btn-cta {
  position: relative; z-index: 1;
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #0A0A0E;
  font-size: 15px; font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(212,175,55,.28);
  transition: transform .2s, box-shadow .25s, filter .2s;
  text-decoration: none;
  font-family: inherit;
}
.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(212,175,55,.45);
  filter: brightness(1.05);
}
.btn-cta:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-ghost {
  position: relative; z-index: 1;
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  margin-top: 10px;
  text-decoration: none;
}
.btn-ghost:hover {
  border-color: var(--border-strong);
  background: rgba(212,175,55,.05);
  color: var(--gold-light);
}

.summary-note {
  position: relative; z-index: 1;
  margin-top: 14px;
  font-size: 11.5px; color: var(--text-muted);
  text-align: center; line-height: 1.9;
}
.summary-note a { color: var(--gold); font-weight: 600; }
.summary-note a:hover { color: var(--gold-light); }

/* =========================================================
   TOAST
   ========================================================= */
.toast {
  position: fixed; bottom: 24px; left: 24px;
  background: rgba(20,20,24,.96);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px;
  box-shadow: 0 20px 50px rgba(0,0,0,.6);
  transform: translateY(150%);
  transition: transform .4s cubic-bezier(.22,1,.36,1);
  z-index: 100;
  max-width: 340px;
  color: #86EFAC;
}
.toast.show { transform: translateY(0); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--success); }
.toast.error {
  color: #FCA5A5;
  border-color: rgba(239,68,68,.4);
}
.toast.error svg { color: var(--danger); }

/* =========================================================
   FOOTER
   ========================================================= */
.foot {
  text-align: center;
  margin-top: 60px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.back-home {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-size: 13px;
  transition: color .2s;
}
.back-home:hover { color: var(--gold); }
.back-home svg { width: 14px; height: 14px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .topbar-inner { padding: 12px 16px; }
  .nav-links {
    width: 100%;
    justify-content: center;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
  .nav-link { padding: 6px 10px; font-size: 12px; }
  .wrap { padding: 24px 16px 100px; }
  .products { grid-template-columns: 1fr; }
  .summary { position: static; }
}

::selection { background: rgba(212,175,55,.3); color: var(--gold-light); }