﻿/**
 * Dabi — product detail page (maket Clay / Vintage cup).
 *
 * Title case: display as entered (no forced UPPERCASE) — cards stay uppercase.
 * Sample = display/sample piece (possible wear, discounted); Нова = unused.
 */

/* --------------------------------------------------------------------------
   Breadcrumbs
   -------------------------------------------------------------------------- */

.pdp-crumbs {
  padding-block: var(--s-4) var(--s-2);
}

.pdp-crumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-small);
  color: var(--ink-2);
}

.pdp-crumbs__item:not(:last-child)::after {
  content: "/";
  margin-inline-start: var(--s-2);
  color: var(--ink-3);
}

.pdp-crumbs__item a {
  color: var(--ink-2);
  text-decoration: none;
}

.pdp-crumbs__item a:hover {
  color: var(--ink);
  opacity: 1;
}

.pdp-crumbs__item[aria-current="page"] a,
.pdp-crumbs__item[aria-current="page"] span {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Layout — gallery ~55% / buy ~45%
   -------------------------------------------------------------------------- */

.pdp__layout {
  display: grid;
  gap: var(--block-y);
  align-items: start;
  padding-block-end: var(--section-y);
}

.pdp__gallery {
  min-width: 0;
}

@media (min-width: 768px) {
  .pdp__layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--gap);
  }

  .pdp__buy {
    position: static;
  }
}

@media (min-width: 1024px) {
  .pdp__layout {
    grid-template-columns: minmax(0, 0.55fr) minmax(0, 0.45fr);
  }

  .pdp__buy {
    position: sticky;
    top: calc(4.25rem + var(--s-6));
  }

  body:has(.site-header.is-scrolled) .pdp__buy {
    top: calc(3.5rem + var(--s-6));
  }

  body:has(.site-header.is-hidden) .pdp__buy {
    top: var(--s-6);
  }
}

/* --------------------------------------------------------------------------
   Gallery — thumbs + main
   -------------------------------------------------------------------------- */

.pdp-gallery {
  min-width: 0;
}

.pdp-gallery--empty,
.pdp-gallery__main,
.pdp-gallery__slide,
.pdp-gallery__thumb {
  background: var(--surface);
  border: none;
  padding: 0;
  overflow: hidden;
}

.pdp-gallery--empty {
  aspect-ratio: 4 / 5;
  border-radius: 10px;
}

.pdp-gallery__main,
.pdp-gallery__slide {
  cursor: zoom-in;
  border-radius: 10px;
}

.pdp-gallery__main img,
.pdp-gallery__slide img,
.pdp-gallery__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp-gallery__rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.pdp-gallery__rail::-webkit-scrollbar {
  display: none;
}

.pdp-gallery__slide {
  aspect-ratio: 4 / 5;
  scroll-snap-align: start;
}

.pdp-gallery__dots {
  display: flex;
  justify-content: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.pdp-gallery__dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--hairline);
}

.pdp-gallery__dot.is-active {
  background: var(--ink);
}

.pdp-gallery__desktop {
  display: none;
}

