/* =========================================================
   Marbaden Young - Deep Redesign Custom Styles
   Performance-first: only overrides + new utilities
   ========================================================= */

/* ---------- Theme Variables (Light / Dim / Dark) ---------- */
:root,
[data-theme="light"] {
  --kt-primary: 99 102 241;          /* Indigo 500 - modern & attractive */
  --kt-primary-hover: 79 70 229;     /* Indigo 600 */
  --kt-blue: 59 130 246;
  --kt-green: 16 185 129;
  --kt-red: 239 68 68;
  --kt-orange: 249 115 22;
  --kt-yellow: 245 158 11;
  --kt-secondary: 30 41 59;
  --kt-gray: 100 116 139;
  --kt-dark: 15 23 42;
  --kt-light: 248 250 252;
  --kt-gray-100: 241 245 249;
  --kt-gray-200: 226 232 240;
  --kt-gray-300: 203 213 225;
  --kt-gray-400: 148 163 184;
  --kt-gray-500: 100 116 139;
  --kt-gray-600: 71 85 105;
  --kt-gray-700: 51 65 85;
  --kt-gray-800: 30 41 59;
  --kt-gray-900: 15 23 42;

  --surface: 255 255 255;
  --surface-2: 248 250 252;
  --text: 15 23 42;
  --text-muted: 100 116 139;
  --border: 226 232 240;
  --shadow-color: 15 23 42;
  --announcement-from: 37 99 235;
  --announcement-to: 124 58 237;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px 0 rgb(var(--shadow-color) / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(var(--shadow-color) / 0.08), 0 2px 4px -2px rgb(var(--shadow-color) / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(var(--shadow-color) / 0.1), 0 4px 6px -4px rgb(var(--shadow-color) / 0.08);
  --shadow-xl: 0 20px 25px -5px rgb(var(--shadow-color) / 0.1), 0 8px 10px -6px rgb(var(--shadow-color) / 0.08);
}

[data-theme="dim"] {
  --kt-primary: 129 140 248;
  --kt-primary-hover: 99 102 241;
  --kt-secondary: 226 232 240;
  --kt-gray: 148 163 184;
  --kt-dark: 241 245 249;
  --kt-light: 30 41 59;
  --kt-gray-100: 51 65 85;
  --kt-gray-200: 71 85 105;
  --kt-gray-300: 100 116 139;
  --kt-gray-400: 148 163 184;
  --kt-gray-500: 148 163 184;
  --kt-gray-600: 203 213 225;
  --kt-gray-700: 226 232 240;
  --kt-gray-800: 241 245 249;
  --kt-gray-900: 248 250 252;

  --surface: 30 41 59;
  --surface-2: 51 65 85;
  --text: 241 245 249;
  --text-muted: 148 163 184;
  --border: 71 85 105;
  --shadow-color: 0 0 0;
  --announcement-from: 59 130 246;
  --announcement-to: 139 92 246;
}

[data-theme="dark"] {
  --kt-primary: 129 140 248;
  --kt-primary-hover: 165 180 252;
  --kt-secondary: 226 232 240;
  --kt-gray: 148 163 184;
  --kt-dark: 248 250 252;
  --kt-light: 15 23 42;
  --kt-gray-100: 30 41 59;
  --kt-gray-200: 51 65 85;
  --kt-gray-300: 71 85 105;
  --kt-gray-400: 100 116 139;
  --kt-gray-500: 148 163 184;
  --kt-gray-600: 203 213 225;
  --kt-gray-700: 226 232 240;
  --kt-gray-800: 241 245 249;
  --kt-gray-900: 248 250 252;

  --surface: 15 23 42;
  --surface-2: 30 41 59;
  --text: 248 250 252;
  --text-muted: 148 163 184;
  --border: 51 65 85;
  --shadow-color: 0 0 0;
  --announcement-from: 37 99 235;
  --announcement-to: 124 58 237;
}

/* ---------- Base improvements ---------- */
html {
  scroll-behavior: smooth;
}

body {
  background-color: rgb(var(--surface));
  color: rgb(var(--text));
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  letter-spacing: -0.01em;
}

/* Better international-style typography */
h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
  line-height: 1.35;
}

p, .text-body {
  line-height: 1.7;
}

/* ---------- Announcement Bar (fixed) ---------- */
.announcement-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(90deg, rgb(var(--announcement-from)), rgb(var(--announcement-to)));
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 8px 16px;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.announcement-bar .announcement-icon {
  font-size: 16px;
  opacity: 0.95;
}

.announcement-bar a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

/* navigation-space moved to bugfix section */

/* ---------- Header / Navbar Redesign ---------- */
.navbar {
  top: 40px !important; /* below announcement */
  background: rgb(var(--surface) / 0.92) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgb(var(--border));
  box-shadow: var(--shadow-sm);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.navbar .container {
  padding-top: 10px;
  padding-bottom: 10px;
}

@media (min-width: 1024px) {
  .navbar {
    padding-bottom: 0 !important;
  }
  .navbar .container > .flex {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }
}

/* Logo */
.navbar img,
.navbar .logo-text {
  max-height: 36px !important;
}

@media (min-width: 1024px) {
  .navbar img,
  .navbar .logo-text {
    max-height: 42px !important;
  }
}

/* Search field redesign */
.navbar-search .form-control {
  border-radius: var(--radius-md) !important;
  border: 1px solid rgb(var(--border)) !important;
  background: rgb(var(--surface-2)) !important;
  height: 42px !important;
  padding-right: 44px !important;
  font-size: 14px !important;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.navbar-search .form-control:focus {
  border-color: rgb(var(--kt-primary)) !important;
  box-shadow: 0 0 0 3px rgb(var(--kt-primary) / 0.15) !important;
  background: rgb(var(--surface)) !important;
}

/* Theme switcher */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgb(var(--surface-2));
  border: 1px solid rgb(var(--border));
  border-radius: 999px;
  padding: 3px;
}

.theme-switcher button {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgb(var(--text-muted));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
}

.theme-switcher button:hover {
  color: rgb(var(--text));
  background: rgb(var(--border) / 0.5);
}

.theme-switcher button.active {
  background: rgb(var(--kt-primary));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* ---------- Buttons (international style) ---------- */
.btn {
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  transition: all 0.15s ease !important;
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: rgb(var(--kt-primary)) !important;
  border-color: rgb(var(--kt-primary)) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background: rgb(var(--kt-primary-hover)) !important;
  border-color: rgb(var(--kt-primary-hover)) !important;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-white {
  background: rgb(var(--surface)) !important;
  border: 1px solid rgb(var(--border)) !important;
  color: rgb(var(--text)) !important;
}

.btn-white:hover {
  background: rgb(var(--surface-2)) !important;
  border-color: rgb(var(--kt-gray-300)) !important;
}

.btn-icon {
  border-radius: var(--radius-md) !important;
}

/* ---------- Product Cards (Digikala-like) ---------- */
.product-card {
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgb(var(--kt-primary) / 0.25);
  transform: translateY(-2px);
}

.product-card .thumbnail-holder {
  background: rgb(var(--surface-2));
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  position: relative;
}

.product-card .thumbnail {
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product-card:hover .thumbnail {
  transform: scale(1.04);
}

.product-card .product-info {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-card .product-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: rgb(var(--text));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.product-card .product-price {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.product-card .price-current {
  font-size: 15px;
  font-weight: 700;
  color: rgb(var(--text));
}

.product-card .price-old {
  font-size: 12px;
  color: rgb(var(--text-muted));
  text-decoration: line-through;
}

.product-card .discount-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgb(var(--kt-red));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 2;
  box-shadow: var(--shadow-sm);
}

.product-card .out-of-stock {
  color: rgb(var(--kt-red));
  font-size: 13px;
  font-weight: 600;
}

/* Grid for products: 2 / 3 / 4 */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

/* ---------- Guarantees section ---------- */
.guarantees-section {
  padding: 28px 0;
  border-bottom: 1px solid rgb(var(--border));
}

.guarantee-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 12px;
  border-radius: var(--radius-lg);
  background: rgb(var(--surface-2));
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
}

.guarantee-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.guarantee-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 12px;
}

.guarantee-item h4 {
  font-size: 13px;
  font-weight: 600;
  color: rgb(var(--text));
  line-height: 1.4;
}

/* ---------- Footer improvements ---------- */
footer {
  background: rgb(var(--surface));
  border-top: 1px solid rgb(var(--border));
}

footer a {
  transition: color 0.15s;
}

footer a:hover {
  color: rgb(var(--kt-primary)) !important;
}

/* ---------- Bottom Navigation (Mobile) ---------- */
.bottom-nav {
  background: rgb(var(--surface) / 0.95) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgb(var(--border));
  box-shadow: 0 -4px 20px rgb(var(--shadow-color) / 0.06);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav a,
.bottom-nav button {
  color: rgb(var(--text-muted));
  transition: color 0.15s;
}

.bottom-nav a:hover,
.bottom-nav a.active,
.bottom-nav button:hover {
  color: rgb(var(--kt-primary));
}

.bottom-nav .nav-icon-wrap {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  margin: 0 auto 4px;
  transition: background 0.15s, color 0.15s;
}

.bottom-nav a:hover .nav-icon-wrap,
.bottom-nav a.active .nav-icon-wrap {
  background: rgb(var(--kt-primary) / 0.12);
  color: rgb(var(--kt-primary));
}

/* ---------- Product page gallery & layout ---------- */
.lightbox-close-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 50;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgb(var(--surface) / 0.9);
  border: 1px solid rgb(var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.lightbox-close-btn:hover {
  transform: scale(1.08);
  background: rgb(var(--surface));
}

/* ---------- Filters / Sort (Digikala-like) ---------- */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  margin-bottom: 16px;
}

.filter-chip,
.sort-btn {
  border-radius: 999px !important;
  border: 1px solid rgb(var(--border)) !important;
  background: rgb(var(--surface)) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 8px 14px !important;
  color: rgb(var(--text)) !important;
  transition: all 0.15s !important;
}

.filter-chip:hover,
.sort-btn:hover,
.filter-chip.active {
  border-color: rgb(var(--kt-primary)) !important;
  color: rgb(var(--kt-primary)) !important;
  background: rgb(var(--kt-primary) / 0.06) !important;
}

/* ---------- Forms & Inputs ---------- */
.form-control,
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  border-radius: var(--radius-md) !important;
  border-color: rgb(var(--border)) !important;
  background: rgb(var(--surface)) !important;
  color: rgb(var(--text)) !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: rgb(var(--kt-primary)) !important;
  box-shadow: 0 0 0 3px rgb(var(--kt-primary) / 0.12) !important;
  outline: none !important;
}

/* ---------- Comments ---------- */
.comment-item {
  border-radius: var(--radius-lg);
  border: 1px solid rgb(var(--border));
  background: rgb(var(--surface));
  padding: 16px 18px;
  margin-bottom: 12px;
}

.comment-form textarea {
  min-height: 110px;
  border-radius: var(--radius-lg) !important;
}

/* ---------- Cards / Surfaces general ---------- */
.card,
.rounded-lg,
.border {
  border-radius: var(--radius-lg) !important;
}

.shadow-sm-bold,
.shadow-dropdown {
  box-shadow: var(--shadow-md) !important;
}

/* ---------- Utility helpers ---------- */
.bg-surface { background-color: rgb(var(--surface)) !important; }
.bg-surface-2 { background-color: rgb(var(--surface-2)) !important; }
.text-main { color: rgb(var(--text)) !important; }
.text-muted { color: rgb(var(--text-muted)) !important; }
.border-main { border-color: rgb(var(--border)) !important; }

/* Smooth transitions for theme change */
body,
.navbar,
.bottom-nav,
.product-card,
footer,
.btn,
.form-control {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* Reduce motion for performance / a11y */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ========== Bug fixes v2 ========== */

/* 1. Modal / Add-to-cart text visibility in all themes */
.modal .modal-inner,
.modal-inner {
  background: rgb(var(--surface)) !important;
  color: rgb(var(--text)) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xl) !important;
}

.modal .text-dark,
.modal-inner .text-dark,
#product-addtocart-modal .text-dark,
#product-addtocart-modal span,
#product-addtocart-modal .text-xs {
  color: rgb(var(--text)) !important;
}

.modal .border-b {
  border-color: rgb(var(--border)) !important;
}

/* 2. Theme switcher always visible next to menu */
.theme-switcher-mobile {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgb(var(--surface-2));
  border: 1px solid rgb(var(--border));
  border-radius: 999px;
  padding: 2px;
}

.theme-switcher-mobile button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgb(var(--text-muted));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
}

.theme-switcher-mobile button.active {
  background: rgb(var(--kt-primary));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* 3. Announcement stuck to header (no gap) */
.announcement-bar {
  height: 36px;
  padding: 0 16px;
  line-height: 36px;
  font-size: 12.5px;
  box-shadow: none;
  border-bottom: none;
}

.navbar {
  top: 36px !important;
  border-top: none !important;
  box-shadow: 0 1px 0 rgb(var(--border)), var(--shadow-sm) !important;
}

/* 4. More space under header so content doesn't go under */
.navigation-space {
  height: calc(36px + 78px) !important;
}

@media (min-width: 1024px) {
  .navigation-space {
    height: calc(36px + 96px) !important;
  }
}

/* Ensure lightbox close is visible */
.lightbox-close-btn,
.modal-close-btn {
  color: rgb(var(--text)) !important;
}

/* =========================================================
   Marbaden polish pass — premium header, clearer spacing,
   responsive product details and gallery safeguards.
   ========================================================= */
:root,
[data-theme="light"] {
  --kt-primary: 38 92 75;
  --kt-primary-hover: 29 72 59;
  --announcement-from: 31 67 56;
  --announcement-to: 67 105 81;
  --radius-md: 13px;
  --radius-lg: 18px;
}

/* A compact, premium announcement strip */
.announcement-bar {
  min-height: 36px;
  height: auto;
  padding: 7px 14px;
  line-height: 1.55;
  gap: 9px;
  background: linear-gradient(105deg, rgb(var(--announcement-from)), rgb(var(--announcement-to)));
  font-size: 12px;
  letter-spacing: 0;
}
.announcement-bar strong { color: #fff; font-weight: 800; }

/* Header: layered surface, readable controls and breathing room */
.navbar {
  top: 36px !important;
  background: rgb(var(--surface) / .97) !important;
  border-bottom: 1px solid rgb(var(--border) / .9) !important;
  box-shadow: 0 8px 28px rgb(15 23 42 / .065) !important;
}
.navbar > .container { max-width: 1440px; }
.navbar .container > .flex:first-child {
  column-gap: 16px !important;
  row-gap: 10px !important;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}
.navbar .navbar-content nav { gap: 12px !important; }
.navbar .navbar-items { gap: 7px !important; }
.navbar .navbar-items > li > .nav-link,
.navbar .navbar-items > li > a.nav-link {
  padding: 10px 14px !important;
  border-radius: 10px !important;
  white-space: nowrap;
}
.navbar .navbar-items > li.active > .nav-link,
.navbar .navbar-items > li > .nav-link:hover {
  color: rgb(var(--kt-primary)) !important;
  background: rgb(var(--kt-primary) / .075) !important;
}
.navbar .navbar-items > li { margin-inline: 1px; }
.navbar .navbar-content { border-color: rgb(var(--border) / .8) !important; }
.navbar .theme-switcher { margin-inline: 3px; }
.navbar .theme-switcher button { width: 34px; height: 34px; }
.navbar .navbar-search .form-control { min-height: 44px; }
.navbar .btn { min-height: 40px; }
.navbar .mobile-menu-btn { width: 42px; height: 42px; }
.theme-switcher-mobile { gap: 4px !important; padding: 3px !important; }
.theme-switcher-mobile button { width: 33px !important; height: 33px !important; }

/* Reserve the real header footprint so page content never slides underneath. */
.navigation-space { height: 150px !important; }
@media (min-width: 1024px) {
  .navigation-space { height: 174px !important; }
  .navbar .container > .flex:first-child { padding-top: 13px !important; padding-bottom: 13px !important; }
}
@media (max-width: 1023.98px) {
  .navbar .container { padding-inline: 14px; }
  .navbar .container > .flex:first-child { column-gap: 12px !important; }
  .navbar .navbar-search { flex-basis: 100%; order: 4; }
  .navbar .navbar-search > div { padding-top: 0 !important; }
  .navbar .navbar-search .form-control { height: 42px !important; }
}

/* Consistent breathing room between clickable controls */
.btn-group { gap: 8px; padding: 6px !important; border-radius: 14px !important; }
.btn-group > .btn { border-radius: 10px !important; }
.product-container button,
.product-container .btn,
.product-container a.btn-light { touch-action: manipulation; }
.product-container .product-attributes-item { margin-inline-end: 5px; }
.product-container .product-attributes-item span { padding: 9px 15px; border-radius: 10px; }
.product-container .product-header-features { gap: 10px !important; }
.product-container .product-header-features > * { min-width: 0; }

/* Product action controls: avoid cramped buttons on narrow screens */
.product-container .btn-primary.product-addtocart { min-height: 48px; font-size: 14px; }
.product-container .product-quantity-input { min-height: 42px; }
.product-container .product-tabs [data-tab] { margin: 0 3px 7px; }
.product-container .product-fields-item { gap: 10px; }

@media (max-width: 575.98px) {
  .announcement-bar { font-size: 11px; padding-inline: 9px; }
  .announcement-bar .announcement-icon { font-size: 14px; }
  .navigation-space { height: 145px !important; }
}

/* Respect keyboard focus and users who prefer reduced motion. */
.navbar a:focus-visible,
.navbar button:focus-visible,
.product-container a:focus-visible,
.product-container button:focus-visible {
  outline: 2px solid rgb(var(--kt-primary)) !important;
  outline-offset: 3px;
}

/* =========================================================
   Marbaden header + product gallery correction (v3)
   ========================================================= */
:root,
[data-theme="light"] {
  --announcement-from: 20 91 160;
  --announcement-to: 37 124 194;
  --kt-primary: 35 93 145;
  --kt-primary-hover: 25 74 119;
}
[data-theme="dim"], [data-theme="dark"] {
  --announcement-from: 20 91 160;
  --announcement-to: 37 124 194;
}
.announcement-bar {
  background: linear-gradient(105deg, #155b9d, #287fbd) !important;
  color: #fff !important;
  min-height: 38px;
  padding: 7px 14px;
  font-size: 12px;
  line-height: 1.5;
}
.announcement-bar strong { color: #eaf5ff !important; }

/* Rebuild the header rhythm: brand row, search row, desktop navigation. */
.navbar {
  top: 38px !important;
  background: rgb(var(--surface) / .985) !important;
  border-bottom: 1px solid rgb(var(--border)) !important;
  box-shadow: 0 7px 24px rgb(15 23 42 / .07) !important;
}
.navbar .container { max-width: 1440px; }
.navbar .container > .flex:first-child {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  column-gap: 20px !important;
  row-gap: 12px !important;
  padding: 14px 0 13px !important;
}
.navbar .container > .flex:first-child > a:first-child { order: 1; }
.navbar .navbar-search { order: 2; min-width: 220px; }
.navbar .container > .flex:first-child > .flex.items-center.gap-2.lg\:hidden {
  order: 3;
  gap: 14px !important;
  margin-inline-start: 8px;
}
.navbar .theme-switcher-mobile { gap: 5px !important; padding: 4px !important; }
.navbar .theme-switcher-mobile button { width: 34px !important; height: 34px !important; }
.navbar .mobile-menu-btn {
  width: 46px !important;
  height: 46px !important;
  margin-inline-start: 10px !important;
  border: 1px solid rgb(var(--border)) !important;
  border-radius: 13px !important;
  background: rgb(var(--surface-2)) !important;
}
.navbar .navbar-search .form-control {
  height: 46px !important;
  border-radius: 13px !important;
  background: rgb(var(--surface-2)) !important;
}
.navbar .navbar-content nav { gap: 16px !important; padding-block: 9px !important; }
.navbar .navbar-items { gap: 9px !important; }
.navbar .navbar-items .nav-link { padding: 10px 15px !important; }
.navbar .theme-switcher { gap: 5px !important; padding: 4px !important; }
.navbar .theme-switcher button { width: 36px !important; height: 36px !important; }

/* Mobile header follows the Salimond-style two-level arrangement. */
@media (max-width: 1023.98px) {
  .navbar .container { padding-inline: 16px !important; }
  .navbar .container > .flex:first-child {
    display: flex !important;
    flex-wrap: wrap !important;
    padding: 12px 0 13px !important;
    column-gap: 12px !important;
    row-gap: 12px !important;
  }
  .navbar .container > .flex:first-child > a:first-child { order: 1; margin-inline-end: auto; }
  .navbar .container > .flex:first-child > .flex.items-center.gap-2.lg\:hidden {
    order: 2;
    margin: 0 !important;
    gap: 15px !important;
  }
  .navbar .navbar-search {
    order: 3 !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }
  .navbar .navbar-search > div { padding: 0 !important; }
  .navbar .navbar-search .form-control { height: 46px !important; }
  .navbar .navbar-content { display: none !important; }
  .navigation-space { height: 155px !important; }
}
@media (max-width: 575.98px) {
  .announcement-bar { min-height: 36px; font-size: 10.5px !important; padding-inline: 8px !important; }
  .navbar { top: 36px !important; }
  .navbar .container { padding-inline: 12px !important; }
  .navbar .container > .flex:first-child { padding-block: 10px 12px !important; row-gap: 10px !important; }
  .navbar .theme-switcher-mobile { gap: 4px !important; }
  .navbar .theme-switcher-mobile button { width: 32px !important; height: 32px !important; }
  .navbar .mobile-menu-btn { width: 43px !important; height: 43px !important; margin-inline-start: 8px !important; }
  .navbar .navbar-search .form-control { height: 44px !important; }
  .navigation-space { height: 146px !important; }
}
@media (min-width: 1024px) {
  .navigation-space { height: 170px !important; }
}

/* Compact, horizontal product facts instead of tall oversized tiles. */
.product-container .product-header-features {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  gap: 7px !important;
}
.product-container .product-header-features > div,
.product-container .product-header-features > button {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  padding: 7px 10px !important;
  border-radius: 9px !important;
  line-height: 1.45 !important;
  font-size: 11px !important;
}
.product-container .product-header-features > div > div { margin-bottom: 1px !important; }
.product-container .product-header-features > div > div:first-child { font-size: 11px !important; }
@media (max-width: 767.98px) {
  .product-container .product-header-features { overflow-x: auto; flex-wrap: nowrap !important; padding-bottom: 3px; }
  .product-container .product-header-features > div,
  .product-container .product-header-features > button { flex: 0 0 auto !important; white-space: nowrap; }
}

/* Marbaden V5: compact horizontal service benefits */
.mb-service-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px 22px !important;
  width: 100% !important;
  margin: 14px auto 20px !important;
}
.mb-service-item {
  display: inline-flex !important;
  flex: 0 1 auto !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  min-height: 34px !important;
  padding: 5px 9px !important;
  margin: 0 !important;
  text-align: right !important;
  font-size: 12px !important;
  line-height: 1.6 !important;
  white-space: nowrap !important;
}
.mb-service-item i,
.mb-service-item svg,
.mb-service-item img,
.mb-service-item .icon {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  font-size: 18px !important;
  line-height: 20px !important;
  object-fit: contain !important;
  margin: 0 !important;
}
@media (max-width: 767.98px) {
  .mb-service-row { gap: 7px 10px !important; margin: 10px auto 16px !important; }
  .mb-service-item { min-height: 30px !important; padding: 4px 6px !important; font-size: 10.5px !important; gap: 5px !important; }
  .mb-service-item i, .mb-service-item svg, .mb-service-item img, .mb-service-item .icon {
    width: 17px !important; height: 17px !important; max-width: 17px !important; max-height: 17px !important; font-size: 16px !important; line-height: 17px !important;
  }
}

/* Larger, more visible shopping bag action */
.navbar [cart] > a.icon-bag,
.navbar [cart] > a[aria-label="سبد خرید"] {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #1769aa !important;
  background: rgba(23,105,170,.09) !important;
  border: 1px solid rgba(23,105,170,.22) !important;
  border-radius: 14px !important;
  font-size: 25px !important;
}
.navbar [cart] > a.icon-bag:hover,
.navbar [cart] > a[aria-label="سبد خرید"]:hover {
  color: #fff !important;
  background: #1769aa !important;
}

/* Reading progress indicator and back-to-top control */
#marbaden-reading-progress {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 3px !important;
  z-index: 100000 !important;
  pointer-events: none !important;
  background: transparent !important;
}
#marbaden-reading-progress > span {
  display: block !important;
  width: 0;
  height: 100% !important;
  background: linear-gradient(90deg,#1684d6,#36b6e9) !important;
  box-shadow: 0 0 7px rgba(22,132,214,.35) !important;
  transition: width .08s linear !important;
}
#marbaden-back-to-top {
  position: fixed !important;
  right: 18px !important;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 99990 !important;
  width: 44px !important;
  height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: 50% !important;
  color: #fff !important;
  background: #1769aa !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.2) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(8px) !important;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease !important;
  cursor: pointer !important;
}
#marbaden-back-to-top.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}
#marbaden-back-to-top svg { width: 21px !important; height: 21px !important; display:block !important; }
@media (prefers-reduced-motion: reduce) {
  #marbaden-back-to-top, #marbaden-reading-progress > span { transition: none !important; }
}

/* Marbaden V6 refinements */
/* Reading progress: slim vertical indicator on the left edge. */
#marbaden-reading-progress {
  top: 18vh !important;
  bottom: 18vh !important;
  left: max(7px, env(safe-area-inset-left, 0px)) !important;
  right: auto !important;
  width: 4px !important;
  height: auto !important;
  border-radius: 99px !important;
  overflow: hidden !important;
  background: rgba(120,130,145,.18) !important;
}
#marbaden-reading-progress > span {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 0;
  border-radius: 99px !important;
  background: linear-gradient(0deg,#1684d6,#36b6e9) !important;
  transition: height .08s linear !important;
}

/* Lift common third-party chat launchers so they do not cover the home button. */
#smartsupp-widget-container,
#goftino_w,
#crisp-chatbox,
#tawkchat-container,
iframe[id*="smartsupp"], iframe[src*="smartsupp"],
iframe[id*="goftino"], iframe[src*="goftino"],
iframe[title*="chat" i], iframe[title*="Chat"],
[id*="chat-widget"], [class*="chat-widget"] {
  bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Product breadcrumb must clear the sticky header. */
.product-container > .container > .breadcrumb {
  position: relative !important;
  z-index: 2 !important;
  margin-top: 24px !important;
  padding-top: 8px !important;
  margin-bottom: 18px !important;
}

/* Larger product photography while retaining the full image ratio. */

.product-container .lightbox-container > .thumbnail-holder {
  min-height: 320px !important;
}

.product-container .lightbox-container > .thumbnail-holder .thumbnail {
  max-width: 100% !important;
  max-height: min(72vh, 720px) !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}
.product-container @media (min-width: 768px) {
  .product-container   .product-container }
@media (max-width: 767px) {
  .product-container > .container > .breadcrumb { margin-top: 18px !important; margin-bottom: 14px !important; }
  #marbaden-reading-progress { left: max(5px, env(safe-area-inset-left, 0px)) !important; width: 3px !important; top: 20vh !important; bottom: 20vh !important; }
}

/* Marbaden V7 corrections: restore horizontal reading progress, move top button,
   lift the externally injected chat launcher, and use native 4:5 product framing. */
#marbaden-reading-progress {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  left: 0 !important;
  width: 100% !important;
  height: 3px !important;
  z-index: 100000 !important;
  overflow: hidden !important;
  border-radius: 0 !important;
  background: rgba(120,130,145,.14) !important;
  pointer-events: none !important;
}
#marbaden-reading-progress > span {
  position: absolute !important;
  top: 0 !important;
  right: auto !important;
  bottom: 0 !important;
  left: 0 !important;
  display: block !important;
  width: 0;
  height: 100% !important;
  border-radius: 0 !important;
  background: linear-gradient(90deg,#1684d6,#36b6e9) !important;
  transition: width .08s linear !important;
}
/* Put the return-to-top button on the opposite side from the chat launcher. */
#marbaden-back-to-top {
  right: auto !important;
  left: 18px !important;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Common Goftino, Smartsupp, Crisp and Tawk launchers are injected after page load.
   Move the outer launcher itself (not just its iframe) clear of the home control. */
#goftino_w, #goftino, .goftino-widget, .goftino-launcher,
#smartsupp-widget-container, .smartsupp-widget, #crisp-chatbox,
.crisp-client, #tawkchat-container, .tawk-min-container,
iframe[src*="goftino" i], iframe[id*="goftino" i],
iframe[src*="smartsupp" i], iframe[id*="smartsupp" i],
iframe[src*="crisp" i], iframe[src*="tawk" i],
[id^="tawk"], [class*="tawk"] {
  transform: translateY(-88px) !important;
}

/* Product images are photographed in portrait 4:5. Show the entire photo without crop/zoom. */

.product-container .lightbox-container > .thumbnail-holder {
  width: min(100%, 560px) !important;
  aspect-ratio: 4 / 5 !important;
  min-height: 0 !important;
  height: auto !important;
  margin-inline: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.product-container .lightbox-container > .thumbnail-holder .thumbnail {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  transform: none !important;
}
@media (max-width: 767px) {
  #marbaden-back-to-top { left: 14px !important; bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important; }
  #goftino_w, #goftino, .goftino-widget, .goftino-launcher,
  #smartsupp-widget-container, .smartsupp-widget, #crisp-chatbox,
  .crisp-client, #tawkchat-container, .tawk-min-container,
  iframe[src*="goftino" i], iframe[id*="goftino" i],
  iframe[src*="smartsupp" i], iframe[id*="smartsupp" i],
  iframe[src*="crisp" i], iframe[src*="tawk" i],
  [id^="tawk"], [class*="tawk"] { transform: translateY(-104px) !important; }
}

/* V10: place the chat launcher over the "خانه" item in the mobile bottom navigation.
   Reset the previous lift transforms so the third-party widget remains clickable. */
@media (max-width: 767px) {
  #goftino_w, #goftino, .goftino-widget, .goftino-launcher,
  #smartsupp-widget-container, .smartsupp-widget,
  #crisp-chatbox, .crisp-client,
  #tawkchat-container, .tawk-min-container,
  iframe[src*="goftino" i], iframe[id*="goftino" i],
  iframe[src*="smartsupp" i], iframe[id*="smartsupp" i],
  iframe[src*="crisp" i], iframe[src*="tawk" i],
  [id^="tawk"], [class*="tawk"] {
    right: calc(12.5vw - 30px) !important;
    left: auto !important;
    bottom: 0 !important;
    top: auto !important;
    transform: none !important;
  }
}

/* کنتراست متن در تم روشن، نیمه‌روشن و شب */
:root,
[data-theme="light"] {
  --menu-bg: 255 255 255;
  --menu-bg-2: 241 245 249;
  --menu-text: 15 23 42;
  --menu-muted: 51 65 85;
  --menu-line: 203 213 225;
}
[data-theme="dim"] {
  --menu-bg: 30 41 59;
  --menu-bg-2: 51 65 85;
  --menu-text: 248 250 252;
  --menu-muted: 226 232 240;
  --menu-line: 100 116 139;
}
[data-theme="dark"] {
  --menu-bg: 15 23 42;
  --menu-bg-2: 30 41 59;
  --menu-text: 248 250 252;
  --menu-muted: 226 232 240;
  --menu-line: 71 85 105;
}

body {
  background-color: rgb(var(--menu-bg)) !important;
  color: rgb(var(--menu-text)) !important;
}

.text-dark,
.text-secondary,
.md\\:text-dark,
.nav-link,
.megamenu-btn,
.megamenu-item,
.mobile-menu-link,
.nav-submenu-link,
.product-title,
.product-card .price-current,
.bottom-nav a,
.bottom-nav button,
.bottom-nav span,
.navbar,
footer,
.drawer-inner,
.dropdown-menu,
.mobile-menu,
.nav-submenu,
.megamenu {
  color: rgb(var(--menu-text)) !important;
}

.text-gray,
.text-muted,
footer a,
.footer a,
.mobile-menu-link,
.nav-submenu-link {
  color: rgb(var(--menu-muted)) !important;
}

.text-dark,
.text-secondary,
.nav-link,
.megamenu-btn,
.megamenu-item,
.product-title,
.bottom-nav a,
.bottom-nav button,
.bottom-nav span,
.dropdown-menu a,
.drawer-inner a,
.megamenu a,
.mobile-menu a {
  color: rgb(var(--menu-text)) !important;
}

.navbar,
.bottom-nav,
footer,
.dropdown-menu,
.nav-submenu,
.mobile-menu,
.drawer-inner,
.modal-inner,
.megamenu,
.widget-buttons,
.bg-white:not(.rounded-circle),
.navbar-search .bg-white {
  background-color: rgb(var(--menu-bg)) !important;
  border-color: rgb(var(--menu-line)) !important;
}

.megamenu-items,
.bg-light,
.bg-surface,
.bg-surface-2,
.guarantee-item,
.product-card,
.comment-item {
  background-color: rgb(var(--menu-bg-2)) !important;
  color: rgb(var(--menu-text)) !important;
}

.navbar {
  background-color: rgb(var(--menu-bg) / .98) !important;
}

.dropdown-menu a:not(.btn):hover,
.drawer-inner a:not(.btn):hover,
.megamenu a:not(.btn):hover,
.mobile-menu a:not(.btn):hover,
.nav-link:hover,
.nav-submenu-link:hover,
.nav-submenu-link.active,
.mobile-menu-link:hover,
.mobile-menu-link.active,
.megamenu-item:hover,
.megamenu-item.active,
.bottom-nav a:hover,
.bottom-nav a.active,
.bottom-nav button:hover,
footer a:hover,
.navbar .navbar-items > li.active > .nav-link,
.navbar .navbar-items > li > .nav-link:hover {
  color: rgb(var(--kt-primary)) !important;
  background-color: rgb(var(--kt-primary) / .14) !important;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="password"],
input[type="number"],
textarea,
select {
  background-color: rgb(var(--menu-bg)) !important;
  color: rgb(var(--menu-text)) !important;
  border-color: rgb(var(--menu-line)) !important;
}
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: rgb(var(--menu-muted)) !important;
  opacity: 1 !important;
}

.btn-white,
.mobile-menu-btn,
.mobile-menu-close-btn {
  background-color: rgb(var(--menu-bg-2)) !important;
  color: rgb(var(--menu-text)) !important;
  --btn-color: rgb(var(--menu-text));
  --btn-hover-color: rgb(var(--kt-primary));
  border-color: rgb(var(--menu-line)) !important;
}

.theme-switcher,
.theme-switcher-mobile {
  background: rgb(var(--menu-bg-2)) !important;
  border-color: rgb(var(--menu-line)) !important;
}
.theme-switcher button,
.theme-switcher-mobile button {
  color: rgb(var(--menu-text)) !important;
}
.theme-switcher button.active,
.theme-switcher-mobile button.active {
  background: rgb(var(--kt-primary)) !important;
  color: #fff !important;
}

a.btn-primary,
button.btn-primary,
.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.discount-badge,
.announcement-bar,
.announcement-bar strong,
.text-white {
  color: #fff !important;
}
a.btn-primary,
button.btn-primary,
.btn-primary,
.btn-primary:hover,
.btn-primary:focus {
  background-color: rgb(var(--kt-primary)) !important;
  border-color: rgb(var(--kt-primary)) !important;
}

/* Marbaden floating dock inspired by the supplied Digikala reference. */
@media (max-width: 1023px) {
  body { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important; }
  .mb-floating-navigation {
    position: fixed !important;
    z-index: 9500 !important;
    left: 16px !important;
    right: 16px !important;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row-reverse !important; /* support button on the left, navigation pill on the right */
    gap: 12px !important;
    pointer-events: none !important;
  }
  .mb-nav-pill {
    pointer-events: auto !important;
    flex: 1 1 auto !important;
    max-width: 390px !important;
    min-width: 0 !important;
    height: 66px !important;
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-around !important;
    gap: 2px !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 999px !important;
    background: rgba(34,34,36,.96) !important;
    box-shadow: 0 9px 28px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.08) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
  }
  .mb-nav-item {
    position: relative !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    height: 54px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #a8a8ad !important;
    background: transparent !important;
    border: 0 !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  .mb-nav-item svg { width: 30px !important; height: 30px !important; fill: none !important; stroke: currentColor !important; stroke-width: 1.8 !important; stroke-linecap: round !important; stroke-linejoin: round !important; }
  .mb-nav-item:active { color: #fff !important; transform: scale(.94) !important; }
  .mb-nav-item[aria-current="page"] { color: #fff !important; }
  .mb-cart-count { position:absolute !important; top:3px !important; right:calc(50% - 22px) !important; min-width:17px !important; height:17px !important; padding:2px 4px !important; border-radius:99px !important; background:#e53935 !important; color:#fff !important; font-size:10px !important; line-height:13px !important; text-align:center !important; font-weight:700 !important; }
  .mb-chat-launcher {
    pointer-events: auto !important;
    flex: 0 0 66px !important;
    width: 66px !important;
    height: 66px !important;
    border: 0 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    background: linear-gradient(145deg,#7057f5,#287cf0) !important;
    box-shadow: 0 8px 25px rgba(47,104,238,.38) !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  .mb-chat-launcher svg { width: 32px !important; height: 32px !important; fill:none !important; stroke:currentColor !important; stroke-width:1.8 !important; stroke-linecap:round !important; stroke-linejoin:round !important; }
  .mb-chat-launcher:active { transform:scale(.94) !important; }
  /* Use our headset button as the visible trigger for the existing chat provider. */
  #goftino_w, #goftino, .goftino-widget, .goftino-launcher,
  #smartsupp-widget-container, .smartsupp-widget, #crisp-chatbox, .crisp-client,
  #tawkchat-container, .tawk-min-container,
  iframe[src*="goftino" i], iframe[id*="goftino" i],
  iframe[src*="smartsupp" i], iframe[id*="smartsupp" i],
  iframe[src*="crisp" i], iframe[src*="tawk" i], [id^="tawk"], [class*="tawk"] {
    right: 16px !important; left: auto !important;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important; transform: none !important;
  }
}
@media (min-width: 1024px) { .mb-floating-navigation { display:none !important; } }
.mb-footer-signature { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; padding:4px 0; text-align:center; }
.mb-footer-signature strong { color:rgb(var(--text)) !important; font-size:17px; line-height:1.15; letter-spacing:.3px; font-weight:800; }
.mb-footer-signature span { color:rgb(var(--text-muted)) !important; font-size:11px; line-height:1.5; }

/* Keep the mini-cart drawer above the floating mobile navigation. */
@media (max-width: 1023px) {
  #cart-drawer.drawer {
    z-index: 20000 !important;
  }
}

/* Keep the product-added-to-cart confirmation (including its instruction text)
   above the mobile floating navigation. */
@media (max-width: 1023px) {
  #product-addtocart-modal.modal {
    z-index: 30000 !important;
  }
}

/* V17: keep the account drawer above the floating dock, like the mini-cart. */
@media (max-width: 1023px) {
  #user-drawer.drawer {
    z-index: 20000 !important;
  }

  /* Glass-style back-to-top control, always above the dock and open drawers. */
  #marbaden-back-to-top {
    z-index: 40000 !important;
    color: #fff !important;
    background: rgba(42, 48, 58, .42) !important;
    border: 1px solid rgba(255, 255, 255, .34) !important;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .20),
                inset 0 1px 0 rgba(255, 255, 255, .28) !important;
    -webkit-backdrop-filter: blur(16px) saturate(155%) !important;
    backdrop-filter: blur(16px) saturate(155%) !important;
  }
}

/* V18: visibly relocate the glass back-to-top control above the mobile dock. */
@media (max-width: 1023px) {
  #marbaden-back-to-top {
    left: 18px !important;
    right: auto !important;
    bottom: calc(104px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 50000 !important;
    width: 48px !important;
    height: 48px !important;
    background: rgba(24, 39, 58, .58) !important;
    border: 1px solid rgba(255,255,255,.58) !important;
    color: #fff !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.38) !important;
    -webkit-backdrop-filter: blur(18px) saturate(170%) !important;
    backdrop-filter: blur(18px) saturate(170%) !important;
  }
}

/* V18: high-contrast reading progress track and fill. */
#marbaden-reading-progress {
  height: 5px !important;
  background: rgba(20, 35, 52, .28) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.16) !important;
}
#marbaden-reading-progress > span {
  background: linear-gradient(90deg, #ff7a00 0%, #ffc400 48%, #00b894 100%) !important;
  box-shadow: 0 0 8px rgba(255,122,0,.65), 0 0 3px rgba(0,0,0,.18) !important;
}

