/* صفحه محصول — چیدمان شبیه مارکت‌پلیس (گالری | مشخصات | باکس خرید) */

.pd-page {
  padding: 16px 0 72px;
}
.container.pd-page {
  max-width: 1240px;
}
.pd-crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  color: var(--color-muted);
  margin-bottom: 16px;
}
.pd-crumb a { color: var(--color-muted); }
.pd-crumb a:hover { color: var(--color-primary); }
.pd-crumb .sep { font-size: 9px; opacity: .55; }

.pd-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 1.05fr) 300px;
  gap: 20px;
  align-items: start;
  margin-bottom: 28px;
}

/* Gallery: تصویر بالا، بندانگشتی زیر عکس */
.pd-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 88px;
}
.pd-stage {
  min-width: 0;
}
.pd-main-img {
  position: relative;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
}
#pdGallerySwiper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#pdGallerySwiper .swiper-slide {
  display: grid;
  place-items: center;
  height: 100%;
}
.pd-main-img img,
.pd-slide-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 18px;
}
.pd-main-img.is-zoomable { cursor: zoom-in; }
.pd-fab {
  position: absolute;
  z-index: 4;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: var(--color-text);
  box-shadow: 0 4px 14px rgba(20, 20, 20, .08);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.pd-fab i { margin: 0; }
.pd-zoom-btn { top: 12px; left: 12px; }
.pd-wish-btn.pd-fab {
  top: 12px;
  left: 58px;
  border: 0;
}
.pd-wish-btn.pd-fab.is-solo { left: 12px; }
.pd-wish-btn.pd-fab.active { color: var(--color-primary); }
.pd-badge-main {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 10px;
}
.pd-thumbs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px;
}
.pd-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1.5px solid var(--color-border);
  background: #fff;
  padding: 4px;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  appearance: none;
}
.pd-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pd-thumb.active,
.pd-thumb:hover { border-color: var(--color-primary); }
.pd-zoom {
  position: fixed;
  inset: 0;
  background: rgba(16, 16, 16, .9);
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
}
.pd-zoom[hidden] { display: none !important; }
.pd-zoom img { max-width: min(96vw, 920px); max-height: 90vh; object-fit: contain; }
.pd-zoom-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  font-size: 22px;
  cursor: pointer;
}

/* Details */
.pd-details { min-width: 0; padding-top: 4px; }
.pd-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: -.3px;
  margin: 0 0 12px;
  color: var(--color-text);
}
.pd-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.pd-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-text);
}
.pd-brand:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pd-brand i { font-size: 11px; margin: 0; color: var(--color-muted); }
.pd-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: #9A6700;
  background: #FFF8E8;
  border-radius: 999px;
  padding: 4px 10px;
}
.pd-rating i { color: #E3A008; margin: 0; font-size: 11px; }
.pd-rating b { font-weight: 800; }
.pd-rating em {
  font-style: normal;
  font-weight: 500;
  color: var(--color-muted);
}
.pd-sku {
  font-size: 12px;
  color: var(--color-muted);
  font-family: ui-monospace, monospace;
  direction: ltr;
}
.pd-short {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--color-text);
}
.pd-short p { margin: 0 0 8px; }
.pd-short p:last-child { margin-bottom: 0; }
.pd-short ul { margin: 0; padding: 0; list-style: none; }
.pd-short li {
  display: grid;
  grid-template-columns: minmax(7.5rem, 38%) 1fr;
  gap: 8px 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f1efec;
  font-size: 13px;
}
.pd-short li:last-child { border-bottom: 0; padding-bottom: 0; }
.pd-short li:first-child { padding-top: 0; }
.pd-short li span,
.pd-short li strong:first-child {
  font-weight: 700;
  color: var(--color-muted);
}
.pd-share {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.pd-share-lbl { font-size: 12px; color: var(--color-muted); }
.pd-share-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--color-text);
}
.pd-share-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pd-share-btn i { margin: 0; }

/* Variants */
.pd-vgroup { margin-bottom: 18px; }
.pd-vgroup-hd {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.pd-vgroup.is-color .pd-vgroup-hd span:first-child::after { content: ":"; }
.pd-vgroup-selval { display: none; color: var(--color-text); font-size: 13.5px; font-weight: 800; }
.pd-vgroup-selval.show { display: inline; }
.pd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.vchip {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  background: #fff;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  color: var(--color-text);
  font-family: inherit;
  appearance: none;
}
.vchip.sel {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-soft);
  font-weight: 800;
}
.vchip.oos { opacity: .45; }
.vchip.v-disabled,
.pd-color.v-disabled { opacity: .32; pointer-events: none; }

