/* ==========================================================================
   MUGDOST - 3-COLUMN FLAGSHIP MINIMAL PDP + MODERN RELATED PRODUCTS
   ========================================================================== */

#md-pdp {
  --md-bg: #ffffff;
  --md-surface: #f8fafc;
  --md-surface-2: #f1f5f9;
  --md-border: #e5e7eb;
  --md-border-hover: #cbd5e1;

  --md-text: #0f172a;
  --md-text-muted: #475569;
  --md-text-light: #94a3b8;

  --md-brand: #0f4c3a;
  --md-brand-hover: #0a3629;
  --md-brand-soft: #ecfdf5;
  --md-brand-border: #a7f3d0;

  --md-radius-xl: 22px;
  --md-radius-lg: 16px;
  --md-radius-md: 12px;
  --md-radius-pill: 999px;

  --md-shadow-card: 0 18px 40px -16px rgba(15, 23, 42, 0.1);
  --md-shadow-sm: 0 4px 14px -4px rgba(15, 23, 42, 0.06);
  --md-transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);

  background-color: var(--md-bg);
  color: var(--md-text);
  padding: 20px 0 80px;
}

#md-pdp .md-pdp-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- ۱. نوار بالای صفحه --- */
#md-pdp .md-pdp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--md-border);
}

#md-pdp .md-pdp-breadcrumb {
  font-size: 13px;
  color: var(--md-text-light);
}

#md-pdp .md-pdp-breadcrumb a {
  color: var(--md-text-muted);
  text-decoration: none;
}

#md-pdp .md-pdp-breadcrumb a:hover {
  color: var(--md-brand);
}

#md-pdp .md-sku-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--md-text-muted);
  background: var(--md-surface);
  border: 1px solid var(--md-border);
  padding: 4px 12px;
  border-radius: var(--md-radius-pill);
}

/* --- ۲. گرید ۳ ستونه اصلی --- */
#md-pdp .md-pdp-grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr) minmax(320px, 380px);
  gap: 36px;
  align-items: start;
}

@media (min-width: 1100px) {
  #md-pdp .md-sticky-box {
    position: sticky;
    top: 96px;
  }
}

/* --- ۳. ستون راست: گالری --- */
#md-pdp .woocommerce-product-gallery {
  margin: 0 !important;
  width: 100% !important;
}

#md-pdp .wd-gallery-images .wd-carousel-inner,
#md-pdp .woocommerce-product-gallery__wrapper {
  border-radius: var(--md-radius-xl);
  overflow: hidden;
  background: var(--md-surface);
  border: 1px solid var(--md-border);
}

#md-pdp .product-labels {
  top: 14px;
  right: 14px;
  left: auto;
  z-index: 5;
}

#md-pdp .product-labels .onsale.product-label {
  background: var(--md-text) !important;
  color: #ffffff !important;
  border-radius: var(--md-radius-pill) !important;
  padding: 5px 12px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

#md-pdp .wd-gallery-thumb .wd-carousel-item img {
  border-radius: var(--md-radius-md);
  border: 2px solid transparent;
  opacity: 0.6;
  transition: var(--md-transition);
}

#md-pdp .wd-gallery-thumb .wd-carousel-item:hover img,
#md-pdp .wd-gallery-thumb .wd-carousel-item.wd-thumb-active img {
  opacity: 1;
  border-color: var(--md-brand);
}

/* --- ۴. ستون وسط: اطلاعات محصول --- */
#md-pdp .md-col-info h1.product_title {
  font-size: clamp(22px, 2.2vw, 28px) !important;
  font-weight: 800 !important;
  line-height: 1.4 !important;
  color: var(--md-text) !important;
  margin: 0 0 18px !important;
}

#md-pdp .md-col-info .woocommerce-product-details__short-description {
  font-size: 14.5px;
  line-height: 2;
  color: var(--md-text-muted);
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--md-border);
}

/* کارت‌های اعتمادسازی */
#md-pdp .md-trust-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

#md-pdp .md-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--md-surface);
  border: 1px solid var(--md-border);
  border-radius: var(--md-radius-md);
}

#md-pdp .md-trust-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #ffffff;
  color: var(--md-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--md-border);
}