/* V18: the custom Marbaden headset is the only visible chat launcher. */
@media (max-width: 1023px) {
  .mb-chat-launcher { position: relative !important; z-index: 9501 !important; }
  #smartsupp-widget-container,
  .smartsupp-widget,
  iframe[id*="smartsupp" i], iframe[src*="smartsupp" i] {
    z-index: 1 !important;
  }
}

/* V18.1: keep the custom Marbaden headset aligned with the dock and
   lower the opened Smartsupp panel to the bottom safe-area edge. */
@media (max-width: 1023px) {
  .mb-floating-navigation { align-items: center !important; }
  .mb-chat-launcher {
    align-self: center !important;
    margin-block: 0 !important;
    transform: none !important;
  }
  /* The native launcher is hidden through Smartsupp's API; retain the
     container/iframe so the actual conversation panel remains available. */
  #smartsupp-widget-container,
  .smartsupp-widget,
  iframe[id*="smartsupp" i],
  iframe[src*="smartsupp" i] {
    bottom: env(safe-area-inset-bottom, 0px) !important;
    transform: none !important;
  }
}


/* =========================================================
   Product gallery (Digikala style)
   Free horizontal strip of groups: [ big portrait | two small portrait tiles ].
   The next group peeks in from the edge, images always fill their tile.
   Sizes derive from one variable (--dk-big); all gallery tiles use a 4:5 portrait ratio.
   ========================================================= */
