/*
 * КнигДекор · карточка товара v2
 * Подключается после style.css, theme-v2.css и cards-v3.css.
 */

body.theme-v2.pdp-store {
  padding-bottom: calc(128px + env(safe-area-inset-bottom));
  background: var(--surface-page);
}

body.theme-v2.pdp-store.pdp-no-gift {
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

.theme-v2.pdp-store main {
  background: var(--surface-page);
}

.theme-v2.pdp-store .catalog-crumbs {
  padding-top: 1rem;
  padding-bottom: 0.65rem;
}

.theme-v2.pdp-store .catalog-crumbs [data-product-crumb] {
  color: var(--c-text-muted);
}

.theme-v2.pdp-store .product-hero {
  padding: 0.25rem 0 4rem;
  background: var(--surface-page);
}

.theme-v2.pdp-store .product {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "summary"
    "gallery"
    "details";
  gap: 1.25rem;
}

.theme-v2.pdp-store .product__summary {
  grid-area: summary;
  min-width: 0;
}

.theme-v2.pdp-store .product__panel {
  display: contents;
}

.theme-v2.pdp-store .product__meta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.theme-v2.pdp-store .product__summary .eyebrow {
  margin: 0;
  color: var(--c-accent);
  font-size: 0.75rem;
  font-weight: 800;
}

.theme-v2.pdp-store .product__title {
  max-width: 16ch;
  margin: 0;
  color: var(--c-text);
  font-family: var(--f-sans);
  font-size: clamp(2.25rem, 10vw, 3.3rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.theme-v2.pdp-store .product[data-product-kind="panel"] .product__title,
.theme-v2.pdp-store .product[data-product-kind="lamp"] .product__title,
.theme-v2.pdp-store .product[data-product-kind="art"] .product__title {
  max-width: 19ch;
  font-size: clamp(2rem, 8.5vw, 2.85rem);
  line-height: 1;
}

.theme-v2.pdp-store .product__intro {
  max-width: 44ch;
  margin: 0.8rem 0 0;
  color: var(--c-text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.theme-v2.pdp-store .product__price {
  margin: 1rem 0 0;
  color: var(--c-text);
  font-family: var(--f-sans);
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.035em;
}

.theme-v2.pdp-store .product__gallery {
  grid-area: gallery;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.theme-v2.pdp-store .product__main {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 24px;
  background: var(--surface-placeholder);
}

.theme-v2.pdp-store .product__main::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(32, 35, 31, 0.07);
  border-radius: inherit;
  pointer-events: none;
  content: "";
}

.theme-v2.pdp-store .product__main img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.theme-v2.pdp-store .product[data-product-kind="panel"] .product__main,
.theme-v2.pdp-store .product[data-product-kind="lamp"] .product__main,
.theme-v2.pdp-store .product[data-product-kind="art"] .product__main {
  background: #ebe7df;
}

.theme-v2.pdp-store .product[data-product-kind="panel"] .product__main img,
.theme-v2.pdp-store .product[data-product-kind="lamp"] .product__main img,
.theme-v2.pdp-store .product[data-product-kind="art"] .product__main img {
  object-fit: contain;
}

.theme-v2.pdp-store .product__image-count {
  right: 0.85rem;
  bottom: 0.85rem;
  min-width: 48px;
  padding: 0.38rem 0.58rem;
  border-radius: 999px;
  background: rgba(28, 33, 30, 0.76);
  font-size: 0.68rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.theme-v2.pdp-store .product__thumbs {
  gap: 0.55rem;
  padding: 0.1rem 0 0.25rem;
  scrollbar-width: none;
}

.theme-v2.pdp-store .product__thumbs::-webkit-scrollbar {
  display: none;
}

.theme-v2.pdp-store .product__thumbs[hidden],
.theme-v2.pdp-store .product__image-count[hidden] {
  display: none;
}

.theme-v2.pdp-store .product__thumb {
  width: 64px;
  height: 64px;
  flex-basis: 64px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--surface-card);
}

.theme-v2.pdp-store .product__thumb.is-active {
  border-color: var(--c-accent);
  box-shadow: none;
}

.theme-v2.pdp-store .product__photo-note {
  position: relative;
  margin: 0.1rem 0 0;
  padding: 0 0 0 1.45rem;
  border: 0;
  border-radius: 0;
  color: var(--c-text-muted);
  background: transparent;
  font-size: 0.875rem;
  line-height: 1.4;
}

.theme-v2.pdp-store .product__photo-note::before {
  position: absolute;
  top: 0.1rem;
  left: 0;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--c-accent);
  background: #f1e3e5;
  font-size: 0.6rem;
  font-weight: 900;
  content: "i";
}

.theme-v2.pdp-store .product__details {
  grid-area: details;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.theme-v2.pdp-store .product__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.theme-v2.pdp-store .product[data-product-kind="book_set"] .product__facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.theme-v2.pdp-store .product[data-product-kind="panel"] .product__facts,
.theme-v2.pdp-store .product[data-product-kind="lamp"] .product__facts,
.theme-v2.pdp-store .product[data-product-kind="art"] .product__facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.theme-v2.pdp-store .product[data-product-kind="panel"] .product__facts li:last-child:nth-child(odd),
.theme-v2.pdp-store .product[data-product-kind="art"] .product__facts li:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.theme-v2.pdp-store .product__facts li {
  min-width: 0;
  padding: 0.8rem;
  border: 0;
  border-radius: 15px;
  background: var(--surface-card);
}

.theme-v2.pdp-store .product__facts span {
  display: block;
  margin-bottom: 0.28rem;
  color: var(--c-text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.theme-v2.pdp-store .product__facts strong {
  display: block;
  color: var(--c-text);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
}

.theme-v2.pdp-store .product__facts .product__fact-palette {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  margin: 0 0 0.38rem;
}

.theme-v2.pdp-store .product__fact-palette i {
  width: 12px;
  height: 12px;
  display: block;
  flex: 0 0 12px;
  border: 1px solid rgba(32, 35, 31, 0.1);
  border-radius: 50%;
}

.theme-v2.pdp-store .product__buy {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0;
  padding: 1.15rem;
  border: 0;
  border-radius: 22px;
  background: #f0e5e6;
  box-shadow: 0 10px 28px rgba(30, 33, 30, 0.055);
}

.theme-v2.pdp-store .product__gift {
  min-height: 50px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0 0.85rem;
  border: 1px solid rgba(110, 41, 51, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.theme-v2.pdp-store .product__gift input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--c-accent);
}

.theme-v2.pdp-store .product__gift input:focus-visible {
  outline: 0;
  box-shadow: none;
}

.theme-v2.pdp-store .product__gift-label {
  min-width: 0;
  color: var(--c-text);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
}

.theme-v2.pdp-store .product__gift-price {
  color: var(--c-accent);
  font-size: 0.875rem;
  font-weight: 900;
  white-space: nowrap;
}

.theme-v2.pdp-store .product__gift:has(input:checked) {
  border-color: rgba(110, 41, 51, 0.36);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(110, 41, 51, 0.05);
}

.theme-v2.pdp-store .product__gift:has(input:focus-visible) {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

.theme-v2.pdp-store .product__buy .btn {
  min-height: 56px;
  margin: 0;
  border-radius: 16px;
  font-size: 0.92rem;
}

.theme-v2.pdp-store .product__buy .btn.is-added,
.theme-v2.pdp-store .sticky-cta .btn.is-added {
  border-color: var(--c-accent-2);
  background: var(--c-accent-2);
  box-shadow: 0 9px 22px rgba(63, 96, 74, 0.18);
}

.theme-v2.pdp-store .product__assurances {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  color: var(--c-text);
  font-size: 0.75rem;
  font-weight: 700;
}

.theme-v2.pdp-store .product__assurances span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.theme-v2.pdp-store .product__assurances span::before {
  color: var(--c-accent-2);
  font-weight: 900;
  content: "✓";
}

.theme-v2.pdp-store .product-editorial {
  padding: clamp(2.75rem, 5vw, 4rem) 0;
  border: 0;
  background: var(--surface-card);
}

.theme-v2.pdp-store .product-editorial__inner {
  max-width: var(--max-w);
  display: grid;
  gap: 0.85rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: 28px;
  background: var(--surface-warm);
}

.theme-v2.pdp-store .product-editorial__inner .eyebrow {
  margin: 0;
}

.theme-v2.pdp-store .product-editorial__inner h2 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 0.98;
}

.theme-v2.pdp-store .product-editorial .product__desc {
  max-width: 70ch;
  margin: 0;
  color: var(--c-text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.theme-v2.pdp-store [data-similar-section] {
  padding: clamp(3.5rem, 7vw, 5.5rem) 0;
  background: var(--surface-page);
}

.theme-v2.pdp-store.pdp-book-set [data-similar-section] {
  padding-top: 0;
}

.theme-v2.pdp-store [data-similar-section] .section-head {
  margin-bottom: 1.75rem;
}

.theme-v2.pdp-store [data-similar-section] .section-head h2 {
  font-size: clamp(2.25rem, 4vw, 3.4rem);
  line-height: 0.98;
}

.theme-v2.pdp-store .pdp-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.25rem 0.7rem;
}

.theme-v2.pdp-store .pdp-related-more {
  margin-top: 2.5rem;
  text-align: center;
}

.theme-v2.pdp-store .footer {
  margin-top: 0;
}

.theme-v2.pdp-store .sticky-cta {
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.5rem var(--pad-x) calc(0.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(32, 35, 31, 0.08);
  background: rgba(250, 249, 246, 0.97);
  box-shadow: 0 -10px 30px rgba(30, 33, 30, 0.09);
  backdrop-filter: blur(16px);
}

.theme-v2.pdp-store .sticky-cta__options {
  width: 100%;
}

.theme-v2.pdp-store.pdp-no-gift .sticky-cta {
  gap: 0;
  padding-top: 0.55rem;
  padding-bottom: calc(0.55rem + env(safe-area-inset-bottom));
}

.theme-v2.pdp-store.pdp-no-gift .sticky-cta__options,
.theme-v2.pdp-store.pdp-no-gift .product__gift {
  display: none;
}

.theme-v2.pdp-store .product__gift[hidden],
.theme-v2.pdp-store .sticky-cta__gift[hidden] {
  display: none;
}

.theme-v2.pdp-store .sticky-cta__gift {
  min-width: 0;
  min-height: 50px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.48rem;
  padding: 0 0.75rem;
  border: 1px solid rgba(110, 41, 51, 0.1);
  border-radius: 14px;
  background: rgba(110, 41, 51, 0.035);
  color: var(--c-text);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.theme-v2.pdp-store .sticky-cta__gift input {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin: 0;
  accent-color: var(--c-accent);
}

.theme-v2.pdp-store .sticky-cta__gift input:focus-visible {
  outline: 0;
  box-shadow: none;
}

.theme-v2.pdp-store .sticky-cta__gift-label {
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.18;
}

.theme-v2.pdp-store .sticky-cta__gift-price {
  color: var(--c-accent);
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.theme-v2.pdp-store .sticky-cta__gift:has(input:checked) {
  border-color: rgba(110, 41, 51, 0.34);
  background: rgba(110, 41, 51, 0.1);
  box-shadow: inset 0 0 0 1px rgba(110, 41, 51, 0.04);
}

.theme-v2.pdp-store .sticky-cta__gift:has(input:focus-visible) {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 14px;
}

@media (hover: hover) {
  .theme-v2.pdp-store .sticky-cta__gift:hover {
    border-color: rgba(110, 41, 51, 0.22);
    background: rgba(110, 41, 51, 0.07);
  }
}

.theme-v2.pdp-store .sticky-cta .btn {
  min-height: 52px;
  border-radius: 16px;
}

@media (max-width: 1023px) {
  .theme-v2.pdp-store .product__buy {
    display: none;
  }
}

@media (max-width: 767px) {
  /* Цена уже постоянно видна в нижнем CTA; повтор в summary только отодвигает фото. */
  .theme-v2.pdp-store .product__price {
    display: none;
  }

  .theme-v2.pdp-store .catalog-crumbs > span:nth-last-child(2),
  .theme-v2.pdp-store .catalog-crumbs [data-product-crumb] {
    display: none;
  }

  .theme-v2.pdp-store .product-hero {
    padding-bottom: 2rem;
  }

  .theme-v2.pdp-store .product-editorial {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .theme-v2.pdp-store [data-similar-section] {
    padding-top: 2rem;
    padding-bottom: 3.5rem;
  }

  .theme-v2.pdp-store.pdp-book-set [data-similar-section] {
    padding-top: 1.25rem;
  }
}

@media (min-width: 768px) {
  body.theme-v2.pdp-store {
    padding-bottom: 0;
  }

  .theme-v2.pdp-store .product__main {
    border-radius: 28px;
  }

  .theme-v2.pdp-store .product__thumb {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
  }

  .theme-v2.pdp-store .product-editorial__inner {
    grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1fr);
    column-gap: clamp(2.5rem, 7vw, 7rem);
    align-items: end;
  }

  .theme-v2.pdp-store .product-editorial__inner .eyebrow {
    grid-column: 1;
  }

  .theme-v2.pdp-store .product-editorial__inner h2 {
    grid-column: 1;
  }

  .theme-v2.pdp-store .product-editorial .product__desc {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .theme-v2.pdp-store .pdp-related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3rem 1rem;
  }
}

/* До появления настоящей двухколоночной PDP покупка остаётся доступной:
   иначе на планшете CTA оказывается ниже крупной квадратной фотографии. */
@media (min-width: 768px) and (max-width: 1023px) {
  body.theme-v2.pdp-store {
    padding-bottom: calc(128px + env(safe-area-inset-bottom));
  }

  .theme-v2.pdp-store .sticky-cta {
    display: flex;
  }
}

@media (min-width: 1024px) {
  .theme-v2.pdp-store .catalog-crumbs {
    padding-top: 1.1rem;
    padding-bottom: 0.8rem;
  }

  .theme-v2.pdp-store .product-hero {
    padding: 0.25rem 0 4rem;
  }

  .theme-v2.pdp-store .product {
    grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
    grid-template-areas: "gallery panel";
    gap: clamp(2.5rem, 5vw, 5rem);
    align-items: start;
  }

  .theme-v2.pdp-store .product__panel {
    grid-area: panel;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: calc(var(--hdr-h) + 1rem);
  }

  .theme-v2.pdp-store .product__summary {
    padding-top: 0.3rem;
  }

  .theme-v2.pdp-store .product__title {
    font-size: clamp(2.8rem, 4.2vw, 4rem);
  }

  .theme-v2.pdp-store .product[data-product-kind="panel"] .product__title,
  .theme-v2.pdp-store .product[data-product-kind="lamp"] .product__title,
  .theme-v2.pdp-store .product[data-product-kind="art"] .product__title {
    font-size: clamp(2.35rem, 3.25vw, 3.2rem);
  }

  .theme-v2.pdp-store .product__price {
    font-size: 1.8rem;
  }

  .theme-v2.pdp-store .product__intro {
    font-size: 1rem;
    line-height: 1.55;
  }

  .theme-v2.pdp-store .product__facts li {
    min-height: 88px;
    padding: 1rem;
  }

  .theme-v2.pdp-store .product__facts span {
    font-size: 0.875rem;
  }

  .theme-v2.pdp-store .product__facts strong {
    font-size: 1rem;
  }

  .theme-v2.pdp-store .product__buy {
    gap: 0.75rem;
    padding: 1rem;
  }

  .theme-v2.pdp-store .product__assurances {
    font-size: 0.875rem;
  }
}

@media (min-width: 1024px) and (max-height: 760px) {
  .theme-v2.pdp-store .product { gap: 3rem; }

  .theme-v2.pdp-store .product__panel { gap: 1.25rem; }

  .theme-v2.pdp-store .product__title {
    font-size: 2.65rem;
  }

  .theme-v2.pdp-store .product__intro {
    margin-top: 0.55rem;
  }

  .theme-v2.pdp-store .product__price {
    margin-top: 0.65rem;
    font-size: 1.55rem;
  }

  .theme-v2.pdp-store .product__gallery {
    gap: 0.5rem;
  }

  .theme-v2.pdp-store .product__facts li {
    min-height: 64px;
    padding: 0.65rem;
  }

  .theme-v2.pdp-store .product__buy {
    gap: 0.55rem;
    padding: 0.9rem 1rem;
  }

  .theme-v2.pdp-store .product__gift {
    min-height: 46px;
  }

  .theme-v2.pdp-store .product__buy .btn {
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-v2.pdp-store .product__main img,
  .theme-v2.pdp-store .btn {
    transition: none;
  }
}