#md-pdp .md-trust-icon svg {
  width: 17px;
  height: 17px;
}

#md-pdp .md-trust-item strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--md-text);
  line-height: 1.4;
}

#md-pdp .md-trust-item span {
  display: block;
  font-size: 11.5px;
  color: var(--md-text-muted);
}

/* متا در ستون وسط */
#md-pdp .md-col-info .product_meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12.5px;
  color: var(--md-text-muted);
  padding-top: 18px;
  border-top: 1px solid var(--md-border);
}

#md-pdp .md-col-info .product_meta .sku_wrapper {
  display: none; /* در نوار بالا نمایش داده شده */
}

#md-pdp .md-col-info .product_meta .meta-label {
  font-weight: 700;
  color: var(--md-text);
  margin-left: 4px;
}

#md-pdp .md-col-info .product_meta a {
  color: var(--md-text-muted);
  text-decoration: none;
}

#md-pdp .md-col-info .product_meta a:hover {
  color: var(--md-brand);
}

/* --- ۵. ستون چپ: باکس خرید چسبان (Buy Box Card) --- */
#md-pdp .md-buybox-card {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
  background: #ffffff !important;
  border: 1px solid var(--md-border) !important;
  border-radius: var(--md-radius-xl) !important;
  padding: 24px !important;
  box-shadow: var(--md-shadow-card) !important;
}

/* حذف کش‌بک تکراری داخل متغیرها */
#md-pdp .single_variation .cashback {
  display: none !important;
}

/* قیمت داخل باکس خرید */
#md-pdp .md-buybox-card > p.price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px !important;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--md-border);
}

#md-pdp .md-buybox-card > p.price::before {
  display: none !important;
}

#md-pdp .md-buybox-card > p.price ins {
  text-decoration: none;
  background: none;
  font-size: 25px !important;
  font-weight: 800 !important;
  color: var(--md-text) !important;
}

#md-pdp .md-buybox-card > p.price del {
  font-size: 14px !important;
  color: var(--md-text-light) !important;
}

#md-pdp .md-buybox-card > p.price .woocommerce-Price-currencySymbol {
  font-size: 0.6em;
  font-weight: 600;
  color: var(--md-text-muted);
}

/* باکس کش‌بک یکپارچه داخل باکس خرید */
#md-pdp #custom-cashback-box.cashback-premium-box {
  display: flex !important;
  align-items: center;
  gap: 10px;
  background: var(--md-brand-soft) !important;
  border: 1px solid var(--md-brand-border) !important;
  border-radius: var(--md-radius-md) !important;
  padding: 10px 12px !important;
  margin: 0 0 18px !important;
  box-shadow: none !important;
}

#md-pdp #custom-cashback-box .cb-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--md-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#md-pdp #custom-cashback-box .cb-icon-wrapper svg {
  width: 18px;
  height: 18px;
}

#md-pdp #custom-cashback-box .cb-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

#md-pdp #custom-cashback-box .cb-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--md-brand);
}

#md-pdp #custom-cashback-box .cb-amount {
  font-size: 13px;
  font-weight: 800;
  color: var(--md-brand);
  background: #ffffff;
  padding: 2px 10px;
  border-radius: var(--md-radius-pill);
  border: 1px solid var(--md-brand-border);
  white-space: nowrap;
}

/* انتخابگر رنگ */
#md-pdp form.variations_form table.variations {
  width: 100%;
  margin: 0 0 16px !important;
  border: none !important;
}

#md-pdp form.variations_form table.variations th.label {
  display: block;
  text-align: right;
  padding: 0 0 8px !important;
  border: none !important;
}

#md-pdp form.variations_form table.variations td.value {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 !important;
  border: none !important;
}

#md-pdp .wd-swatches-single .wd-swatch {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  border: 2px solid var(--md-border-hover) !important;
  padding: 2px;
  transition: var(--md-transition);
}

#md-pdp .wd-swatches-single .wd-swatch.wd-active {
  border-color: var(--md-brand) !important;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--md-brand) !important;
}

/* وضعیت موجودی */
#md-pdp .single_variation .stock {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--md-radius-pill);
  margin: 0 0 14px;
}