.dk-gallery {
  --dk-big: min(70vw, 460px);
  --dk-big: min(70cqw, 460px);
  --dk-big-h: calc(var(--dk-big) * 1.25);
  --dk-gap: 10px;
  --dk-pad: 16px;
  --dk-small: calc((var(--dk-big) - var(--dk-gap)) / 2);
  --dk-small-h: calc((var(--dk-big-h) - var(--dk-gap)) / 2);
  --dk-radius: 18px;
  position: relative;
  direction: rtl;
  container-type: inline-size;
  -webkit-tap-highlight-color: transparent;
}
.dk-stage {
  position: relative;
  height: var(--dk-big-h);
  overflow: hidden;
}
.dk-track {
  display: flex;
  align-items: flex-start;
  gap: var(--dk-gap);
  height: 100%;
  direction: rtl;
  padding-inline: var(--dk-pad);
  scroll-padding-inline: var(--dk-pad);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dk-track::-webkit-scrollbar { display: none; }
.dk-group {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: var(--dk-gap);
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}
.dk-side { display: flex; flex-direction: column; gap: var(--dk-gap); }
.dk-item {
  position: relative;
  flex: 0 0 auto;
  width: var(--dk-small);
  height: var(--dk-small-h);
  overflow: hidden;
  border-radius: var(--dk-radius);
  background: rgb(var(--border));
  cursor: pointer;
  transition: transform .15s ease;
}
.dk-group > .dk-item:first-child,
.dk-track > .dk-item { width: var(--dk-big); height: var(--dk-big-h); }
.dk-track > .dk-item { scroll-snap-align: start; }
.dk-item:active { transform: scale(.985); }
.dk-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;        /* preserve the original 4:5 product photo without cropping */
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Keep gallery images non-draggable and disable iOS long-press image callout. */
.dk-viewer-thumb { position: relative; overflow: hidden; -webkit-touch-callout: none; }
.dk-item, .dk-item img, .dk-viewer-main, .dk-viewer-main img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

/* Glass surface used by the badge, the progress pill and the arrows */
.dk-glass {
  color: #fff;
  background: rgba(52, 52, 56, .5);
  border: 1px solid rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(12px) saturate(170%);
  backdrop-filter: blur(12px) saturate(170%);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255, 255, 255, .3);
}

