/* =========================================================
   P'rabote — pdp.css
   Product detail page (templates/product.json).
   Each block = one Shopify section / snippet.
   ========================================================= */

:root {
  /* Figma token not yet in base.css */
  --color-border-strong: #cbd5e1;
}

/* =========================================================
   BREADCRUMB  (snippets/breadcrumb.liquid)
   ========================================================= */
.pdp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 32px var(--page-gutter) 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-neutral-500);
  white-space: nowrap;
}
.pdp-breadcrumb a:hover {
  color: var(--color-text-primary);
}
.pdp-breadcrumb__current {
  font-weight: 500;
  color: var(--color-text-primary);
}

/* =========================================================
   PRODUCT  (sections/main-product.liquid)
   ========================================================= */
.pdp-product {
  display: flex;
  align-items: flex-start;
  gap: 64px;
  padding: 40px 64px 72px var(--page-gutter);
}

/* ---- Gallery ---- */
.pdp-gallery {
  flex: 1 1 0;
  min-width: 1px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pdp-gallery__main {
  aspect-ratio: 1116 / 720;
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-bg-secondary);
}
.pdp-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pdp-gallery__thumbs {
  display: flex;
  gap: 16px;
}
.pdp-thumb {
  position: relative;
  flex: 1 1 0;
  min-width: 1px;
  aspect-ratio: 267 / 150;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-bg-secondary);
}
.pdp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pdp-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  transition: border-color 0.15s ease;
}
.pdp-thumb:hover::after {
  border-color: var(--color-brand-primary-300);
}
.pdp-thumb.is-active::after {
  border-color: var(--color-brand-default);
}

/* ---- Info column ---- */
.pdp-info {
  flex: 0 0 620px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.pdp-info > * {
  max-width: 100%;
}
.pdp-info__title {
  width: 100%;
  font-family: var(--font-family-serif);
  font-weight: 400;
  font-size: 48px;
  line-height: 56px;
  letter-spacing: -0.96px;
  color: var(--color-text-primary);
}

.pdp-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.pdp-rating__value {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.pdp-rating__count {
  font-size: 14px;
  line-height: 20px;
  color: var(--color-neutral-500);
}

.pdp-price {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.pdp-price__current {
  font-size: 28px;
  line-height: 36px;
  font-weight: 600;
  letter-spacing: -0.8px;
  color: var(--color-text-primary);
}
.pdp-price__compare {
  font-size: 16px;
  line-height: 24px;
  color: var(--color-neutral-500);
}
.pdp-price__badge {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--color-danger-default);
  color: var(--color-text-inverse);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

/* Countdown band */
.pdp-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--color-brand-subtle);
}
.pdp-timer__text {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: var(--color-brand-default);
}
.pdp-timer__short {
  display: none;
}
.pdp-timer__clock {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}
.pdp-timer__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pdp-timer__num {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.7px;
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
}
.pdp-timer__label {
  font-size: 12px;
  line-height: 16px;
  color: var(--color-neutral-500);
}
.pdp-timer__sep {
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
  color: var(--color-neutral-500);
}

.pdp-info__desc {
  font-size: 16px;
  line-height: 24px;
  color: var(--color-neutral-500);
}
.pdp-divider {
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--color-neutral-200);
}

/* Variant pickers */
.pdp-option {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.pdp-option__label {
  float: left; /* lets the legend take part in the flex gap */
  padding: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.pdp-option__label + * {
  clear: both;
}
.pdp-swatches {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pdp-swatch {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--color-border-default);
  background: var(--swatch);
  cursor: pointer;
}
.pdp-swatch input,
.pdp-size input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.pdp-swatch:has(input:checked) {
  border-color: var(--swatch);
  outline: 2px solid var(--color-brand-default);
  outline-offset: 2px;
  margin: 4px;
}
.pdp-swatch:has(input:focus-visible),
.pdp-size:has(input:focus-visible) {
  box-shadow: 0 0 0 3px var(--color-brand-primary-200);
}
.pdp-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pdp-size span {
  display: block;
  padding: 8px 17px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-bg-primary);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.pdp-size span:hover {
  border-color: var(--color-text-primary);
}
.pdp-size input:checked + span {
  padding: 7.5px 16.5px;
  border: 1.5px solid var(--color-brand-default);
  background: var(--color-brand-subtle);
  color: var(--color-brand-default);
}

/* Stock */
.pdp-stock {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.pdp-stock__text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-text-primary);
}
.pdp-stock__text img {
  width: 8px;
  height: 8px;
}
.pdp-stock__bar {
  height: 6px;
  border-radius: 999px;
  background: var(--color-neutral-200);
  overflow: hidden;
}
.pdp-stock__bar span {
  display: block;
  width: 430px;
  max-width: 74.6%;
  height: 100%;
  border-radius: 999px;
  background: var(--color-brand-default);
}

/* Quantity + add to cart + wishlist */
.pdp-actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  padding-top: 4px;
}
.pdp-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  width: 118px;
  height: 48px;
  padding: 0 16.5px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 12px;
  background: var(--color-bg-primary);
}
.pdp-qty button {
  display: flex;
  width: 20px;
  height: 20px;
}
.pdp-qty button img {
  width: 20px;
  height: 20px;
}
.pdp-qty button:disabled {
  opacity: 0.35;
  cursor: default;
}
.pdp-qty input {
  width: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: var(--color-text-primary);
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
.pdp-qty input::-webkit-outer-spin-button,
.pdp-qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pdp-actions__add {
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
}
.pdp-wish {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 52px;
  height: 48px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 12px;
  background: var(--color-bg-primary);
}
.pdp-wish:hover {
  border-color: var(--color-text-primary);
}
.pdp-wish img {
  width: 24px;
  height: 24px;
}
.pdp-wish.is-active img {
  filter: brightness(0) saturate(100%) invert(31%) sepia(28%) saturate(860%) hue-rotate(95deg) brightness(92%) contrast(88%);
}
.pdp-wish.is-active {
  border-color: var(--color-brand-default);
  background: var(--color-brand-subtle);
}

/* Trust */
.pdp-trust {
  display: flex;
  gap: 12px;
  width: 100%;
  padding-top: 12px;
}
.pdp-trust__item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 19px 11px;
  border: 1px solid var(--color-border-default);
  border-radius: 12px;
  background: var(--color-bg-secondary);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  color: var(--color-text-primary);
}
.pdp-trust__item img {
  width: 24px;
  height: 24px;
}