#md-pdp .single_variation .stock.in-stock {
  background: var(--md-brand-soft);
  color: var(--md-brand);
}

#md-pdp .single_variation .stock.out-of-stock {
  background: #fef2f2;
  color: #dc2626;
}

/* دکمه خرید و تعداد */
#md-pdp .woocommerce-variation-add-to-cart,
#md-pdp form.cart:not(.variations_form) {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 14px;
}

#md-pdp .quantity {
  display: inline-flex !important;
  align-items: center;
  height: 50px;
  background: var(--md-surface);
  border: 1px solid var(--md-border);
  border-radius: var(--md-radius-md);
  padding: 0 4px;
}

#md-pdp .quantity input.btn {
  width: 30px !important;
  height: 30px !important;
  border: none !important;
  background: transparent !important;
  font-size: 16px !important;
  color: var(--md-text) !important;
  cursor: pointer;
}

#md-pdp .quantity input.qty {
  width: 36px !important;
  border: none !important;
  background: transparent !important;
  text-align: center;
  font-size: 15px !important;
  font-weight: 700 !important;
}

#md-pdp .single_add_to_cart_button.button {
  flex: 1 1 160px;
  height: 50px !important;
  border-radius: var(--md-radius-md) !important;
  background: var(--md-brand) !important;
  color: #ffffff !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: 0 8px 20px -6px rgba(15, 76, 58, 0.35);
  transition: var(--md-transition) !important;
}

#md-pdp .single_add_to_cart_button.button:hover:not(.disabled) {
  background: var(--md-brand-hover) !important;
  transform: translateY(-2px);
}

/* اسنپ‌پی و جمع کل داخل باکس خرید */
#md-pdp .snapppay-widget {
  background: var(--md-surface) !important;
  border: 1px solid var(--md-border) !important;
  border-radius: var(--md-radius-md) !important;
  padding: 12px 14px !important;
  gap: 10px !important;
  margin-top: 12px !important;
}

#md-pdp .snapppay-widget-title {
  font-family: inherit !important;
  font-size: 12.5px !important;
}

#md-pdp .snapppay-widget-description {
  font-family: inherit !important;
  font-size: 11px !important;
}

#md-pdp #md-epo-totals.tm-epo-totals {
  margin: 14px 0 0 !important;
  background: var(--md-surface);
  border: 1px solid var(--md-border);
  border-radius: var(--md-radius-md);
  padding: 12px 14px;
}

#md-pdp #md-epo-totals dl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 !important;
}

#md-pdp #md-epo-totals dt {
  font-size: 13px;
  color: var(--md-text-muted);
}

#md-pdp #md-epo-totals dd {
  font-size: 16px;
  font-weight: 800;
  color: var(--md-text);
  margin: 0;
}

/* --- ۶. بخش تب‌ها و توضیحات --- */
#md-pdp .md-pdp-details {
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--md-border);
}

#md-pdp ul.wc-tabs {
  display: flex !important;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 6px;
  margin: 0 auto 32px !important;
  background: var(--md-surface);
  border: 1px solid var(--md-border);
  border-radius: var(--md-radius-pill);
  width: fit-content;
}

#md-pdp ul.wc-tabs li a {
  display: block;
  padding: 10px 24px !important;
  border-radius: var(--md-radius-pill) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--md-text-muted) !important;
  text-decoration: none;
  transition: var(--md-transition);
}

#md-pdp ul.wc-tabs li a::after,
#md-pdp ul.wc-tabs li a::before {
  display: none !important;
}

#md-pdp ul.wc-tabs li.active a {
  background: #ffffff !important;
  color: var(--md-text) !important;
  box-shadow: var(--md-shadow-sm);
}

#md-pdp .woocommerce-Tabs-panel {
  max-width: 960px;
  margin: 0 auto !important;
  background: #ffffff !important;
  border: 1px solid var(--md-border) !important;
  border-radius: var(--md-radius-xl) !important;
  padding: 36px 40px !important;
  box-shadow: var(--md-shadow-sm);
}

#md-pdp .woocommerce-Tabs-panel table {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: 1px solid var(--md-border);
  border-radius: var(--md-radius-lg);
  overflow: hidden;
  margin: 20px 0;
}