/* "Best price in the last 30 days" badge: bottom of the big tile */
.dk-badge {
  position: absolute;
  right: calc(var(--dk-pad) + 8px);
  bottom: 8px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 3px 0 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  cursor: default;
  user-select: none;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 14px, 0);
  transition: opacity .42s ease, transform .42s cubic-bezier(.2,.75,.25,1), visibility .42s;
}
.dk-badge.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
}
.dk-badge > span:last-child { padding-top: 2px; font-feature-settings: "ss02"; }
.dk-badge-emoji {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  background: rgba(0, 0, 0, .5);
}

/* Progress pill: bottom left of the strip, follows the scroll live */
.dk-progress {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 19px;
  padding: 0 8px;
  border-radius: 999px;
  direction: ltr;
  pointer-events: auto;
  cursor: default;
  user-select: none;
}
.dk-progress[hidden] { display: none; }
.dk-progress-track {
  position: relative;
  display: block;
  width: 42px;
  height: 2px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .34);
}
.dk-progress-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 14px;
  border-radius: 99px;
  background: #fff;
  box-shadow: 0 0 5px rgba(255, 255, 255, .6);
  transform: translate3d(0, 0, 0);
  will-change: transform;
}
.dk-progress-sep { width: 1px; height: 11px; background: rgba(255, 255, 255, .45); }
.dk-progress-num {
  min-width: 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding-top: 2px;
  font-feature-settings: "ss02";
}
.dk-progress-icon {
  display: block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  opacity: .95;
}