/* =========================================================
   DETAILS  (sections/product-details.liquid)
   ========================================================= */
.pdp-details {
  display: flex;
  align-items: flex-start;
  gap: 96px;
  padding: 72px var(--page-gutter);
  background: var(--color-bg-secondary);
}
.pdp-about,
.pdp-specs {
  flex: 1 1 0;
  min-width: 1px;
  display: flex;
  flex-direction: column;
}
.pdp-about {
  gap: 20px;
}
.pdp-specs {
  gap: 16px;
}
.pdp-about__text {
  font-size: 16px;
  line-height: 24px;
  color: var(--color-neutral-500);
}
.pdp-checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}
.pdp-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-text-primary);
}
.pdp-checklist img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.pdp-specs__table {
  margin: 0;
  padding-top: 8px;
}
.pdp-specs__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-neutral-200);
  font-size: 14px;
  line-height: 20px;
}
.pdp-specs__row dt {
  color: var(--color-neutral-500);
}
.pdp-specs__row dd {
  margin: 0;
  font-weight: 500;
  text-align: right;
  color: var(--color-text-primary);
}

/* =========================================================
   CUSTOMER REVIEWS  (sections/product-reviews.liquid)
   ========================================================= */
.pdp-reviews {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 56px var(--page-gutter);
  background: var(--color-bg-primary);
}
.pdp-reviews__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.pdp-reviews__write-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-border-default);
  border-radius: 999px;
}
.pdp-reviews__write-icon img {
  width: 18px;
  height: 18px;
}
.pdp-reviews__summary {
  display: flex;
  align-items: flex-start;
  gap: 80px;
  padding: 8px 0;
}
.pdp-reviews__stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pdp-reviews__stat--recommend {
  width: 320px;
}
.pdp-reviews__avg {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.pdp-reviews__big {
  font-family: var(--font-family-serif);
  font-size: 48px;
  line-height: 56px;
  letter-spacing: -0.96px;
  color: var(--color-text-primary);
}
.pdp-reviews__big--brand {
  color: var(--color-brand-default);
}
.pdp-stars-20 {
  gap: 2.8px;
}
.pdp-stars-20 img {
  width: 20px;
  height: 20px;
}
.pdp-stars-16 img {
  width: 16px;
  height: 16px;
}
.pdp-reviews__caption {
  font-size: 14px;
  line-height: 20px;
  color: var(--color-neutral-500);
}

.pdp-reviews__list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.pdp-review {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  padding: 8px 0;
}
.pdp-review__author {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pdp-review__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  line-height: 16px;
  color: var(--color-neutral-500);
}
.pdp-review__name {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.pdp-review__verified {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pdp-review__verified img,
.pdp-review__recommend img {
  width: 16px;
  height: 16px;
}
.pdp-review__body {
  flex: 1 1 0;
  min-width: 1px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pdp-review__title {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.pdp-review__text {
  font-size: 14px;
  line-height: 20px;
  color: var(--color-neutral-500);
}
.pdp-review__recommend {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-text-primary);
}
.pdp-review__helpful {
  flex: 0 0 180px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-neutral-500);
}
.pdp-review__votes {
  display: flex;
  gap: 8px;
}
.pdp-review__votes button {
  padding: 7px 17px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-bg-primary);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--color-text-primary);
}
.pdp-review__votes button:hover {
  border-color: var(--color-text-primary);
}
.pdp-review__votes button[aria-pressed="true"] {
  border-color: var(--color-brand-default);
  background: var(--color-brand-subtle);
  color: var(--color-brand-default);
}
.pdp-reviews__more {
  display: flex;
  justify-content: center;
  padding-top: 24px;
}
.pdp-pill-btn {
  padding: 8.5px 20px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-bg-primary);
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  color: var(--color-text-primary);
}
.pdp-pill-btn:hover {
  border-color: var(--color-text-primary);
}