#md-pdp .woocommerce-Tabs-panel table th,
#md-pdp .woocommerce-Tabs-panel table td {
  padding: 13px 16px !important;
  text-align: right;
  font-size: 13.5px;
  border: none !important;
  border-bottom: 1px solid var(--md-border) !important;
}

#md-pdp .woocommerce-Tabs-panel table tr:last-child td {
  border-bottom: none !important;
}

#md-pdp .woocommerce-Tabs-panel table td:first-child {
  font-weight: 700;
  color: var(--md-text);
  width: 30%;
  background: var(--md-surface);
}

/* --- ۷. بازطراحی کامل بخش محصولات مرتبط (Related Products) --- */
#md-pdp .related-products,
#md-pdp .related.products {
  margin-top: 72px !important;
  padding-top: 48px;
  border-top: 1px solid var(--md-border);
}

#md-pdp .related-products .wd-el-title,
#md-pdp .related.products > h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px !important;
  font-weight: 800 !important;
  color: var(--md-text) !important;
  margin-bottom: 28px !important;
  text-align: right;
}

#md-pdp .related-products .wd-el-title::before,
#md-pdp .related.products > h2::before {
  content: "";
  width: 6px;
  height: 24px;
  border-radius: 6px;
  background: var(--md-brand);
  display: inline-block;
}

/* کارت‌های محصولات مرتبط */
#md-pdp .related-products .wd-product .product-wrapper {
  background: #ffffff;
  border: 1px solid var(--md-border);
  border-radius: var(--md-radius-xl);
  padding: 14px;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: var(--md-transition);
}

#md-pdp .related-products .wd-product .product-wrapper:hover {
  transform: translateY(-6px);
  border-color: var(--md-border-hover);
  box-shadow: var(--md-shadow-card);
}

#md-pdp .related-products .product-element-top {
  border-radius: var(--md-radius-lg);
  overflow: hidden;
  background: var(--md-surface);
  margin-bottom: 14px;
}

#md-pdp .related-products .product-labels .product-label {
  border-radius: var(--md-radius-pill) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 4px 10px !important;
}

#md-pdp .related-products .wd-entities-title {
  font-size: 14.5px !important;
  font-weight: 700 !important;
  line-height: 1.5 !important;
  margin: 8px 0 10px !important;
  text-align: right;
}

#md-pdp .related-products .wd-entities-title a {
  color: var(--md-text);
  text-decoration: none;
}

#md-pdp .related-products .price {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: var(--md-brand) !important;
  margin-bottom: 14px;
  display: block;
  text-align: right;
}

#md-pdp .related-products .wd-add-btn {
  margin-top: auto;
}

#md-pdp .related-products .wd-add-btn a.button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: var(--md-radius-md) !important;
  background: var(--md-surface) !important;
  color: var(--md-text) !important;
  border: 1px solid var(--md-border) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  transition: var(--md-transition) !important;
}

#md-pdp .related-products .wd-add-btn a.button:hover {
  background: var(--md-brand) !important;
  color: #ffffff !important;
  border-color: var(--md-brand) !important;
}

/* --- ۸. ریسپانسیو تبلت و موبایل --- */
@media (max-width: 1100px) {
  #md-pdp .md-pdp-grid-3 {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  #md-pdp .md-col-buybox {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  #md-pdp .md-pdp-container {
    padding: 0 16px;
  }

  #md-pdp .md-pdp-grid-3 {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  #md-pdp .md-trust-grid {
    grid-template-columns: 1fr;
  }

  #md-pdp .woocommerce-Tabs-panel {
    padding: 22px 18px !important;
  }
}

/* --- حذف کامل دکمه مقایسه و اشتراک‌گذاری --- */
#md-pdp .wd-compare-btn,
#md-pdp .product-compare-button,
#md-pdp .wd-social-icons.product-share {
  display: none !important;
}

/* --- دکمه کپی سریع کد کالا --- */
#md-pdp .md-sku-pill {
  cursor: pointer;
  transition: var(--md-transition);
}

#md-pdp .md-sku-pill:hover {
  border-color: var(--md-brand);
  color: var(--md-brand);
  background: var(--md-brand-soft);
}

