/* =====================================================================
   BargeSabz Club Premium — Theme 2 / v4.0.0
   ---------------------------------------------------------------------
   A fully scoped premium visual layer for the existing production build.
   It activates only when <html> has .bgs-theme-club-premium.
   ===================================================================== */

html.bgs-theme-club-premium {
  --club-950: 5 43 25;
  --club-900: 8 66 36;
  --club-800: 9 86 44;
  --club-700: 12 110 54;
  --club-600: 17 132 65;
  --club-500: 28 158 78;
  --club-400: 67 188 105;
  --club-300: 126 211 151;
  --club-200: 190 235 203;
  --club-100: 226 246 232;
  --club-50: 245 252 247;
  --club-gold-700: 157 105 25;
  --club-gold-600: 190 132 35;
  --club-gold-500: 217 161 55;
  --club-gold-400: 234 186 84;
  --club-gold-100: 251 241 211;
  --club-ink: 19 38 27;
  --club-muted: 103 124 111;
  --club-line: 220 232 224;
  --club-surface: 255 255 255;
  --club-page: 246 249 246;
  --club-danger: 223 56 75;
  --club-radius-sm: 12px;
  --club-radius-md: 18px;
  --club-radius-lg: 24px;
  --club-radius-xl: 30px;
  --club-shadow-sm: 0 4px 16px rgba(8, 66, 36, .07);
  --club-shadow-md: 0 14px 38px rgba(8, 66, 36, .10);
  --club-shadow-lg: 0 24px 60px rgba(8, 66, 36, .14);
  --club-ring: 0 0 0 3px rgba(28, 158, 78, .16);
  color-scheme: light;
}

html.bgs-theme-club-premium,
html.bgs-theme-club-premium body {
  background: rgb(var(--club-page));
  color: rgb(var(--club-ink));
}

html.bgs-theme-club-premium body {
  background-image:
    radial-gradient(900px 400px at 88% -160px, rgba(28,158,78,.12), transparent 68%),
    radial-gradient(720px 360px at 8% 8%, rgba(217,161,55,.075), transparent 70%),
    linear-gradient(180deg, #fbfdfb 0%, #f5f8f5 54%, #f8faf8 100%);
  background-attachment: fixed;
}

html.bgs-theme-club-premium ::selection {
  background: rgba(28,158,78,.22);
  color: rgb(var(--club-950));
}

html.bgs-theme-club-premium * {
  scrollbar-width: thin;
  scrollbar-color: rgba(17,132,65,.40) rgba(8,66,36,.05);
}
html.bgs-theme-club-premium ::-webkit-scrollbar { width: 10px; height: 10px; }
html.bgs-theme-club-premium ::-webkit-scrollbar-track { background: rgba(8,66,36,.04); }
html.bgs-theme-club-premium ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(17,132,65,.48), rgba(8,86,44,.34));
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}
html.bgs-theme-club-premium ::-webkit-scrollbar-thumb:hover { background-color: rgba(17,132,65,.58); }

/* ---------- Header / desktop navigation ---------- */
html.bgs-theme-club-premium .bgs-header-top {
  background: rgba(255,255,255,.88) !important;
  border-color: rgba(8,66,36,.09) !important;
  box-shadow: 0 8px 26px rgba(8,66,36,.055);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

html.bgs-theme-club-premium .bgs-header-top::after {
  content: "";
  position: absolute;
  inset-inline: 8%;
  bottom: -1px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(28,158,78,.45), rgba(217,161,55,.35), transparent);
}

html.bgs-theme-club-premium header a,
html.bgs-theme-club-premium header button,
html.bgs-theme-club-premium nav a,
html.bgs-theme-club-premium nav button {
  -webkit-tap-highlight-color: transparent;
}

/* Search-like fields in header */
html.bgs-theme-club-premium .bgs-header-top input[type="text"],
html.bgs-theme-club-premium .bgs-header-top input[type="search"] {
  background: rgba(246,249,246,.92) !important;
  border-color: rgba(8,66,36,.11) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 2px 9px rgba(8,66,36,.035);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
html.bgs-theme-club-premium .bgs-header-top input[type="text"]:focus,
html.bgs-theme-club-premium .bgs-header-top input[type="search"]:focus {
  background: white !important;
  border-color: rgba(28,158,78,.48) !important;
  box-shadow: var(--club-ring), 0 6px 20px rgba(8,66,36,.07);
}

/* ---------- Main surfaces ---------- */
html.bgs-theme-club-premium main [class*="bg-white"]:not(.bgs-product-card):not([class*="bg-white/"]) {
  border-color: rgba(8,66,36,.08);
}

html.bgs-theme-club-premium [class*="rounded-2xl"][class*="border"],
html.bgs-theme-club-premium [class*="rounded-3xl"][class*="border"] {
  border-color: rgba(8,66,36,.10);
}

/* ---------- Product cards ---------- */
html.bgs-theme-club-premium .bgs-product-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(8,66,36,.105) !important;
  border-radius: 20px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.99), rgba(251,253,251,.99)) !important;
  box-shadow: var(--club-shadow-sm) !important;
  transform: translateZ(0);
  transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s ease, border-color .28s ease !important;
}