@media (min-width: 768px) {
  .pdp-gallery__rail,
  .pdp-gallery__dots {
    display: none;
  }

  .pdp-gallery__desktop {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: var(--s-3);
    align-items: start;
  }

  .pdp-gallery__thumbs {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    max-height: min(70vh, 40rem);
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .pdp-gallery__thumb {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 8px;
    cursor: pointer;
    outline: 1.5px solid transparent;
    outline-offset: 2px;
  }

  .pdp-gallery__thumb.is-active {
    outline-color: var(--ink);
  }

  .pdp-gallery__main {
    aspect-ratio: 4 / 5;
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Buy column
   -------------------------------------------------------------------------- */

.pdp-buy {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 28rem;
}

.pdp-buy__title {
  margin: 0 0 var(--s-3);
  font-family: var(--font-sans);
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: var(--lh-head);
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
}

.pdp-buy__by {
  margin: 0 0 var(--s-4);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-2);
}

.pdp-buy__brand {
  color: var(--ink-2);
  text-decoration: none;
}

.pdp-buy__brand:hover {
  color: var(--ink);
  opacity: 1;
}

.pdp-buy__price {
  margin: 0 0 var(--s-6);
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--price);
}

.pdp-buy__price .amount,
.pdp-buy__price del,
.pdp-buy__price ins {
  text-decoration: none;
}

.pdp-buy__price del {
  color: var(--ink-2);
  text-decoration: line-through;
  margin-inline-end: var(--s-2);
  font-weight: 500;
}

.pdp-buy__excerpt {
  margin: 0 0 var(--s-8);
  color: var(--ink-2);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.pdp-buy__excerpt p {
  margin: 0 0 var(--s-3);
}

.pdp-buy__excerpt p:last-child {
  margin-bottom: 0;
}

.pdp-buy__cart {
  margin: 0 0 var(--s-4);
}

.woocommerce .pdp form.cart,
.woocommerce div.product.pdp form.cart,
.pdp-buy__cart form.cart {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  float: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.woocommerce .pdp form.cart::before,
.woocommerce .pdp form.cart::after {
  content: none;
  display: none;
}

.pdp-buy__packing {
  margin: 0;
}

.pdp-buy__packing[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.pdp-buy__packing-note {
  margin: var(--s-2) 0 0;
  font-size: var(--fs-small);
}

/* Qty + ATC row */
.pdp-atc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
}

.pdp-qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  overflow: hidden;
  flex: 0 0 auto;
}

.pdp-qty__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: none;
  cursor: pointer;
}

.pdp-qty .quantity,
.pdp-qty .pdp-qty__input,
.pdp-qty input.qty {
  width: 2.5rem;
  min-height: 2.75rem;
  margin: 0;
  padding: 0;
  text-align: center;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.pdp-qty input.qty::-webkit-outer-spin-button,
.pdp-qty input.qty::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.pdp-atc-row .single_add_to_cart_button {
  flex: 1 1 10rem;
  float: none;
  width: auto;
  min-width: 10rem;
}

.pdp-cart--unique .pdp-qty {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.pdp .stock {
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: var(--s-4);
}

.woocommerce-variation-add-to-cart .woocommerce-variation-price,
.single_variation .woocommerce-variation-price,
.woocommerce-variation-price {
  display: none;
}

.woocommerce-variation-availability {
  margin-bottom: var(--s-3);
}

/* --------------------------------------------------------------------------
   Variations — Стан pills / Color swatches
   -------------------------------------------------------------------------- */

.pdp-vars {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  margin-bottom: var(--s-6);
}

.pdp-vars__group {
  position: relative;
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
}

.pdp-vars__legend {
  margin: 0 0 var(--s-3);
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 0;
}

.pdp-vars__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pdp-vars__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.pdp-vars__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: var(--s-2) var(--s-4);
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.pdp-vars__chip:hover {
  border-color: var(--ink);
}

.pdp-vars__chip.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.pdp-vars__chip.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.pdp-vars__chip--swatch {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  border-radius: var(--radius-pill);
  background: var(--swatch, var(--surface));
  border: 1.5px solid var(--hairline);
  box-shadow: inset 0 0 0 2px var(--paper);
}

.pdp-vars__chip--swatch.is-active {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--paper), 0 0 0 1.5px var(--ink);
  background: var(--swatch, var(--ink));
  color: transparent;
}

.pdp-vars__hint {
  margin: var(--s-3) 0 0;
  font-size: var(--fs-small);
  line-height: var(--lh-body);
  color: var(--ink-2);
  max-width: 36ch;
}

.pdp-facts {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin: 0 0 var(--s-6);
}

.pdp-facts__row {
  margin: 0;
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-2);
}

.pdp-facts__value {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Lifestyle gallery — maket: tall left + 2×2 right (5 photos)
   -------------------------------------------------------------------------- */

.pdp-life {
  padding-block-start: 0;
}

.pdp-life__masonry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
}

.pdp-life__cell {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  aspect-ratio: 1;
}

.pdp-life__cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 768px) {
  .pdp-life__masonry {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-auto-flow: column;
    gap: var(--gap);
    aspect-ratio: 3 / 2;
  }

  .pdp-life__masonry--maket {
    aspect-ratio: 3 / 2;
  }

  .pdp-life__cell {
    aspect-ratio: auto;
    min-height: 0;
  }

  .pdp-life__cell--hero {
    grid-row: span 2;
  }
}

@media (max-width: 767px) {
  .pdp-life__cell--hero {
    grid-column: 1 / -1;
    aspect-ratio: 3 / 4;
  }
}

/* --------------------------------------------------------------------------
   Description
   -------------------------------------------------------------------------- */

.pdp-desc {
  background: #f9f9f9;
}

.pdp-desc__title {
  margin: 0 0 var(--s-6);
  text-align: center;
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--ink);
}

.pdp-desc__body {
  max-width: none;
  width: 100%;
  color: var(--ink-2);
  text-align: left;
}

.pdp-desc__body > *:first-child {
  margin-block-start: 0;
}

.pdp-desc__body > *:last-child {
  margin-block-end: 0;
}

/* --------------------------------------------------------------------------
   Related
   -------------------------------------------------------------------------- */

.pdp-related__title {
  margin: 0;
  text-align: center;
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--ink);
}

.pdp-related__more {
  margin: 0;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Sticky ATC (mobile)
   -------------------------------------------------------------------------- */

.pdp-sticky-atc {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: var(--paper);
  border-top: 1.5px solid var(--hairline);
  padding-block: var(--s-3);
  padding-bottom: calc(var(--s-3) + env(safe-area-inset-bottom, 0px));
}

.pdp-sticky-atc[hidden] {
  display: none;
}

.pdp-sticky-atc__inner {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.pdp-sticky-atc__price {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--price);
}

.pdp-sticky-atc__actions {
  display: flex;
  flex: 0 0 auto;
  gap: var(--s-2);
  align-items: center;
}

.pdp-sticky-atc__packing {
  padding-inline: var(--s-3);
  min-height: 2.75rem;
  font-size: var(--fs-small);
}

.pdp-sticky-atc__packing[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.pdp-sticky-atc__btn {
  flex: 0 0 auto;
}

@media (min-width: 768px) {
  .pdp-sticky-atc {
    display: none !important;
  }
}

body.has-pdp-sticky-atc {
  padding-bottom: 5.5rem;
}

body.is-pdp-lightbox {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */

.pdp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 24, 21, 0.88);
  padding: var(--gutter);
}

.pdp-lightbox[hidden] {
  display: none;
}

.pdp-lightbox__figure {
  margin: 0;
  max-width: min(56rem, 100%);
  max-height: 90vh;
}

.pdp-lightbox__img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  margin-inline: auto;
}

.pdp-lightbox__close,
.pdp-lightbox__nav {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--paper);
  background: transparent;
  border: 1.5px solid rgba(252, 251, 249, 0.35);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.pdp-lightbox__close {
  top: var(--s-4);
  right: var(--s-4);
}

.pdp-lightbox__nav--prev {
  left: var(--s-4);
  top: 50%;
  transform: translateY(-50%);
}

.pdp-lightbox__nav--next {
  right: var(--s-4);
  top: 50%;
  transform: translateY(-50%);
}

@media (prefers-reduced-motion: reduce) {
  .pdp-vars__chip,
  .pdp-gallery__thumb {
    transition: none;
  }
}
