/* ===========================================================
   PHARMATAC — product page (extends styles.css + catalog.css)
   =========================================================== */

.section--soft { background: #f6f6f4; }

.product-section-title {
  font-size: var(--h-m-size);
  line-height: var(--h-m-lh);
  font-weight: var(--h-m-weight);
  letter-spacing: -0.01em;
  margin: 0 0 28px;
}

/* =========================================================
   PRODUCT TAB NAV (sticky)
   ========================================================= */
.product-tabs {
  position: sticky;
  top: 73px;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--gray-border);
}
.product-tabs__inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.product-tabs__inner::-webkit-scrollbar { display: none; }
.product-tab {
  padding: 18px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.product-tab:hover { color: var(--ink); }
.product-tab.is-active { color: var(--ink); border-bottom-color: var(--green-900); }

/* =========================================================
   HERO
   ========================================================= */
.product-hero { padding-top: 40px; padding-bottom: 40px; }
.product-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

/* ---- gallery ---- */
.gallery {
  position: relative;
  background: var(--gray-bg);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.gallery__stage {
  position: relative;
  aspect-ratio: 1 / 1;
}
.gallery__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .25s ease;
}
.gallery__slide.is-active { opacity: 1; }
.gallery__slide img { width: 100%; height: 100%; object-fit: cover; }

.gallery__zoom {
  position: absolute;
  top: 18px; right: 18px;
  z-index: 3;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.85);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.gallery__zoom:hover { background: #fff; }

.gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.gallery__arrow--prev { left: 18px; background: rgba(255,255,255,.9); color: var(--ink); }
.gallery__arrow--next { right: 18px; background: var(--green-900); color: #fff; }
.gallery__arrow--prev:hover { background: #fff; }
.gallery__arrow--next:hover { opacity: .92; }

.gallery__dots {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 6px;
}
.gallery__dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(0,0,0,.2); }
.gallery__dot.is-active { width: 20px; border-radius: 4px; background: var(--green-900); }

/* single-image variant: hide arrows + dots */
.gallery[data-count="1"] .gallery__arrow,
.gallery[data-count="1"] .gallery__dots { display: none; }

/* ---- info ---- */
.product-info__promo { position: static; display: inline-flex; margin-bottom: 14px; }
.product-info__cat {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-gray);
  margin: 0 0 10px;
}
.product-info__title {
  font-size: var(--h-m-size);
  line-height: var(--h-m-lh);
  font-weight: var(--h-m-weight);
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

.product-info__rating {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 12px;
}
.stars--inline { display: inline-flex; gap: 2px; }
.product-info__rating strong { font-weight: 700; }
.product-info__rating a { color: var(--text-gray); }
.product-info__rating a:hover { color: var(--ink); }

.product-info__brand { font-size: 15px; color: var(--ink-soft); margin: 0; }
.product-info__brand strong { color: var(--ink); }

.product-info__rule { border: none; border-top: 1px solid var(--gray-border); margin: 20px 0; }

.product-info__stock {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--green-700); font-weight: 600;
  margin: 0 0 8px;
}
.product-info__stock span { width: 7px; height: 7px; border-radius: 50%; background: var(--green-700); }

.product-info__price { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; }
.product-info__price-now { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; }
.product-info__price-old { font-size: 18px; color: var(--text-gray); text-decoration: line-through; }

.product-info__label { display: block; font-size: 13px; color: var(--text-gray); margin-bottom: 10px; }
.product-info__variants { margin-bottom: 22px; }
.variant-group { display: flex; gap: 10px; flex-wrap: wrap; }
.variant {
  min-width: 76px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-border);
  background: #fff;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}
.variant:hover { border-color: var(--green-900); }
.variant.is-active { background: var(--green-900); border-color: var(--green-900); color: #fff; }

.product-info__qty { display: flex; gap: 28px; margin-bottom: 24px; }

.product-info__actions { display: flex; gap: 14px; margin-bottom: 28px; }
.product-info__actions .btn { flex: 1; }

.product-info__delivery { display: flex; flex-direction: column; gap: 14px; }
.product-info__delivery li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--ink-soft);
}
.product-info__delivery svg { color: var(--green-700); flex: none; }

/* =========================================================
   SPEC / APPLICATION TABLES
   ========================================================= */
.product-basics { padding-top: 64px; padding-bottom: 64px; }

.spec-table { margin-bottom: 40px; }
.spec-table:last-child { margin-bottom: 0; }
.spec-table__head {
  background: var(--green-900);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  position: relative;
  padding-left: 42px;
}
.spec-table__head::before {
  content: "";
  position: absolute;
  left: 24px; top: 50%;
  transform: translateY(-50%);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #6fae87;
}
.spec-table dl { margin: 0; }
.spec-row {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  padding: 18px 24px;
  font-size: 15px;
}
.spec-row:nth-child(even) { background: #f0f0ee; border-radius: var(--radius-sm); }
.spec-row dt { color: var(--ink-soft); margin: 0; }
.spec-row dd { margin: 0; color: var(--ink); }

.app { display: flex; align-items: center; gap: 8px; }
.app__icon { width: 18px; height: 18px; border-radius: 50%; flex: none; position: relative; }
.app__icon::after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}
.app--ok .app__icon { background: var(--green-700); }
.app--ok .app__icon::after { content: "✓"; }
.app--warn .app__icon { background: var(--gold); }
.app--warn .app__icon::after { content: "!"; }
.app--danger .app__icon { background: #c32c2c; }
.app--danger .app__icon::after { content: "✕"; font-size: 10px; }

/* =========================================================
   MANUFACTURER INSTRUCTION
   ========================================================= */
.instruction-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  align-items: start;
}

.accordion { display: flex; flex-direction: column; gap: 14px; }
.acc-item {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 4px 24px;
}
.acc-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  padding: 20px 0;
}
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary svg { color: var(--text-gray); transition: transform .2s ease; flex: none; }
.acc-item[open] summary svg { transform: rotate(180deg); }
.acc-item__body {
  padding: 0 0 22px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.acc-toggle {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--green-700);
  cursor: pointer;
}
.acc-toggle:hover { text-decoration: underline; }

