/* ═══════════════════════════════════════════
   PRODUCT DETAIL — Modern Redesign
═══════════════════════════════════════════ */

.pd-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 90px 24px 100px;
}

/* ── Breadcrumb ── */
.pd-breadcrumb {
  display: none;
}
.pd-breadcrumb a { color: #6b7280; text-decoration: none; font-weight: 500; }
.pd-breadcrumb a:hover { color: #111; }
.pd-breadcrumb img { width: 12px; height: 12px; opacity: 0.4; }

/* ── Grid ── */
.pd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 768px) {
  body.page-product {
    padding-top: 0 !important;
    overflow-x: hidden;
  }
  .page-product .pd-wrap {
    padding: calc(52px + env(safe-area-inset-top, 0px)) 12px calc(88px + env(safe-area-inset-bottom, 0px));
    max-width: 100%;
    box-sizing: border-box;
  }
  .pd-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    min-width: 0;
    width: 100%;
  }
  .pd-gallery,
  .pd-info {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  .pd-gallery {
    position: static;
    top: auto;
    margin: 0;
  }
  .pd-main-img {
    width: 100%;
    max-width: 100%;
    background: #fff;
    overflow: hidden;
    isolation: isolate;
  }
  .pd-main-img img,
  .pd-main-img video {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    object-position: center center;
    transform: none !important;
    margin: 0 !important;
    left: auto !important;
    right: auto !important;
  }
  .pd-badge-overlay {
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: calc(100% - 20px);
  }
  /* Бейджи только на фото — дубль в блоке info скрываем */
  .pd-info > .pd-badges-row {
    display: none;
  }
  .pd-thumbs {
    width: 100%;
    max-width: 100%;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
  }
  .pd-thumb {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    position: relative;
    z-index: 2;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .pd-thumb img,
  .pd-thumb video {
    pointer-events: none;
    user-select: none;
  }
  .pd-title {
    font-size: 1.35rem;
    word-break: break-word;
  }
  .pd-rating-row {
    flex-wrap: wrap;
    gap: 6px;
  }
  .pd-price-row {
    padding: 14px;
    flex-wrap: wrap;
  }
  .pd-price {
    font-size: 1.65rem;
  }
  .pd-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .pd-meta-label {
    min-width: 0;
    width: auto;
  }
  .pd-meta-tags {
    max-width: 100%;
  }
  .pd-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .pd-btn-cart,
  .pd-btn-buy {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    width: auto;
    min-height: 0;
    height: auto;
    padding: 10px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 10px;
    gap: 6px;
    white-space: nowrap;
  }
  .pd-btn-cart img,
  .pd-btn-buy img {
    width: 15px;
    height: 15px;
  }
  .pd-btn-wish {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }
  .page-product .fab,
  .page-product #scrollTopBtn.fab {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 12px;
    z-index: 50;
  }
}

/* ── Gallery ── */
.pd-gallery { position: sticky; top: 80px; }
.pd-main-img {
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #f9fafb;
  margin-bottom: 12px;
  position: relative;
}
.pd-main-img img, .pd-main-img video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pd-main-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f9fafb, #f3f4f6);
}
.pd-main-placeholder img { width: 60px; height: 60px; opacity: 0.2; }
.pd-badge-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pd-badge {
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.pd-badge.hit { background: #f59e0b; color: #fff; }
.pd-badge.new { background: #3b82f6; color: #fff; }
.pd-badge.sale { background: #ef4444; color: #fff; }
.pd-badge.stock { background: #22c55e; color: #fff; }
.pd-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.pd-thumbs::-webkit-scrollbar { display: none; }
.pd-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: border-color .15s;
  background: #f3f4f6;
}
.pd-thumb.active { border-color: #111; }
.pd-thumb img, .pd-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Info ── */
.pd-info {}
.pd-badges-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pd-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 900;
  color: #111;
  letter-spacing: -0.3px;
  line-height: 1.2;
  margin-bottom: 12px;
}
.pd-rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.pd-stars { color: #f59e0b; font-size: 0.9rem; letter-spacing: 2px; }
.pd-rating-num { font-size: 0.875rem; font-weight: 800; color: #111; }
.pd-rating-cnt { font-size: 0.82rem; color: #9ca3af; }
.pd-rating-sep { color: #e5e7eb; }
.pd-reviews-link { font-size: 0.82rem; color: #6b7280; text-decoration: none; font-weight: 600; }
.pd-reviews-link:hover { color: #111; }

/* ── Price ── */
.pd-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 24px;
  padding: 20px;
  background: #f9fafb;
  border-radius: 16px;
  border: 1.5px solid #f3f4f6;
}
.pd-price { font-size: 2rem; font-weight: 900; color: #111; letter-spacing: -0.5px; }
.pd-price-old { font-size: 1.1rem; color: #9ca3af; text-decoration: line-through; }
.pd-price-save {
  padding: 4px 10px;
  background: #fef2f2;
  color: #ef4444;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 800;
}

/* ── Description ── */
.pd-desc {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.8;
  margin-bottom: 24px;
}

/* ── Meta ── */
.pd-meta { margin-bottom: 24px; }
.pd-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f9fafb;
}
.pd-meta-row:last-child { border-bottom: none; }
.pd-meta-label { font-size: 0.78rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.4px; min-width: 80px; padding-top: 2px; }
.pd-meta-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.pd-meta-tag {
  padding: 4px 10px;
  background: #f3f4f6;
  color: #374151;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
}
.pd-meta-val { font-size: 0.875rem; color: #374151; font-weight: 500; }

/* ── Qty ── */
.pd-qty-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.pd-qty-label { font-size: 0.82rem; font-weight: 700; color: #6b7280; }
.pd-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 0;
  background: #f3f4f6;
  border-radius: 12px;
  overflow: hidden;
}
.pd-qty-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  color: #374151;
  transition: background .12s;
  font-family: Inter, sans-serif;
}
.pd-qty-btn:hover { background: #e5e7eb; }
.pd-qty-num { min-width: 36px; text-align: center; font-size: 0.95rem; font-weight: 800; color: #111; }

/* ── CTA ── */
.pd-cta { display: flex; gap: 10px; margin-bottom: 20px; }
.pd-btn-buy {
  flex: 1;
  padding: 11px 18px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s, transform .1s;
}
.pd-btn-buy:active { transform: scale(0.98); }
.pd-btn-buy img { width: 18px; height: 18px; filter: invert(1); }

.pd-btn-cart {
  flex: 1;
  padding: 11px 18px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: Inter, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s, transform .1s;
}
.pd-btn-cart:active { transform: scale(0.98); }
.pd-btn-cart img { width: 18px; height: 18px; filter: invert(1); }
.pd-btn-wish {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.pd-btn-wish:hover { border-color: #111; }
.pd-btn-wish img { width: 18px; height: 18px; }
.pd-btn-wish.liked img { filter: invert(27%) sepia(90%) saturate(600%) hue-rotate(330deg); }

/* ── Delivery info ── */
.pd-delivery {
  background: #f9fafb;
  border-radius: 16px;
  border: 1.5px solid #f3f4f6;
  overflow: hidden;
}
.pd-delivery-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.875rem;
  color: #374151;
}
.pd-delivery-row:last-child { border-bottom: none; }
.pd-delivery-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.pd-delivery-icon img { width: 16px; height: 16px; }

/* ── Related ── */
.pd-related { margin-top: 60px; }
.pd-related-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: #111;
  margin-bottom: 20px;
}
.pd-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
@media(max-width:600px) {
  .pd-related-grid { grid-template-columns: repeat(2, 1fr); }
}