/* =========================================================
   YOU MAY ALSO LIKE  (sections/product-recommendations.liquid)
   ========================================================= */
.pdp-related {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 80px var(--page-gutter) 96px;
}
.pdp-related__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  white-space: nowrap;
}
.pdp-related__all {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: var(--color-brand-default);
}
.pdp-related__all:hover {
  color: var(--color-brand-hover);
}
.pdp-related__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.pdp-related__extra {
  display: none;
}

/* =========================================================
   STICKY BUY BAR  (snippets/sticky-buy-bar.liquid) — mobile only
   ========================================================= */
.pdp-sticky {
  display: none;
}

/* =========================================================
   SMALL DESKTOP (1024–1279): keep the gallery readable
   ========================================================= */
@media (max-width: 1279px) {
  .pdp-product {
    gap: 48px;
  }
  .pdp-info {
    flex-basis: 460px;
  }
  .pdp-timer__text {
    white-space: normal;
  }
}

/* =========================================================
   TABLET (Figma: 768)
   ========================================================= */
@media (max-width: 1023px) {
  .pdp-product {
    flex-direction: column;
    align-items: stretch;
    gap: 40px;
    padding: 40px var(--page-gutter) 72px;
  }
  .pdp-info {
    flex: none;
    width: 100%;
  }
  .pdp-gallery__main {
    aspect-ratio: 672 / 520;
  }
  .pdp-thumb {
    aspect-ratio: 156 / 150;
  }

  .pdp-details {
    flex-direction: column;
    align-items: stretch;
    gap: 56px;
  }

  .pdp-reviews__list {
    gap: 40px;
  }
  .pdp-review {
    flex-direction: column;
    gap: 16px;
  }
  .pdp-review__author,
  .pdp-review__helpful {
    flex: none;
  }
  .pdp-review__body {
    flex: none;
    width: 100%;
  }

  .pdp-related {
    padding: 80px var(--page-gutter) 96px;
  }
  .pdp-related__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 40px;
  }
  .pdp-related__extra {
    display: flex;
  }
  .pdp-related .product-card__media {
    aspect-ratio: 1 / 1;
  }
}

/* =========================================================
   MOBILE (Figma: 390)
   ========================================================= */
@media (max-width: 767px) {
  .pdp-breadcrumb {
    overflow: hidden;
  }
  .pdp-breadcrumb__extra {
    display: none;
  }

  .pdp-product {
    padding: 24px var(--page-gutter) 40px;
    gap: 24px;
  }
  .pdp-gallery__main {
    aspect-ratio: 342 / 360;
  }
  .pdp-gallery__thumbs {
    gap: 8px;
  }
  .pdp-thumb {
    aspect-ratio: 79.5 / 80;
  }

  .pdp-timer {
    padding: 12px 20px;
  }
  .pdp-timer__text {
    max-width: 112px;
    font-size: 12px;
    line-height: 16px;
  }
  .pdp-timer__long {
    display: none;
  }
  .pdp-timer__short {
    display: inline;
  }
  .pdp-timer__num {
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0;
  }

  /* Add-to-cart lives in the sticky bar on mobile */
  .pdp-info .pdp-actions {
    display: none;
  }
  .pdp-trust {
    flex-direction: column;
    gap: 4px;
    padding-top: 0;
  }
  .pdp-trust__item {
    flex: none;
  }

  .pdp-details {
    gap: 40px;
    padding: 40px var(--page-gutter);
  }

  .pdp-reviews {
    padding: 40px var(--page-gutter);
  }
  .pdp-reviews__write {
    display: none;
  }
  .pdp-reviews__write-icon {
    display: flex;
  }
  .pdp-reviews__summary {
    flex-direction: column;
    gap: 20px;
  }
  .pdp-reviews__stat--recommend {
    width: auto;
  }

  .pdp-related {
    gap: 40px;
    padding: 48px var(--page-gutter) 56px;
  }
  .pdp-related__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 28px;
  }
  .pdp-related__extra {
    display: none;
  }
  .pdp-related .product-card__title {
    white-space: nowrap;
    overflow: hidden;
  }

  /* Sticky buy bar (Figma "Product Detail — Mobile · Sticky") */
  .pdp-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px var(--page-gutter) 16px;
    border-top: 1px solid var(--color-border-default);
    background: var(--color-bg-primary);
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.05);
    transform: translateY(0);
    transition: transform 0.25s ease;
  }
  .pdp-sticky.is-hidden {
    transform: translateY(100%);
  }
  body {
    padding-bottom: 84px;
  }
}