.review-check {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
}
.review-check__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 20px;
}
.review-check__head > svg { color: var(--text-gray); }
.review-check__badge {
  margin-left: auto;
  background: #4b9b6e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
}
.review-check__person { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.review-check__avatar { width: 52px; height: 52px; border-radius: 50%; flex: none; }
.review-check__person strong { display: block; font-size: 15px; }
.review-check__person span { font-size: 13px; color: var(--text-gray); }
.review-check__dates {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-border);
  font-size: 13px;
  color: var(--text-gray);
}
.review-check__dates strong { color: var(--ink); font-weight: 600; }

/* =========================================================
   CERTIFICATES
   ========================================================= */
.product-certs { padding-top: 64px; padding-bottom: 64px; }
.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.cert-card {
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.cert-card__icon {
  display: inline-flex;
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--cream);
  color: var(--green-900);
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.cert-card h3 { font-size: 17px; margin: 0 0 8px; }
.cert-card p { font-size: 14px; color: var(--text-gray); margin: 0 0 18px; line-height: 1.5; }
.cert-card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--green-700);
}
.cert-card__link:hover { color: var(--green-900); }

/* =========================================================
   REVIEWS
   ========================================================= */
.product-reviews { padding-top: 64px; padding-bottom: 64px; }
.reviews-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  align-items: start;
}
.reviews-list { display: flex; flex-direction: column; gap: 0; }

.pr-review { border-bottom: 1px solid var(--gray-border); padding: 24px 0; }
.pr-review:first-child { padding-top: 0; }
.pr-review__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.pr-review__head strong { display: block; font-size: 16px; margin-bottom: 6px; }
.pr-review__head .stars { display: inline-flex; gap: 2px; }
.pr-review__head time { font-size: 13px; color: var(--text-gray); }
.pr-review__text { font-size: 15px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 16px; }
.pr-review .review-card__product { background: var(--gray-bg); margin-bottom: 16px; }
.pr-review__foot { display: flex; align-items: center; justify-content: space-between; }
.pr-review__reply,
.pr-review__votes button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-size: 13px;
  color: var(--text-gray);
  cursor: pointer;
  font-family: inherit;
}
.pr-review__reply:hover, .pr-review__votes button:hover { color: var(--ink); }
.pr-review__votes { display: flex; gap: 16px; }

.reviews-list__more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 32px;
}
.reviews-list__more p { margin: 0; font-size: 13px; color: var(--text-gray); }