html.bgs-theme-club-premium .bgs-product-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  height: 3px;
  opacity: .82;
  pointer-events: none;
  background: linear-gradient(90deg, rgb(var(--club-600)), rgb(var(--club-400)) 52%, rgb(var(--club-gold-500)));
}

html.bgs-theme-club-premium .bgs-product-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 110px;
  height: 110px;
  left: -58px;
  bottom: -62px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(28,158,78,.08), transparent 70%);
  transition: transform .35s ease, opacity .35s ease;
}

html.bgs-theme-club-premium .bgs-product-card:hover {
  transform: translateY(-5px) !important;
  border-color: rgba(17,132,65,.28) !important;
  box-shadow: var(--club-shadow-md) !important;
}
html.bgs-theme-club-premium .bgs-product-card:hover::after { transform: scale(1.55); opacity: 1; }

html.bgs-theme-club-premium .bgs-product-card > div:first-child,
html.bgs-theme-club-premium .bgs-product-card .aspect-square,
html.bgs-theme-club-premium .bgs53-tile {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, #ffffff 0%, #f5faf6 72%, #eff6f1 100%) !important;
}

html.bgs-theme-club-premium .bgs-product-card > div:first-child::after,
html.bgs-theme-club-premium .bgs53-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(118deg, transparent 24%, rgba(255,255,255,.62) 43%, transparent 61%);
  transform: translateX(110%);
  transition: transform .7s cubic-bezier(.25,.8,.25,1);
}
html.bgs-theme-club-premium .bgs-product-card:hover > div:first-child::after,
html.bgs-theme-club-premium .bgs53-tile:hover::after { transform: translateX(-115%); }

html.bgs-theme-club-premium .bgs-product-card img,
html.bgs-theme-club-premium .bgs53-tile img {
  mix-blend-mode: multiply;
  filter: saturate(1.03) contrast(1.015);
}

html.bgs-theme-club-premium .bgs-product-card .mt-auto::before {
  background: linear-gradient(90deg, rgba(8,66,36,.14), rgba(8,66,36,.015)) !important;
}

html.bgs-theme-club-premium .bgs-product-card .mt-auto .items-baseline {
  border-color: rgba(17,132,65,.22) !important;
  background: linear-gradient(180deg, rgba(245,252,247,.88), rgba(255,255,255,.76));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.68);
}

html.bgs-theme-club-premium .bgs-product-card [class*="-bottom-3"] {
  border-color: rgba(255,255,255,.98) !important;
  box-shadow: 0 7px 18px rgba(8,86,44,.26), 0 0 0 1px rgba(8,66,36,.06) !important;
}

