/* ============================================================
   Amora — گل و کیک‌فروشی آنلاین شیراز
   سیستم طراحی موبایل‌محور با پالت سبز پاستیلی
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  /* پالت سبز پاستیلی */
  --mint-50:  #f1f7f2;
  --mint-100: #e4f0e6;
  --mint-200: #cfe4d3;
  --sage-300: #aed3b6;
  --sage-400: #8cbf99;
  --sage-500: #6ba680;   /* رنگ اصلی */
  --sage-600: #548a67;
  --sage-700: #40694f;
  --leaf-900: #26382c;   /* عنوان‌ها */

  /* رنگ‌های مکمل */
  --blush:    #e9a7a2;
  --blush-dark: #d67f7a;
  --gold:     #d8b46a;
  --cream:    #f7f9f4;

  /* خنثی */
  --white: #ffffff;
  --ink:   #2c3a30;
  --muted: #7c8b80;
  --line:  #e6ede7;

  --danger: #d9534f;
  --success: #4c9a63;

  /* شعاع و سایه */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(38, 56, 44, .06);
  --shadow-md: 0 8px 24px rgba(38, 56, 44, .09);
  --shadow-lg: 0 16px 40px rgba(38, 56, 44, .14);
  --shadow-brand: 0 10px 24px rgba(107, 166, 128, .30);

  --nav-h: 66px;
  --header-h: 60px;
  --announce-h: 32px;
  --container: 1140px;

  --t-fast: .15s ease;
  --t: .25s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

::selection { background: var(--sage-300); color: var(--leaf-900); }

/* ---------- Layout helpers ---------- */
/* فاصله واکنش‌گرا از لبه‌ها؛ در هر اندازه صفحه به‌اندازه‌ی خودش */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 480px)  { .container { padding-inline: 22px; } }
@media (min-width: 768px)  { .container { padding-inline: 34px; } }
@media (min-width: 1024px) { .container { padding-inline: 48px; } }
@media (min-width: 1280px) { .container { padding-inline: 64px; } }

/* هدر با محتوای صفحه هم‌تراز بماند */
.app-header .container { max-width: var(--container); }

.app-main { padding-top: calc(var(--announce-h) + var(--header-h)); padding-bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); min-height: 100vh; }
@media (min-width: 900px) { .app-main { padding-bottom: 40px; } }

.section { padding-block: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.section-head h2 { font-size: 1.25rem; color: var(--leaf-900); font-weight: 700; }
.section-head .link { color: var(--sage-600); font-size: .9rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex: 0 0 auto; }
.section-head .link svg { width: 15px; height: 15px; flex: 0 0 auto; }

.hidden { display: none !important; }
.spacer { flex: 1; }

/* ============================================================
   Header
   ============================================================ */
.app-header {
  position: fixed; inset-block-start: var(--announce-h); inset-inline: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(247, 249, 244, .85);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
}
.app-header .container { display: flex; align-items: center; gap: 12px; }

.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--leaf-900); font-size: 1.2rem; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 12px;
  background: linear-gradient(135deg, var(--sage-400), var(--sage-600));
  display: grid; place-items: center; color: #fff; font-size: 1.05rem;
  box-shadow: var(--shadow-brand);
}
.brand small { color: var(--muted); font-weight: 500; font-size: .68rem; display: block; margin-top: -4px; }

.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: var(--r-pill);
  display: grid; place-items: center; color: var(--sage-700);
  position: relative; transition: background var(--t-fast);
}
.icon-btn:hover { background: var(--mint-100); }
.icon-btn svg { width: 22px; height: 22px; }

.badge-count {
  position: absolute; inset-block-start: 2px; inset-inline-start: 2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--blush-dark); color: #fff; border-radius: var(--r-pill);
  font-size: .68rem; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--cream);
}

/* ============================================================
   Bottom nav (mobile)
   ============================================================ */
/* ناوبری پایینِ شیشه‌ای با پیلِ فعالِ گسترش‌یابنده (سبک تلگرام) */
.bottom-nav {
  position: fixed; z-index: 100;
  inset-inline: 10px; inset-block-end: calc(8px + env(safe-area-inset-bottom));
  height: 60px;
  display: flex; align-items: center; justify-content: space-around;
  gap: 4px; padding: 0 8px;
  background: rgba(247, 249, 244, .72);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 26px;
  box-shadow: 0 10px 30px rgba(38, 56, 44, .16);
}
.bottom-nav a {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 11px; border-radius: 999px;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  font-size: .82rem; font-weight: 700;
  -webkit-tap-highlight-color: transparent;
  transition: background .35s cubic-bezier(.34, 1.2, .64, 1), color .25s ease, padding .35s cubic-bezier(.34, 1.2, .64, 1);
}
.bottom-nav .nav-ico { position: relative; display: inline-flex; }
.bottom-nav a svg { width: 24px; height: 24px; }
.bottom-nav .nav-label {
  max-width: 0; overflow: hidden; opacity: 0; margin-inline-start: 0;
  transition: max-width .35s cubic-bezier(.34, 1.2, .64, 1), opacity .25s ease, margin .35s ease;
}
.bottom-nav a.active {
  background: var(--sage-500); color: #fff; padding: 0 16px;
  box-shadow: 0 6px 16px rgba(107, 166, 128, .45);
}
.bottom-nav a.active .nav-label { max-width: 90px; opacity: 1; margin-inline-start: 8px; }
.bottom-nav .nav-badge {
  position: absolute; top: -5px; right: -7px;
  min-width: 16px; height: 16px; padding: 0 4px; background: var(--blush-dark); color: #fff;
  border-radius: var(--r-pill); font-size: .6rem; font-weight: 700; display: grid; place-items: center;
}
/* انیمیشنِ سرزنده هنگام جابه‌جایی بین آیتم‌ها */
.bottom-nav a svg { transition: transform .3s cubic-bezier(.34, 1.4, .64, 1); }
.bottom-nav a.active .nav-ico svg { animation: navPop .5s cubic-bezier(.34, 1.5, .55, 1); }
.bottom-nav a.active .nav-label { animation: navLabelIn .42s cubic-bezier(.34, 1.3, .64, 1) both; }
@keyframes navPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.3) rotate(-5deg); }
  65%  { transform: scale(.9) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes navLabelIn {
  0%   { transform: translateX(6px) scale(.85); opacity: 0; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .bottom-nav a.active .nav-ico svg,
  .bottom-nav a.active .nav-label { animation: none; }
}

@media (min-width: 900px) { .bottom-nav { display: none; } }

/* ---------- Desktop nav ---------- */
.desktop-nav { display: none; gap: 4px; margin-inline-start: 10px; }
.desktop-nav a, .desktop-nav .nav-link-btn { padding: 8px 14px; border-radius: var(--r-pill); font-weight: 600; color: var(--sage-700); font-size: .92rem; transition: background var(--t-fast); background: none; border: none; cursor: pointer; font-family: inherit; }
.desktop-nav a:hover, .desktop-nav a.active, .desktop-nav .nav-link-btn:hover { background: var(--mint-100); color: var(--sage-700); }
@media (min-width: 900px) { .desktop-nav { display: flex; } }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--r-pill); font-weight: 600; font-size: .95rem;
  transition: transform var(--t-fast), box-shadow var(--t), background var(--t), opacity var(--t);
  white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 19px; height: 19px; }
.btn-primary { background: linear-gradient(135deg, var(--sage-500), var(--sage-600)); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { box-shadow: 0 12px 28px rgba(107, 166, 128, .40); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: var(--mint-100); color: var(--sage-700); }
.btn-ghost:hover { background: var(--mint-200); }
.btn-outline { background: transparent; border: 1.5px solid var(--sage-400); color: var(--sage-700); }
.btn-outline:hover { background: var(--mint-50); }
.btn-danger { background: #fdeceb; color: var(--danger); }
.btn-danger:hover { background: #fbdad8; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn-lg { padding: 15px 26px; font-size: 1.02rem; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative; margin-top: 12px;
  border-radius: var(--r-xl); overflow: hidden;
  background: linear-gradient(135deg, #dff0e3 0%, #eaf5ec 55%, #f7ecec 100%);
  padding: 30px 24px;
}
.hero::after {
  content: '🌿'; position: absolute; font-size: 9rem; opacity: .12;
  inset-block-end: -30px; inset-inline-start: -14px; transform: rotate(-15deg);
}
.hero-content { position: relative; z-index: 1; max-width: 460px; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.7); color: var(--sage-700); padding: 6px 13px; border-radius: var(--r-pill); font-size: .78rem; font-weight: 600; margin-bottom: 14px; }
.hero h1 { font-size: 1.9rem; line-height: 1.35; color: var(--leaf-900); font-weight: 700; margin-bottom: 10px; }
.hero h1 span { color: var(--sage-600); }
.hero p { color: var(--sage-700); margin-bottom: 20px; font-size: .98rem; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (min-width: 720px) {
  .hero { padding: 52px 44px; display: flex; align-items: center; min-height: 300px; }
  .hero h1 { font-size: 2.7rem; }
  .hero::after { font-size: 15rem; inset-inline-start: auto; inset-inline-end: 40px; inset-block-end: -50px; }
}

/* ---------- Advanced search & filter ---------- */
.search-bar { position: relative; display: flex; align-items: center; margin-bottom: 14px; }
.search-bar .search-ic { position: absolute; inset-inline-start: 14px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search-bar .search-ic svg { width: 100%; height: 100%; }
.search-bar input { width: 100%; padding: 13px 44px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--white); outline: none; transition: border var(--t-fast); }
.search-bar input:focus { border-color: var(--sage-400); }
.search-clear { position: absolute; inset-inline-end: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--mint-100); color: var(--sage-700); display: grid; place-items: center; font-size: .8rem; }

.shop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.filter-btn { display: inline-flex; align-items: center; gap: 6px; }
.filter-btn svg { width: 17px; height: 17px; }
.filter-btn.active { background: var(--sage-500); color: #fff; }
.filter-count { min-width: 18px; height: 18px; padding: 0 5px; background: var(--blush-dark); color: #fff; border-radius: var(--r-pill); font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.filter-btn.active .filter-count { background: #fff; color: var(--sage-600); }

.filter-panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-top: 12px; animation: pageIn .25s ease; }
.filter-group { margin-bottom: 16px; }
.filter-group > label { display: block; font-size: .84rem; font-weight: 600; color: var(--sage-700); margin-bottom: 9px; }
.price-inputs { display: flex; align-items: center; gap: 10px; }
.price-inputs input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--cream); outline: none; }
.price-inputs input:focus { border-color: var(--sage-400); background: #fff; }
.price-inputs span { color: var(--muted); font-size: .85rem; }
.rating-chips, .toggle-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.rchip, .tchip { padding: 8px 14px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--white); color: var(--sage-700); font-weight: 600; font-size: .85rem; transition: all var(--t-fast); }
.rchip:hover, .tchip:hover { border-color: var(--sage-300); }
.rchip.active, .tchip.active { background: var(--sage-500); border-color: var(--sage-500); color: #fff; box-shadow: var(--shadow-brand); }

.result-line { margin-top: 16px; margin-bottom: 12px; }

/* ---------- Infinite scroll ---------- */
.inf-sentinel { display: flex; justify-content: center; align-items: center; min-height: 8px; padding: 18px 0; }
.inf-sentinel .inf-spinner { display: none; }
.inf-sentinel.loading .inf-spinner { display: block; }
.inf-spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--mint-200); border-top-color: var(--sage-500); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.inf-end { text-align: center; color: var(--muted); font-size: .85rem; padding: 16px 0 24px; }

/* ---------- Category chips ---------- */
.chip-row { display: flex; gap: 10px; overflow-x: auto; padding-block: 6px 4px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--r-pill); background: var(--white);
  border: 1.5px solid var(--line); color: var(--sage-700); font-weight: 600; font-size: .88rem;
  transition: all var(--t-fast); scroll-snap-align: start;
}
.chip .ic { font-size: 1.05rem; }
.chip:hover { border-color: var(--sage-300); }
.chip.active { background: var(--sage-500); border-color: var(--sage-500); color: #fff; box-shadow: var(--shadow-brand); }

/* ---------- Category cards grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 620px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(5, 1fr); } }
.cat-card {
  background: var(--white); border-radius: var(--r-md); padding: 18px 12px; text-align: center;
  border: 1px solid var(--line); transition: transform var(--t), box-shadow var(--t);
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cat-card .ic { font-size: 2rem; margin-bottom: 8px; }
.cat-card h3 { font-size: .92rem; color: var(--leaf-900); font-weight: 600; }
.cat-card small { color: var(--muted); font-size: .74rem; }

/* ============================================================
   Product grid & cards
   ============================================================ */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 620px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px) { .product-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; } }