.rating-summary {
  background: #fff;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: sticky;
  top: 140px;
}
.rating-summary__score { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.rating-summary__score strong { font-size: 22px; font-weight: 800; }
.rating-summary__base { font-size: 13px; color: var(--text-gray); margin: 0 0 20px; }
.rating-bars { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.rating-bars li { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-soft); }
.rating-bars li span { width: 58px; flex: none; }
.rating-bars li i { flex: 1; height: 8px; background: var(--gray-bg); border-radius: var(--radius-pill); overflow: hidden; }
.rating-bars li i b { display: block; height: 100%; background: var(--green-900); border-radius: var(--radius-pill); }
.rating-bars li em { width: 34px; text-align: right; flex: none; font-style: normal; color: var(--text-gray); }
.rating-summary .btn { width: 100%; }

/* =========================================================
   STICKY BUY BAR
   ========================================================= */
.sticky-buy {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 120;
  background: #fff;
  border-top: 1px solid var(--gray-border);
  box-shadow: 0 -8px 24px rgba(0,0,0,.06);
  padding: 14px 0;
}
.sticky-buy__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.sticky-buy__product { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sticky-buy__thumb { width: 52px; height: 52px; border-radius: 10px; flex: none; }
.sticky-buy__product strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sticky-buy__product span { font-size: 13px; color: var(--text-gray); }
.sticky-buy__controls { display: flex; align-items: center; gap: 24px; }
.qty-field--row { display: flex; align-items: center; gap: 12px; }
.qty-field--row span { margin: 0; }
.sticky-buy__cta { white-space: nowrap; }

/* =========================================================
   LEAVE-A-REVIEW MODAL
   ========================================================= */
.review-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.review-modal[hidden] { display: none; }
.review-modal__backdrop { position: absolute; inset: 0; background: rgba(10,15,12,.55); }
.review-modal__sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 28px;
}
.review-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.review-modal__head h3 { font-size: 22px; font-weight: 800; margin: 0; }
.review-modal__close {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--gray-border); background: #fff;
  display: flex; align-items: center; justify-content: center; flex: none; cursor: pointer;
}

.review-stars { display: flex; gap: 10px; justify-content: center; margin-bottom: 24px; }
.review-stars button { background: none; border: none; padding: 0; cursor: pointer; line-height: 0; }
.review-stars svg { width: 44px; height: 44px; fill: none; stroke: #c9c9c6; stroke-width: 1.5; }
.review-stars button.is-on svg { fill: var(--gold); stroke: var(--gold); }

.review-form .field { margin-bottom: 16px; }
.review-form > .btn { width: 100%; margin-top: 8px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px) {
  .product-tabs { top: 72px; }
  .product-hero__grid { grid-template-columns: 1fr; gap: 28px; }
  .instruction-grid { grid-template-columns: 1fr; }
  .reviews-grid { grid-template-columns: 1fr; }
  .rating-summary { position: static; order: -1; }
  .cert-grid { grid-template-columns: 1fr; }
  .spec-row { grid-template-columns: 1fr; gap: 4px; }
  .product-similar .product-grid { grid-template-columns: repeat(2, 1fr); }
  .sticky-buy__product strong { max-width: 200px; }
}

@media (max-width: 760px) {
  .sticky-buy__product { display: none; }
  .sticky-buy__inner { justify-content: stretch; }
  .sticky-buy__controls { flex: 1; justify-content: space-between; }
}

@media (max-width: 640px) {
  .product-section-title { font-size: 26px; }
  .product-info__title { font-size: 24px; }
  .product-info__price-now { font-size: 34px; }
  .product-info__actions { flex-direction: column; }

  /* gallery: arrows off, swipe + dots */
  .gallery__arrow { display: none; }

  /* mobile shows only the "Упаковка" stepper */
  .product-info__qty .qty-field:nth-child(2) { display: none; }
  .product-info__qty { display: block; }

  /* popular becomes a horizontal-scroll carousel */
  .product-similar .product-grid {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    gap: 14px;
    margin: 0 -20px;
    padding: 4px 20px 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .product-similar .product-grid::-webkit-scrollbar { display: none; }
  .product-similar .product-card {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }
  .product-similar .section-head { position: relative; }
  .product-similar .section-head .btn { align-self: stretch; }

  /* sticky bar: just the full-width CTA */
  .sticky-buy__controls .qty-field--row { display: none; }
  .sticky-buy__cta { width: 100%; }

  /* review modal becomes a bottom sheet */
  .review-modal { align-items: flex-end; padding: 0; }
  .review-modal__sheet {
    max-width: none;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 92vh;
  }
  .review-stars svg { width: 40px; height: 40px; }
}