html.bgs-theme-club-premium .bgs-product-card span[class*="bg-orange-500"] {
  color: #fff !important;
  background: radial-gradient(circle at 32% 24%, #ff7384, rgb(var(--club-danger)) 72%) !important;
  box-shadow: 0 5px 15px rgba(223,56,75,.30), inset 0 0 0 1px rgba(255,255,255,.25) !important;
}

/* ---------- Buttons ---------- */
html.bgs-theme-club-premium button,
html.bgs-theme-club-premium a[role="button"] { position: relative; }

html.bgs-theme-club-premium .bg-leaf-600,
html.bgs-theme-club-premium .bg-leaf-700,
html.bgs-theme-club-premium [class*="bg-emerald-600"] {
  background-image: linear-gradient(145deg, rgb(var(--club-600)), rgb(var(--club-800))) !important;
  box-shadow: 0 7px 18px rgba(8,86,44,.20);
}
html.bgs-theme-club-premium .hover\:bg-leaf-700:hover { background-color: rgb(var(--club-800)) !important; }

html.bgs-theme-club-premium .bgs-ripple {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(255,255,255,.50);
  transform: translate(-50%,-50%) scale(0);
  animation: bgs-premium-ripple .55s ease-out forwards;
}
@keyframes bgs-premium-ripple { to { transform: translate(-50%,-50%) scale(15); opacity: 0; } }

/* ---------- Forms ---------- */
html.bgs-theme-club-premium input,
html.bgs-theme-club-premium select,
html.bgs-theme-club-premium textarea {
  color-scheme: light;
}
html.bgs-theme-club-premium input:not([type="checkbox"]):not([type="radio"]),
html.bgs-theme-club-premium select,
html.bgs-theme-club-premium textarea {
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
html.bgs-theme-club-premium input:not([type="checkbox"]):not([type="radio"]):focus,
html.bgs-theme-club-premium select:focus,
html.bgs-theme-club-premium textarea:focus {
  border-color: rgba(28,158,78,.52) !important;
  box-shadow: var(--club-ring) !important;
}
html.bgs-theme-club-premium :focus-visible {
  outline: 2px solid rgba(17,132,65,.58);
  outline-offset: 3px;
}

/* ---------- Skeleton ---------- */
html.bgs-theme-club-premium .animate-pulse {
  animation: bgs-premium-shimmer 1.5s linear infinite !important;
  background-image: linear-gradient(100deg, transparent 28%, rgba(255,255,255,.82) 49%, transparent 70%) !important;
  background-size: 210% 100% !important;
  background-repeat: no-repeat !important;
}
@keyframes bgs-premium-shimmer { from { background-position: 205% 0; } to { background-position: -205% 0; } }

/* ---------- Swiper ---------- */
html.bgs-theme-club-premium .swiper-pagination-bullet {
  width: 7px;
  height: 7px;
  opacity: .28;
  transition: width .2s ease, opacity .2s ease, background .2s ease;
}
html.bgs-theme-club-premium .swiper-pagination-bullet-active {
  width: 22px;
  border-radius: 999px;
  opacity: 1;
  background: linear-gradient(90deg, rgb(var(--club-600)), rgb(var(--club-gold-500))) !important;
}

/* ---------- Mobile bottom navigation ---------- */
@media (max-width: 1023px) {
  html.bgs-theme-club-premium nav.fixed.bottom-0 > div {
    background: rgba(255,255,255,.91) !important;
    border-color: rgba(8,66,36,.12) !important;
    box-shadow: 0 -12px 36px rgba(8,66,36,.10) !important;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
  }
  html.bgs-theme-club-premium nav.fixed.bottom-0 > div::before {
    content: "";
    position: absolute;
    inset-inline: 18%;
    top: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(28,158,78,.68), rgba(217,161,55,.48), transparent);
  }
}

/* ---------- Reorder widget ---------- */
html.bgs-theme-club-premium .bgs53-reorder {
  position: relative;
  overflow: hidden;
  margin: 16px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(8,66,36,.12);
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(241,249,244,.96));
  box-shadow: var(--club-shadow-md);
  font-family: inherit;
  direction: rtl;
}
html.bgs-theme-club-premium .bgs53-reorder::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  left: -78px;
  top: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217,161,55,.17), transparent 70%);
  pointer-events: none;
}
html.bgs-theme-club-premium .bgs53-rhead { display:flex; flex-direction:column; gap:3px; margin-bottom:12px; }
html.bgs-theme-club-premium .bgs53-rtitle { display:flex; align-items:center; gap:8px; color:rgb(var(--club-800)); font-size:15px; font-weight:900; }
html.bgs-theme-club-premium .bgs53-rtitle::before { content:""; width:9px; height:9px; border-radius:50%; background:rgb(var(--club-500)); box-shadow:0 0 0 5px rgba(28,158,78,.10); }
html.bgs-theme-club-premium .bgs53-rsub { color:rgb(var(--club-muted)); font-size:11px; }
html.bgs-theme-club-premium .bgs53-row { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; padding:11px; border:1px solid rgba(8,66,36,.08); border-radius:15px; background:rgba(255,255,255,.72); }
html.bgs-theme-club-premium .bgs53-otitle { margin-bottom:2px; color:rgb(var(--club-ink)); font-size:12.5px; font-weight:800; }
html.bgs-theme-club-premium .bgs53-osub { color:rgb(var(--club-muted)); font-size:11px; }
html.bgs-theme-club-premium .bgs53-add { flex-shrink:0; padding:9px 13px; border:0; border-radius:12px; color:#fff; background:linear-gradient(145deg,rgb(var(--club-600)),rgb(var(--club-800))); box-shadow:0 5px 14px rgba(8,86,44,.22); cursor:pointer; font:800 12px inherit; transition:transform .16s ease,filter .16s ease,box-shadow .2s ease; }
html.bgs-theme-club-premium .bgs53-add:hover { filter:brightness(1.06); box-shadow:0 7px 18px rgba(8,86,44,.28); }
html.bgs-theme-club-premium .bgs53-add:active { transform:scale(.96); }
html.bgs-theme-club-premium .bgs53-add[disabled] { opacity:.56; cursor:wait; }
html.bgs-theme-club-premium .bgs53-rmsg { padding:6px 2px; color:rgb(var(--club-muted)); font-size:11.5px; }
html.bgs-theme-club-premium .bgs53-rdone { color:rgb(var(--club-600)); font-weight:900; }

/* ---------- Fly to cart ---------- */
html.bgs-theme-club-premium .bgs53-fly {
  position:fixed;
  z-index:99999;
  width:42px;
  height:42px;
  overflow:hidden;
  border:3px solid rgba(255,255,255,.95);
  border-radius:50%;
  background:#fff;
  box-shadow:0 10px 26px rgba(5,43,25,.28),0 0 0 2px rgba(28,158,78,.22);
  pointer-events:none;
}
html.bgs-theme-club-premium .bgs53-fly img { width:100%; height:100%; object-fit:contain; mix-blend-mode:multiply; }

/* ---------- Toast ---------- */
.bgs-premium-toast-wrap {
  position:fixed;
  z-index:100000;
  right:16px;
  bottom:calc(84px + env(safe-area-inset-bottom));
  display:flex;
  width:min(370px,calc(100vw - 32px));
  flex-direction:column;
  gap:8px;
  pointer-events:none;
}
.bgs-premium-toast {
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:12px 13px;
  border:1px solid rgba(8,66,36,.12);
  border-radius:15px;
  background:rgba(255,255,255,.96);
  box-shadow:0 16px 42px rgba(5,43,25,.16);
  backdrop-filter:blur(14px);
  animation:bgs-premium-toast-in .28s ease both;
  pointer-events:auto;
}
.bgs-premium-toast-dot { width:9px; height:9px; margin-top:5px; flex:0 0 auto; border-radius:50%; background:rgb(var(--club-500)); box-shadow:0 0 0 5px rgba(28,158,78,.11); }
.bgs-premium-toast-text { min-width:0; color:rgb(var(--club-ink)); font-size:12px; font-weight:800; line-height:1.8; }
.bgs-premium-toast.is-leaving { animation:bgs-premium-toast-out .22s ease both; }
@keyframes bgs-premium-toast-in { from { opacity:0; transform:translateY(9px) scale(.98); } to { opacity:1; transform:none; } }
@keyframes bgs-premium-toast-out { to { opacity:0; transform:translateY(8px) scale(.98); } }

/* ---------- Scroll progress ---------- */
.bgs-premium-progress {
  position:fixed;
  z-index:100001;
  top:0;
  right:0;
  width:0;
  height:2px;
  pointer-events:none;
  background:linear-gradient(90deg,rgb(var(--club-500)),rgb(var(--club-gold-500)));
  box-shadow:0 0 12px rgba(28,158,78,.30);
}

/* ---------- utility polish ---------- */
html.bgs-theme-club-premium .bg-amber-50 { background-color:#fff9e8 !important; }
html.bgs-theme-club-premium .border-amber-200 { border-color:#f2d796 !important; }
html.bgs-theme-club-premium .bg-red-50 { background-color:#fff3f4 !important; }
html.bgs-theme-club-premium .border-red-200 { border-color:#f4c4ca !important; }
html.bgs-theme-club-premium .bg-orange-50 { background-color:#fff6ed !important; }

/* Avoid old dark mode rules leaking into this light theme. */
html.bgs-theme-club-premium.dark {
  color-scheme: light;
  --page-bg: 246 249 246;
  --surface: 255 255 255;
  --surface-2: 247 250 247;
  --surface-3: 240 246 242;
  --text: 19 38 27;
  --text-muted: 103 124 111;
  --border: 220 232 224;
  --border-strong: 200 218 205;
  --ink: 19 38 27;
  --ink-light: 103 124 111;
  --cream: 255 255 255;
}
html.bgs-theme-club-premium.dark body { background-color:rgb(var(--club-page)) !important; color:rgb(var(--club-ink)) !important; }
html.bgs-theme-club-premium.dark .bgs-header-top { background:rgba(255,255,255,.90) !important; color:rgb(var(--club-ink)) !important; }

@media (max-width: 640px) {
  html.bgs-theme-club-premium .bgs-product-card { border-radius:16px !important; }
  html.bgs-theme-club-premium .bgs-product-card:hover { transform:none !important; }
  html.bgs-theme-club-premium .bgs53-reorder { margin:12px; padding:13px; border-radius:18px; }
  html.bgs-theme-club-premium .bgs53-row { align-items:stretch; flex-direction:column; }
  html.bgs-theme-club-premium .bgs53-add { width:100%; }
  .bgs-premium-toast-wrap { right:12px; bottom:calc(78px + env(safe-area-inset-bottom)); width:calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  html.bgs-theme-club-premium *,
  html.bgs-theme-club-premium *::before,
  html.bgs-theme-club-premium *::after {
    scroll-behavior:auto !important;
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
  }
  html.bgs-theme-club-premium .bgs53-fly { display:none !important; }
}

/* =====================================================================
   Task58 — Base-theme parity: ویجت‌های همیشه‌فعال در تم پایه
   (fly-to-cart، خرید مجدد، شیمر — دقیقاً مثل نسخهٔ قبلی bgs-club.css)
   در تم پریمیوم، قوانین scoped بالاتر این‌ها را بازنویسی می‌کنند.
   ===================================================================== */
:root{
  --club-500:28 158 78;
  --club-600:17 132 65;
  --club-800:9 86 44;
  --club-ink:19 38 27;
  --club-muted:103 124 111;
  --club-gold-500:217 161 55;
  --club-page:246 249 246;
}
.swiper-pagination-bullet-active{background:#21833b}
.bgs-product-card span[class*="bg-orange-500"]{
  background:radial-gradient(circle at 30% 25%,#f4506a,#dc2626 72%)!important;
}
.animate-pulse{
  animation:bgs58-shim 1.6s linear infinite;
  background-image:linear-gradient(100deg,transparent 30%,rgba(255,255,255,.55) 50%,transparent 70%);
  background-size:200% 100%;
  background-repeat:no-repeat;
}
@keyframes bgs58-shim{0%{background-position:200% 0}100%{background-position:-200% 0}}
.bgs53-reorder{
  margin:14px 16px;padding:14px;border-radius:18px;
  background:#fff;border:1px solid #e3ebe5;
  box-shadow:0 4px 16px rgba(19,50,35,.07);
  font-family:inherit;direction:rtl;
}
.bgs53-rhead{display:flex;flex-direction:column;gap:2px;margin-bottom:10px}
.bgs53-rtitle{font-weight:900;font-size:15px;color:#14532d;display:flex;align-items:center;gap:6px}
.bgs53-rtitle::before{content:"";width:8px;height:8px;border-radius:50%;background:#16a34a;box-shadow:0 0 8px rgba(22,163,74,.5)}
.bgs53-rsub{font-size:11px;color:#8ba093}
.bgs53-row{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:10px;border-radius:14px;background:#f4f9f5;margin-bottom:8px;
  border:1px solid #e6efe8;
}
.bgs53-otitle{font-size:12.5px;font-weight:700;color:#2c3e33;margin-bottom:2px}
.bgs53-osub{font-size:11px;color:#8ba093}
.bgs53-add{
  border:0;cursor:pointer;border-radius:11px;padding:9px 13px;flex-shrink:0;
  font-size:12px;font-weight:800;color:#fff;background:linear-gradient(180deg,#22a355,#16803f);
  box-shadow:0 3px 12px rgba(30,150,75,.35);
  font-family:inherit;transition:transform .15s ease,filter .15s ease,box-shadow .2s ease;
}
.bgs53-add:hover{filter:brightness(1.08)}
.bgs53-add:active{transform:scale(.95)}
.bgs53-add[disabled]{opacity:.55;cursor:wait}
.bgs53-rmsg{font-size:11.5px;color:#8ba093;padding:6px 2px}
.bgs53-rdone{color:#16a34a;font-weight:800}
.bgs53-fly{
  position:fixed;z-index:9999;width:38px;height:38px;
  border-radius:50%;overflow:hidden;pointer-events:none;
  box-shadow:0 4px 14px rgba(0,0,0,.3),0 0 0 2px rgba(255,255,255,.85);
  background:#fff;
}
.bgs53-fly img{width:100%;height:100%;object-fit:cover}