/* Arrows: desktop only, appear on hover */
.dk-nav {
  position: absolute;
  top: 50%;
  z-index: 7;
  width: 38px;
  height: 38px;
  margin-top: -19px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  opacity: 0;
  transition: opacity .2s, transform .2s;
}
.dk-nav-next { left: 10px; }
.dk-nav-prev { right: 10px; }
.dk-nav:hover { transform: scale(1.08); }
.dk-nav[disabled] { visibility: hidden; }
@media (min-width: 1024px) {
  .dk-gallery { --dk-pad: 0px; }
  .dk-nav { display: flex; }
  .dk-stage:hover .dk-nav { opacity: 1; }
}
.dk-gallery.is-single .dk-nav { display: none !important; }

/* Full-screen viewer (opens on tap) */
.dk-viewer {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  flex-direction: column;
  direction: rtl;
  background: #fff;
  color: #18191d;
}
.dk-viewer.is-open { display: flex; }
.dk-viewer-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid #eceef3;
}
.dk-viewer-title { font-size: 14px; font-weight: 700; padding-top: 3px; }
.dk-viewer-counter { font-size: 13px; color: #6b7280; font-feature-settings: "ss02"; padding-top: 3px; }
.dk-viewer-close {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 16px; color: #3b3f4a; background: #f1f2f6;
}
.dk-viewer-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.dk-viewer-main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: pan-y;
  cursor: zoom-in;
  background: #fff;
}
.dk-viewer-main.is-zoomed { cursor: zoom-out; touch-action: none; }
.dk-viewer-main img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .24s cubic-bezier(.2,.7,.25,1), opacity .22s ease-in-out;
}
.dk-viewer-main img.is-switching { opacity: .08; }
.dk-viewer-main.is-zoomed img { transform: scale(2.4); transition: none; }
.dk-viewer-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 44px; height: 44px;
  margin-top: -22px;
  display: none;
  align-items: center; justify-content: center;
  border-radius: 50%; font-size: 14px; color: #3b3f4a;
  background: #fff; box-shadow: 0 1px 10px rgba(0,0,0,.2);
}
.dk-viewer-arrow-next { left: 16px; }
.dk-viewer-arrow-prev { right: 16px; }
.dk-viewer-thumbs {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 14px max(12px, env(safe-area-inset-bottom));
  overflow-x: auto;
  scrollbar-width: none;
  border-top: 1px solid #eceef3;
  direction: rtl;
}
.dk-viewer-thumbs::-webkit-scrollbar { display: none; }
.dk-viewer-thumb {
  flex: 0 0 64px;
  width: 64px; height: 64px;
  padding: 3px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e0e2e8;
  opacity: .75;
  transition: opacity .2s ease, border-color .2s ease, transform .2s cubic-bezier(.2,.7,.25,1);
}
.dk-viewer-thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: 7px; }
.dk-viewer-thumb.is-active { opacity: 1; border: 2px solid rgb(var(--kt-primary)); padding: 2px; }
@media (min-width: 1024px) {
  .dk-viewer-body { flex-direction: row; }
  .dk-viewer-arrow { display: flex; }
  .dk-viewer-thumbs {
    order: -1;
    flex-direction: column;
    width: 100px;
    padding: 16px 18px;
    overflow-x: hidden;
    overflow-y: auto;
    border-top: 0;
    border-left: 1px solid #eceef3;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dk-item, .dk-nav, .dk-viewer-main img { transition: none !important; }
}

/* =========================================================
   Digikala canvas + two-state theme toggle (light / dark)
   Page background matches Digikala #f0f0f1. Cards and the
   header stay white so the gray canvas stays visible.
   ========================================================= */
:root,
[data-theme="light"] {
  --dk-canvas: 240 240 241;
  color-scheme: light;
}
[data-theme="dark"] {
  --dk-canvas: 18 20 28;
  color-scheme: dark;
}
html,
body {
  background-color: rgb(var(--dk-canvas)) !important;
}
[data-theme="light"] .product-card {
  background-color: #fff !important;
}

.theme-switcher,
.theme-switcher-mobile {
  display: none !important;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: rgb(var(--menu-text));
  cursor: pointer;
  font: inherit;
  line-height: 1.4;
}
.theme-toggle .theme-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: block;
}
.theme-toggle .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }
.theme-toggle-label::before { content: "حالت تاریک"; }
[data-theme="dark"] .theme-toggle-label::before { content: "حالت روشن"; }

