/* ═══════════════════════════════════════════════════════════════
   Product Detail Page  —  product-detail.css
   RTL · Vazirmatn · matches site.css design tokens
═══════════════════════════════════════════════════════════════ */

/* ── Layout wrapper ───────────────────────────────────────────── */
.pd-wrap {
  max-width: 1192px;
  margin: 0 auto 48px;
  padding: 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;

  /* کادر */
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(65, 43, 87, .08);
}

/* ══════════════════════════════════════════════════════════════
   GALLERY
══════════════════════════════════════════════════════════════ */
.pd-gallery {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-left: 1px solid var(--line);
  padding-left: 3rem;
}

.pd-gallery__stage {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background: #f4eff5;
  aspect-ratio: 1 / 1;
  box-shadow: 0 20px 60px rgba(65, 43, 87, .10);
}

.pd-gallery__stage img[data-gallery-main] {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .22s ease;
}

.pd-gallery__stage img.is-changing {
  opacity: 0;
}

.pd-gallery__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: .5rem;
  color: var(--muted);
  font-size: .9rem;
}

.pd-gallery__empty span { font-size: 3rem; }

/* Badges */
.pd-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: .3rem .85rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .03em;
  z-index: 2;
  backdrop-filter: blur(6px);
}

.pd-badge--sale {
  background: linear-gradient(135deg, #ff6f91, #ff4d75);
  color: #fff;
  box-shadow: 0 6px 20px rgba(255, 77, 117, .3);
}

.pd-badge--featured {
  top: 56px;
  background: linear-gradient(135deg, #7957c8, #a15cf2);
  color: #fff;
  box-shadow: 0 6px 20px rgba(121, 87, 200, .3);
}

/* Thumbnails */
.pd-gallery__thumbs {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

.pd-gallery__thumb {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #f0ebf5;
  padding: 0;
  cursor: pointer;
  transition: border-color .18s, transform .18s, box-shadow .18s;
  flex-shrink: 0;
}

.pd-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pd-gallery__thumb:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(121, 87, 200, .15);
}

.pd-gallery__thumb.is-active {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(121, 87, 200, .18);
}

/* ══════════════════════════════════════════════════════════════
   INFO PANEL
══════════════════════════════════════════════════════════════ */
.pd-info {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

/* Meta row */
.pd-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
}

.pd-meta__cat {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,232,246,.95));
  color: var(--purple);
  font-weight: 700;
  padding: .3rem .85rem;
  border-radius: 999px;
  border: 1px solid rgba(121, 87, 200, .14);
  transition: background .18s, box-shadow .18s;
}

.pd-meta__cat:hover {
  background: rgba(121, 87, 200, .08);
  box-shadow: 0 4px 14px rgba(121, 87, 200, .12);
}

.pd-meta__sep { color: var(--muted); }
.pd-meta__sku { color: var(--muted); }

/* Title & summary */
.pd-title {
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 0;
  color: var(--ink);
}

.pd-summary {
  color: var(--muted);
  font-size: .97rem;
  line-height: 1.85;
  margin: 0;
}

/* Alert */
.pd-alert {
  padding: .8rem 1rem;
  border-radius: 12px;
  font-size: .85rem;
  font-weight: 600;
}

.pd-alert--error {
  background: #fff0f3;
  color: #a92c49;
  border: 1px solid #f5c6d0;
}

/* Price block */
.pd-price-block {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.pd-price {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--purple);
  line-height: 1;
}

.pd-price small {
  font-size: .8rem;
  font-weight: 600;
  margin-right: .2rem;
}

.pd-price-old {
  font-size: .9rem;
  color: #b0a8be;
  text-decoration: line-through;
}

/* ── Purchase Form ─────────────────────────────────────────── */
.pd-purchase-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* Option groups */
.pd-option-group {
  border: none;
  padding: 0;
  margin: 0;
}

.pd-option-legend {
  display: block;
  font-size: .84rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: .6rem;
}

.pd-option-selected {
  color: var(--purple);
}

.pd-option-values {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.pd-opt-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .16s, background .16s, box-shadow .16s, transform .14s;
}

.pd-opt-btn:hover {
  border-color: var(--purple);
  background: #f7f2ff;
  transform: translateY(-1px);
}

.pd-opt-btn.is-selected {
  border-color: var(--purple);
  background: linear-gradient(135deg, rgba(121,87,200,.08), rgba(161,92,242,.06));
  color: var(--purple);
  box-shadow: 0 0 0 3px rgba(121, 87, 200, .12);
}

/* Color variant button */
.pd-opt-btn--color {
  padding: .4rem .7rem;
}

.pd-color-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.12);
  flex-shrink: 0;
}

/* Availability */
.pd-availability {
  font-size: 1rem;
  font-weight:500;
  color: #167554;
  margin: .2rem 0 0;
}

.pd-availability.is-unavailable {
  color: #a92c49;
}

/* Select fallback */
.pd-select {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  outline: none;
  transition: border-color .16s;
  cursor: pointer;
}

.pd-select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(121, 87, 200, .1);
}

/* Actions row: qty + add button */
.pd-actions-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-wrap: wrap;
}

/* Quantity */
.pd-qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.pd-qty__btn {
  width: 42px;
  height: 48px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .14s, color .14s;
  display: grid;
  place-items: center;
}

.pd-qty__btn:hover {
  background: #f3edff;
  color: var(--purple);
}

.pd-qty__input {
  width: 52px;
  height: 48px;
  border: none;
  border-right: 1.5px solid var(--line);
  border-left: 1.5px solid var(--line);
  text-align: center;
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  outline: none;
  -moz-appearance: textfield;
}