.pd-colors { gap: 10px; }
.pd-color {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px 6px 10px;
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  color: var(--color-text);
  font-family: inherit;
  appearance: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.pd-color:hover { border-color: #cfcbc6; }
.pd-color.sel {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
  background: #fff;
}
.pd-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.pd-color.is-light .pd-color-swatch {
  box-shadow: inset 0 0 0 1px rgba(20,20,20,.22);
}
.pd-color-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}
.pd-color.sel .pd-color-name { font-weight: 800; }
.pd-color.oos {
  opacity: 1;
  background: #fafafa;
}
.pd-color.oos .pd-color-name {
  text-decoration: line-through;
  color: var(--color-muted);
  font-weight: 600;
}
.pd-color.oos .pd-color-swatch { filter: grayscale(.35); opacity: .7; }
.vsel-alert {
  display: none;
  font-size: 12.5px;
  color: var(--color-danger);
  background: #FDECEC;
  border-radius: 10px;
  padding: 9px 12px;
  margin-top: 10px;
  align-items: center;
  gap: 8px;
}
.vsel-alert.show { display: flex; }
@keyframes vshake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
.vshake { animation: vshake .4s ease; }
@keyframes priceFlash { from { opacity: .45 } to { opacity: 1 } }
.price-flash { animation: priceFlash .28s ease; }

/* Buy box */
.pd-buybox {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 16px;
  position: sticky;
  top: 88px;
  box-shadow: 0 8px 28px rgba(20, 20, 20, .04);
}
.pd-seller {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}
.pd-seller-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 800;
}
.pd-seller-mark i { margin: 0; }
.pd-seller small { display: block; font-size: 11px; color: var(--color-muted); }
.pd-seller strong { font-size: 13.5px; font-weight: 800; }
.pd-price-box { margin-bottom: 14px; }
.pd-original-price {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.pd-original-price del { font-size: 13px; color: #9ca3af; }
.pd-discount-badge {
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
}
.pd-sale-price {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.6px;
  line-height: 1.15;
  color: var(--color-text);
}
.pd-sale-price span {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
  margin-right: 4px;
}
.pd-savings {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--color-success);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.pd-facts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.pd-fact {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}
.pd-fact i {
  width: 16px;
  text-align: center;
  margin: 2px 0 0;
  color: var(--color-success);
}
.pd-fact a { font-weight: 700; }
.pd-stock-in, .pd-stock-out {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 800;
}
.pd-stock-in { color: var(--color-success); }
.pd-stock-out { color: var(--color-danger); }
.pd-payopt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}
.snappay-pdp { background: #EBECF2; }
.digipay-pdp { background: #EEF2FF; }
.snappay-pdp-logo,
.digipay-pdp-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: block;
  border-radius: 9px;
  object-fit: cover;
}
.snappay-pdp-title,
.digipay-pdp-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  color: #1A1C23;
}
.digipay-pdp-title { color: #0040FF; }
.snappay-pdp-desc { font-size: 10.5px; color: #616475; margin-top: 1px; }
.pd-buy-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
}
.pd-qty-ctrl {
  display: flex;
  width: max-content;
  margin: 8px auto 0;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  flex-shrink: 0;
}
.pd-qty-btn {
  width: 36px;
  height: 48px;
  border: 0;
  background: #f7f6f3;
  cursor: pointer;
  font-size: 16px;
}
.pd-qty-input {
  width: 40px;
  height: 48px;
  border: 0;
  text-align: center;
  font-weight: 800;
}
.pd-add-btn {
  flex: 1;
  min-height: 48px;
  background: var(--color-primary);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 18px rgba(196, 30, 58, .18);
}
.pd-add-btn:hover { filter: brightness(.96); color: #fff; }
.pd-add-btn:disabled {
  background: #c4c4c4;
  box-shadow: none;
  cursor: not-allowed;
}
.pd-trust {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}
.pd-trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--color-text-secondary);
  font-weight: 600;
}
.pd-trust-item i { color: var(--color-muted); margin: 0; font-size: 13px; }

.pd-mbar { display: none; }

/* Tabs */
.pd-tabs-wrap {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 4px 20px 24px;
}
.pd-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  position: sticky;
  top: 72px;
  background: #fff;
  z-index: 5;
  margin: 0 -8px;
  padding: 0 8px;
}
.pd-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 750;
  color: var(--color-muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.pd-tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.pd-tab-badge {
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
}
.pd-tab-panel { display: none; padding: 22px 0 8px; }
.pd-tab-panel.active { display: block; }
.pd-description { font-size: 15px; line-height: 2; }
.pd-description img { border-radius: 12px; }
.pd-specs-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}
.pd-specs-table tr { background: #f7f6f3; }
.pd-specs-table th,
.pd-specs-table td {
  padding: 12px 16px;
  font-size: 13.5px;
  border: 0;
}
.pd-specs-table th {
  width: 32%;
  font-weight: 700;
  color: var(--color-muted);
  border-radius: 10px 0 0 10px;
}
.pd-specs-table td {
  font-weight: 650;
  border-radius: 0 10px 10px 0;
}
[dir="rtl"] .pd-specs-table th { border-radius: 0 10px 10px 0; }
[dir="rtl"] .pd-specs-table td { border-radius: 10px 0 0 10px; }

/* Reviews */
.rv-summary {
  display: flex;
  gap: 28px;
  padding: 20px;
  background: #f7f6f3;
  border-radius: 14px;
  margin-bottom: 20px;
  align-items: center;
}
.rv-avg-num { font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.rv-avg-stars { color: #E3A008; margin: 6px 0; }
.rv-avg-count { font-size: 12.5px; color: var(--color-muted); }
.rv-bars { flex: 1; min-width: 0; }
.rv-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.rv-bar-track { flex: 1; height: 6px; background: #e8e6e3; border-radius: 8px; overflow: hidden; }
.rv-bar-fill { height: 100%; background: #E3A008; }
.rv-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.rv-card-header { display: flex; gap: 10px; margin-bottom: 8px; align-items: center; }
.rv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: grid;
  place-items: center;
  font-weight: 800;
}
.rv-meta { flex: 1; min-width: 0; }
.rv-meta-name { font-weight: 800; font-size: 13.5px; }
.rv-meta-date { font-size: 12px; color: var(--color-muted); }
.rv-stars { color: #E3A008; font-size: 12px; }
.rv-title { font-weight: 800; margin-bottom: 4px; }
.rv-body { font-size: 14px; line-height: 1.85; color: var(--color-text-secondary); }
.rv-form-wrap {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 20px;
  margin-top: 20px;
}
.star-picker { display: flex; flex-direction: row-reverse; gap: 4px; justify-content: flex-end; }
.star-picker input { display: none; }
.star-picker label { font-size: 26px; color: #ddd; cursor: pointer; }
.star-picker input:checked ~ label,
.star-picker label:hover,
.star-picker label:hover ~ label { color: #E3A008; }

.pd-related { margin-top: 36px; }
.pd-related-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pd-related-title:after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

@media (max-width: 1099px) {
  .pd-hero { grid-template-columns: minmax(0, 1fr) 300px; }
  .pd-gallery {
    grid-column: 1 / -1;
    position: static;
    max-width: 560px;
    width: 100%;
    margin-inline: auto;
  }
}

@media (max-width: 767px) {
  .pd-page { padding-bottom: 88px; }
  .pd-hero { grid-template-columns: 1fr; gap: 16px; }
  .pd-gallery {
    position: static;
    max-width: none;
  }
  .pd-thumbs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .pd-title { font-size: 17.5px; }
  .pd-buybox {
    padding: 14px;
  }
  .pd-buybox .pd-trust,
  .pd-buybox .pd-seller { display: none; }
  .pd-mbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    bottom: 56px;
    inset-inline: 0;
    z-index: 40;
    background: #fff;
    border-top: 1px solid var(--color-border);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(20, 20, 20, .06);
  }
  .pd-mbar-price { font-size: 16px; font-weight: 800; line-height: 1.2; }
  .pd-mbar-price small { display: block; font-size: 11px; font-weight: 600; color: var(--color-muted); }
  .pd-mbar .pd-add-btn { flex: 1; min-width: 0; height: 46px; min-height: 46px; font-size: 13.5px; }
  .pd-buy-row { display: none; }
  .pd-tabs { top: 0; }
  .rv-summary { flex-direction: column; align-items: stretch; }
}