#md-pdp .md-sku-pill.is-copied {
  background: var(--md-brand);
  color: #ffffff;
  border-color: var(--md-brand);
}

/* --- افکت هایلایت باکس خرید هنگام اسکرول از نوار شناور --- */
@keyframes mdPulseBorder {
  0% { box-shadow: 0 0 0 0 rgba(15, 76, 58, 0.35); }
  70% { box-shadow: 0 0 0 12px rgba(15, 76, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 76, 58, 0); }
}

#md-pdp .md-buybox-card.md-pulse-highlight {
  animation: mdPulseBorder 1.1s ease-out;
  border-color: var(--md-brand) !important;
}

/* --- بخش اختصاصی محصولات مرتبط --- */
#md-pdp .md-related-section {
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--md-border);
}

#md-pdp .md-related-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

#md-pdp .md-related-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 800;
  color: var(--md-text);
  margin: 0;
}

#md-pdp .md-related-title::before {
  content: "";
  width: 6px;
  height: 24px;
  border-radius: 6px;
  background: var(--md-brand);
}

#md-pdp .md-related-all {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--md-brand);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--md-radius-pill);
  background: var(--md-brand-soft);
  transition: var(--md-transition);
}

#md-pdp .md-related-all:hover {
  background: var(--md-brand);
  color: #ffffff;
}

#md-pdp .md-related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

#md-pdp .md-rel-card {
  background: #ffffff;
  border: 1px solid var(--md-border);
  border-radius: var(--md-radius-xl);
  padding: 12px;
  display: flex;
  flex-direction: column;
  transition: var(--md-transition);
}

#md-pdp .md-rel-card:hover {
  transform: translateY(-6px);
  border-color: var(--md-border-hover);
  box-shadow: var(--md-shadow-card);
}

#md-pdp .md-rel-thumb {
  position: relative;
  display: block;
  border-radius: var(--md-radius-lg);
  overflow: hidden;
  background: var(--md-surface);
  aspect-ratio: 1 / 1;
  margin-bottom: 14px;
}

#md-pdp .md-rel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

#md-pdp .md-rel-card:hover .md-rel-thumb img {
  transform: scale(1.06);
}

#md-pdp .md-rel-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--md-radius-pill);
}

#md-pdp .md-rel-badge.is-sale {
  background: var(--md-text);
  color: #ffffff;
}

#md-pdp .md-rel-badge.is-out {
  background: rgba(255, 255, 255, 0.92);
  color: #dc2626;
  border: 1px solid #fecaca;
}

#md-pdp .md-rel-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 4px 4px;
}

#md-pdp .md-rel-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 14px;
}

#md-pdp .md-rel-name a {
  color: var(--md-text);
  text-decoration: none;
}

#md-pdp .md-rel-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--md-border);
}

#md-pdp .md-rel-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--md-brand);
}

#md-pdp .md-rel-price del {
  display: none;
}

#md-pdp .md-rel-price ins {
  text-decoration: none;
  background: none;
}

#md-pdp .md-rel-unavail {
  font-size: 12px;
  color: var(--md-text-light);
  font-weight: 600;
}

#md-pdp .md-rel-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--md-text);
  background: var(--md-surface);
  border: 1px solid var(--md-border);
  padding: 6px 14px;
  border-radius: var(--md-radius-pill);
  text-decoration: none;
  transition: var(--md-transition);
}

#md-pdp .md-rel-card:hover .md-rel-btn {
  background: var(--md-brand);
  color: #ffffff;
  border-color: var(--md-brand);
}