.theme-toggle-menu {
  margin-inline-start: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.theme-toggle-menu:hover {
  color: rgb(var(--kt-primary)) !important;
  background: rgb(var(--kt-primary) / .1) !important;
}

.theme-toggle-drawer {
  margin: 0 24px 8px;
  padding: 12px 14px;
  border: 1px solid rgb(var(--menu-line));
  border-radius: 12px;
  background: rgb(var(--menu-bg)) !important;
  font-size: 14px;
  font-weight: 600;
  justify-content: flex-start;
}


/* M3.11 — compact Digikala-style header on product pages only */
body:has(.product-container) .navigation-space,
body:has(.product-container) .navbar {
  display: none !important;
}
body:has(.product-container) .product-page-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 7px 14px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(30,35,45,.08);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  direction: rtl;
}
body[data-theme="dark"]:has(.product-container) .product-page-topbar {
  background: rgba(18,20,28,.96);
  border-bottom-color: rgba(255,255,255,.1);
}
.product-topbar-close,
.product-topbar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: rgb(var(--kt-secondary));
  background: transparent;
  font-size: 21px;
  line-height: 1;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.product-topbar-close:active,
.product-topbar-action:active { background: rgba(120,125,140,.12); }
.product-topbar-actions { display: flex; align-items: center; gap: 5px; direction: ltr; }
.product-topbar-cart { position: relative; display: inline-flex; }
.product-topbar-cart-count {
  position: absolute;
  top: -1px;
  right: -2px;
  min-width: 16px;
  padding: 2px 4px;
  border-radius: 10px;
  color: #fff;
  background: rgb(var(--kt-primary));
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  pointer-events: none;
}


/* M3.12 — product topbar refinements */
body:has(.product-container) .announcement-bar {
  display: flex !important;
  position: relative !important;
  top: auto !important;
  min-height: 34px;
  padding: 6px 10px !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
  z-index: 1001 !important;
}
body:has(.product-container) .product-page-topbar {
  position: sticky;
  top: 0;
  min-height: 48px;
  padding: 5px 12px;
  color: rgb(var(--text));
  background: rgb(var(--surface) / .94) !important;
  border-bottom: 1px solid rgb(var(--border) / .85) !important;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
body[data-theme="dark"]:has(.product-container) .product-page-topbar,
body[data-theme="dim"]:has(.product-container) .product-page-topbar {
  color: rgb(var(--text));
  background: rgb(var(--surface) / .94) !important;
  border-bottom-color: rgb(var(--border) / .85) !important;
}
body:has(.product-container) .product-topbar-close,
body:has(.product-container) .product-topbar-action {
  color: rgb(var(--text)) !important;
  background: transparent !important;
}
body:has(.product-container) .product-topbar-close:active,
body:has(.product-container) .product-topbar-action:active {
  background: rgb(var(--text) / .08) !important;
}
.product-cart-trolley { width: 25px; height: 25px; display: block; }
.product-topbar-cart-count { z-index: 2; }
/* Keep the product breadcrumb to a compact single line. */
.product-container > .container > .breadcrumb {
  display: flex !important;
  align-items: center !important;
  min-height: 25px !important;
  max-height: 28px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  margin-top: 8px !important;
  margin-bottom: 10px !important;
  padding: 2px 0 !important;
  line-height: 1.4 !important;
  font-size: 11px !important;
}
.product-container > .container > .breadcrumb > * { flex: 0 0 auto; }
.product-container > .container > .breadcrumb a:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
@media (max-width: 767px) {
  .product-container > .container > .breadcrumb {
    min-height: 23px !important;
    max-height: 25px !important;
    margin-top: 6px !important;
    margin-bottom: 8px !important;
    font-size: 10px !important;
  }
}


/* M3.13 — persistent Snapp banner, swapped product actions, theme-aware progress, chat restoration. */
body:has(.product-container) .announcement-bar {
  position: sticky !important;
  top: 0 !important;
  z-index: 1102 !important;
  min-height: 34px !important;
  display: flex !important;
  align-items: center !important;
}
body:has(.product-container) .product-page-topbar {
  position: sticky !important;
  top: 34px !important;
  z-index: 1101 !important;
}
/* Progress track/fill follow the same theme accent used by the site controls. */
#marbaden-reading-progress {
  background: rgb(var(--text-muted) / .28) !important;
  box-shadow: 0 1px 3px rgb(var(--shadow-color) / .14) !important;
}
#marbaden-reading-progress > span {
  background: rgb(var(--kt-primary)) !important;
  box-shadow: 0 0 5px rgb(var(--kt-primary) / .28) !important;
}
[data-theme="dark"] #marbaden-reading-progress,
[data-theme="dim"] #marbaden-reading-progress {
  background: rgb(var(--text-muted) / .38) !important;
}
[data-theme="dark"] #marbaden-reading-progress > span,
[data-theme="dim"] #marbaden-reading-progress > span {
  background: rgb(var(--kt-primary)) !important;
  box-shadow: 0 0 6px rgb(var(--kt-primary) / .38) !important;
}
/* Do not suppress or lower Smartsupp's conversation iframe; let its own launcher remain usable. */
#smartsupp-widget-container, .smartsupp-widget,
iframe[src*="smartsupp" i], iframe[id*="smartsupp" i] {
  visibility: visible !important;
  opacity: 1 !important;
}