.pd-qty__input::-webkit-inner-spin-button,
.pd-qty__input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Add to cart */
.pd-add-btn {
  flex: 1;
  min-width: 180px;
  height: 52px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #7d5bef, #a15cf2);
  color: #fff;
  font: inherit;
  font-size: .97rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .22s, box-shadow .22s, opacity .2s;
  box-shadow: 0 12px 32px rgba(125, 91, 239, .28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.pd-add-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(125, 91, 239, .35);
}

.pd-add-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Brand mode note */
.pd-brand-note {
  padding: 1rem 1.2rem;
  border-radius: 14px;
  background: #f4f0ff;
  color: var(--muted);
  font-size: .88rem;
  border: 1px solid rgba(121, 87, 200, .14);
}

/* Trust badges */
.pd-trust {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pd-trust li {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem .9rem;
}

/* ══════════════════════════════════════════════════════════════
   TABS SECTION (below the hero)
══════════════════════════════════════════════════════════════ */
.pd-below {
  max-width: 1192px;
  margin: 0 auto 80px;
  padding: 0 24px;
}

.pd-tabs-shell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(65, 43, 87, .06);
}

/* Tab nav */
.pd-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #faf6ff;
  padding: 0 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.pd-tabs::-webkit-scrollbar { display: none; }

.pd-tab {
  position: relative;
  padding: 1.1rem 1.4rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: color .18s;
}

.pd-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--purple);
  transform: scaleX(0);
  transition: transform .2s ease;
}

.pd-tab:hover { color: var(--purple); }

.pd-tab.is-active {
  color: var(--purple);
}

.pd-tab.is-active::after {
  transform: scaleX(1);
}

/* Tab panels */
.pd-panel {
  padding: 2rem 2.5rem;
  display: none;
}

.pd-panel.is-active {
  display: block;
}

/* Rich content inside panels */
.pd-panel .rich-content {
  color: var(--ink);
  font-size: .97rem;
  line-height: 2;
}

.pd-panel .rich-content h2,
.pd-panel .rich-content h3 {
  color: var(--ink);
  margin-top: 1.5rem;
}

.pd-panel .rich-content ul,
.pd-panel .rich-content ol {
  padding-right: 1.5rem;
}

/* Pros / Cons */
.pd-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.pd-pros,
.pd-cons {
  padding: 1.5rem;
  border-radius: 16px;
}

.pd-pros {
  background: #edfaf4;
  border: 1px solid rgba(22, 117, 84, .15);
}

.pd-cons {
  background: #fff5f0;
  border: 1px solid rgba(200, 87, 57, .15);
}

.pd-pros-cons__title {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 1rem;
}

.pd-pros-cons__title--pro { color: #167554; }
.pd-pros-cons__title--con { color: #c05035; }

/* FAQ */
.pd-faq {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.pd-faq__item {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fdfbfe;
  transition: box-shadow .18s;
}

.pd-faq__item[open] {
  box-shadow: 0 4px 18px rgba(65, 43, 87, .08);
}

.pd-faq__q {
  padding: 1.1rem 1.4rem;
  font-weight: 700;
  font-size: .93rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  user-select: none;
  transition: background .16s;
}

.pd-faq__q:hover { background: #f7f2ff; }

.pd-faq__q::-webkit-details-marker { display: none; }

.pd-faq__q::after {
  content: '﹢';
  font-size: 1.1rem;
  color: var(--purple);
  transition: transform .2s;
  flex-shrink: 0;
  margin-right: 1rem;
}

.pd-faq__item[open] .pd-faq__q::after {
  content: '−';
}

.pd-faq__a {
  padding: .1rem 1.4rem 1.2rem;
  border-top: 1px solid var(--line);
}

.pd-faq__a p {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.85;
  margin: .8rem 0 .4rem;
}

.pd-faq__who {
  font-size: .75rem;
  color: #b0a8be;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 900px) {
  .pd-wrap {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.75rem;
    margin: 0 16px 40px;
    border-radius: 22px;
  }

  .pd-gallery {
    position: static;
    border-left: none;
    padding-left: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 2rem;
  }

  .pd-pros-cons {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .pd-wrap {
    padding: 1.25rem;
    margin: 0 12px 32px;
    border-radius: 18px;
  }

  .pd-below {
    padding: 0 12px;
  }

  .pd-title {
    font-size: 1.4rem;
  }

  .pd-price {
    font-size: 1.6rem;
  }

  .pd-gallery__thumbs {
    gap: .4rem;
  }

  .pd-gallery__thumb {
    width: 58px;
    height: 58px;
  }

  .pd-actions-row {
    flex-direction: column;
  }

  .pd-add-btn {
    width: 100%;
  }

  .pd-panel {
    padding: 1.4rem 1.2rem;
  }

  .pd-tabs {
    padding: 0 .75rem;
  }

  .pd-tab {
    padding: .9rem 1rem;
    font-size: .82rem;
  }

  .pd-trust {
    gap: .4rem;
  }
}

/* Persian product-detail typography alignment */
.pd-title { font-family: "Segoe UI Variable Text", "Segoe UI", Tahoma, Arial, sans-serif; }
.pd-summary { font-size: 1rem; line-height: 2; margin-bottom: 1.25rem; }
.pd-meta, .pd-option-legend, .pd-availability { line-height: 1.75; }
.pd-price { margin: 1.15rem 0 1.35rem; }
.pd-description { font-size: 1rem; line-height: 2.1; }