/* --- نوار خرید سریع شناور (Floating Glass Bar) --- */
.md-sticky-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 120%);
  width: min(680px, calc(100% - 28px));
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  padding: 10px 14px;
  box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.18);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.md-sticky-bar.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.md-sticky-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.md-sticky-product {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.md-sticky-product img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.md-sticky-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.md-sticky-info strong {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.md-sticky-price {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f4c3a;
}

.md-sticky-price del {
  display: none;
}

.md-sticky-price ins {
  text-decoration: none;
  background: none;
}

.md-sticky-cta {
  background: #0f4c3a;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 11px 22px;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.md-sticky-cta:hover {
  background: #0a3629;
  transform: translateY(-1px);
}

@media (max-width: 1024px) {
  #md-pdp .md-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #md-pdp .md-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .md-sticky-bar {
    bottom: 12px;
    padding: 8px 10px;
  }

  .md-sticky-cta {
    padding: 10px 14px;
    font-size: 12.5px;
  }
}


/* ==========================================================================
   FIXES: TRUST ICONS + LARGER GALLERY + CUSTOM MOBILE LIGHTBOX
   ========================================================================== */

/* ۱. اصلاح دقیق آیکون‌های کارت اعتمادسازی */
#md-pdp .md-trust-item .md-trust-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
}

#md-pdp .md-trust-item .md-trust-icon svg {
  width: 19px !important;
  height: 19px !important;
  display: block !important;
  margin: 0 !important;
}

/* ۲. بزرگ‌تر کردن عکس محصول در گرید ۳ ستونه */
#md-pdp .md-pdp-container {
  max-width: 1420px !important;
}

@media (min-width: 1101px) {
  #md-pdp .md-pdp-grid-3 {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.85fr) minmax(305px, 345px) !important;
    gap: 32px !important;
  }
}

/* بهینه‌سازی نسبت عرض عکس اصلی به تامبنیل‌ها */
#md-pdp .woocommerce-product-gallery.thumbs-position-left {
  gap: 12px;
}

#md-pdp .wd-gallery-thumb {
  max-width: 82px !important;
}

/* ۳. غیرفعال کردن زوم لمسی مزاحم روی موبایل و تبلت */
@media (max-width: 1024px) {
  #md-pdp .woocommerce-product-gallery__image .zoomImg {
    display: none !important;
    pointer-events: none !important;
  }
}

/* ۴. استایل لایت‌باکس اختصاصی و مدرن (موبایل و دسکتاپ) */
.md-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  touch-action: pan-y;
}

.md-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.md-lb-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  z-index: 5;
}

.md-lb-counter {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.14);
  padding: 6px 14px;
  border-radius: 999px;
  direction: ltr;
}

.md-lb-close {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.md-lb-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.md-lb-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 16px;
  overflow: hidden;
}

.md-lb-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

.md-lb-img.is-zoomed {
  transform: scale(1.85);
  cursor: zoom-out;
}

.md-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background 0.2s ease;
}

.md-lb-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.md-lb-prev { right: 16px; }
.md-lb-next { left: 16px; }

.md-lb-hint {
  position: absolute;
  bottom: 18px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  pointer-events: none;
}

@media (max-width: 640px) {
  .md-lb-nav {
    width: 38px;
    height: 38px;
    top: auto;
    bottom: 24px;
    transform: none;
  }
  .md-lb-prev { right: 20px; }
  .md-lb-next { left: 20px; }
  .md-lb-hint { bottom: 32px; }
}

/* --- تنظیم دقیق ابعاد لایت‌باکس برای موبایل و لپ‌تاپ --- */
.md-lightbox {
  width: 100vw;
  height: 100dvh;
}

.md-lb-stage {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 70px 72px 56px;
}

.md-lb-stage.is-zoomed {
  overflow: auto;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 70px 16px 56px;
}

.md-lb-img-wrap {
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ابعاد روی لپ‌تاپ و دسکتاپ */
.md-lb-img {
  max-width: min(80vw, 960px);
  max-height: 80dvh;
  width: auto;
  height: auto;
  border-radius: 16px;
  transition: width 0.25s ease, max-width 0.25s ease, max-height 0.25s ease;
}

.md-lb-img.is-zoomed {
  transform: none !important;
  max-width: none !important;
  max-height: none !important;
  width: min(1400px, 140vw);
  cursor: zoom-out;
}

/* ابعاد اختصاصی روی گوشی */
@media (max-width: 767px) {
  .md-lb-stage {
    padding: 64px 10px 76px;
  }

  .md-lb-img {
    max-width: 94vw;
    max-height: 74dvh;
    border-radius: 12px;
  }

  .md-lb-img.is-zoomed {
    width: 185vw;
    border-radius: 0;
  }
}