/* M3.14 — Black Friday campaign ribbon, home welcome modal and product menu button. */
.mb-blackfriday-ribbon { display:none; }
body:has(.product-container) .mb-blackfriday-ribbon {
  display:flex; position:sticky; top:0; z-index:1104; min-height:27px; box-sizing:border-box;
  align-items:center; justify-content:center; gap:7px; padding:4px 10px;
  color:#f7e7d0; background:linear-gradient(100deg,#171316,#3b1723 52%,#171316);
  border-bottom:1px solid rgba(205,164,119,.42); font-size:10px; line-height:1.35; font-weight:800;
  letter-spacing:.15px; text-align:center;
}
.mb-blackfriday-ribbon span { font-weight:500; color:#e5c9ad; }
body:has(.product-container) .announcement-bar { top:27px !important; }
body:has(.product-container) .product-page-topbar { top:61px !important; }
.product-topbar-menu {
  display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; padding:0;
  border:0; border-radius:11px; color:rgb(var(--text)); background:transparent; font-size:23px;
  -webkit-tap-highlight-color:transparent; cursor:pointer;
}
.product-topbar-menu:active { background:rgb(var(--text) / .09); }

/* Black Friday homepage modal */
.mb-bf-overlay { position:fixed; inset:0; z-index:10050; display:none; align-items:center; justify-content:center; padding:12px; background:rgba(8,7,9,.78); backdrop-filter:blur(5px); -webkit-backdrop-filter:blur(5px); }
.mb-bf-overlay.is-open { display:flex; animation:mbBfFade .22s ease both; }
.mb-bf-modal {
  position:relative; width:min(100%,560px); max-height:min(94vh,900px); overflow:auto; overscroll-behavior:contain;
  padding:24px 22px 18px; color:#f7eee7; text-align:center; direction:rtl;
  background:radial-gradient(ellipse at 50% 18%,#351b25 0%,#21191d 42%,#111114 100%);
  border:1px solid rgba(190,157,119,.7); outline:1px solid rgba(190,157,119,.28); outline-offset:-7px;
  box-shadow:0 24px 80px rgba(0,0,0,.5); border-radius:3px;
}
.mb-bf-close { position:absolute; top:13px; right:13px; width:42px; height:42px; border:1px solid rgba(255,255,255,.28); border-radius:13px; background:#e99bb0; color:#261a1e; font-size:27px; line-height:1; font-weight:700; cursor:pointer; }
.mb-bf-brand { margin:6px 0 8px; color:#d8bd91; font-size:13px; letter-spacing:7px; font-weight:500; direction:ltr; }
.mb-bf-title { margin:0 auto 10px; display:flex; flex-direction:column; direction:ltr; font-family:Georgia,'Times New Roman',serif; font-size:clamp(48px,12vw,82px); line-height:.91; letter-spacing:-2px; font-weight:900; }
.mb-bf-title span { color:#f7eee7; }
.mb-bf-title strong { color:#c66c79; font-weight:900; }
.mb-bf-subtitle { margin:18px 0 4px; font-size:clamp(17px,4.4vw,23px); font-weight:900; }
.mb-bf-caption { margin:0 0 17px; color:#c5b9b8; font-size:14px; }
.mb-bf-tiers { display:grid; gap:8px; }
.mb-bf-tier { min-height:58px; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:9px 12px; border:1px solid rgba(196,164,128,.3); border-radius:8px; background:rgba(255,255,255,.045); text-align:right; }
.mb-bf-tier span { display:flex; flex-direction:column; gap:3px; font-size:13px; font-weight:700; }
.mb-bf-tier span b { color:#d9b58d; font-size:11px; }
.mb-bf-tier > strong { color:#e3c29c; font-size:12px; white-space:nowrap; }
.mb-bf-tier-featured { border-color:#b98270; background:rgba(105,28,47,.28); }
.mb-bf-payment { margin:14px 0 12px; color:#d7ccca; font-size:14px; }
.mb-bf-payment b { color:#fff; font-size:26px; margin:0 5px; }
.mb-bf-cta { display:flex; width:100%; min-height:58px; align-items:center; justify-content:center; gap:18px; padding:10px 14px; border:1px solid #d29b7f; border-radius:7px; color:#fff; background:linear-gradient(100deg,#81243d,#a32c4b); font-size:16px; font-weight:900; cursor:pointer; }
.mb-bf-cta span { font-size:25px; line-height:1; }
.mb-bf-footer { margin-top:14px; color:#827a78; font-size:10px; letter-spacing:5px; direction:ltr; }
@keyframes mbBfFade { from { opacity:0; } to { opacity:1; } }
@media (max-width:380px) { .mb-bf-modal { padding:20px 14px 14px; } .mb-bf-tier { padding:8px; } .mb-bf-tier span { font-size:11px; } .mb-bf-tier > strong { font-size:10px; } .mb-bf-title { font-size:48px; } }
@media (prefers-reduced-motion:reduce) { .mb-bf-overlay.is-open { animation:none; } }

body.mb-bf-modal-open { overflow:hidden !important; }


/* M3.14.4 — Product-page mobile menu fix.
   Root cause (M3.14.3): the product topbar was given z-index 1201, higher than the
   menu drawer (1200), so the topbar was painted OVER the drawer (covering its logo
   and close button) and swallowed taps in that area. The back-to-top button (99990)
   also sat above the drawer. Fix: the drawer now sits above every sticky header
   element, and the topbar goes back below it. */
body:has(.product-container) .product-page-topbar {
  z-index: 1101 !important;
}
body:has(.product-container) .mobile-menu-holder,
.mobile-menu-holder {
  z-index: 100010 !important;
}
.mobile-menu-holder .mobile-menu-backdrop,
body:has(.product-container) .mobile-menu-backdrop {
  z-index: 1 !important;
}
.mobile-menu-holder .mobile-menu {
  z-index: 2 !important;
  height: 100% !important;
  max-height: 100dvh;
  padding-top: env(safe-area-inset-top, 0px);
}
/* Hide floating widgets while the drawer is open so they cannot cover or intercept taps. */
body.mobile-menu-opened #marbaden-back-to-top,
body.mobile-menu-opened .mb-chat-launcher,
body.mobile-menu-opened #smartsupp-widget-container {
  visibility: hidden !important;
  pointer-events: none !important;
}
body.mobile-menu-opened { overflow: hidden; }


/* M3.14.7 — compact, centered floating dock (Digikala-style) + slim promo bar above it. */
@media (max-width: 1023px) {
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }
  .mb-floating-navigation { justify-content: center !important; gap: 0 !important; }
  .mb-dock-main {
    position: relative !important; flex: 0 0 auto !important; min-width: 0 !important;
    width: min(280px, calc((100vw - 16px) / 1.12)) !important; max-width: none !important;
    pointer-events: none !important;
  }
  .mb-nav-pill {
    position: relative !important; z-index: 2 !important;
    flex: none !important; width: 100% !important; max-width: none !important;
    height: 54px !important; padding: 0 8px !important; gap: 0 !important;
  }
  .mb-nav-item { height: 46px !important; }
  .mb-nav-item svg { width: 25px !important; height: 25px !important; }
  .mb-cart-count { top: 0 !important; right: calc(50% - 20px) !important; min-width: 15px !important; height: 15px !important; padding: 1px 3px !important; font-size: 9px !important; line-height: 13px !important; }
  #marbaden-back-to-top { bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* Promo bar: slim, centered, tucked behind the top edge of the dock; slides up when shown. */
.mb-promo { display: none; }
@media (max-width: 1023px) {
  .mb-promo {
    display: flex !important; align-items: center; gap: 6px; direction: rtl;
    position: absolute; z-index: 1; left: 0; right: 0; width: auto;
    bottom: calc(100% - 18px); box-sizing: border-box;
    padding: 4px 10px 22px 8px; border-radius: 14px 14px 0 0;
    color: #fff; background: rgba(46,46,50,.97);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 6px 18px rgba(0,0,0,.24);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    opacity: 0; visibility: hidden; transform: translateY(12px);
    transition: opacity .35s ease, transform .35s ease, visibility 0s linear .35s;
    pointer-events: none;
  }
  .mb-promo.is-visible {
    opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
    transition: opacity .35s ease, transform .35s ease, visibility 0s;
  }
  .mb-promo-text {
    flex: 1 1 auto; min-width: 0; text-align: right; font-size: 11px; line-height: 1.5; font-weight: 600;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .mb-promo-close {
    flex: 0 0 auto; order: 2; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; color: rgba(255,255,255,.65);
    background: transparent; -webkit-tap-highlight-color: transparent; cursor: pointer;
  }
  .mb-promo-close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  body.mobile-menu-opened .mb-promo, body.drawer-opened .mb-promo { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }
}
@media (prefers-reduced-motion: reduce) { .mb-promo, .mb-promo.is-visible { transition: none !important; } }

/* The headset button is gone, so Smartsupp's own launcher is parked above the back-to-top button (left side).
   custom.js sets html.mb-ss-closed only while the conversation is closed; the open panel keeps Smartsupp's placement. */
html.mb-ss-closed #smartsupp-widget-container,
html.mb-ss-closed .smartsupp-widget,
html.mb-ss-closed #chat-application,
html.mb-ss-closed iframe[id*="smartsupp" i],
html.mb-ss-closed iframe[src*="smartsupp" i] {
  left: 12px !important; right: auto !important; top: auto !important; transform: none !important;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
}
@media (max-width: 1023px) {
  html.mb-ss-closed #smartsupp-widget-container,
  html.mb-ss-closed .smartsupp-widget,
  html.mb-ss-closed #chat-application,
  html.mb-ss-closed iframe[id*="smartsupp" i],
  html.mb-ss-closed iframe[src*="smartsupp" i] {
    bottom: calc(148px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* M3.14.8 — dock + promo bar: faint glass while scrolling, then settle slightly larger as dark semi-glass.
   html.mb-scrolling is set by custom.js during scrolling and removed ~0.5s after the user stops. */
@media (max-width: 1023px) {
  .mb-dock-main {
    transform-origin: 50% 100% !important;
    transform: scale(1.12) !important;
    transition: transform .45s cubic-bezier(.2,.8,.2,1) !important;
    will-change: transform;
  }
  html.mb-scrolling .mb-dock-main { transform: scale(1) !important; }

  .mb-floating-navigation .mb-nav-pill {
    background: rgba(34,34,36,.82) !important;
    -webkit-backdrop-filter: blur(18px) saturate(160%) !important;
    backdrop-filter: blur(18px) saturate(160%) !important;
    transition: background-color .4s ease, border-color .4s ease, box-shadow .4s ease !important;
  }
  .mb-floating-navigation .mb-promo {
    background: rgba(46,46,50,.82);
    -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  }
  html.mb-scrolling .mb-floating-navigation .mb-nav-pill {
    background: rgba(34,34,36,.56) !important;
    border-color: rgba(255,255,255,.16) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.12) !important;
  }
  html.mb-scrolling .mb-floating-navigation .mb-promo {
    background: rgba(46,46,50,.56);
    border-color: rgba(255,255,255,.16);
    box-shadow: 0 4px 14px rgba(0,0,0,.14);
  }
  html.mb-scrolling .mb-floating-navigation .mb-promo-text { text-shadow: 0 1px 2px rgba(0,0,0,.45); }
  .mb-floating-navigation .mb-promo {
    transition: opacity .35s ease, transform .35s ease, background-color .4s ease, border-color .4s ease, box-shadow .4s ease, visibility 0s linear .35s;
  }
  .mb-floating-navigation .mb-promo.is-visible {
    transition: opacity .35s ease, transform .35s ease, background-color .4s ease, border-color .4s ease, box-shadow .4s ease, visibility 0s;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mb-dock-main, .mb-floating-navigation .mb-nav-pill, .mb-floating-navigation .mb-promo { transition: none !important; }
}


/* M3.14.9 — categories drawer opens full screen on mobile; the dock stays above it so the
   "دسته‌بندی" button can close it again (custom.js toggles it). */
@media (max-width: 1023px) {
  #categories-drawer .drawer-inner {
    left: 0 !important; right: 0 !important; top: 0 !important; bottom: 0 !important;
    width: 100% !important; height: 100% !important; max-height: none !important;
    border-radius: 0 !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
    --tw-translate-x: 0 !important; --tw-translate-y: 100% !important;
  }
  #categories-drawer.active .drawer-inner { --tw-translate-y: 0 !important; }
  /* keep floating extras from covering the full-screen list */
  body:has(#categories-drawer.active) #marbaden-back-to-top,
  body:has(#categories-drawer.active) #smartsupp-widget-container,
  body:has(#categories-drawer.active) .smartsupp-widget,
  body:has(#categories-drawer.active) iframe[id*="smartsupp" i],
  body:has(#categories-drawer.active) iframe[src*="smartsupp" i] {
    visibility: hidden !important; pointer-events: none !important;
  }
}


/* M3.14.10 — categories drawer styled like Digikala:
   narrow right column of main categories (active one highlighted), left area with a blue
   "all products" link and large rows separated by hairlines with a chevron at the far side. */
@media (max-width: 1023px) {
  /* slim header */
  #categories-drawer .drawer-inner > widget > div:first-child,
  #categories-drawer .drawer-inner > div:first-child { padding-top: 12px !important; padding-bottom: 8px !important; border-bottom: 0 !important; }

  /* right column */
  #categories-drawer .megamenu-items {
    width: 86px !important; flex: 0 0 86px !important; padding: 0 0 24px !important;
    background: transparent !important; overflow-x: hidden !important; overflow-y: auto !important;
  }
  #categories-drawer .megamenu-items > li { margin: 0 !important; }
  #categories-drawer .megamenu-items .megamenu-item {
    display: flex !important; align-items: center !important; justify-content: center !important;
    min-height: 62px !important; padding: 14px 6px !important; text-align: center !important;
    font-size: 11.5px !important; line-height: 1.7 !important; font-weight: 500 !important;
    color: rgb(var(--text-muted)) !important;
    background: rgb(var(--text) / .05) !important;
    border-bottom: 1px solid rgb(var(--text) / .09) !important;
    border-right: 0 !important; border-radius: 0 !important;
  }
  #categories-drawer .megamenu-items .megamenu-item.active {
    color: rgb(var(--kt-primary)) !important; font-weight: 700 !important;
    background: transparent !important; box-shadow: none !important;
  }

  /* left area */
  #categories-drawer .megamenu-content { padding: 0 !important; }
  #categories-drawer .megamenu-content > * + * { margin-top: 0 !important; }
  #categories-drawer .megamenu-content > a:first-child {
    display: flex !important; align-items: center !important; padding: 14px 4px 10px !important;
    color: rgb(var(--kt-blue)) !important; font-size: 13.5px !important; font-weight: 700 !important;
  }
  #categories-drawer .megamenu-content > a:first-child .icon-angle-left { opacity: .9 !important; margin-right: 6px !important; }
  /* rows */
  #categories-drawer .megamenu-content > a:not(:first-child),
  #categories-drawer .megamenu-content > div {
    border-bottom: 1px solid rgb(var(--text) / .10);
  }
  #categories-drawer .megamenu-content > a:not(:first-child) {
    display: block !important; padding: 18px 4px !important; font-size: 14px !important; font-weight: 700 !important; line-height: 1.6 !important;
  }
  #categories-drawer .megamenu-content .accordion-title {
    display: flex !important; align-items: center !important; width: 100% !important;
    padding: 18px 4px !important; font-size: 14px !important; font-weight: 700 !important; line-height: 1.6 !important;
  }
  #categories-drawer .megamenu-content .accordion-title .accordion-arrow { opacity: .55 !important; font-size: 12px !important; margin-left: 4px !important; }
  #categories-drawer .megamenu-content .collapsed-content ul { padding: 0 4px 12px !important; }
  #categories-drawer .megamenu-content .collapsed-content a { padding: 10px 0 !important; font-size: 13px !important; font-weight: 500 !important; }

  /* the dock's categories button looks "pressed" while the drawer is open */
  body:has(#categories-drawer.active) .mb-nav-item[data-drawer="#categories-drawer"] {
    background: rgba(255,255,255,.10) !important; border-radius: 999px !important; color: #fff !important;
  }
}


/* M3.14.11 — (1) categories drawer sits above the product-page topbar (z 1101) but below the dock (9500),
   so its close button is no longer hidden under the header. (2) Product image viewer: smooth scroll-snap
   carousel, thumbnails at the bottom on mobile. */
@media (max-width: 1023px) {
  #categories-drawer { z-index: 9400 !important; }
}
.dk-viewer-main { touch-action: auto !important; cursor: default !important; }
.dk-viewer-track {
  position: absolute; inset: 0; display: flex; direction: rtl;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; touch-action: pan-x;
}
.dk-viewer-track::-webkit-scrollbar { display: none; }
.dk-viewer-slide {
  flex: 0 0 100%; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  scroll-snap-align: center; scroll-snap-stop: always; overflow: hidden;
}
.dk-viewer-slide img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  pointer-events: none; user-select: none; -webkit-user-select: none;
  transition: transform .24s cubic-bezier(.2,.7,.25,1);
}
.dk-viewer-slide img.is-zoomed { transform: scale(2.4); transition: none; }
.dk-viewer-main.is-zoomed .dk-viewer-track { overflow-x: hidden; scroll-snap-type: none; touch-action: none; }
@media (max-width: 1023px) {
  .dk-viewer-thumbs { order: 2; }
}


/* M3.14.12 — Product page (mobile), Digikala-style "curtain":
   the image gallery stays pinned under the sticky header while the information panel slides up over it,
   with rounded top corners and a small grab-handle bar as separator. */
@media (max-width: 1023px) {
  .dk-gallery-sticky-shell {
    position: sticky;
    top: var(--mb-sticky-top, 110px);
    z-index: 0;
  }
  .dk-content-curtain {
    position: relative;
    z-index: 2;
    width: auto !important;
    margin: 6px -16px 0 !important;
    padding: 10px 16px 0 !important;
    background: rgb(var(--dk-canvas));
    border-radius: 26px 26px 0 0;
    border-top: 2.5px solid #ef4444;
    box-shadow: 0 -14px 34px rgba(0,0,0,.14);
  }
  .dk-content-curtain::before {
    content: "";
    display: block;
    width: 64px; height: 6px;
    margin: 0 auto 16px;
    border-radius: 999px;
    background: #ef4444;
    animation: mbBarGlow 2.8s ease-in-out infinite;
  }
}

/* M3.14.12 — full-screen image viewer follows the site theme (light / dim / dark). */
.dk-viewer {
  --dkv-bg: 255 255 255; --dkv-text: 24 25 29; --dkv-muted: 107 114 128;
  --dkv-line: 236 238 243; --dkv-chip: 241 242 246; --dkv-chip-text: 59 63 74;
  --dkv-thumb-bg: 255 255 255; --dkv-thumb-border: 224 226 232;
  background: rgb(var(--dkv-bg)); color: rgb(var(--dkv-text));
}
[data-theme="dark"] .dk-viewer,
[data-theme="dim"] .dk-viewer {
  --dkv-bg: 18 20 28; --dkv-text: 235 237 243; --dkv-muted: 148 163 184;
  --dkv-line: 40 44 58; --dkv-chip: 36 40 54; --dkv-chip-text: 214 218 228;
  --dkv-thumb-bg: 26 29 40; --dkv-thumb-border: 52 57 74;
}
.dk-viewer-top { border-bottom-color: rgb(var(--dkv-line)); }
.dk-viewer-counter { color: rgb(var(--dkv-muted)); }
.dk-viewer-close { background: rgb(var(--dkv-chip)); color: rgb(var(--dkv-chip-text)); }
.dk-viewer-main { background: rgb(var(--dkv-bg)); }
.dk-viewer-arrow { background: rgb(var(--dkv-chip)); color: rgb(var(--dkv-chip-text)); box-shadow: 0 1px 10px rgba(0,0,0,.25); }
.dk-viewer-thumbs { border-top-color: rgb(var(--dkv-line)); }
.dk-viewer-thumb { background: rgb(var(--dkv-thumb-bg)); border-color: rgb(var(--dkv-thumb-border)); }
.dk-viewer-thumb.is-active { border-color: rgb(var(--kt-primary)); }
@media (min-width: 1024px) {
  .dk-viewer-thumbs { border-left-color: rgb(var(--dkv-line)); }
}


/* M3.14.13 — thin red bar along the curtain's rounded top edge with a very faint light sweeping back and forth;
   the red grab handle gently "breathes". */
@keyframes mbBarGlow {
  0%, 100% { background-color: #ef4444; box-shadow: 0 0 0 rgba(239,68,68,0); }
  50%      { background-color: #f46a68; box-shadow: 0 0 7px rgba(239,68,68,.40); }
}
@keyframes mbEdgeSweep {
  from { background-position: 100% 0; }
  to   { background-position: 0 0; }
}
@media (max-width: 1023px) {
  .dk-content-curtain::after {
    content: "";
    position: absolute;
    top: -2.5px; left: 26px; right: 26px; height: 2.5px;
    border-radius: 2px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent 0%, transparent 38%, rgba(255,255,255,.55) 50%, transparent 62%, transparent 100%);
    background-size: 300% 100%;
    animation: mbEdgeSweep 3.6s ease-in-out infinite alternate;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dk-content-curtain::before, .dk-content-curtain::after { animation: none !important; }
}