/* کارت بدون قابِ سفید؛ فقط تصویرِ گِردگوشهٔ جدا و متن زیرِ آن (مطابق تصویر مرجع) */
.product-card {
    position: relative;
    background: transparent;
    border: none;
    /*  box-shadow: none;*/
    border-radius: var(--r-lg);
    box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;
    display: flex;
    flex-direction: column;
    transition: transform var(--t);
}
.product-card:hover { transform: translateY(-4px); }
.product-media {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: linear-gradient(165deg, #f7f6f3 0%, #ebe9e4 100%);
    box-shadow: 0 4px 16px rgba(38, 56, 44, .07);
    transition: box-shadow var(--t);
    border-radius: var(--r-lg);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.product-card:hover .product-media { box-shadow: 0 12px 26px rgba(38, 56, 44, .13); }
.product-media img, .product-media svg { width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.22,.61,.36,1); }
.product-card:hover .product-media img, .product-card:hover .product-media svg { transform: scale(1.06); }
.product-fav {
  position: absolute; inset-block-start: 12px; inset-inline-end: 12px; z-index: 2;
  width: 36px; height: 36px; border-radius: 12px; background: #fff;
  display: grid; place-items: center; color: #4a5a50;
  box-shadow: 0 2px 8px rgba(38,56,44,.12); cursor: pointer; border: none;
  transition: transform var(--t-fast), color var(--t), background var(--t);
}
.product-fav:hover { color: var(--blush-dark); background: #fff; }
.product-fav.is-fav { color: var(--blush-dark); }
.product-fav:active { transform: scale(.82); }
.product-fav svg { width: 18px; height: 18px; }

/* دکمه علاقه‌مندی در صفحه جزئیات */
.fav-detail { color: var(--muted); }
.fav-detail.is-fav { color: var(--blush-dark); border-color: var(--blush); background: #fdf1f0; }
/* برچسب «ویژه» — پیلِ سفیدِ تمیز مثل Featured در تصویر مرجع */
.tag {
  position: absolute; inset-block-start: 12px; inset-inline-start: 12px; z-index: 2;
  padding: 5px 12px; border-radius: var(--r-pill); font-size: .7rem; font-weight: 600; letter-spacing: .2px;
  background: #fff; color: var(--leaf-900);
  box-shadow: 0 2px 8px rgba(38, 56, 44, .12);
}
.tag-sale { background: var(--blush-dark); color: #fff; }

.product-body {
    padding: 12px 11px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product-cat { font-size: .72rem; color: var(--sage-500); font-weight: 600; margin-bottom: 3px; display: inline-block; }
.product-name { font-size: .85rem; font-weight: 600; color: var(--leaf-900); margin-bottom: 0; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-foot { margin-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { display: flex; flex-direction: column; }
.price .old { font-size: .72rem; color: var(--muted); text-decoration: line-through; }
.price .now { font-size: 1rem; font-weight: 800; color: var(--leaf-900); letter-spacing: -.3px; }
.price .now small { font-size: .66rem; font-weight: 500; color: var(--muted); }
.add-btn {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(135deg, var(--sage-500), var(--sage-600)); color: #fff;
  display: grid; place-items: center; box-shadow: 0 4px 12px rgba(107, 166, 128, .4);
  transition: transform var(--t-fast), filter var(--t), box-shadow var(--t);
  flex: 0 0 auto;
}
.add-btn:hover { filter: brightness(1.04); transform: translateY(-2px); box-shadow: 0 7px 16px rgba(107, 166, 128, .5); }
.add-btn:active { transform: scale(.88); }
.add-btn svg { width: 18px; height: 18px; }
.stock-out { font-size: .74rem; color: var(--danger); font-weight: 600; }

/* ============================================================
   Product detail
   ============================================================ */
.detail-wrap { display: grid; gap: 22px; }
@media (min-width: 820px) { .detail-wrap { grid-template-columns: 1fr 1fr; align-items: start; } }
.detail-media { border-radius: var(--r-xl); overflow: hidden; background: var(--mint-50); aspect-ratio: 1/1; }
.detail-media svg { width: 100%; height: 100%; }
.detail-info h1 { font-size: 1.5rem; color: var(--leaf-900); font-weight: 700; margin-bottom: 8px; }
.detail-price { display: flex; align-items: baseline; gap: 10px; margin-block: 14px; }
.detail-price .now { font-size: 1.6rem; font-weight: 700; color: var(--sage-700); }
.detail-price .old { font-size: 1rem; color: var(--muted); text-decoration: line-through; }
.detail-desc { color: var(--sage-700); margin-bottom: 20px; }
.qty-row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.qty { display: inline-flex; align-items: center; background: var(--mint-50); border-radius: var(--r-pill); border: 1px solid var(--line); }
.qty button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--sage-700); font-size: 1.3rem; font-weight: 700; }
.qty span { min-width: 32px; text-align: center; font-weight: 700; }

/* ============================================================
   Cart
   ============================================================ */
.cart-item { display: flex; gap: 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; margin-bottom: 12px; }
.cart-item .thumb { width: 78px; height: 78px; border-radius: var(--r-sm); overflow: hidden; background: var(--mint-50); flex: 0 0 auto; }
.cart-item .thumb svg { width: 100%; height: 100%; }
.cart-item .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cart-item .meta h4 { font-size: .92rem; color: var(--leaf-900); font-weight: 600; margin-bottom: 4px; }
.cart-item .meta .u { font-size: .8rem; color: var(--muted); }
.cart-item .bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cart-item .qty { transform: scale(.85); transform-origin: right; }
.cart-item .line-price { font-weight: 700; color: var(--sage-700); font-size: .95rem; }
.remove-btn { color: var(--muted); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; }
.remove-btn:hover { color: var(--danger); background: #fdeceb; }

.summary { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; position: sticky; inset-block-start: calc(var(--announce-h) + var(--header-h) + 12px); }
.summary h3 { font-size: 1.05rem; color: var(--leaf-900); margin-bottom: 14px; font-weight: 700; }
.summary-row { display: flex; justify-content: space-between; padding-block: 7px; color: var(--sage-700); font-size: .92rem; }
.summary-row.total { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 14px; font-weight: 700; font-size: 1.1rem; color: var(--leaf-900); }
@media (min-width: 820px) { .cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; } }
/* اجازهٔ کوچک‌شدن ستون‌های گرید تا محتوای طولانی/اسکرول‌شونده از قاب بیرون نزند */
.cart-layout > * { min-width: 0; }
.day-row { min-width: 0; }

/* ============================================================
   Reviews & ratings (نظر و امتیاز)
   ============================================================ */
.stars { display: inline-flex; align-items: center; gap: 2px; color: var(--gold); }
.stars .star { width: var(--star-size, 15px); height: var(--star-size, 15px); display: inline-flex; }
.stars .star svg { width: 100%; height: 100%; }
.stars .star.empty { color: #d9d9d9; }

.card-rating { display: flex; align-items: center; gap: 5px; margin-bottom: 8px; }
.card-rating > span:not(.stars) { font-size: .72rem; color: var(--muted); font-weight: 600; }

.detail-rating { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.detail-rating span { font-size: .85rem; color: var(--sage-700); font-weight: 600; }

.reviews-section { margin-top: 30px; }
.reviews-title { font-size: 1.2rem; color: var(--leaf-900); font-weight: 700; margin-bottom: 16px; }

/* خلاصه امتیاز */
.rev-summary { display: flex; gap: 20px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px; align-items: center; }
.rev-avg { text-align: center; flex: 0 0 auto; }
.rev-avg-num { font-size: 2.4rem; font-weight: 700; color: var(--leaf-900); line-height: 1; margin-bottom: 4px; }
.rev-bars { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.rev-bar-row { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--sage-700); }
.rev-bar { flex: 1; height: 7px; background: var(--mint-100); border-radius: 99px; overflow: hidden; }
.rev-bar > div { height: 100%; background: var(--gold); border-radius: 99px; }

/* فرم ثبت نظر */
.rev-form { margin-bottom: 18px; }
.rev-form textarea { width: 100%; padding: 12px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--cream); outline: none; resize: vertical; min-height: 80px; }
.rev-form textarea:focus { border-color: var(--sage-400); background: #fff; }
.star-input { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.star-btn { width: 34px; height: 34px; color: #d9d9d9; transition: transform var(--t-fast), color var(--t-fast); }
.star-btn svg { width: 100%; height: 100%; }
.star-btn.on, .star-btn.hover { color: var(--gold); }
.star-btn:active { transform: scale(.85); }
.star-hint { font-size: .82rem; color: var(--muted); margin-inline-start: 8px; }

/* لیست نظرات */
.rev-list { display: flex; flex-direction: column; gap: 12px; }
.rev-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.rev-head { display: flex; align-items: center; gap: 10px; }
.rev-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--sage-400), var(--sage-600)); color: #fff; display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.rev-meta { flex: 1; min-width: 0; }
.rev-meta h5 { font-size: .92rem; color: var(--leaf-900); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.rev-you { font-size: .66rem; background: var(--mint-100); color: var(--sage-700); padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.rev-comment { margin-top: 10px; color: var(--ink); font-size: .92rem; line-height: 1.8; }

/* پاسخ آمورا */
.rev-reply { margin-top: 12px; background: var(--mint-50); border-inline-start: 3px solid var(--sage-400); border-radius: var(--r-md); padding: 11px 14px; }
.rev-reply-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.rev-reply-badge { font-size: .78rem; font-weight: 700; color: var(--sage-700); }
.rev-reply p { font-size: .88rem; color: var(--sage-700); line-height: 1.7; }

@media (max-width: 480px) {
  .rev-summary { flex-direction: column; gap: 14px; align-items: stretch; }
  .rev-avg { display: flex; align-items: center; gap: 12px; justify-content: center; }
  .rev-avg-num { margin-bottom: 0; }
}

/* ============================================================
   Order status timeline (رهگیری)
   ============================================================ */
.timeline { position: relative; padding-inline-start: 6px; }
.tl-step { position: relative; display: flex; gap: 14px; padding-bottom: 22px; }
.tl-step:last-child { padding-bottom: 0; }
/* خط عمودی بین دایره‌ها */
.tl-step::before {
  content: ''; position: absolute; inset-block-start: 22px; inset-block-end: -4px;
  inset-inline-start: 13px; width: 2px; background: var(--line);
  transition: background var(--t);
}
.tl-step:last-child::before { display: none; }

/* حبابِ نگه‌دارندهٔ دایرهٔ کوچک (بدون آیکون) */
.tl-marker {
  position: relative; z-index: 1; flex: 0 0 auto;
  width: 28px; height: 28px;
  display: grid; place-items: center;
}
.tl-dot {
  position: relative;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--sage-300);
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.tl-content { padding-top: 3px; }
.tl-content h4 { font-size: .95rem; color: var(--muted); font-weight: 600; transition: color var(--t); }
.tl-content .tl-hint { display: block; font-size: .78rem; color: var(--muted); opacity: .8; }
.tl-content .tl-time { display: block; font-size: .74rem; color: var(--sage-500); font-weight: 600; margin-top: 3px; }

/* مرحلهٔ انجام‌شده: دایرهٔ توپُر سبز با ظهور نرم */
.tl-step.done .tl-dot { background: var(--sage-500); border-color: var(--sage-500); animation: tlPop .45s cubic-bezier(.34, 1.56, .64, 1) both; }
.tl-step.done::before { background: var(--sage-400); }
.tl-step.done .tl-content h4 { color: var(--leaf-900); }
@keyframes tlPop { 0% { transform: scale(.1); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* مرحلهٔ جاری: دایرهٔ سبز با موجِ نرمِ تکرارشونده */
.tl-step.current .tl-dot {
  background: var(--sage-500); border-color: var(--sage-500);
  box-shadow: 0 0 0 4px rgba(107, 166, 128, .18);
}
.tl-step.current .tl-dot::before,
.tl-step.current .tl-dot::after {
  content: ''; position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid var(--sage-500);
  animation: tlRipple 2s cubic-bezier(.22, .61, .36, 1) infinite;
}
.tl-step.current .tl-dot::after { animation-delay: 1s; }
@keyframes tlRipple {
  0%   { transform: scale(1);   opacity: .55; }
  100% { transform: scale(3);   opacity: 0; }
}
.tl-step.current .tl-content h4 { color: var(--sage-700); font-weight: 700; }

/* مرحلهٔ لغو */
.tl-step.cancelled .tl-dot { background: var(--danger); border-color: var(--danger); }
.tl-step.cancelled::before { background: #f3c9c7; }
.tl-step.cancelled .tl-content h4 { color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  .tl-step.current .tl-dot::before, .tl-step.current .tl-dot::after { animation: none; opacity: 0; }
  .tl-step.done .tl-dot { animation: none; }
}

/* اطلاعات کلید-مقدار */
.info-row { display: flex; justify-content: space-between; gap: 12px; padding-block: 8px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.info-row:last-child { border-bottom: none; }
.info-row .text-muted { flex: 0 0 auto; }
.info-row > span:last-child { text-align: left; color: var(--ink); }

/* کارت سفارش قابل‌کلیک */
.order-card-link { display: block; cursor: pointer; transition: transform var(--t), box-shadow var(--t); }
.order-card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ============================================================
   Forms & cards
   ============================================================ */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: .85rem; font-weight: 600; color: var(--sage-700); margin-bottom: 7px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line);
  background: var(--cream); transition: border var(--t-fast), background var(--t-fast); outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--sage-400); background: #fff; }
.field textarea { resize: vertical; min-height: 90px; }
.field .hint { font-size: .76rem; color: var(--muted); margin-top: 5px; }
.form-row { display: grid; gap: 0; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; gap: 15px; } }

/* ---------- Delivery date & slot picker ---------- */
.day-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.day-row::-webkit-scrollbar { display: none; }
.day-chip {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 74px; padding: 10px 8px; border-radius: var(--r-md); background: var(--white);
  border: 1.5px solid var(--line); cursor: pointer; transition: all var(--t-fast); scroll-snap-align: start;
}
.day-chip .dc-week { font-size: .82rem; font-weight: 600; color: var(--sage-700); }
.day-chip .dc-date { font-size: .72rem; color: var(--muted); }
.day-chip:hover:not(.disabled) { border-color: var(--sage-300); }
.day-chip.active { background: var(--sage-500); border-color: var(--sage-500); box-shadow: var(--shadow-brand); }
.day-chip.active .dc-week, .day-chip.active .dc-date { color: #fff; }
.day-chip.disabled { opacity: .4; cursor: not-allowed; }

.slot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 560px) { .slot-grid { grid-template-columns: repeat(4, 1fr); } }
.slot-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 11px 8px;
  border-radius: var(--r-md); background: var(--white); border: 1.5px solid var(--line);
  cursor: pointer; transition: all var(--t-fast);
}
.slot-chip .sc-name { font-size: .85rem; font-weight: 600; color: var(--sage-700); }
.slot-chip .sc-time { font-size: .72rem; color: var(--muted); }
.slot-chip:hover:not(.disabled) { border-color: var(--sage-300); }
.slot-chip.active { background: var(--sage-500); border-color: var(--sage-500); box-shadow: var(--shadow-brand); }
.slot-chip.active .sc-name, .slot-chip.active .sc-time { color: #fff; }
.slot-chip.disabled { opacity: .4; cursor: not-allowed; }

/* نمایش زمان تحویل در کارت سفارش */
.delivery-badge { display: inline-flex; align-items: center; gap: 5px; background: var(--mint-100); color: var(--sage-700); padding: 4px 11px; border-radius: var(--r-pill); font-size: .78rem; font-weight: 600; }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 430px; margin-inline: auto; padding-top: 12px; }
.auth-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 28px 24px; box-shadow: var(--shadow-md); }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head .logo-lg { width: 60px; height: 60px; border-radius: 20px; background: linear-gradient(135deg, var(--sage-400), var(--sage-600)); display: grid; place-items: center; margin: 0 auto 14px; font-size: 1.7rem; box-shadow: var(--shadow-brand); }
.auth-head h2 { font-size: 1.4rem; color: var(--leaf-900); font-weight: 700; }
.auth-head p { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.auth-switch { text-align: center; margin-top: 18px; color: var(--muted); font-size: .9rem; }
.auth-switch a { color: var(--sage-600); font-weight: 600; }
.demo-note { background: var(--mint-50); border: 1px dashed var(--sage-300); border-radius: var(--r-md); padding: 11px 14px; font-size: .78rem; color: var(--sage-700); margin-top: 16px; line-height: 1.9; }

/* ============================================================
   Tabs (panels)
   ============================================================ */
.tabs { display: flex; gap: 6px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 5px; overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; padding: 9px 16px; border-radius: var(--r-pill); font-weight: 600; font-size: .88rem; color: var(--muted); transition: all var(--t-fast); white-space: nowrap; }
.tabs button.active { background: var(--sage-500); color: #fff; box-shadow: var(--shadow-brand); }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.stat-card .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--mint-100); display: grid; place-items: center; font-size: 1.2rem; margin-bottom: 10px; }
.stat-card .num { font-size: 1.5rem; font-weight: 700; color: var(--leaf-900); line-height: 1.2; }
.stat-card .lbl { font-size: .8rem; color: var(--muted); }

/* ---------- Data table ---------- */
.table-wrap { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { text-align: right; padding: 13px 14px; font-size: .87rem; }
th { background: var(--mint-50); color: var(--sage-700); font-weight: 600; white-space: nowrap; }
td { border-top: 1px solid var(--line); color: var(--ink); }
tr:hover td { background: var(--mint-50); }

/* ---------- Status pill ---------- */
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: var(--r-pill); font-size: .76rem; font-weight: 600; }
.st-0 { background: #fff5e6; color: #b8860b; }       /* pending */
.st-1 { background: var(--mint-100); color: var(--sage-700); } /* confirmed */
.st-2 { background: #e6f0fb; color: #3b7bc4; }       /* preparing */
.st-3 { background: #eae6fb; color: #6b4fc4; }       /* shipped */
.st-4 { background: #e3f5e8; color: var(--success); }/* delivered */
.st-5 { background: #fdeceb; color: var(--danger); } /* cancelled */

/* ---------- Order card (mobile) ---------- */
.order-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.order-card .oc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.order-card .oc-id { font-weight: 700; color: var(--leaf-900); font-size: .98rem; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-card .oc-date { font-size: .78rem; color: var(--muted); }
.order-card .status-pill { flex: 0 0 auto; white-space: nowrap; }
.oc-delivery { margin-top: 10px; }
.order-items-mini { display: flex; gap: 6px; margin-block: 12px; flex-wrap: nowrap; overflow: hidden; }
.order-items-mini .mini { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 12px; overflow: hidden; background: var(--mint-50); border: 1px solid var(--line); }
.order-items-mini .mini img, .order-items-mini .mini svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.order-items-mini .more { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 12px; background: var(--mint-100); display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--sage-700); }
.oc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 4px; }
.oc-count { font-size: .82rem; color: var(--muted); flex: 0 0 auto; }
.oc-total { font-weight: 800; color: var(--sage-700); font-size: 1.02rem; white-space: nowrap; }
.oc-cta { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--sage-600); background: var(--mint-50); border-radius: var(--r-md); padding: 9px; }
.oc-cta svg { width: 15px; height: 15px; }

/* ============================================================
   Chat
   ============================================================ */
.fab-chat {
  /* بالاتر از ناوبری پایین بنشیند؛ روی گوشی‌های دارای نوار خانه (safe-area) هم زیر آن نرود */
  position: fixed; inset-block-end: calc(var(--nav-h) + 26px + env(safe-area-inset-bottom)); inset-inline-end: 16px; z-index: 90;
  width: 56px; height: 56px; border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--sage-500), var(--sage-600)); color: #fff;
  display: grid; place-items: center; box-shadow: var(--shadow-lg);
  transition: transform var(--t);
}
.fab-chat:hover { transform: scale(1.06); }
.fab-chat:active { transform: scale(.94); }
.fab-chat svg { width: 26px; height: 26px; }
.fab-chat .badge-count { inset-block-start: -2px; inset-inline-start: -2px; border-color: var(--cream); }
@media (min-width: 900px) { .fab-chat { inset-block-end: 24px; inset-inline-end: 24px; } }

/* ---------- ویجت گفتگو (موبایل: تمام‌صفحه، دسکتاپ: باکس شناور) ---------- */
.cw-overlay { position: fixed; inset: 0; z-index: 400; display: flex; opacity: 0; transition: opacity .2s ease; }
.cw-overlay.show { opacity: 1; }
.cw-panel {
  display: flex; flex-direction: column; background: var(--white);
  width: 100%; height: 100%; min-height: 0;
  transform: translateY(18px); transition: transform .26s cubic-bezier(.4, 0, .2, 1);
}
.cw-overlay.show .cw-panel { transform: none; }
.cw-panel .chat-body { flex: 1 1 auto; min-height: 0; }
.cw-head .cw-id { display: flex; flex-direction: column; }
.cw-close {
  margin-inline-start: auto; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(38, 56, 44, .06); color: var(--muted); font-size: 1rem;
  border: none; cursor: pointer; display: grid; place-items: center; flex: 0 0 auto;
  transition: background var(--t-fast);
}
.cw-close:hover { background: rgba(38, 56, 44, .12); }
/* iOS: احترام به نواحی امن */
.cw-panel .cw-head { padding-top: max(14px, env(safe-area-inset-top)); }
.cw-panel .cw-form { padding-bottom: max(12px, env(safe-area-inset-bottom)); }

.cw-guest { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 26px 20px; color: var(--muted); }
.cw-guest .ic { font-size: 2.4rem; }
.cw-guest h3 { color: var(--leaf-900); font-size: 1.05rem; }
.cw-guest p { font-size: .88rem; }
.cw-guest-form { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; margin-top: 8px; }
.cw-guest-form input { padding: 12px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--cream); outline: none; font-family: inherit; text-align: center; }
.cw-guest-form input:focus { border-color: var(--sage-400); background: #fff; }
.cw-login-link { background: none; border: none; color: var(--sage-600); font-weight: 600; font-size: .85rem; cursor: pointer; margin-top: 4px; }
.cw-login-link:hover { text-decoration: underline; }

/* نقطه‌ی پیام خوانده‌نشده روی دکمه‌ی «پشتیبانی» در نویگیشن دسکتاپ */
.nav-link-btn { position: relative; }
.nav-link-btn.has-unread::after {
  content: ''; position: absolute; inset-block-start: 4px; inset-inline-end: 4px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
  box-shadow: 0 0 0 2px var(--cream);
}

/* قفل اسکرول پس‌زمینه فقط روی موبایل (تمام‌صفحه) */
@media (max-width: 899px) { body.cw-open { overflow: hidden; } }

/* دسکتاپ: باکس شناور مثل چت‌بات، بدون مسدودکردن صفحه */
@media (min-width: 900px) {
  .cw-overlay { background: transparent; pointer-events: none; }
  .cw-panel {
    pointer-events: auto;
    position: fixed; inset-block-end: 92px; inset-inline-end: 24px;
    width: 380px; height: 560px; max-height: calc(100vh - 130px);
    border-radius: 22px; overflow: hidden;
    border: 1px solid var(--line); box-shadow: var(--shadow-lg);
    transform: translateY(24px) scale(.98);
  }
  .cw-overlay.show .cw-panel { transform: none; }
}

.chat-shell { display: flex; flex-direction: column; height: calc(100vh - var(--announce-h) - var(--header-h) - var(--nav-h) - 20px); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
@media (min-width: 900px) { .chat-shell { height: calc(100vh - var(--announce-h) - var(--header-h) - 60px); } }
.chat-topbar { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; background: var(--mint-50); }
.chat-topbar .avatar { width: 40px; height: 40px; border-radius: var(--r-pill); background: linear-gradient(135deg, var(--sage-400), var(--sage-600)); display: grid; place-items: center; color: #fff; font-weight: 700; }
.chat-topbar h4 { font-size: .95rem; color: var(--leaf-900); }
.chat-topbar .status { font-size: .74rem; color: var(--success); display: flex; align-items: center; gap: 4px; }
.chat-topbar .status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--cream); }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 18px; font-size: .9rem; line-height: 1.6; position: relative; word-break: break-word; }
.msg .time { display: block; font-size: .66rem; opacity: .6; margin-top: 4px; }
.msg-in { background: var(--white); border: 1px solid var(--line); align-self: flex-start; border-end-start-radius: 6px; color: var(--ink); }
.msg-out { background: linear-gradient(135deg, var(--sage-500), var(--sage-600)); color: #fff; align-self: flex-end; border-end-end-radius: 6px; }
.chat-day { align-self: center; font-size: .72rem; color: var(--muted); background: var(--mint-100); padding: 3px 12px; border-radius: var(--r-pill); }

.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--white); }
.chat-input input { flex: 1; padding: 12px 16px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--cream); outline: none; }
.chat-input input:focus { border-color: var(--sage-400); }
.chat-input button { width: 46px; height: 46px; border-radius: var(--r-pill); background: var(--sage-500); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.chat-input button svg { width: 20px; height: 20px; }

/* ---------- Admin chat two-pane ---------- */
.chat-admin { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 820px) { .chat-admin { grid-template-columns: 300px 1fr; } }
.convo-list { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; max-height: 70vh; overflow-y: auto; }
.convo-item { display: flex; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background var(--t-fast); align-items: center; }
.convo-item:hover { background: var(--mint-50); }
.convo-item.active { background: var(--mint-100); }
.convo-item .avatar { width: 40px; height: 40px; border-radius: var(--r-pill); background: var(--sage-400); color: #fff; display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.convo-item .ci-main { flex: 1; min-width: 0; }
.convo-item .ci-main h5 { font-size: .88rem; color: var(--leaf-900); font-weight: 600; }
.convo-item .ci-main p { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-item .ci-badge { min-width: 20px; height: 20px; padding: 0 6px; background: var(--blush-dark); color: #fff; border-radius: var(--r-pill); font-size: .68rem; font-weight: 700; display: grid; place-items: center; }

/* ============================================================
   Misc — toast, modal, empty, skeleton
   ============================================================ */
.toast-wrap { position: fixed; inset-block-start: calc(var(--announce-h) + var(--header-h) + 10px); inset-inline: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; background: var(--leaf-900); color: #fff; padding: 11px 20px; border-radius: var(--r-pill); font-size: .88rem; font-weight: 500; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px; animation: toastIn .3s ease, toastOut .3s ease 2.4s forwards; max-width: 90%; }
.toast.success { background: var(--sage-600); }
.toast.error { background: var(--danger); }
.toast svg { width: 18px; height: 18px; }
@keyframes toastIn { from { transform: translateY(-16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-16px); opacity: 0; } }

.modal-back { position: fixed; inset: 0; z-index: 300; background: rgba(38, 56, 44, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--white); border-radius: var(--r-xl); padding: 24px; max-width: 480px; width: 100%; max-height: 88vh; overflow-y: auto; animation: pop .25s cubic-bezier(.4,0,.2,1); }
@keyframes pop { from { transform: scale(.94) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal h3 { font-size: 1.15rem; color: var(--leaf-900); margin-bottom: 16px; font-weight: 700; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .ic { font-size: 3.5rem; margin-bottom: 12px; opacity: .8; }
.empty h3 { color: var(--sage-700); font-size: 1.1rem; margin-bottom: 6px; }
.empty p { font-size: .9rem; margin-bottom: 18px; }

.skeleton { background: linear-gradient(90deg, var(--mint-50) 25%, var(--mint-100) 37%, var(--mint-50) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-md); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sk-card { aspect-ratio: 3/4; border-radius: var(--r-lg); }

/* ---------- Fade page transitions ---------- */
.page-enter { animation: pageIn .35s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Scrollbar (desktop) ---------- */
@media (min-width: 900px) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb { background: var(--sage-300); border-radius: 10px; border: 2px solid var(--cream); }
  ::-webkit-scrollbar-track { background: transparent; }
}

/* ============================================================
   Image picker (admin)
   ============================================================ */
.img-picker-row { display: flex; gap: 14px; align-items: stretch; }
.img-preview { width: 92px; height: 92px; border-radius: var(--r-md); overflow: hidden; background: var(--mint-50); border: 1px solid var(--line); flex: 0 0 auto; }
.img-preview img, .img-preview svg { width: 100%; height: 100%; object-fit: cover; }
.img-picker-controls { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.img-upload-btn { position: relative; overflow: hidden; text-align: center; }
.img-picker-controls .hint { margin: 0; }

/* نوار پیشرفت آپلود */
.upload-progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.upload-progress .up-bar { flex: 1; height: 8px; background: var(--mint-100); border-radius: 99px; overflow: hidden; }
.upload-progress .up-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--sage-400), var(--sage-600)); border-radius: 99px; transition: width .2s ease; }
.upload-progress .up-pct { font-size: .78rem; font-weight: 700; color: var(--sage-700); min-width: 42px; text-align: left; }

/* چند تصویر (گالری محصول در پنل) */
.multi-thumbs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mthumb { position: relative; width: 72px; height: 72px; border-radius: var(--r-md); overflow: hidden; border: 2px solid var(--line); flex: 0 0 auto; }
.mthumb.is-cover { border-color: var(--sage-500); }
.mthumb img, .mthumb svg { width: 100%; height: 100%; object-fit: cover; }
.mthumb .cover-badge { position: absolute; inset-block-end: 0; inset-inline: 0; background: var(--sage-500); color: #fff; font-size: .62rem; text-align: center; padding: 1px; font-weight: 600; }
.mthumb .rm-thumb { position: absolute; inset-block-start: 2px; inset-inline-end: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: .7rem; display: grid; place-items: center; }
.mthumb .mk-cover { position: absolute; inset-block-start: 2px; inset-inline-start: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.85); color: var(--gold); font-size: .72rem; display: grid; place-items: center; }

/* ============================================================
   Product detail gallery
   ============================================================ */
.detail-gallery { position: sticky; top: calc(var(--announce-h) + var(--header-h) + 12px); }
@media (max-width: 819px) { .detail-gallery { position: static; } }
.detail-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.detail-thumbs::-webkit-scrollbar { display: none; }
.detail-thumb { width: 66px; height: 66px; border-radius: var(--r-md); overflow: hidden; border: 2px solid transparent; flex: 0 0 auto; cursor: pointer; background: var(--mint-50); transition: border var(--t-fast); padding: 0; }
.detail-thumb img, .detail-thumb svg { width: 100%; height: 100%; object-fit: cover; }
.detail-thumb.active { border-color: var(--sage-500); }

/* ============================================================
   Explore gallery (سبک اکسپلور اینستاگرام)
   ============================================================ */
.explore-head { margin-bottom: 16px; }
.explore-head h2 { font-size: 1.4rem; color: var(--leaf-900); font-weight: 700; }
.explore-head p { color: var(--muted); font-size: .9rem; }
.explore-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; grid-auto-flow: dense; }
@media (min-width: 768px) { .explore-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; } }
@media (min-width: 1100px) { .explore-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; } }
.explore-tile {
  position: relative; aspect-ratio: 1; overflow: hidden; cursor: pointer; border: none;
  background: var(--mint-50); border-radius: 6px;
}
.explore-tile.big { grid-column: span 2; grid-row: span 2; }
.explore-tile img, .explore-tile video, .explore-tile svg { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.explore-tile:hover img, .explore-tile:hover video, .explore-tile:hover svg { transform: scale(1.06); }
.explore-tile .explore-cap {
  position: absolute; inset-inline: 0; inset-block-end: 0; padding: 16px 8px 6px;
  background: linear-gradient(to top, rgba(38,56,44,.7), transparent);
  color: #fff; font-size: .74rem; font-weight: 500; text-align: right;
  opacity: 0; transition: opacity var(--t); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.explore-tile:hover .explore-cap { opacity: 1; }
.play-badge {
  position: absolute; inset-block-start: 7px; inset-inline-end: 7px;
  width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.5); backdrop-filter: blur(3px);
  display: grid; place-items: center; color: #fff; pointer-events: none;
}
.play-badge svg { width: 13px; height: 13px; transform: none !important; }
.explore-tile.skeleton { border-radius: 6px; }

/* آمار روی تایل (لایک/کامنت) */
.tile-stats {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 16px;
  background: rgba(38,56,44,.42); color: #fff; opacity: 0; transition: opacity var(--t); font-weight: 700; font-size: .9rem;
}
.tile-stats span { display: inline-flex; align-items: center; gap: 5px; }
.tile-stats svg { width: 18px; height: 18px; }
.explore-tile:hover .tile-stats { opacity: 1; }
@media (hover: none) { .tile-stats { display: none; } }

/* ============================================================
   Lightbox (نمای پست اینستاگرامی: رسانه + لایک/کامنت/شیر)
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 400; background: #000;
  display: grid; place-items: center; animation: fade .2s ease;
}

/* قاب رسانه: موبایل تمام‌صفحه، دسکتاپ ستون عمودی وسط (مثل ریلز) */
.lb-frame {
  position: relative; overflow: hidden; background: #000;
  width: 100vw; height: 100dvh;
}
@media (min-width: 900px) {
  .lb-frame { width: min(480px, 96vw); height: min(92vh, 880px); border-radius: 20px; box-shadow: var(--shadow-lg); }
}

/* رسانه تمام‌قاب */
.lb-stage { position: absolute; inset: 0; background: #000; display: grid; place-items: center; overflow: hidden; }
.lb-full { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ویدیو + دکمه پخش/توقف کاملاً مرکزی */
.lb-video { position: absolute; inset: 0; }
.lb-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.lb-pp {
  position: absolute; inset: 0; margin: auto;               /* دقیقاً وسط قاب */
  width: 76px; height: 76px; border-radius: 50%;
  background: rgba(20, 28, 22, .5); backdrop-filter: blur(4px);
  color: #fff; display: grid; place-items: center; border: none; cursor: pointer;
  z-index: 3; transition: opacity var(--t), transform var(--t-fast);
}
.lb-pp svg { width: 34px; height: 34px; }
/* مثلث «پخش» به‌طور بصری کمی به راست جابه‌جا می‌شود تا در مرکز دیده شود */
.lb-video:not(.playing) .lb-pp svg { transform: translateX(3px); }
.lb-pp:active { transform: scale(.92); }
.lb-video.hide-btn .lb-pp { opacity: 0; pointer-events: none; }

/* پرده‌ی گرادیانی پایین برای خوانایی کنترل‌ها روی رسانه */
.lb-scrim {
  position: absolute; inset-inline: 0; inset-block-end: 0; height: 44%;
  background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,.12) 60%, transparent);
  pointer-events: none; z-index: 2;
}

/* لایه‌ی کنترل‌ها روی رسانه (کپشن + ریل اکشن) */
.lb-overlay {
  position: absolute; inset-inline: 0; inset-block-end: 0; z-index: 3;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.lb-info { flex: 1; min-width: 0; color: #fff; pointer-events: auto; }
.lb-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.lb-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--sage-400), var(--sage-600)); display: grid; place-items: center; font-size: .9rem; }
.lb-caption { font-size: .9rem; line-height: 1.7; text-shadow: 0 1px 3px rgba(0,0,0,.55); max-height: 5.4em; overflow-y: auto; }

/* ریل اکشن عمودی (لایک/کامنت/شیر) — استایل ریلز */
.lb-rail { display: flex; flex-direction: column; align-items: center; gap: 16px; pointer-events: auto; }
.lb-act {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer; color: #fff; font-weight: 700; font-size: .78rem;
  transition: transform var(--t-fast);
}
.lb-act svg { width: 30px; height: 30px; filter: drop-shadow(0 2px 5px rgba(0,0,0,.5)); }
.lb-act:active { transform: scale(.88); }
.lb-like.on { color: var(--blush); }

/* پس‌زمینه‌ی تیره هنگام باز بودن شیت نظرات */
.lb-sheet-back { position: absolute; inset: 0; z-index: 4; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.lb-sheet-back.show { opacity: 1; pointer-events: auto; }

/* شیت نظرات کشویی از پایین */
.lb-sheet {
  position: absolute; inset-inline: 0; inset-block-end: 0; z-index: 5;
  height: 70%; display: flex; flex-direction: column;
  background: var(--white); border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 30px rgba(0,0,0,.28);
  transform: translateY(101%); transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.lb-sheet.open { transform: none; }
.lb-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.lb-sheet-title { font-weight: 700; color: var(--leaf-900); }
.lb-sheet-close { width: 32px; height: 32px; border-radius: 50%; background: rgba(38,56,44,.06); color: var(--muted); border: none; cursor: pointer; display: grid; place-items: center; }
.lb-sheet-close:hover { background: rgba(38,56,44,.12); }

.lb-comments { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.lb-c-loading, .lb-c-empty { color: var(--muted); font-size: .85rem; text-align: center; padding: 20px 0; }
.lb-comment { display: flex; gap: 10px; align-items: flex-start; }
.lb-c-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sage-400); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: 0 0 auto; }
.lb-c-body { flex: 1; min-width: 0; }
.lb-c-top { display: flex; align-items: center; gap: 8px; }
.lb-c-top b { font-size: .85rem; color: var(--leaf-900); }
.lb-c-top span { font-size: .72rem; color: var(--muted); }
.lb-c-body p { font-size: .88rem; color: var(--ink); line-height: 1.7; margin-top: 2px; word-break: break-word; }
.lb-c-del { color: var(--muted); width: 24px; height: 24px; border-radius: 6px; flex: 0 0 auto; background: none; border: none; cursor: pointer; }
.lb-c-del:hover { color: var(--danger); background: #fdeceb; }

.lb-comment-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.lb-comment-form input { flex: 1; padding: 10px 14px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--cream); outline: none; }
.lb-comment-form input:focus { border-color: var(--sage-400); }
.lb-comment-form button { width: 42px; height: 42px; border-radius: 50%; background: var(--sage-500); color: #fff; border: none; cursor: pointer; display: grid; place-items: center; flex: 0 0 auto; }
.lb-comment-form button svg { width: 18px; height: 18px; }

.lb-close {
  position: fixed; inset-block-start: max(14px, env(safe-area-inset-top)); inset-inline-end: 14px; z-index: 8;
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff;
  font-size: 1.3rem; border: none; cursor: pointer; display: grid; place-items: center; transition: background var(--t);
}
.lb-close:hover { background: rgba(255,255,255,.3); }
/* فلش‌های ناوبری عمودی (بالا=قبلی، پایین=بعدی) روی دسکتاپ، سمت راست */
.lb-nav {
  position: fixed; inset-inline-end: 22px; z-index: 7;
  width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff;
  border: none; cursor: pointer; display: grid; place-items: center; transition: background var(--t);
}
.lb-nav:hover { background: rgba(255,255,255,.28); }
.lb-nav svg { width: 24px; height: 24px; }
.lb-prev { inset-block-start: calc(50% - 54px); }
.lb-next { inset-block-start: calc(50% + 8px); }
/* روی موبایل به‌جای فلش، سوایپ عمودی استفاده می‌شود */
@media (max-width: 899px) { .lb-nav { display: none; } }

/* انیمیشن اسلاید عمودی هنگام جابه‌جایی (سبک ریلز) */
@keyframes lbSlideUp { from { transform: translateY(14%); opacity: .35; } to { transform: none; opacity: 1; } }
@keyframes lbSlideDown { from { transform: translateY(-14%); opacity: .35; } to { transform: none; opacity: 1; } }
.lb-stage.slide-up { animation: lbSlideUp .3s cubic-bezier(.4, 0, .2, 1); }
.lb-stage.slide-down { animation: lbSlideDown .3s cubic-bezier(.4, 0, .2, 1); }

/* ============================================================
   Category banner cards (home)
   ============================================================ */
/* کارت کاور تمام‌صفحه با متن روی هاور */
.cat-card.cat-cover { position: relative; padding: 0; overflow: hidden; aspect-ratio: 1 / 1; border: none; display: block; }
.cat-card.cat-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--t); }
.cat-card.cat-cover:hover > img { transform: scale(1.07); }
.cat-cover-info {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; text-align: center; padding: 12px; color: #fff;
  background: linear-gradient(to top, rgba(38,56,44,.6), rgba(38,56,44,.2));
  opacity: 0; transition: opacity var(--t);
}
.cat-card.cat-cover:hover .cat-cover-info { opacity: 1; }
.cat-cover-info h3 { color: #fff; font-size: 1.02rem; font-weight: 700; }
.cat-cover-info small { color: rgba(255,255,255,.9); font-size: .78rem; }
/* روی دستگاه‌های لمسی (بدون هاور): هیچ پرده‌ای روی عکس نیست تا کامل دیده شود؛
   عنوان به‌صورت یک نوار تمیز زیر عکس نمایش داده می‌شود */
@media (hover: none) {
  .cat-card.cat-cover {
    aspect-ratio: auto;
    display: flex; flex-direction: column;
    background: var(--white); border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
  }
  .cat-card.cat-cover > img {
    position: static;
    aspect-ratio: 1 / 1; height: auto;
  }
  .cat-cover-info {
    position: static; inset: auto; opacity: 1;
    background: none;
    flex-direction: row; flex-wrap: wrap;
    align-items: baseline; justify-content: center;
    gap: 3px 6px; padding: 9px 8px 10px;
  }
  .cat-cover-info h3 { color: var(--leaf-900); font-size: .9rem; }
  .cat-cover-info small { color: var(--muted); }
}

/* ============================================================
   Flash sale — پیشنهاد شگفت‌انگیز (فروش ویژه روزانه)
   ============================================================ */
.flash-sale {
  position: relative;
  border-radius: var(--r-xl);
  padding: 22px 20px 24px;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.34), transparent 55%),
    linear-gradient(135deg, #f07aa2 0%, #f39ab7 48%, #f8c3d6 100%);
  box-shadow: 0 18px 44px rgba(233, 138, 172, .30);
  isolation: isolate;
}
/* درخشش نرم پس‌زمینه */
.flash-sale::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(60% 80% at 8% 120%, rgba(255,255,255,.16), transparent 60%);
  pointer-events: none;
}
.flash-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.flash-title { display: flex; align-items: center; gap: 12px; }
.flash-fire {
  font-size: 1.9rem; line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.22));
  animation: flashPulse 1.6s ease-in-out infinite;
}
@keyframes flashPulse { 0%,100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.14) rotate(3deg); } }
.flash-title h2 { color: #fff; font-size: 1.28rem; font-weight: 800; letter-spacing: -.01em; text-shadow: 0 1px 5px rgba(150, 50, 90, .28); }
.flash-sub { display: block; color: rgba(255,255,255,.9); font-size: .8rem; margin-top: 2px; }

/* لینک «مشاهده همه» در هدر سکشن */
.flash-all-top {
  margin-top: 0; padding: 7px 14px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px; backdrop-filter: blur(4px);
}
.flash-all-top:hover { background: rgba(255,255,255,.28); }

/* نوار افقی محصولات */
.flash-strip {
  display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; padding: 6px 2px 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.5) transparent;
}
.flash-strip::-webkit-scrollbar { height: 6px; }
.flash-strip::-webkit-scrollbar-thumb { background: rgba(255,255,255,.45); border-radius: 999px; }

.sale-card {
  scroll-snap-align: start;
  flex: 0 0 clamp(150px, 44%, 190px);
  background: var(--white); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: transform var(--t), box-shadow var(--t);
}
.sale-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.sale-media { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; }
.sale-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t); }
.sale-card:hover .sale-media img { transform: scale(1.06); }
.sale-badge {
  position: absolute; top: 8px; inset-inline-start: 8px;
  background: linear-gradient(135deg, #f76a92, #e35080);
  color: #fff; font-size: .72rem; font-weight: 800;
  padding: 3px 9px; border-radius: 999px;
  box-shadow: 0 4px 10px rgba(227,80,128,.35);
}
.sale-body { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.sale-name {
  font-size: .86rem; font-weight: 600; color: var(--leaf-900); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.4em;
}
.sale-prices { display: flex; flex-direction: column; gap: 1px; margin-top: auto; }
.sale-old { color: var(--muted); font-size: .74rem; text-decoration: line-through; }
.sale-now { color: var(--blush-dark); font-weight: 800; font-size: 1rem; }
.sale-now small { font-weight: 500; font-size: .68rem; color: var(--muted); }
.sale-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sale-add {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(135deg, #ff6e7f, #d67f7a); color: #fff;
  border: none; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 14px rgba(214,127,122,.4); transition: transform var(--t-fast);
}
.sale-add:hover { transform: scale(1.08); }
.sale-add svg { width: 18px; height: 18px; }

/* شمارنده‌ی اختصاصی هر محصول — جعبه‌های جدا برای روز/ساعت/دقیقه/ثانیه */
.sale-timer { display: flex; gap: 4px; width: 100%; direction: ltr; }
.sale-timer .stb {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 5px 2px 3px; border-radius: 10px;
  background: linear-gradient(150deg, #ffe6f0, #ffd4e4);
  border: 1px solid rgba(227, 80, 128, .22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 2px 6px rgba(227, 80, 128, .14);
}
.sale-timer .stb b {
  font-size: .95rem; font-weight: 800; color: #d63384; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.sale-timer .stb i { font-style: normal; font-size: .56rem; color: #b76e8a; margin-top: 1px; font-weight: 600; }
.sale-timer.ended { padding: 3px 0; justify-content: center; }
.sale-timer .st-end { font-size: .78rem; font-weight: 800; color: var(--muted); }
.sale-card.sale-ended { opacity: .6; }
.sale-card.sale-ended .sale-add { pointer-events: none; filter: grayscale(1); opacity: .7; }

/* انتخابگر شمسیِ «پایان تخفیف» در پنل ادمین */
.sale-end-picker {
  border: 1.5px solid var(--line); background: var(--cream);
  border-radius: var(--r-md); padding: 12px;
  display: flex; flex-direction: column; gap: 11px;
}
.sep-presets { display: flex; flex-wrap: wrap; gap: 7px; }
.sep-chip {
  padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; color: var(--sage-700); font-family: inherit;
  font-size: .82rem; font-weight: 700; cursor: pointer; transition: all var(--t-fast);
}
.sep-chip:hover { border-color: var(--sage-400); }
.sep-chip.active { background: var(--sage-500); border-color: var(--sage-500); color: #fff; }
.sep-chip.sep-clear { margin-inline-start: auto; color: var(--danger); }
.sep-chip.sep-clear.active { background: var(--danger); border-color: var(--danger); color: #fff; }
.sep-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sep-grid select {
  width: auto; flex: 0 0 auto; padding: 8px 9px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; font-family: inherit; font-size: .85rem;
}
.sep-grid .sep-sep { font-size: .8rem; color: var(--muted); margin-inline-start: 4px; }
.sep-grid .sep-colon { font-weight: 800; color: var(--muted); }
.sep-preview {
  font-size: .84rem; color: var(--muted); background: #fff;
  border: 1px dashed var(--line); border-radius: 10px; padding: 8px 11px; text-align: center;
}
.sep-preview.active { border-style: solid; border-color: var(--sage-300); color: var(--leaf-900); }
.sep-preview b { color: var(--blush-dark); font-weight: 800; }

.flash-all {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  color: #fff; font-weight: 700; font-size: .9rem; text-decoration: none;
  opacity: .95; transition: opacity var(--t-fast);
}
.flash-all:hover { opacity: 1; }
.flash-all svg { width: 16px; height: 16px; }

@media (max-width: 480px) {
  .flash-sale { padding: 18px 14px 20px; }
  .flash-title h2 { font-size: 1.12rem; }
  .flash-fire { font-size: 1.6rem; }
  .flash-all-top { padding: 6px 11px; font-size: .82rem; }
}

/* ============================================================
   Category admin cards
   ============================================================ */
.cat-admin-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 560px) { .cat-admin-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cat-admin-grid { grid-template-columns: repeat(3, 1fr); } }
.cat-admin-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.cat-admin-banner { aspect-ratio: 16 / 8; background: linear-gradient(135deg, var(--mint-100), var(--mint-200)); display: grid; place-items: center; overflow: hidden; }
.cat-admin-banner img { width: 100%; height: 100%; object-fit: cover; }
.cat-admin-emoji { font-size: 2.6rem; }
.cat-admin-body { padding: 14px; }
.cat-admin-body h4 { font-size: .98rem; color: var(--leaf-900); font-weight: 600; }

/* ============================================================
   PWA install banner
   ============================================================ */
.install-banner {
  position: fixed; z-index: 150; inset-inline: 12px;
  inset-block-end: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 12px 14px; display: flex; align-items: center; gap: 12px;
  transform: translateY(140%); opacity: 0; transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s;
  max-width: 460px; margin-inline: auto;
}
.install-banner.show { transform: translateY(0); opacity: 1; }
@media (min-width: 900px) { .install-banner { inset-inline: auto; inset-inline-end: 24px; inset-block-end: 24px; width: 380px; } }
.install-banner .ib-icon { width: 46px; height: 46px; border-radius: 12px; overflow: hidden; flex: 0 0 auto; box-shadow: var(--shadow-sm); }
.install-banner .ib-icon img { width: 100%; height: 100%; }
.install-banner .ib-text { flex: 1; min-width: 0; }
.install-banner .ib-text b { display: block; color: var(--leaf-900); font-size: .92rem; }
.install-banner .ib-text span { display: block; color: var(--muted); font-size: .76rem; line-height: 1.6; }
.install-banner .ib-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.install-banner .ib-close { width: 30px; height: 30px; border-radius: 50%; color: var(--muted); display: grid; place-items: center; font-size: .8rem; }
.install-banner .ib-close:hover { background: var(--mint-50); color: var(--ink); }

/* ---------- utility ---------- */
.text-muted { color: var(--muted); }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 14px; } .mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 14px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .gap-3 { gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ============================================================
   ساخت دسته گل (Builder) + انیمیشن‌ها
   ============================================================ */
/* بنر دعوت در صفحه اصلی */
.builder-cta {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  border-radius: var(--r-xl); padding: 18px 20px; overflow: hidden; position: relative;
  background: linear-gradient(120deg, #6ba680 0%, #548a67 55%, #40694f 100%);
  color: #fff; box-shadow: 0 14px 34px rgba(64,105,79,.32);
  margin-block: 6px 16px;
}
.builder-cta::after { content: ''; position: absolute; inset: 0; background: radial-gradient(90% 120% at 100% 0%, rgba(255,255,255,.22), transparent 55%); pointer-events: none; }
.builder-cta .bcta-emoji { font-size: 2.4rem; animation: ctaBob 2.4s ease-in-out infinite; }
@keyframes ctaBob { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }
.builder-cta .bcta-text { flex: 1; }
.builder-cta h3 { font-size: 1.12rem; font-weight: 800; }
.builder-cta p { font-size: .84rem; opacity: .92; margin-top: 2px; }
.builder-cta .bcta-arrow { transform: rotate(180deg); opacity: .85; }
.builder-cta .bcta-arrow svg { width: 22px; height: 22px; }

.builder-head { margin-bottom: 16px; }
.builder-head h2 { font-size: 1.4rem; color: var(--leaf-900); font-weight: 800; }
.builder-head p { color: var(--muted); font-size: .9rem; margin-top: 4px; }

.builder { display: grid; gap: 18px; }
@media (min-width: 900px) { .builder { grid-template-columns: 1fr 340px; align-items: start; } }

.builder-step { margin-bottom: 20px; }
.builder-step h3 { display: flex; align-items: center; gap: 8px; color: var(--leaf-900); font-size: 1.02rem; margin-bottom: 12px; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--sage-500); color: #fff; display: grid; place-items: center; font-size: .82rem; font-weight: 800; }

/* پایه‌ها */
.builder-bases { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.bld-base-card {
  position: relative; text-align: start; cursor: pointer; background: var(--white);
  border: 2px solid var(--line); border-radius: var(--r-lg); overflow: hidden; padding: 0;
  transition: border-color var(--t), transform var(--t-fast), box-shadow var(--t);
}
.bld-base-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.bld-base-card .bbc-media { aspect-ratio: 16/10; overflow: hidden; }
.bld-base-card .bbc-info { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.bld-base-card .bbc-info span { font-size: .86rem; font-weight: 600; color: var(--leaf-900); }
.bld-base-card .bbc-info b { font-size: .82rem; color: var(--sage-700); }
.bld-base-card .bbc-check { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--sage-500); color: #fff; display: grid; place-items: center; font-size: .9rem; opacity: 0; transform: scale(.4); transition: all var(--t); }
.bld-base-card.selected { border-color: var(--sage-500); }
.bld-base-card.selected .bbc-check { opacity: 1; transform: scale(1); }
.bld-base-card.pick { animation: pickPulse .4s ease; }
@keyframes pickPulse { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }

/* گل‌ها */
.builder-flowers { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.bld-flower-card {
  background: var(--white); border: 2px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  text-align: center; transition: border-color var(--t), box-shadow var(--t), transform var(--t-fast);
}
.bld-flower-card.active { border-color: var(--blush); box-shadow: 0 8px 20px rgba(233,167,162,.28); }
.bld-flower-card .bfc-media { position: relative; aspect-ratio: 1/1; overflow: hidden; }
.bld-flower-card .bfc-dot { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.bld-flower-card .bfc-name { font-size: .84rem; font-weight: 600; color: var(--leaf-900); margin-top: 8px; }
.bld-flower-card .bfc-price { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.bfc-qty { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 10px 12px; }
.qbtn { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--cream); color: var(--leaf-900); font-size: 1.1rem; font-weight: 700; cursor: pointer; display: grid; place-items: center; transition: all var(--t-fast); }
.qbtn:hover { border-color: var(--sage-400); }
.qbtn-add { background: var(--sage-500); color: #fff; border-color: var(--sage-500); }
.qbtn-add:hover { background: var(--sage-600); }
.bfc-qty [data-count] { min-width: 22px; font-weight: 800; color: var(--leaf-900); font-variant-numeric: tabular-nums; }
.bfc-qty [data-count].bump { animation: bump .3s ease; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.5); color: var(--sage-600); } 100% { transform: scale(1); } }

/* ورود انیمیشنی کارت‌ها */
/* حالتِ پایه همیشه visible است؛ انیمیشن فقط برای ورود است تا اگر اجرا نشد، کارت نامرئی نماند */
.builder-in { animation: builderIn .45s ease; }
@keyframes builderIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

/* پیش‌نمایش */
.builder-preview .bp-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-md); overflow: hidden; }
@media (min-width: 900px) { .builder-preview { position: sticky; top: calc(var(--announce-h) + var(--header-h) + 12px); } }
/* موبایل: پیش‌نمایش به‌صورت عادی بالای صفحه (بدون sticky تا روی کارت‌ها نیفتد) */
@media (max-width: 899px) { .builder-preview { order: -1; } .builder-preview #bpAdd, .builder-preview #bpReset { display: none; } }

/* نوارِ چسبانِ پایینِ صفحهٔ ساخت دسته‌گل (فقط موبایل) */
.bld-mobilebar { display: none; }
@media (max-width: 899px) {
  .bld-mobilebar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; inset-block-end: calc(var(--nav-h) + 8px); z-index: 45;
    margin-top: 14px; padding: 10px 12px;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px);
    border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: 0 10px 26px rgba(38, 56, 44, .18);
  }
  .bld-mobilebar .blm-info { display: flex; flex-direction: column; line-height: 1.15; flex: 0 0 auto; }
  .bld-mobilebar .blm-label { font-size: .66rem; color: var(--muted); }
  .bld-mobilebar #blmTotal { font-size: 1.05rem; font-weight: 800; color: var(--sage-700); font-variant-numeric: tabular-nums; }
  .bld-mobilebar #blmAdd { flex: 1; }
}
.bp-stage {
  position: relative; min-height: 160px; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(120% 120% at 50% 0%, var(--mint-50), var(--mint-100));
}
@media (max-width: 899px) { .bp-stage { min-height: 120px; } }
.bp-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: .82rem; }
.bp-empty { font-size: 2rem; }
.bp-empty span { font-size: .82rem; }
.bp-cluster { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; max-width: 240px; }
.bp-flower {
  width: 46px; height: 46px; border-radius: 50%; overflow: hidden; margin: -5px;
  border: 2px solid #fff; box-shadow: 0 3px 8px rgba(38,56,44,.18);
  transform: rotate(calc(var(--i) * 9deg - 18deg));
}
.bp-flower :is(img, svg) { width: 100%; height: 100%; object-fit: cover; }
.bp-flower.pop { animation: popIn .4s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes popIn { 0% { transform: scale(0) rotate(0); } 100% { transform: scale(1) rotate(calc(var(--i) * 9deg - 18deg)); } }

.bp-base-band { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--cream); font-size: .88rem; color: var(--leaf-900); font-weight: 600; }
.bp-base-band .bp-base-media { width: 40px; height: 40px; border-radius: 10px; overflow: hidden; flex: 0 0 auto; }
.bp-base-band .bp-base-media :is(img,svg) { width: 100%; height: 100%; object-fit: cover; }

.bp-summary { padding: 14px 16px; }
.bp-row { display: flex; align-items: center; justify-content: space-between; font-size: .9rem; margin-bottom: 8px; color: var(--ink); }
.bp-row.bp-total { font-size: 1rem; }
.bp-row.bp-total b { color: var(--sage-700); font-weight: 800; font-size: 1.1rem; }
.bp-row.bp-total b.flash { animation: totalFlash .35s ease; }
@keyframes totalFlash { 0% { transform: scale(1); } 50% { transform: scale(1.12); color: var(--blush-dark); } 100% { transform: scale(1); } }
#bpAdd { margin-top: 6px; }
#bpReset { margin-top: 8px; }

/* پرواز گل به سبد پیش‌نمایش */
.bld-fly { position: fixed; z-index: 500; border-radius: 50%; overflow: hidden; pointer-events: none; box-shadow: 0 6px 16px rgba(0,0,0,.3); transition: all .62s cubic-bezier(.5, 0, .3, 1); }
.bld-fly :is(img, svg) { width: 100%; height: 100%; object-fit: cover; }

/* گلبرگ‌های پخش‌شونده هنگام افزودن به سبد */
.bld-petal { position: fixed; z-index: 600; font-size: 1.2rem; pointer-events: none; animation: petalFly 1s ease-out forwards; }
@keyframes petalFly { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(200deg); opacity: 0; } }

/* ردیف آیتم در پنل ادمین */
.admin-row { display: flex; align-items: center; gap: 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 10px; }
.admin-row .ar-thumb { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; flex: 0 0 auto; }
.admin-row .ar-thumb :is(img, svg) { width: 100%; height: 100%; object-fit: cover; }
.admin-row .ar-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-row .ar-main b { color: var(--leaf-900); font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
  .builder-in, .bp-flower.pop, .bcta-emoji, .bld-petal { animation: none; opacity: 1; }
}
   ظهور نرم هنگام اسکرول (Reveal on scroll)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.22, .61, .36, 1),
              transform .7s cubic-bezier(.22, .61, .36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal.reveal-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   کیف پول (Wallet)
   ============================================================ */
.wallet-hero {
  background: linear-gradient(135deg, var(--sage-500), var(--sage-700));
  color: #fff;
  border-radius: var(--r-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-brand);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.wallet-hero::after {
  content: '🌿';
  position: absolute;
  inset-inline-end: -8px;
  bottom: -18px;
  font-size: 88px;
  opacity: .16;
  transform: rotate(-12deg);
}
.wallet-hero .wh-label { font-size: .82rem; opacity: .9; }
.wallet-hero .wh-balance { font-size: 2rem; font-weight: 800; margin-top: 4px; letter-spacing: -.5px; }
.wallet-hero .wh-actions { margin-top: 16px; position: relative; z-index: 1; }
.wallet-hero .wh-actions .btn {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  backdrop-filter: blur(4px);
}
.wallet-hero .wh-actions .btn:hover { background: rgba(255, 255, 255, .28); }

.wtxn-list { display: flex; flex-direction: column; }
.wtxn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
}
.wtxn:last-child { border-bottom: none; }
.wtxn-ic {
  width: 38px; height: 38px; flex: 0 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.1rem; font-weight: 700;
}
.wtxn-ic.in { background: var(--mint-100); color: var(--sage-600); }
.wtxn-ic.out { background: #fdeceb; color: var(--blush-dark); }
.wtxn-main { flex: 1; min-width: 0; }
.wtxn-main h5 { font-size: .9rem; color: var(--leaf-900); font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wtxn-main span { font-size: .74rem; color: var(--muted); }
.wtxn-amt { font-weight: 700; font-size: .95rem; white-space: nowrap; }
.wtxn-amt.in { color: var(--success); }
.wtxn-amt.out { color: var(--blush-dark); }

/* کارت کد معرف */
.referral-card {
  background: linear-gradient(135deg, #fff, var(--mint-50));
  border: 1px solid var(--mint-200);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.referral-card .ref-head h4 { color: var(--leaf-900); font-size: 1.05rem; margin-bottom: 6px; }
.referral-card .ref-head p { color: var(--sage-700); font-size: .84rem; line-height: 1.7; }
.ref-code {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 10px;
  background: #fff;
  border: 1.5px dashed var(--sage-400);
  border-radius: var(--r-md);
  padding: 8px 8px 8px 14px;
}
.ref-code code {
  flex: 1;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 2px;
  color: var(--sage-700);
  direction: ltr;
  text-align: center;
}
.ref-stats {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  font-size: .8rem; color: var(--muted);
}
.ref-stats b { color: var(--leaf-900); }

/* ============================================================
   کد تخفیف و کیف پول در تسویه‌حساب
   ============================================================ */
.promo-box {
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  margin-top: 4px;
}
.promo-input-row { display: flex; gap: 8px; }
.promo-input-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: .9rem;
  background: var(--cream);
}
.promo-input-row input:focus { outline: none; border-color: var(--sage-400); background: #fff; }
.promo-input-row .btn { flex: 0 0 auto; }
.promo-msg { font-size: .78rem; margin-top: 8px; min-height: 0; }
.promo-msg.ok { color: var(--success); }
.promo-msg.err { color: var(--danger); }

.summary-row.discount-row { color: var(--success); font-weight: 600; }
.summary-row.discount-row b { font-weight: 700; letter-spacing: .5px; }
.promo-remove {
  border: none; background: none; cursor: pointer;
  color: var(--danger); font-size: .8rem; padding: 0 2px; line-height: 1;
}

.wallet-toggle {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
  padding: 12px;
  background: var(--mint-50);
  border: 1px solid var(--mint-200);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: .88rem;
  color: var(--leaf-900);
}
.wallet-toggle input { width: 20px; height: 20px; accent-color: var(--sage-500); flex: 0 0 auto; }
.wallet-toggle .wt-text b { color: var(--sage-700); font-weight: 700; }
.summary-row.wallet-row { color: var(--sage-700); font-weight: 600; }

/* کد در جدول مدیریت تخفیف‌ها */
.dc-code {
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--sage-700);
  background: var(--mint-50);
  padding: 3px 8px;
  border-radius: 6px;
  direction: ltr;
  display: inline-block;
}

/* ============================================================
   فرم احراز هویت: نمایش/مخفی رمز، خطای فیلد، یادداشت هدیه
   ============================================================ */
.pw-wrap { position: relative; }
.pw-wrap input { padding-inline-end: 44px; }
.pw-toggle {
  position: absolute;
  inset-inline-end: 8px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: none; background: none; cursor: pointer;
  color: var(--muted);
  border-radius: 8px;
  transition: color var(--t-fast), background var(--t-fast);
}
.pw-toggle:hover { color: var(--sage-600); background: var(--mint-50); }
.pw-toggle.on { color: var(--sage-600); }
.pw-toggle svg { width: 20px; height: 20px; }

.field-err { color: var(--danger); min-height: 0; }
.field input.invalid { border-color: var(--danger); background: #fdf3f2; }

.wallet-gift-note {
  margin-top: 12px;
  background: var(--mint-50);
  border: 1px solid var(--mint-200);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: .82rem;
  color: var(--sage-700);
  line-height: 1.6;
}

/* ============================================================
   بنر اسلایدر صفحهٔ اصلی
   ============================================================ */
.hero-slider { position: relative; margin-bottom: 12px; }
/* کمی فاصله از هدرِ چسبان روی دسکتاپ تا بنر زیر هدر نرود */
@media (min-width: 900px) { .hero-slider { margin-top: 14px; } }
.hs-viewport {
  display: flex; gap: 0;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.hs-viewport::-webkit-scrollbar { display: none; }
.hs-slide {
  flex: 0 0 100%;           /* یک بنر در هر نما */
  scroll-snap-align: center;
  aspect-ratio: 16 / 9;
  background: var(--mint-100);
  overflow: hidden;
  display: block;
}
.hs-slide img, .hs-slide svg { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 700px) { .hs-slide { aspect-ratio: 3 / 1; } }

/* دکمه‌های قبلی/بعدیِ شیشه‌ای */
.hs-arrow {
  position: absolute; inset-block-start: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; z-index: 3;
  display: grid; place-items: center; cursor: pointer;
  color: var(--leaf-900);
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(8px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: var(--shadow-sm);
  transition: background var(--t-fast), transform var(--t-fast);
}
.hs-arrow:hover { background: #fff; }
.hs-arrow:active { transform: translateY(-50%) scale(.92); }
.hs-arrow svg { width: 20px; height: 20px; }
.hs-prev { right: 10px; }   /* بازگشت — سمت راست */
.hs-next { left: 10px; }    /* بعدی — سمت چپ */
@media (max-width: 480px) { .hs-arrow { width: 34px; height: 34px; } .hs-arrow svg { width: 17px; height: 17px; } }

.hs-dots { display: flex; justify-content: center; gap: 7px; margin-top: 11px; }
.hs-dot {
  width: 8px; height: 8px; padding: 0;
  border: none; border-radius: 50%;
  background: var(--mint-200); cursor: pointer;
  transition: width var(--t), background var(--t), border-radius var(--t);
}
.hs-dot.active { background: var(--sage-500); width: 24px; border-radius: 99px; }

/* ============================================================
   روزهای بستهٔ ارسال (تسویه‌حساب + پنل تنظیمات)
   ============================================================ */
.day-chip.closed {
  background: #fdf3f2; border-color: var(--danger);
  opacity: 1; cursor: not-allowed;
}
.day-chip.closed:hover { border-color: var(--danger); }
.day-chip.closed .dc-week { color: var(--danger); }
.day-chip.closed .dc-date { color: var(--blush-dark); }
.day-chip.closed .dc-closed {
  font-size: .62rem; color: #fff; background: var(--danger);
  padding: 1px 7px; border-radius: 99px; margin-top: 2px; font-weight: 600;
}

.weekday-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 560px) { .weekday-grid { grid-template-columns: repeat(4, 1fr); } }
.wd-chip {
  padding: 12px 8px; border-radius: var(--r-md);
  border: 1.5px solid var(--line); background: var(--white);
  font-size: .9rem; font-weight: 600; color: var(--sage-700);
  cursor: pointer; transition: all var(--t-fast);
}
.wd-chip:hover { border-color: var(--sage-300); }
.wd-chip.closed {
  background: #fdeceb; border-color: var(--danger); color: var(--danger);
}
.wd-chip.closed::after { content: ' • بسته'; font-size: .7rem; }

/* ============================================================
   تقویم شمسیِ روزهای بستهٔ ارسال (پنل مدیریت)
   ============================================================ */
.jcal {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
  background: var(--cream);
}
.jc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.jc-title { font-weight: 700; color: var(--leaf-900); font-size: .98rem; }
.jc-nav {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--white);
  color: var(--sage-700); font-size: 1.2rem; line-height: 1; cursor: pointer;
  transition: all var(--t-fast);
}
.jc-nav:hover { background: var(--mint-100); border-color: var(--sage-300); }
.jc-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.jc-week span { text-align: center; font-size: .74rem; font-weight: 600; color: var(--muted); }
.jc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.jc-cell {
  aspect-ratio: 1; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 10px;
  background: var(--white); color: var(--ink);
  font-size: .86rem; font-weight: 600; cursor: pointer;
  transition: all var(--t-fast);
}
.jc-cell.empty { background: transparent; cursor: default; }
.jc-cell:not(.empty):not(.past):hover { border-color: var(--sage-300); }
.jc-cell.past { color: var(--muted); opacity: .38; cursor: not-allowed; background: transparent; }
.jc-cell.closed { background: var(--danger); color: #fff; border-color: var(--danger); box-shadow: var(--shadow-sm); }

.closed-dates-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cdl-title { flex: 1 0 100%; font-size: .82rem; font-weight: 600; color: var(--sage-700); margin-bottom: 2px; }
.closed-date-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fdeceb; color: var(--danger);
  border: 1px solid var(--danger); border-radius: var(--r-pill);
  padding: 4px 6px 4px 12px; font-size: .8rem; font-weight: 600;
}
.closed-date-chip button {
  border: none; background: rgba(217, 83, 79, .18); color: var(--danger);
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  font-size: .7rem; line-height: 1; display: grid; place-items: center;
}

/* ============================================================
   سکشن «تازه‌ترین‌ها» در صفحهٔ اصلی
   ============================================================ */
.latest-sec .section-head { margin-bottom: 2px; }
.latest-sub { color: var(--muted); font-size: .86rem; margin-bottom: 14px; }

/* یک ردیف افقیِ قابل‌اسکرول از تازه‌ترین محصولات (با کشیدن ماوس هم اسکرول می‌شود) */
.latest-row {
  display: flex; gap: 12px;
  overflow-x: auto; overflow-y: hidden;   /* فقط اسکرول افقی؛ جلوگیری از اسکرول عمودیِ ناخواسته */
  scroll-snap-type: x proximity;
  scrollbar-width: none; padding: 8px 0 10px;
  cursor: grab;
}
.latest-row::-webkit-scrollbar { display: none; }
.latest-row.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; user-select: none; }
.latest-row.dragging a, .latest-row.dragging img, .latest-row.dragging svg { pointer-events: none; }
.latest-row a, .latest-row img { -webkit-user-drag: none; user-select: none; }
    .latest-row .product-card {
        flex: 0 0 clamp(150px, 44vw, 190px);
        scroll-snap-align: start;
        transition: transform .35s cubic-bezier(.22, .61, .36, 1), box-shadow .35s ease;
        border-radius: var(--r-lg);
    }
@media (min-width: 600px) { .latest-row .product-card { flex-basis: 210px; } }
/* ستاره‌های امتیاز در سکشن «تازه‌ترین‌ها» نمایش داده نشوند */
.latest-row .card-rating { display: none; }
.latest-row .product-card:hover { transform: translateY(-6px); }
.latest-row .product-media { overflow: hidden; }
.latest-row .product-media img, .latest-row .product-media svg { transition: transform .55s cubic-bezier(.22, .61, .36, 1); }
.latest-row .product-card:hover .product-media img,
.latest-row .product-card:hover .product-media svg { transform: scale(1.07); }
@media (prefers-reduced-motion: reduce) {
  .latest-row .product-media img, .latest-row .product-media svg { transition: none; }
}

/* ============================================================
   فوتر سایت
   ============================================================ */
.site-footer {
  background: var(--leaf-900);
  color: rgba(255, 255, 255, .82);
  margin-top: 30px;
  padding: 34px 0 calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { .site-footer { padding-bottom: 30px; } }
.footer-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px 16px;
  padding-bottom: 22px; border-bottom: 1px solid rgba(255, 255, 255, .12);
}
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.4fr; } }
.footer-brand { grid-column: 1 / -1; }
@media (min-width: 720px) { .footer-brand { grid-column: auto; } }
.footer-logo { display: inline-flex; align-items: center; gap: 6px; font-size: 1.3rem; font-weight: 800; color: #fff; margin-bottom: 10px; text-decoration: none; }
.footer-brand p { font-size: .84rem; line-height: 1.95; color: rgba(255, 255, 255, .7); max-width: 340px; }
.footer-col h4 { color: #fff; font-size: .95rem; margin-bottom: 10px; font-weight: 700; }
.footer-col a, .footer-contact span { display: block; color: rgba(255, 255, 255, .72); font-size: .86rem; padding: 5px 0; text-decoration: none; transition: color var(--t-fast); }
.footer-col a:hover { color: #fff; }

/* آیکون‌های شبکه‌های اجتماعی/تماس با بوردرِ رنگِ اختصاصی هرکدام */
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a {
  width: 42px; height: 42px; padding: 0; border-radius: var(--r-pill);
  display: grid; place-items: center; background: transparent;
  border: 1.6px solid currentColor;
  transition: transform var(--t-fast), background var(--t), color var(--t), border-color var(--t);
}
.footer-social a svg { width: 19px; height: 19px; }
.footer-social a:hover { transform: translateY(-3px); color: #fff; }
.fs-insta { color: #ff6aa0; }
.fs-insta:hover { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); border-color: transparent; }
.fs-wa { color: #3ddc7f; }
.fs-wa:hover { background: #25d366; border-color: #25d366; }
.fs-call { color: #8fd0a5; }
.fs-call:hover { background: var(--sage-500); border-color: var(--sage-500); }
.fs-mail { color: #e8c880; }
.fs-mail:hover { background: var(--gold); border-color: var(--gold); }

.footer-seo { padding: 18px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.footer-seo h2 { font-size: .96rem; color: rgba(255, 255, 255, .9); margin-bottom: 8px; }
.footer-seo p { font-size: .8rem; line-height: 2.1; color: rgba(255, 255, 255, .58); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; padding: 15px 0; font-size: .78rem; color: rgba(255, 255, 255, .6); }

/* ============================================================
   صفحات اطلاعاتی (درباره، قوانین، سوالات، تماس)
   ============================================================ */
.info-page { padding-top: 14px; max-width: 780px; margin-inline: auto; }
.info-hero { text-align: center; padding: 18px 0 22px; }
.info-hero-emoji { font-size: 2.6rem; margin-bottom: 8px; }
.info-hero h1 { font-size: 1.55rem; color: var(--leaf-900); font-weight: 800; margin-bottom: 6px; }
.info-hero p { color: var(--muted); font-size: .92rem; }
.info-card p { line-height: 2; color: var(--ink); margin-bottom: 10px; }
.info-card p:last-child { margin-bottom: 0; }
.info-values { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 16px 0; }
@media (min-width: 600px) { .info-values { grid-template-columns: repeat(3, 1fr); } }
.value-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; text-align: center; box-shadow: var(--shadow-sm); }
.value-card .vc-ic { font-size: 1.9rem; margin-bottom: 8px; }
.value-card h4 { color: var(--leaf-900); margin-bottom: 6px; }
.value-card p { font-size: .82rem; color: var(--muted); line-height: 1.8; }
.info-cta { text-align: center; margin-top: 16px; }
.info-cta h3 { color: var(--leaf-900); margin-bottom: 4px; }

.terms-list { display: flex; flex-direction: column; gap: 12px; }
.terms-item .ti-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.terms-item .ti-ic { font-size: 1.3rem; }
.terms-item h3 { color: var(--leaf-900); font-size: 1.02rem; }
.terms-item p { color: var(--ink); line-height: 2; font-size: .9rem; }

.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px; background: none; border: none; cursor: pointer; font-family: inherit; font-size: .94rem; font-weight: 600; color: var(--leaf-900); text-align: start; }
.faq-toggle { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: var(--mint-100); color: var(--sage-600); display: grid; place-items: center; font-size: 1.1rem; transition: transform var(--t); }
.faq-item.open .faq-toggle { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.faq-item.open .faq-a { max-height: 340px; }
.faq-a p { padding: 0 15px 15px; color: var(--muted); line-height: 1.9; font-size: .87rem; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.contact-item { text-align: center; text-decoration: none; padding: 18px 12px; }
.contact-item .ci-ic { font-size: 1.7rem; margin-bottom: 6px; }
.contact-item h4 { color: var(--leaf-900); font-size: .92rem; margin-bottom: 4px; }
.contact-item span { color: var(--sage-700); font-size: .84rem; }

/* فوتر: بخش سئوی جمع‌شوندهٔ (details) */
.footer-seo summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.footer-seo summary::-webkit-details-marker { display: none; }
.footer-seo summary h2 { margin: 0; }
.footer-seo summary::after {
  content: 'بیشتر بخوانید ▾';
  flex: 0 0 auto; font-size: .76rem; font-weight: 600; color: var(--sage-300); white-space: nowrap;
}
.footer-seo[open] summary::after { content: 'بستن ▴'; }
.footer-seo .seo-body { padding-top: 12px; }
.footer-seo .seo-body p { font-size: .8rem; line-height: 2.1; color: rgba(255, 255, 255, .58); margin-bottom: 10px; }
.footer-seo .seo-body p:last-child { margin-bottom: 0; }

/* اسکرول با کشیدنِ ماوس روی نوار «شگفت‌انگیز» */
.flash-strip { cursor: grab; }
.flash-strip.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; user-select: none; }
.flash-strip.dragging a, .flash-strip.dragging img, .flash-strip.dragging svg { pointer-events: none; }
.flash-strip a, .flash-strip img { -webkit-user-drag: none; user-select: none; }

/* ============================================================
   سوییچ آی‌اواس‌مانند + انتخابگر تاریخ شمسی (پنل‌ها)
   ============================================================ */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 4px; }
.switch-label { font-size: .9rem; font-weight: 600; color: var(--sage-700); }
.ios-switch { position: relative; display: inline-block; width: 50px; height: 30px; flex: 0 0 auto; }
.ios-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.ios-switch .ios-slider { position: absolute; inset: 0; background: #d3dcd6; border-radius: 999px; cursor: pointer; transition: background .25s ease; }
.ios-switch .ios-slider::before {
  content: ''; position: absolute; width: 26px; height: 26px;
  inset-block-start: 2px; inset-inline-start: 2px;
  background: #fff; border-radius: 50%; box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}
.ios-switch input:checked + .ios-slider { background: var(--sage-500); }
.ios-switch input:checked + .ios-slider::before { transform: translateX(-20px); }
.ref-input-wrap { margin-top: 6px; }

.jdt-enable { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--sage-700); cursor: pointer; margin-bottom: 8px; }
.jdt-enable input { width: auto; }
.jdt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.jdt-row select { width: auto; padding: 8px 6px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--cream); font-family: inherit; font-size: .85rem; }
.jdt-sep { font-size: .82rem; color: var(--muted); margin-inline-start: 4px; }
.jdt-colon { color: var(--muted); }

/* یادداشتِ فصلی‌بودن روی کارت جزئیات محصول */
.product-note {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 16px; padding: 12px 14px;
  background: var(--mint-50); border: 1px solid var(--mint-200);
  border-radius: var(--r-md);
}
.product-note .pn-ic { font-size: 1.1rem; flex: 0 0 auto; margin-top: 1px; }
.product-note p { font-size: .82rem; line-height: 1.95; color: var(--sage-700); margin: 0; }

/* ============================================================
   لوگوی برند (هدر، فوتر، صفحات ورود/ثبت‌نام)
   ============================================================ */
.brand .logo svg { width: 20px; height: 20px; }
.footer-logo-img { height: 40px; width: auto; display: block; filter: brightness(0) invert(1); opacity: .95; }
.auth-logo { height: 58px; width: auto; display: block; margin: 0 auto 14px; }

/* ============================================================
   ارتقای تجربه: میکرو-انیمیشن، Quick-view، مناسبت، کارت هدیه
   ============================================================ */

/* حرکتِ نرم‌ترِ بین صفحات */
.page-enter { animation: pageIn .42s cubic-bezier(.22,.61,.36,1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px) scale(.995); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page-enter { animation: none; } }

/* افکت موجی دکمه‌ها */
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.5); transform: scale(0); animation: rippleAnim .6s ease-out; pointer-events: none; }
@keyframes rippleAnim { to { transform: scale(2.4); opacity: 0; } }
.btn-outline .ripple, .btn-ghost .ripple, .qv-btn .ripple { background: rgba(107,166,128,.25); }

/* پرواز محصول به سبد */
.cart-fly { position: fixed; z-index: 400; border-radius: 14px; overflow: hidden; pointer-events: none;
  box-shadow: 0 10px 26px rgba(38,56,44,.28);
  transition: left .68s cubic-bezier(.5,-0.2,.5,1), top .68s cubic-bezier(.5,-0.2,.5,1), width .68s ease, height .68s ease, opacity .68s ease, transform .68s ease; }
.cart-fly img, .cart-fly svg { width: 100%; height: 100%; object-fit: cover; }
.cart-bump { animation: cartBump .5s cubic-bezier(.34,1.5,.55,1); }
@keyframes cartBump { 0%{transform:scale(1)} 35%{transform:scale(1.28)} 60%{transform:scale(.92)} 100%{transform:scale(1)} }

/* پرشِ قلب علاقه‌مندی */
.fav-pop { animation: favPop .45s cubic-bezier(.34,1.6,.55,1); }
@keyframes favPop { 0%{transform:scale(1)} 30%{transform:scale(1.35)} 55%{transform:scale(.9)} 100%{transform:scale(1)} }

/* لایهٔ عکسِ دومِ کارت روی hover + دکمهٔ نمایش سریع */
.product-media .pm-alt { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; }
.product-media .pm-alt img, .product-media .pm-alt svg { width:100%; height:100%; object-fit: cover; }
.product-card:hover .product-media .pm-alt { opacity: 1; }
.qv-btn { position: absolute; inset-block-end: 10px; inset-inline-start: 10px; z-index: 3;
  width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.92); color: var(--leaf-900);
  display: grid; place-items: center; border: none; cursor: pointer; box-shadow: 0 2px 8px rgba(38,56,44,.14);
  opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s, background .2s; overflow: hidden; }
.qv-btn svg { width: 19px; height: 19px; }
.product-card:hover .qv-btn, .qv-btn:focus-visible { opacity: 1; transform: none; }
.qv-btn:hover { background: #fff; color: var(--sage-600); }
@media (hover: none) { .qv-btn { opacity: 1; transform: none; } }

/* پنجرهٔ نمایش سریع محصول */
.modal-back .modal:has(.qv) { padding: 0; max-width: 720px; overflow: hidden; }
.qv { display: grid; grid-template-columns: 1fr; position: relative; }
@media (min-width: 620px) { .qv { grid-template-columns: 1fr 1fr; } }
.qv-x { position: absolute; inset-block-start: 10px; inset-inline-end: 12px; z-index: 5; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(255,255,255,.92); color: var(--leaf-900); cursor: pointer; font-size: 1rem; box-shadow: var(--shadow-sm); }
.qv-gallery { background: linear-gradient(165deg,#f7f6f3,#ebe9e4); padding: 14px; }
.qv-media { position: relative; aspect-ratio: 1/1; border-radius: 16px; overflow: hidden; background: var(--mint-50); }
.qv-media img, .qv-media svg { width:100%; height:100%; object-fit: cover; }
.qv-thumbs { display: flex; gap: 8px; margin-top: 10px; }
.qv-thumb { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--mint-50); padding: 0; cursor: pointer; }
.qv-thumb.active { border-color: var(--sage-500); }
.qv-thumb img, .qv-thumb svg { width:100%; height:100%; object-fit: cover; }
.qv-body { padding: 22px 22px 24px; display: flex; flex-direction: column; }
.qv-cat { font-size: .74rem; color: var(--sage-500); font-weight: 600; }
.qv-name { font-size: 1.2rem; color: var(--leaf-900); font-weight: 700; margin: 4px 0 10px; }
.qv-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.qv-price .now { font-size: 1.3rem; font-weight: 800; color: var(--leaf-900); }
.qv-price .old { font-size: .9rem; color: var(--muted); text-decoration: line-through; }
.qv-desc { font-size: .86rem; line-height: 1.9; color: var(--sage-700); margin-bottom: 16px;
  display:-webkit-box; -webkit-line-clamp:5; line-clamp:5; -webkit-box-orient:vertical; overflow:hidden; }
.qv-actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.qv-actions-row { display: flex; gap: 10px; align-items: stretch; }
.qv-fav { flex: 0 0 auto; width: 46px; display: grid; place-items: center; padding: 0; color: var(--muted); border: 1.5px solid var(--line); }
.qv-fav.is-fav { color: var(--blush-dark); border-color: var(--blush); background: #fdf1f0; }
.qv-fav svg { width: 20px; height: 20px; }

/* بخش «برای چه مناسبتی؟» */
.occasion-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
@media (min-width: 620px) { .occasion-grid { grid-template-columns: repeat(6, minmax(0,1fr)); } }
.occasion-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t); }
.occasion-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--sage-300); }
.occasion-emoji { font-size: 1.8rem; transition: transform var(--t); }
.occasion-card:hover .occasion-emoji { transform: scale(1.18) rotate(-6deg); }
.occasion-card span { font-size: .82rem; font-weight: 600; color: var(--leaf-900); }

/* کارت پیام هدیه در تسویه‌حساب */
.gift-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0; }
.gift-toggle .gt-label { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--leaf-900); font-size: .92rem; }
.gift-card-wrap { overflow: hidden; max-height: 0; opacity: 0; transition: max-height .4s ease, opacity .3s ease, margin .3s ease; }
.gift-card-wrap.open { max-height: 460px; opacity: 1; margin-top: 12px; }
.gift-card { background: linear-gradient(160deg,#fffdf7,#fdf3f0); border: 1px dashed var(--blush); border-radius: var(--r-lg); padding: 16px 14px 14px; position: relative; }
.gift-card::before { content: "🎁"; position: absolute; inset-block-start: -13px; inset-inline-start: 14px; font-size: 1.25rem; background: var(--white); border-radius: 50%; padding: 0 4px; }
.gift-card textarea { width: 100%; min-height: 74px; border: none; background: transparent; resize: vertical; font-family: inherit; color: var(--leaf-900); outline: none; line-height: 1.9; }
.gift-card .gc-from { display: flex; gap: 8px; margin-top: 8px; }
.gift-card .gc-from input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--white); outline: none; font-family: inherit; }
.gift-hint { font-size: .74rem; color: var(--muted); margin-top: 8px; }

/* پیوندِ شفافِ روی تصویر کارت برای ناوبری (تا دکمه‌ها روی آن کلیک‌پذیر بمانند) */
.product-media .pm-link { position: absolute; inset: 0; z-index: 1; }

/* نوار اعلان ارسال رایگان (ثابت، بالای هدر) */
.announce-bar {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 101;
  height: var(--announce-h);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(90deg, var(--sage-600), var(--sage-500));
  color: #fff; font-size: .78rem; font-weight: 600; letter-spacing: .1px;
  padding: 0 14px; text-align: center; line-height: 1.3; white-space: nowrap;
}
.announce-bar b { font-weight: 800; }
.announce-truck { display: inline-block; animation: truckBob 2.4s ease-in-out infinite; }
@keyframes truckBob { 0%,100% { transform: translateX(0); } 50% { transform: translateX(-5px); } }
@media (prefers-reduced-motion: reduce) { .announce-truck { animation: none; } }

/* نمایش «رایگان» در خلاصهٔ پرداخت */
.ship-free { color: var(--sage-600); font-weight: 700; }

/* ============================================================
   برچسب‌ها (تگ) و صفحهٔ نتایج برچسب
   ============================================================ */
.tag-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 5px 12px; border-radius: var(--r-pill);
  background: var(--mint-100); color: var(--sage-700);
  font-size: .8rem; font-weight: 600; text-decoration: none;
  border: 1px solid transparent;
  transition: background var(--t), color var(--t), transform var(--t-fast), border-color var(--t);
}
.tag-chip:hover { background: var(--sage-500); color: #fff; transform: translateY(-2px); }
.tag-chip:active { transform: scale(.94); }

/* تگ‌ها داخل لایت‌باکس گالری (زمینهٔ تیره) */
.lb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lb-tags .tag-chip {
  background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.28);
  backdrop-filter: blur(4px);
}
.lb-tags .tag-chip:hover { background: #fff; color: var(--leaf-900); }

.tagpage-head { margin-bottom: 18px; }
.tagpage-title { font-size: 1.6rem; color: var(--leaf-900); font-weight: 800; margin: 10px 0 4px; }
.tagpage-title .tp-hash { color: var(--sage-500); }
.tag-sec-title { font-size: 1.05rem; color: var(--leaf-900); font-weight: 700; margin-bottom: 12px; }
.tag-gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
@media (min-width: 620px) { .tag-gallery-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.tag-gallery-item { position: relative; display: block; aspect-ratio: 1/1; border-radius: var(--r-lg); overflow: hidden; background: var(--mint-50); box-shadow: 0 4px 14px rgba(38,56,44,.06); }
.tag-gallery-item img, .tag-gallery-item svg { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.tag-gallery-item:hover img, .tag-gallery-item:hover svg { transform: scale(1.06); }
.tag-gallery-item .tgi-cap { position: absolute; inset-inline: 0; inset-block-end: 0; padding: 16px 10px 8px; font-size: .76rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.62)); }
.tag-gallery-item .tgi-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.5rem; text-shadow: 0 2px 8px rgba(0,0,0,.45); pointer-events: none; }

/* ردیف‌های مدیریت مناسبت (پنل ادمین) */
.occ-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 8px; }
.occ-row input { padding: 8px 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--cream); outline: none; font-family: inherit; min-width: 0; }
.occ-row .occ-thumb { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 10px; border: 1px dashed var(--line); background-color: var(--cream); background-size: cover; background-position: center; cursor: pointer; display: grid; place-items: center; font-size: 1.05rem; color: var(--muted); overflow: hidden; }
.occ-row .occ-emoji { width: 52px; flex: 0 0 auto; text-align: center; }
.occ-row .occ-label, .occ-row .occ-tag { flex: 1 1 110px; }
.occ-row .occ-rm { flex: 0 0 auto; margin-inline-start: auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--danger); cursor: pointer; font-size: .9rem; }
.occ-row .occ-rm:hover { background: #fdeceb; }

/* کارت مناسبت با عکسِ پس‌زمینه (صفحهٔ اصلی) */
.occasion-card.has-img { position: relative; min-height: 96px; padding: 0; border: none; overflow: hidden; background-size: cover; background-position: center; justify-content: flex-end; align-items: stretch; }
.occasion-card.has-img::before { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(0,0,0,.55)); }
.occasion-card.has-img > span { position: relative; z-index: 1; color: #fff; padding: 8px; text-align: center; text-shadow: 0 1px 4px rgba(0,0,0,.4); }

/* بریکداونِ آیتم‌های دسته‌گل در پیش‌نمایش */
.bp-lines { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.bp-lines:empty { display: none; }
.bp-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: .82rem; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.bp-line:last-child { border-bottom: none; padding-bottom: 0; }
.bp-line > span { color: var(--sage-700); }
.bp-line > span em { color: var(--muted); font-style: normal; font-weight: 700; }
.bp-line b { color: var(--leaf-900); font-weight: 700; white-space: nowrap; }

/* آکاردئونِ تنظیمات (پیش‌فرض بسته؛ با کلیک باز می‌شود) */
.settings-acc { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 12px; overflow: hidden; }
.settings-acc > summary {
  list-style: none; cursor: pointer; padding: 15px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 1rem; font-weight: 700; color: var(--leaf-900); user-select: none;
}
.settings-acc > summary::-webkit-details-marker { display: none; }
.settings-acc > summary::after { content: '⌄'; font-size: 1.2rem; color: var(--muted); transition: transform var(--t); }
.settings-acc[open] > summary::after { transform: rotate(180deg); }
.settings-acc > summary:hover { background: var(--mint-50); }
.settings-acc .acc-body { padding: 4px 16px 18px; }
.settings-acc .acc-body h4 { font-size: .9rem; color: var(--leaf-900); font-weight: 700; margin: 8px 0; }

/* بنرِ ریسپانسیو با <picture> (تصویر موبایل/دسکتاپ جدا) */
.hs-slide picture { display: block; width: 100%; height: 100%; }

/* ============================================================
   مرحلهٔ «ارسال رسید پرداخت» (کارت‌به‌کارت)
   ============================================================ */

/* ---------- نشان وضعیت پرداخت ---------- */
.pay-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--r-pill);
  font-size: .76rem; font-weight: 600; white-space: nowrap;
}
.pay-1 { background: #eef4ff; color: #3b6bc4; }
.pay-2 { background: #fff5e6; color: #b8860b; }
.pay-3 { background: #e3f5e8; color: var(--success); }
.pay-4 { background: #fdeceb; color: var(--danger); }

/* ---------- بنر وضعیت ---------- */
.pay-status {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--white);
  box-shadow: var(--shadow-sm); margin-bottom: 14px;
}
.pay-status .ps-ic {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.4rem; background: var(--mint-100);
}
.pay-status .ps-text h3 { font-size: 1.02rem; color: var(--leaf-900); font-weight: 700; margin-bottom: 3px; }
.pay-status .ps-text p { font-size: .86rem; color: var(--muted); line-height: 1.8; }
.pay-status.ps-1 { background: linear-gradient(135deg, #f4f8ff, var(--white)); border-color: #dbe6fb; }
.pay-status.ps-1 .ps-ic { background: #e7efff; }
.pay-status.ps-2 { background: linear-gradient(135deg, #fffaf0, var(--white)); border-color: #f2e3c4; }
.pay-status.ps-2 .ps-ic { background: #fdf1d8; }
.pay-status.ps-3 { background: linear-gradient(135deg, var(--mint-50), var(--white)); border-color: var(--mint-200); }
.pay-status.ps-4 { background: linear-gradient(135deg, #fdf4f3, var(--white)); border-color: #f3d6d4; }
.pay-status.ps-4 .ps-ic { background: #fdeceb; }

/* ---------- مبلغ قابل پرداخت ---------- */
.pay-amount-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--white); border: 1.5px dashed var(--sage-400); border-radius: var(--r-lg);
  padding: 14px 18px; margin-bottom: 16px;
}
.pay-amount-box > span { font-size: .85rem; color: var(--muted); }
.pay-amount-box > b { font-size: 1.25rem; font-weight: 800; color: var(--sage-700); letter-spacing: -.3px; }

/* ---------- کارت بانکی ---------- */
.bank-cards {
  display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.bank-cards::-webkit-scrollbar { display: none; }
@media (min-width: 760px) {
  .bank-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); overflow: visible; }
}

.bank-card {
  position: relative; flex: 0 0 auto; width: min(340px, 86vw); scroll-snap-align: center;
  aspect-ratio: 1.586 / 1; padding: 18px; border-radius: 20px; color: #fff; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, #4f8c68, #26382c);
  box-shadow: 0 12px 28px rgba(38, 56, 44, .28);
  transition: transform var(--t), box-shadow var(--t); cursor: pointer;
  text-align: start; user-select: none;
}
@media (min-width: 760px) { .bank-card { width: auto; } }
.bank-card:hover { transform: translateY(-3px); box-shadow: 0 18px 36px rgba(38, 56, 44, .32); }
.bank-card::after {
  content: ''; position: absolute; inset-inline-end: -30%; inset-block-start: -60%;
  width: 90%; height: 200%; background: rgba(255, 255, 255, .10);
  transform: rotate(24deg); pointer-events: none;
}
.bank-card .bc-glow {
  position: absolute; inset-inline-start: -20%; inset-block-end: -70%;
  width: 70%; height: 160%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 65%);
  pointer-events: none;
}
.bank-card .bc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 1; }
.bank-card .bc-bank { font-weight: 700; font-size: .95rem; text-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.bank-card .bc-tick {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .45);
  font-size: .8rem; opacity: 0; transform: scale(.6); transition: all var(--t);
}
.bank-card.is-selected { outline: 3px solid var(--sage-400); outline-offset: 3px; }
.bank-card.is-selected .bc-tick { opacity: 1; transform: scale(1); }
.bank-card .bc-chip {
  position: relative; z-index: 1; width: 44px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #f7e3a1, #d8b46a 55%, #b8933f);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.bank-card .bc-chip::before,
.bank-card .bc-chip::after {
  content: ''; position: absolute; inset-inline: 6px; height: 1px; background: rgba(0, 0, 0, .18);
}
.bank-card .bc-chip::before { top: 11px; }
.bank-card .bc-chip::after { top: 20px; }
.bank-card .bc-number-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 1; }
.bank-card .bc-number {
  font-size: clamp(1.02rem, 4.4vw, 1.24rem); font-weight: 700; letter-spacing: 2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .25); white-space: nowrap;
}
.bank-card .bc-copy, .bank-card .bc-sheba {
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .38); color: #fff;
  border-radius: var(--r-pill); padding: 4px 12px; font-size: .74rem; font-weight: 600;
  backdrop-filter: blur(4px); transition: background var(--t-fast); white-space: nowrap;
}
.bank-card .bc-copy:hover, .bank-card .bc-sheba:hover { background: rgba(255, 255, 255, .32); }
.bank-card .bc-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.bank-card .bc-holder { display: flex; flex-direction: column; min-width: 0; }
.bank-card .bc-holder span { font-size: .66rem; opacity: .75; }
.bank-card .bc-holder b { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bank-card.is-preview { cursor: default; box-shadow: var(--shadow-md); }
.bank-card.is-preview:hover { transform: none; }
.bank-card.is-preview .bc-sheba { font-size: .68rem; letter-spacing: .5px; }

/* رنگ‌بندی کارت‌ها */
.bc-green  { background: linear-gradient(135deg, #5fa47c, #26382c); }
.bc-blue   { background: linear-gradient(135deg, #4f86c6, #1b3a5c); }
.bc-purple { background: linear-gradient(135deg, #8c6bc8, #35235e); }
.bc-gold   { background: linear-gradient(135deg, #d8b46a, #7a5a1e); }
.bc-dark   { background: linear-gradient(135deg, #4a5350, #1c211f); }
.bc-rose   { background: linear-gradient(135deg, #e08c9a, #7d2f43); }

.pay-hint { font-size: .8rem; color: var(--muted); line-height: 1.9; }
.pay-note {
  background: var(--mint-50); border: 1px dashed var(--sage-300); border-radius: var(--r-md);
  padding: 12px 14px; font-size: .84rem; color: var(--sage-700); line-height: 1.9; margin-bottom: 14px;
  white-space: pre-wrap;
}
.pay-empty-cards {
  background: #fdf4f3; border: 1px solid #f3d6d4; color: var(--danger);
  border-radius: var(--r-md); padding: 14px; font-size: .86rem; margin-bottom: 14px;
}

/* ---------- فرم ارسال رسید ---------- */
.receipt-form { margin-bottom: 14px; }
.receipt-form h3 { color: var(--leaf-900); font-size: 1.02rem; margin-bottom: 12px; }
.receipt-drop {
  display: block; border: 2px dashed var(--sage-300); border-radius: var(--r-lg);
  background: var(--mint-50); padding: 18px; cursor: pointer; text-align: center;
  transition: border-color var(--t-fast), background var(--t-fast); margin-bottom: 12px;
}
.receipt-drop:hover { border-color: var(--sage-500); background: var(--mint-100); }
.receipt-drop .rd-ic { font-size: 1.9rem; display: block; margin-bottom: 6px; }
.receipt-drop b { display: block; color: var(--leaf-900); font-size: .94rem; }
.receipt-drop small { display: block; color: var(--muted); font-size: .76rem; margin-top: 4px; line-height: 1.8; }
.receipt-drop .rd-preview img {
  max-height: 260px; width: auto; margin-inline: auto; border-radius: var(--r-md);
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}

/* ---------- کارت رسید ---------- */
.receipt-card {
  display: flex; gap: 10px; margin-top: 8px; padding: 8px;
  background: rgba(255, 255, 255, .82); border: 1px solid var(--line);
  border-radius: var(--r-md); max-width: 320px;
}
.msg-out .receipt-card { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .35); }
.receipt-card .rc-img { width: 76px; height: 76px; flex: 0 0 auto; border-radius: 10px; overflow: hidden; background: var(--mint-50); padding: 0; }
.receipt-card .rc-img img { width: 100%; height: 100%; object-fit: cover; }
.receipt-card .rc-meta { min-width: 0; font-size: .76rem; line-height: 1.9; }
.receipt-card .rc-amount { font-weight: 800; font-size: .88rem; }
.receipt-card .rc-line { opacity: .9; word-break: break-word; }
.receipt-card .rc-status { display: inline-block; margin-top: 3px; padding: 2px 9px; border-radius: var(--r-pill); font-size: .7rem; font-weight: 700; }
.receipt-card .rcs-0 { background: #fff5e6; color: #b8860b; }
.receipt-card .rcs-1 { background: #e3f5e8; color: var(--success); }
.receipt-card .rcs-2 { background: #fdeceb; color: var(--danger); }
.receipt-card .rc-review { margin-top: 4px; font-size: .74rem; opacity: .95; }

/* ---------- گفتگوی پرداخت (تیکت) ---------- */
.pay-ticket h3 { color: var(--leaf-900); font-size: 1.02rem; margin-bottom: 4px; }
.pay-thread {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 460px; overflow-y: auto; padding: 14px 4px;
  margin-top: 10px; background: var(--mint-50); border-radius: var(--r-md);
}
.pay-thread .msg { max-width: 88%; }
.pay-msg .pm-who { display: block; font-size: .68rem; font-weight: 700; opacity: .75; margin-bottom: 2px; }
.pay-msg .pm-attach { display: block; margin-top: 8px; border-radius: var(--r-md); overflow: hidden; max-width: 220px; padding: 0; }
.pay-msg .pm-attach img { width: 100%; display: block; }
.pay-sys {
  align-self: center; max-width: 92%; text-align: center;
  background: var(--white); border: 1px solid var(--line); color: var(--sage-700);
  border-radius: var(--r-pill); padding: 8px 16px; font-size: .8rem; line-height: 1.9;
}
.pay-sys .time { display: block; font-size: .64rem; color: var(--muted); }

.pay-composer {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--r-pill); padding: 5px 6px;
}
.pay-composer input[type=text], .pay-composer input:not([type]) {
  flex: 1; border: none; background: none; outline: none; padding: 8px 10px; font-size: .9rem; min-width: 0;
}
.pay-composer button[type=submit] {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--sage-500), var(--sage-600)); color: #fff;
}
.pay-composer button[type=submit] svg { width: 18px; height: 18px; }
.pay-composer .pc-attach {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: var(--mint-100); cursor: pointer; font-size: 1.05rem;
}
.pc-attached {
  display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 10px;
  background: var(--mint-50); border: 1px dashed var(--sage-300); border-radius: var(--r-md); font-size: .78rem; color: var(--sage-700);
}
.pc-attached img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; }
.pc-attached button { color: var(--danger); font-weight: 700; }

/* ---------- جعبهٔ پرداخت در جزئیات سفارش ---------- */
.pay-box .pb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.pay-box .pb-head h3 { color: var(--leaf-900); font-size: 1.02rem; }
.pay-box-1, .pay-box-4 { border-color: var(--sage-300); box-shadow: var(--shadow-sm); }

/* نشانِ پرداخت در کارت سفارش */
.oc-pay { margin-top: 8px; }
.order-card.needs-receipt { border-color: var(--sage-300); box-shadow: 0 6px 18px rgba(107, 166, 128, .18); }
.oc-cta-pay { background: var(--sage-500); color: #fff; }

/* ---------- پنل مدیریت: صفِ رسیدها ---------- */
.pay-admin-layout { display: grid; gap: 14px; }
@media (min-width: 980px) { .pay-admin-layout { grid-template-columns: 340px 1fr; align-items: start; } }
.pay-queue { display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow-y: auto; padding-inline-end: 2px; }
.pq-item {
  display: flex; gap: 10px; align-items: flex-start; text-align: start; width: 100%;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px;
  transition: all var(--t-fast);
}
.pq-item:hover { border-color: var(--sage-300); box-shadow: var(--shadow-sm); }
.pq-item.active { border-color: var(--sage-500); background: var(--mint-50); box-shadow: var(--shadow-sm); }
.pq-thumb {
  width: 54px; height: 54px; flex: 0 0 auto; border-radius: 10px; overflow: hidden;
  background: var(--mint-100); display: grid; place-items: center; font-size: 1.3rem;
}
.pq-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pq-main { min-width: 0; flex: 1; }
.pq-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pq-top b { font-size: .88rem; color: var(--leaf-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pq-badge {
  flex: 0 0 auto; min-width: 20px; height: 20px; padding-inline: 6px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center;
}
.pq-amount { font-size: .82rem; font-weight: 700; color: var(--sage-700); }
.pq-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.pq-date { display: block; font-size: .7rem; color: var(--muted); margin-top: 4px; }
.pay-pane { min-width: 0; }
.pay-admin-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px; margin-bottom: 12px; font-size: .9rem;
}
.pay-admin-head .pah-right { display: flex; align-items: center; gap: 10px; }
.pay-admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }

/* نشان روی تب و کارت آماری هشدار */
.tab-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding-inline: 5px;
  margin-inline-start: 6px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: .68rem; font-weight: 700;
}
.stat-card.stat-alert { border-color: var(--sage-400); box-shadow: 0 6px 18px rgba(107, 166, 128, .2); }
.stat-card.stat-alert .ic { background: #fff5e6; }

/* ---------- تنظیمات: ردیف کارت بانکی ---------- */
.pcard-row {
  display: grid; gap: 14px; padding: 14px; margin-bottom: 12px;
  background: var(--cream); border: 1px solid var(--line); border-radius: var(--r-lg);
}
@media (min-width: 860px) { .pcard-row { grid-template-columns: 320px 1fr; align-items: start; } }
.pcard-row.is-off { opacity: .6; }
.pcard-row .pcr-fields .field { margin-bottom: 10px; }
.pcard-row .pcr-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- لایت‌باکس تصویر ---------- */
.img-lightbox { position: relative; text-align: center; }
.img-lightbox img { max-width: 100%; max-height: 72vh; border-radius: var(--r-md); margin-inline: auto; }
.img-lightbox .il-x {
  position: absolute; inset-block-start: -6px; inset-inline-end: -6px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; background: var(--white);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: .95rem; color: var(--ink);
}

/* ---------- پنل مدیریت: کارت بررسی رسید ---------- */
.admin-receipt .ar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.admin-receipt .ar-head h3 { color: var(--leaf-900); font-size: 1.02rem; }
.admin-receipt .ar-body { display: grid; gap: 14px; }
@media (min-width: 620px) { .admin-receipt .ar-body { grid-template-columns: 220px 1fr; align-items: start; } }
.admin-receipt .ar-img {
  padding: 0; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line);
  background: var(--mint-50); display: block; width: 100%;
}
.admin-receipt .ar-img img { width: 100%; max-height: 300px; object-fit: contain; display: block; }
.admin-receipt .ar-info .info-row { font-size: .85rem; }
.admin-receipt .ar-warn {
  margin-top: 8px; background: #fff5e6; color: #a9761a; border: 1px solid #f2e3c4;
  border-radius: var(--r-md); padding: 9px 12px; font-size: .82rem;
}

/* دکمهٔ اقدام داخل تایم‌لاین (مثلاً ارسال رسید پرداخت) */
.tl-content .tl-cta {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  background: var(--sage-500); color: #fff; border-radius: var(--r-pill);
  padding: 5px 14px; font-size: .78rem; font-weight: 600; box-shadow: var(--shadow-brand);
}
.tl-content .tl-cta:hover { background: var(--sage-600); }

/* وضعیت زندهٔ مرحلهٔ پرداخت در تنظیمات */
.pay-state { border-radius: var(--r-md); padding: 10px 13px; font-size: .84rem; line-height: 1.9; margin-bottom: 12px; }
.pay-state.ok { background: var(--mint-50); border: 1px solid var(--mint-200); color: var(--sage-700); }
.pay-state.warn { background: #fff5e6; border: 1px solid #f2e3c4; color: #a9761a; }
.pay-0 { background: var(--mint-50); color: var(--muted); }
.pay-admin-actions.single { grid-template-columns: 1fr; }

/* مزایای کد معرف (دو خط شفاف به‌جای یک جملهٔ طولانی) */
.ref-benefits { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ref-benefits li { display: flex; align-items: flex-start; gap: 8px; font-size: .86rem; color: var(--sage-700); line-height: 1.8; }
.ref-benefits .rb-ic { flex: 0 0 auto; font-size: 1rem; line-height: 1.6; }
.ref-benefits bdi { font-weight: 700; color: var(--leaf-900); }

/* ============================================================
   نمودار و آمار بازدید (پنل مدیریت)
   ============================================================ */
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ch-legend-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--white);
  font-size: .8rem; font-weight: 600; color: var(--sage-700); transition: all var(--t-fast);
}
.ch-legend-item:hover { border-color: var(--sage-300); }
.ch-legend-item.off { opacity: .45; }
.ch-legend-item.off .ch-swatch { filter: grayscale(1); }
.ch-swatch { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }

.chart-canvas { position: relative; direction: ltr; }
.chart-canvas svg { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-ytick, .ch-xtick { font-family: inherit; font-size: 11px; fill: var(--muted); }
.ch-guide { stroke: var(--sage-400); stroke-width: 1; stroke-dasharray: 4 4; }
.ch-line { filter: drop-shadow(0 3px 6px rgba(38, 56, 44, .12)); }
.ch-dot { pointer-events: none; }
.ch-hit { cursor: crosshair; }
.chart-empty { padding: 40px 10px; text-align: center; color: var(--muted); font-size: .88rem; }

.chart-tip {
  position: absolute; top: 6px; direction: rtl; pointer-events: none; z-index: 3;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-md); padding: 8px 11px; font-size: .78rem; min-width: 130px;
}
.chart-tip .ct-date { font-weight: 700; color: var(--leaf-900); margin-bottom: 4px; font-size: .76rem; }
.chart-tip .ct-row { display: flex; align-items: center; gap: 6px; line-height: 1.9; }
.chart-tip .ct-label { color: var(--muted); flex: 1; }
.chart-tip .ct-row b { color: var(--leaf-900); }

/* کارت‌های آماری */
.an-stats .stat-card .lbl { display: flex; flex-direction: column; gap: 3px; }
.an-live .ic { background: #e3f5e8; animation: anPulse 2s ease-in-out infinite; }
@keyframes anPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(76, 154, 99, .35); } 50% { box-shadow: 0 0 0 8px rgba(76, 154, 99, 0); } }
@media (prefers-reduced-motion: reduce) { .an-live .ic { animation: none; } }
.an-delta { font-size: .7rem; font-weight: 700; }
.an-delta.up { color: var(--success); }
.an-delta.down { color: var(--danger); }
.an-delta.flat { color: var(--muted); }

.an-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.an-head h3 { color: var(--leaf-900); font-size: 1.05rem; }
.an-head span { font-size: .8rem; }
.an-chart { margin-inline: -4px; }
.an-range-summary {
  display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--line); font-size: .82rem; color: var(--muted);
}
.an-range-summary b { color: var(--leaf-900); font-weight: 700; }

.an-grid { display: grid; gap: 12px; }
@media (min-width: 860px) { .an-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.an-title { color: var(--leaf-900); font-size: 1rem; margin-bottom: 12px; }
.an-sub { color: var(--leaf-900); font-size: .9rem; margin: 16px 0 8px; }
.an-list { display: flex; flex-direction: column; gap: 10px; }
.an-row-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .84rem; }
.an-row-title { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-row-num { color: var(--sage-700); font-weight: 700; flex: 0 0 auto; }
.an-bar { height: 6px; background: var(--mint-100); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.an-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--sage-400), var(--sage-600)); border-radius: 99px; }
.an-device-row { display: flex; justify-content: space-between; font-size: .85rem; color: var(--sage-700); margin-top: 8px; }
.an-total { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .82rem; color: var(--muted); }
.an-total b { color: var(--leaf-900); }

/* ============================================================
   نمادهای اعتماد در فوتر (اینماد / ساماندهی)
   ============================================================ */
.footer-trust { padding: 18px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.footer-trust .ft-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.footer-trust .ft-title { color: #fff; font-size: .95rem; font-weight: 700; }
.footer-trust .ft-sub { color: rgba(255, 255, 255, .55); font-size: .78rem; }
.trust-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.trust-badge {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 96px; height: 96px; padding: 8px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
  transition: transform var(--t), box-shadow var(--t);
}
.trust-badge:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0, 0, 0, .18); }
.trust-badge img { width: 100%; height: 100%; object-fit: contain; }
.trust-note {
  flex: 1 1 220px; min-width: 200px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--r-md); padding: 12px 14px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.trust-note b { display: block; color: #fff; font-size: .86rem; margin-bottom: 4px; }
.trust-note span { color: rgba(255, 255, 255, .62); font-size: .78rem; line-height: 1.9; }

/* ============================================================
   داشبورد کاربر — کارت‌های شیشه‌ای (glassmorphism) با تم آمورا
   ============================================================ */
.glass-card, .glass-panel {
  position: relative;
  background: linear-gradient(145deg, rgba(255, 255, 255, .82), rgba(228, 240, 230, .55));
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: var(--r-lg);
  box-shadow: 0 10px 30px rgba(38, 56, 44, .10), inset 0 1px 0 rgba(255, 255, 255, .8);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
}
.glass-panel { padding: 18px; }

/* درخشش ملایم بالای کارت‌های شیشه‌ای */
.glass-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 70% at 85% -20%, rgba(255, 255, 255, .75), transparent 60%);
}

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .dash-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.dash-stat { padding: 16px; text-align: center; overflow: hidden; }
.dash-stat .ds-ic { font-size: 1.5rem; line-height: 1; margin-bottom: 6px; }
.dash-stat .ds-num { font-size: 1.35rem; font-weight: 800; color: var(--leaf-900); line-height: 1.4; }
.dash-stat .ds-num small { font-size: .68rem; font-weight: 600; color: var(--muted); }
.dash-stat .ds-lbl { font-size: .82rem; color: var(--sage-700); font-weight: 600; }
.dash-stat .ds-sub { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.dash-stat.ds-wallet { display: block; transition: transform var(--t); }
.dash-stat.ds-wallet:hover { transform: translateY(-3px); }
.dash-stat.ds-alert { border-color: rgba(233, 167, 162, .7); background: linear-gradient(145deg, rgba(255, 255, 255, .86), rgba(250, 226, 224, .6)); }
/* در گرید ۲ستونه، کارت سوم تمام‌عرض شود تا فضای خالی نماند */
@media (max-width: 719px) { .dash-grid > :nth-child(3):last-child { grid-column: 1 / -1; } }

.dash-alert { display: flex; align-items: center; gap: 12px; padding: 14px 16px; flex-wrap: wrap; }
.dash-alert .da-ic { font-size: 1.6rem; }
.dash-alert .da-main { flex: 1 1 180px; min-width: 0; }
.dash-alert h4 { color: var(--leaf-900); font-size: .95rem; font-weight: 700; }
.dash-alert p { color: var(--muted); font-size: .8rem; }
.dash-cta { text-align: center; padding: 26px 18px; }
.dash-cta h3 { color: var(--leaf-900); font-size: 1.05rem; margin-bottom: 4px; }
.dash-cta p { color: var(--muted); font-size: .86rem; }

/* ---------- کارت اعلان‌ها ---------- */
.notif-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-top: 14px; flex-wrap: wrap; }
.notif-card .nc-ic { font-size: 1.5rem; }
.notif-card .nc-main { flex: 1 1 200px; min-width: 0; }
.notif-card h4 { color: var(--leaf-900); font-size: .95rem; font-weight: 700; }
.notif-card p { color: var(--muted); font-size: .79rem; line-height: 1.8; }
.notif-card .nc-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.notif-card.is-on { border-color: rgba(107, 166, 128, .55); }

/* ---------- فهرست نامه‌ها ---------- */
.letters-panel .lp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.letters-panel .lp-head h3 { color: var(--leaf-900); font-size: 1.05rem; font-weight: 700; }
.letters-panel .lp-hint { color: var(--muted); font-size: .78rem; margin-bottom: 12px; }
.glass-panel .lp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.glass-panel .lp-head h3 { color: var(--leaf-900); font-size: 1.05rem; font-weight: 700; }

.letters-list { display: flex; flex-direction: column; gap: 10px; }
.letter-item {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: start;
  padding: 12px 14px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t), background var(--t);
}
.letter-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: #fff; }
.letter-item.is-unread {
  background: linear-gradient(135deg, rgba(228, 240, 230, .95), rgba(255, 255, 255, .78));
  border-color: rgba(107, 166, 128, .5);
}
.letter-item .li-seal {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.15rem;
  background: linear-gradient(135deg, var(--mint-100), #fff);
  border: 1px solid rgba(255, 255, 255, .9); box-shadow: var(--shadow-sm);
}
.letter-item.is-unread .li-seal { animation: sealPulse 2.4s ease-in-out infinite; }
@keyframes sealPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(107, 166, 128, .38); }
  50% { box-shadow: 0 0 0 8px rgba(107, 166, 128, 0); }
}
.letter-item .li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.letter-item .li-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.letter-item .li-title { font-weight: 700; color: var(--leaf-900); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.letter-item .li-new { flex: 0 0 auto; font-size: .66rem; font-weight: 700; color: #fff; background: var(--blush-dark); padding: 2px 8px; border-radius: var(--r-pill); }
.letter-item .li-seen { flex: 0 0 auto; font-size: .68rem; color: var(--muted); }
.letter-item .li-preview { font-size: .8rem; color: var(--sage-700); line-height: 1.8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.letter-item .li-meta { display: flex; align-items: center; gap: 8px; font-size: .7rem; color: var(--muted); }
.letter-item .li-gift { color: var(--sage-600); font-weight: 700; }

/* ---------- پنجرهٔ خواندن نامه ---------- */
.letter-modal { text-align: center; }
.letter-modal .lm-seal {
  width: 58px; height: 58px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.7rem;
  background: linear-gradient(135deg, var(--mint-100), #fff);
  box-shadow: var(--shadow-md);
}
.letter-modal .lm-title { color: var(--leaf-900); font-size: 1.1rem; font-weight: 700; }
.letter-modal .lm-date { color: var(--muted); font-size: .74rem; margin-bottom: 12px; }
.letter-modal .lm-body {
  text-align: start; color: var(--ink); font-size: .9rem; line-height: 2.1;
  background: var(--mint-50); border: 1px dashed var(--line);
  border-radius: var(--r-md); padding: 14px; max-height: 46vh; overflow-y: auto;
}
.letter-modal .lm-code {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  margin-top: 12px; padding: 12px; border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(216, 180, 106, .16), rgba(233, 167, 162, .16));
  border: 1px dashed var(--gold);
}
.letter-modal .lm-code-label { font-size: .78rem; color: var(--muted); width: 100%; }
.letter-modal .lm-code code {
  font-family: 'Vazirmatn', monospace; font-weight: 800; letter-spacing: 2px;
  color: var(--leaf-900); font-size: 1.05rem; direction: ltr;
}

/* ============================================================
   نامه‌های پنل مدیریت (نوشتن و فهرست ارسال‌شده‌ها)
   ============================================================ */
.emoji-row { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick {
  width: 42px; height: 42px; border-radius: var(--r-md); font-size: 1.2rem;
  background: var(--mint-50); border: 1.5px solid var(--line);
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.emoji-pick:hover { transform: translateY(-2px); }
.emoji-pick.active { border-color: var(--sage-500); background: var(--mint-100); }

.recipients-wrap { transition: opacity var(--t); }
.recipients-wrap.is-off { opacity: .38; pointer-events: none; }
.recipient-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 260px; overflow-y: auto; padding: 6px;
  background: var(--mint-50); border: 1px solid var(--line); border-radius: var(--r-md);
}
.recipient {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm); text-align: start;
  background: var(--white); border: 1.5px solid transparent;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.recipient:hover { border-color: var(--sage-300); }
.recipient.picked { border-color: var(--sage-500); background: var(--mint-100); }
.recipient .rc-name { font-weight: 600; color: var(--leaf-900); font-size: .88rem; }
.recipient .rc-meta { font-size: .74rem; color: var(--muted); direction: ltr; }

.sent-letters { display: flex; flex-direction: column; gap: 10px; }
.sent-letter {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px; border-radius: var(--r-md);
  background: var(--mint-50); border: 1px solid var(--line);
}
.sent-letter.is-read { background: var(--white); }
.sent-letter .sl-seal { font-size: 1.2rem; flex: 0 0 auto; }
.sent-letter .sl-main { flex: 1; min-width: 0; }
.sent-letter .sl-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sent-letter .sl-top b { color: var(--leaf-900); font-size: .9rem; }
.sent-letter .sl-state { flex: 0 0 auto; font-size: .7rem; color: var(--muted); }
.sent-letter.is-read .sl-state { color: var(--sage-600); font-weight: 700; }
.sent-letter .sl-to { font-size: .74rem; color: var(--muted); margin-bottom: 4px; }
.sent-letter .sl-body { font-size: .82rem; color: var(--sage-700); line-height: 1.9; overflow-wrap: anywhere; }
.sent-letter .sl-code { margin-top: 6px; font-size: .78rem; color: var(--sage-600); font-weight: 700; direction: ltr; text-align: end; }

/* ============================================================
   اصلاح‌های فاصله و جای‌گیری (موبایل)
   ============================================================ */
/* دکمه‌های خلاصهٔ سبد نباید به هم و به ناوبری پایین بچسبند */
.summary .summary-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.summary .summary-actions .btn { margin: 0; }
@media (max-width: 819px) {
  .summary { margin-bottom: 18px; }
  .cart-layout { padding-bottom: 12px; }
}

/* روی صفحه‌های باریک، دکمه‌های کارت‌های داشبورد تمام‌عرض و مرتب شوند */
@media (max-width: 520px) {
  .dash-alert > .btn { flex: 1 1 100%; }
  .notif-card .nc-actions { width: 100%; justify-content: space-between; }
}

/* ============================================================
   منوی ریلیِ پنل‌ها (کاربر و مدیریت)
   ریلِ آیکونی که باز می‌شود + نشانگرِ سفیدِ سُرخورنده
   ============================================================ */
.panel-shell {
  --rail-w: 62px;
  --rail-w-open: 212px;
  --rail-gap: 12px;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: var(--rail-gap);
  align-items: start;
  position: relative;
  transition: grid-template-columns .45s cubic-bezier(.22, 1, .36, 1);
}
.panel-shell.rail-open { grid-template-columns: var(--rail-w-open) minmax(0, 1fr); }

.panel-rail {
  /* جای ثابت در گرید: وقتی در موبایل fixed می‌شود، محتوا سرِ جای خودش بماند */
  grid-column: 1; grid-row: 1;
  position: sticky;
  inset-block-start: calc(var(--announce-h) + var(--header-h) + 10px);
  width: var(--rail-w);
  /* حتی با آیتم‌های کم، ارتفاعِ کاملِ صفحه را بگیرد */
  height: calc(100vh - var(--announce-h) - var(--header-h) - 24px);
  height: calc(100dvh - var(--announce-h) - var(--header-h) - 24px);
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 8px;
  border-radius: 30px;
  /* شیشه‌ای، هم‌خانواده با ناوبریِ پایینِ صفحه */
  background: linear-gradient(165deg, rgba(140, 191, 153, .8) 0%, rgba(107, 166, 128, .84) 55%, rgba(84, 138, 103, .88) 100%);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 10px 30px rgba(38, 56, 44, .16);
  overflow: hidden auto;
  scrollbar-width: none;
  z-index: 20;
  transition: width .45s cubic-bezier(.22, 1, .36, 1);
}
.panel-rail::-webkit-scrollbar { display: none; }
.rail-open .panel-rail { width: var(--rail-w-open); }

.rail-head { display: flex; align-items: center; padding: 2px 2px 4px; flex: 0 0 auto; }

/* دکمهٔ منو: همبرگری که هنگام باز شدن به ضربدر تبدیل می‌شود */
.rail-toggle {
  width: 42px; height: 42px; border-radius: 14px; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  transition: background var(--t-fast), transform var(--t-fast);
}
.rail-toggle:hover { background: rgba(255, 255, 255, .24); }
.rail-toggle:active { transform: scale(.92); }
.burger { position: relative; width: 18px; height: 14px; display: block; }
.burger i {
  position: absolute; inset-inline: 0; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform .38s cubic-bezier(.6, -.4, .3, 1.4), opacity .22s ease, width .3s ease;
}
.burger i:nth-child(1) { inset-block-start: 0; }
.burger i:nth-child(2) { inset-block-start: 6px; width: 72%; inset-inline-start: 0; }
.burger i:nth-child(3) { inset-block-start: 12px; }
.rail-open .burger i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.rail-open .burger i:nth-child(2) { opacity: 0; transform: translateX(-8px); }
.rail-open .burger i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* مشخصات کاربر در بالای منو */
.rail-user {
  display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
  padding: 8px 4px 12px; margin-bottom: 4px; cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
}
.rail-user .ru-avatar {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.05rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, .12));
  border: 2px solid rgba(255, 255, 255, .45);
  box-shadow: 0 4px 12px rgba(38, 56, 44, .12);
}
.rail-user .ru-info {
  flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.5;
  opacity: 0; transform: translateX(10px);
  transition: opacity .3s ease .1s, transform .42s cubic-bezier(.22, 1, .36, 1) .1s;
}
.rail-user .ru-info b { color: #fff; font-size: .92rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-user .ru-info small { color: rgba(255, 255, 255, .78); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-open .rail-user .ru-info,
.rail-closing .rail-user .ru-info { opacity: 1; transform: none; }
.panel-shell:not(.rail-open):not(.rail-closing) .rail-user { justify-content: center; padding-inline: 0; }
.panel-shell:not(.rail-open):not(.rail-closing) .rail-user .ru-info { position: absolute; inset-inline-start: -9999px; }

.rail-items { position: relative; display: flex; flex-direction: column; gap: 6px; }

/* نشانگرِ سفیدِ آیتم فعال — با فنر سُر می‌خورد و به پنلِ محتوا می‌چسبد */
.rail-indicator {
  position: absolute; inset-inline: 0; inset-block-start: 0; height: 46px;
  border-radius: var(--r-pill);
  background: var(--white);
  opacity: 0; pointer-events: none;
  transition: transform .5s cubic-bezier(.3, 1.3, .5, 1), height .35s cubic-bezier(.22, 1, .36, 1), opacity .25s ease;
}
.rail-indicator.show { opacity: 1; }

.rail-item {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 12px;
  min-height: 46px; padding: 0 11px;
  border-radius: var(--r-pill);
  color: rgba(255, 255, 255, .94);
  font-size: .88rem; font-weight: 600; white-space: nowrap; text-align: start;
  -webkit-tap-highlight-color: transparent;
  transition: color .3s ease, background .3s ease;
}
.rail-item:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.rail-item.active { color: var(--leaf-900); background: transparent; }
.rail-item.active:hover { background: transparent; }

.rail-item .ri-ic { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; }
.rail-item .ri-ic svg { width: 21px; height: 21px; transition: transform .4s cubic-bezier(.34, 1.4, .64, 1); }
.rail-item.active .ri-ic svg { animation: railPop .5s cubic-bezier(.34, 1.5, .55, 1); }
@keyframes railPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.28) rotate(-6deg); }
  70% { transform: scale(.92) rotate(3deg); }
  100% { transform: scale(1); }
}

.rail-item .ri-label {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateX(10px);
  transition: opacity .3s ease var(--ri-delay, 0ms), transform .4s cubic-bezier(.22, 1, .36, 1) var(--ri-delay, 0ms);
}
.rail-open .rail-item .ri-label,
.rail-closing .rail-item .ri-label { opacity: 1; transform: none; }
/* در حالت جمع، برچسب فضایی نگیرد */
.panel-shell:not(.rail-open):not(.rail-closing) .rail-item .ri-label { position: absolute; inset-inline-start: -9999px; }
.panel-shell:not(.rail-open):not(.rail-closing) .rail-item { justify-content: center; padding: 0; }
.panel-shell:not(.rail-open):not(.rail-closing) .rail-item .tab-badge {
  position: absolute; inset-block-start: 4px; inset-inline-end: 4px; margin: 0;
  min-width: 15px; height: 15px; font-size: .6rem;
}
.rail-item .tab-badge { flex: 0 0 auto; }

/* پنلِ محتوا: سطحِ سفیدِ گرد که نشانگر داخلش می‌رود */
.panel-content {
  grid-column: 2; grid-row: 1;
  min-width: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, .9), rgba(241, 247, 242, .78));
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: var(--r-lg);
  box-shadow: 0 10px 30px rgba(38, 56, 44, .08);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  padding: 16px;
}
@media (min-width: 900px) { .panel-content { padding: 20px; } }

/* پوششِ نیمه‌شفاف پشت ریلِ باز در موبایل */
.rail-scrim {
  /* بالاتر از ناوبریِ پایین و دکمهٔ شناورِ گفتگو، پایین‌تر از مودال‌ها */
  position: fixed; inset: 0; z-index: 200;
  background: rgba(38, 56, 44, .38);
  backdrop-filter: blur(2px);
  animation: fade .22s ease;
}
@media (min-width: 900px) { .rail-scrim { display: none; } }

/* ============================================================
   موبایل: منویِ بسته یک «نوار افقی» بالای صفحه است تا محتوا فشرده نشود؛
   با زدن دکمهٔ منو، از سمت راست به‌صورت کشوی عمودی باز می‌شود.
   ============================================================ */
@media (max-width: 899px) {
  .panel-shell {
    --rail-w-open: 210px;
    --rail-gap: 10px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    /* جلوی سرریزِ افقی (و پرشِ صفحه در چیدمان راست‌به‌چپ) را می‌گیرد و
       برخلاف hidden، چسبندگیِ نوار را از کار نمی‌اندازد */
    overflow-x: clip;
  }
  .panel-shell.rail-open { grid-template-columns: minmax(0, 1fr); }

  /* ---------- حالت بسته: نوارِ افقیِ بالای صفحه ---------- */
  .panel-rail {
    grid-column: 1; grid-row: 1;
    position: sticky;
    inset-block-start: calc(var(--announce-h) + var(--header-h) + 6px);
    width: auto; height: auto;
    flex-direction: row; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 24px;
    overflow: visible;
  }
  .panel-content { grid-column: 1; grid-row: 2; padding: 14px 12px; }

  .rail-head { padding: 0; }
  .rail-toggle { width: 40px; height: 40px; }

  /* در حالت بسته، مشخصات کاربر نمایش داده نمی‌شود؛ فقط آیکون‌ها می‌مانند */
  .panel-shell:not(.rail-open):not(.rail-closing) .rail-user { display: none; }

  /* آیتم‌ها از راست به چپ، با اسکرول افقیِ نرم */
  .rail-items {
    flex: 1; min-width: 0;
    flex-direction: row; align-items: center; gap: 4px;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .rail-items::-webkit-scrollbar { display: none; }
  /* حالت بسته: فقط آیکون، بدون نوشته */
  .rail-item { min-height: 44px; flex: 0 0 auto; justify-content: center; }
  .panel-shell:not(.rail-open):not(.rail-closing) .rail-item { width: 44px; padding: 0; }
  .panel-shell:not(.rail-open):not(.rail-closing) .rail-item .tab-badge {
    position: absolute; inset-block-start: 2px; inset-inline-end: 2px; margin: 0;
    min-width: 15px; height: 15px; font-size: .6rem;
  }

  /* نشانگرِ افقی */
  .rail-indicator.is-h { inset-inline: auto; left: 0; top: 0; }

  /* ---------- حالت باز: کشوی عمودی که از راست می‌آید ---------- */
  .rail-open .panel-rail,
  .rail-closing .panel-rail {
    position: fixed;
    /* منوی باز روی همهٔ المان‌ها می‌نشیند (ناوبری پایین، دکمهٔ گفتگو و ...) */
    z-index: 210;
    inset-block-start: calc(var(--announce-h) + var(--header-h) + 8px);
    inset-inline-start: 12px;
    width: var(--rail-w-open);
    height: calc(100vh - var(--announce-h) - var(--header-h) - 24px);
    height: calc(100dvh - var(--announce-h) - var(--header-h) - 24px);
    flex-direction: column; align-items: stretch; gap: 10px;
    padding: 10px 8px; border-radius: 30px;
    overflow: hidden auto;
  }
  .rail-open .rail-items,
  .rail-closing .rail-items { flex-direction: column; align-items: stretch; gap: 6px; overflow: visible; }
  .rail-open .rail-item,
  .rail-closing .rail-item { justify-content: flex-start; padding: 0 11px; min-height: 46px; }
  .rail-open .rail-user,
  .rail-closing .rail-user {
    border-inline-end: none; border-bottom: 1px solid rgba(255, 255, 255, .16);
    padding: 8px 4px 12px; gap: 10px;
  }
  .rail-open .rail-user .ru-avatar,
  .rail-closing .rail-user .ru-avatar { width: 42px; height: 42px; font-size: 1.05rem; }

  /* انیمیشنِ باز و بسته شدنِ کشو از سمت راست */
  .rail-open .panel-rail { animation: drawerIn .42s cubic-bezier(.22, 1, .36, 1) both; }
  .rail-closing .panel-rail { animation: drawerOut .32s cubic-bezier(.4, 0, .8, .5) both; }
  .rail-restored .panel-rail { animation: barIn .38s cubic-bezier(.22, 1, .36, 1) both; }
  @keyframes barIn { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes drawerIn  { from { transform: translateX(115%); opacity: .4; } to { transform: none; opacity: 1; } }
  @keyframes drawerOut { from { transform: none; opacity: 1; } to { transform: translateX(115%); opacity: .3; } }

  /* با باز شدن منو، صفحه به‌آرامی کنار می‌رود و با بستن برمی‌گردد */
  .panel-content {
    transform-origin: 0% 50%;
    transition: transform .46s cubic-bezier(.32, .72, .3, 1), box-shadow .46s ease, border-radius .46s ease;
    will-change: transform;
  }
  .rail-open .panel-content {
    transform: translateX(calc(-1 * (var(--rail-w-open) - 40px))) scale(.94);
    box-shadow: -14px 0 44px rgba(38, 56, 44, .22);
    border-radius: var(--r-xl);
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel-shell, .panel-rail, .rail-indicator, .rail-item .ri-label { transition: none; }
  .rail-item.active .ri-ic svg { animation: none; }
}

/* ============================================================
   نوار ابزار و جستجوی پنل مدیریت
   ============================================================ */
.panel-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-toolbar > .btn { flex: 0 0 auto; }

.panel-search {
  position: relative; display: flex; align-items: center; gap: 8px;
  flex: 1 1 220px; min-width: 0;
  background: var(--white); border: 1.5px solid var(--line);
  border-radius: var(--r-pill); padding: 0 14px; height: 44px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.panel-search:focus-within { border-color: var(--sage-400); box-shadow: 0 0 0 4px rgba(107, 166, 128, .16); }
.panel-search .ps-ic { flex: 0 0 auto; width: 18px; height: 18px; color: var(--muted); display: grid; place-items: center; }
.panel-search .ps-ic svg { width: 100%; height: 100%; }
.panel-search input {
  flex: 1; min-width: 0; border: none; outline: none; background: none;
  font-size: .9rem; padding: 0; height: 100%;
}
.panel-search input::-webkit-search-cancel-button { display: none; }
.panel-search .ps-clear {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: .74rem;
  color: var(--muted); background: var(--mint-50);
  transition: background var(--t-fast), color var(--t-fast);
}
.panel-search .ps-clear:hover { background: var(--mint-100); color: var(--leaf-900); }

.filter-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
