/* ===== PRODUCT.CSS ===== */

.product-detail { padding: 48px 0 72px; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }

/* Gallery */
.product-gallery { position: sticky; top: 90px; }
.gallery-main {
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--cream); aspect-ratio: 1;
  margin-bottom: 12px;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery-thumb {
  width: 72px; height: 72px; border-radius: 10px;
  overflow: hidden; border: 2px solid var(--cream-dark);
  cursor: pointer; transition: border-color var(--transition);
}
.gallery-thumb:hover, .gallery-thumb.active { border-color: var(--gold); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Info */
.product-info {}
.product-info-cat { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin-bottom: 10px; }
.product-info-title { font-size: clamp(22px,2.5vw,32px); font-weight: 800; color: var(--brown-deep); line-height: 1.2; margin-bottom: 16px; }
.product-info-price { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; }
.product-info-price .price-current { font-size: 32px; font-weight: 800; color: var(--gold); }
.product-info-price .price-old { font-size: 18px; color: var(--text-muted); text-decoration: line-through; }
.product-info-price .discount-badge { padding: 3px 10px; background: #e84b4b; color: #fff; border-radius: 20px; font-size: 13px; font-weight: 700; }
.product-short-desc { font-size: 15px; color: var(--text-muted); line-height: 1.7; margin-bottom: 24px; }
.product-add-cart { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; align-items: center; }
.product-add-cart .btn { min-width: 180px; }
.btn-wish-lg {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: #fff; color: var(--text-muted);
  border: 2px solid var(--cream-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-wish-lg:hover, .btn-wish-lg.active { background: #fde; color: #e84b4b; border-color: #e84b4b; }
.product-features { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--cream); border-radius: var(--radius); margin-bottom: 24px; }
.product-feature { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--text-muted); }
.product-feature-icon { color: var(--gold); font-size: 16px; flex-shrink: 0; }

/* Description tabs */
.product-tabs { margin-top: 48px; }
.product-tab-nav {
  display: flex; gap: 4px; border-bottom: 2px solid var(--cream-dark); margin-bottom: 24px;
  /* На узких экранах вкладки прокручиваются горизонтально, а не растягивают страницу */
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.product-tab-nav::-webkit-scrollbar { display: none; }
.product-tab-btn {
  padding: 10px 22px; font-size: 14px; font-weight: 600;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all var(--transition); cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.product-tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.product-tab-content { display: none; }
.product-tab-content.active { display: block; }

/* Prose (rich text) */
.prose h2 { font-size: 20px; font-weight: 700; color: var(--brown-deep); margin: 24px 0 12px; }
.prose h3 { font-size: 16px; font-weight: 700; color: var(--brown-deep); margin: 20px 0 8px; }
.prose p { font-size: 14px; line-height: 1.75; color: var(--text-muted); margin-bottom: 12px; }
.prose ul, .prose ol { padding-left: 20px; margin-bottom: 12px; }
.prose li { font-size: 14px; line-height: 1.7; color: var(--text-muted); margin-bottom: 4px; }
.prose blockquote { border-left: 3px solid var(--gold); padding: 12px 16px; background: var(--cream); border-radius: 0 8px 8px 0; margin: 16px 0; }
.prose a { color: var(--gold); }

/* Related */
.related-section { margin-top: 64px; }

/* Gallery zoom */
.gallery-main { position: relative; }
.gallery-zoom-btn {
  position: absolute; bottom: 12px; right: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.85); color: var(--brown-deep);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--transition);
  box-shadow: var(--shadow-soft);
}
.gallery-main:hover .gallery-zoom-btn { opacity: 1; }
.gallery-main img { cursor: zoom-in; }

/* Rating row */
.product-rating-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.rating-stars { display: flex; gap: 2px; }
.star { font-size: 18px; color: var(--cream-dark); }
.star-filled { color: var(--gold); }
.rating-text { font-size: 13px; color: var(--text-muted); }

/* Product meta */
.product-meta-row { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }

/* Share buttons */
.product-share { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.product-share-label { font-size: 12px; color: var(--text-muted); }
.share-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: transform var(--transition), opacity var(--transition);
  text-decoration: none; flex-shrink: 0;
}
.share-btn:hover { transform: scale(1.15); opacity: .88; }
.share-vk { background: #0077ff; }
.share-tg { background: #27a6e5; }
.share-ok { background: #f48120; }
.share-copy { background: var(--brown-mid); color: #fff; }

/* Tab badge */
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--gold); color: var(--brown-deep);
  font-size: 10px; font-weight: 700; border-radius: 9px;
  margin-left: 6px; vertical-align: middle;
}

/* Reviews */
.reviews-list { display: flex; flex-direction: column; gap: 20px; margin-bottom: 40px; }
.review-item { background: var(--cream); border-radius: var(--radius); padding: 20px; }
.review-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.review-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brown-mid); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.review-meta { flex: 1; }
.review-name { font-size: 14px; font-weight: 700; color: var(--brown-deep); }
.review-date { font-size: 12px; color: var(--text-muted); }
.review-stars { display: flex; gap: 2px; }
.review-text { font-size: 14px; line-height: 1.7; color: var(--text-muted); }
.reviews-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); margin-bottom: 32px; }

/* Q&A */
.qa-list { display: flex; flex-direction: column; gap: 20px; margin-bottom: 40px; }
.qa-item { background: var(--cream); border-radius: var(--radius); overflow: hidden; }
.qa-question, .qa-answer { display: flex; gap: 14px; padding: 16px 20px; }
.qa-answer { background: rgba(200,146,42,.07); border-top: 1px solid var(--cream-dark); }
.qa-icon {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; background: var(--brown-mid); color: #fff;
}
.qa-icon-a { background: var(--gold); color: var(--brown-deep); }
.qa-author { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.qa-text { font-size: 14px; line-height: 1.65; color: var(--text-main); }

/* Forms (reviews/questions) */
.review-form-wrap { border-top: 2px solid var(--cream-dark); padding-top: 32px; margin-top: 32px; }
.form-section-title { font-size: 18px; font-weight: 700; color: var(--brown-deep); margin-bottom: 20px; }
.review-form { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.form-field input, .form-field textarea {
  padding: 10px 14px; border: 1px solid var(--cream-dark);
  border-radius: var(--radius); font-family: inherit; font-size: 14px;
  color: var(--text-main); background: #fff; outline: none;
  transition: border-color var(--transition);
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--cream-dark); }
.captcha-field .captcha-input { max-width: 120px; }
.form-note { font-size: 12px; color: var(--text-muted); }

/* Star rating input */
.star-rating-input { display: flex; gap: 4px; cursor: pointer; }
.star-input { font-size: 28px; color: var(--cream-dark); transition: color var(--transition); background: none; border: none; padding: 0; line-height: 1; cursor: pointer; }
.star-input.star-filled, .star-input.star-selected { color: var(--gold); }
.star-input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* Lightbox */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 3000;
  background: rgba(20,10,5,.92);
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-img-wrap { max-width: 90vw; max-height: 85vh; }
.lightbox-img-wrap img { max-width: 100%; max-height: 85vh; object-fit: contain; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 16px; right: 20px;
  font-size: 32px; color: rgba(255,255,255,.7); background: none;
  cursor: pointer; line-height: 1; transition: color var(--transition);
}
.lightbox-close:hover { color: #fff; }
.lightbox-prev, .lightbox-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 36px; color: rgba(255,255,255,.6); background: none;
  cursor: pointer; padding: 12px; transition: color var(--transition);
}
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-prev:hover, .lightbox-next:hover { color: #fff; }

@media (max-width: 900px) {
  .product-detail-grid { grid-template-columns: 1fr; }
  .product-gallery { position: static; }
  .form-row-2 { grid-template-columns: 1fr; }
}

/* ===== STICKY MOBILE CTA ===== */
.product-sticky-cta {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 90;
  background: #fff;
  border-top: 1px solid var(--cream-dark);
  box-shadow: 0 -8px 24px rgba(0,0,0,.08);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
}
.product-sticky-cta-inner {
  display: flex; align-items: center; gap: 10px;
  max-width: 720px; margin: 0 auto;
}
.product-sticky-cta-info { flex: 1; min-width: 0; }
.product-sticky-cta-name {
  font-size: 12px; font-weight: 700; color: var(--brown-deep);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}
.product-sticky-cta-price {
  font-size: 16px; font-weight: 800; color: var(--gold);
  white-space: nowrap; margin-top: 2px;
}
.product-sticky-cta .btn { padding: 10px 14px; font-size: 13px; white-space: nowrap; }
.product-sticky-cta .btn-wish-lg { width: 40px; height: 40px; padding: 0; }
@media (max-width: 760px) {
  .product-sticky-cta:not([hidden]) { display: block; }
  body { padding-bottom: 80px; } /* reserve space when sticky shows; harmless when hidden */
}

/* ── Иконки на карточке товара ───────────────────────────────────────────── */
.product-info-cat { display: flex; align-items: center; gap: 7px; }
.product-feature-icon { display: inline-flex; align-items: center; }

/* Звёзды рейтинга: контур — пустая, заливка — заполненная */
.star { width: 18px; height: 18px; color: var(--cream-dark); }
.star-filled { color: var(--gold); fill: currentColor; }
.review-stars .star { width: 15px; height: 15px; }

/* Виджет выбора оценки */
.star-input { display: inline-flex; }
.star-input .ic { width: 28px; height: 28px; }
.star-input.star-filled .ic,
.star-input.star-selected .ic { fill: currentColor; }

/* Наличие товара */
.product-meta-instock { display: inline-flex; align-items: center; gap: 5px; color: #3f9e52; }

/* Заголовки во вкладке «Доставка и оплата» */
.product-tab-content .prose h3 { display: flex; align-items: center; gap: 8px; }
.product-tab-content .prose h3 .ic { color: var(--gold); }
