/*
  JustTeia - product.css
  Single product page: mosaic gallery, sticky buy box,
  variant pills, volume pricing table, accordions,
  cross-sell, sticky mobile add-to-cart.
  Loaded only on single product pages.
*/

.pdp { padding: 32px 0 0; }
.pdp > .wrap > .shop-crumb { margin-bottom: 20px; }
.pdp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* ── MOSAIC GALLERY ─────────────────────────────── */
.pdp-mosaic {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.pdp-shot {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #FFE4EF, #EDE0F7);
  aspect-ratio: 1 / 1;
}
/* First shot spans both columns so the hero image reads large */
.pdp-shot.is-wide { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
.pdp-shot img,
.pdp-shot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pdp-shot button.pdp-zoom {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: none;
  padding: 0;
  cursor: zoom-in;
}
.pdp-shot-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 72px;
}

/* Lightbox */
.pdp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(45, 36, 56, 0.9);
  display: grid;
  place-items: center;
  padding: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease);
}
.pdp-lightbox.is-open { opacity: 1; pointer-events: auto; }
.pdp-lightbox img {
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  width: auto;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
.pdp-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 1.125rem;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* ── BUY BOX ────────────────────────────────────── */
.pdp-info {
  position: sticky;
  top: 96px;
  align-self: start;
  padding-bottom: 40px;
}
.pdp-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: var(--text-sm);
  color: var(--text-mid);
  margin-bottom: 18px;
  transition: color 150ms var(--ease);
}
.pdp-back:hover { color: var(--cta); }
/* Without an explicit size the inline SVG claims the full column width and
   pushes the label onto three lines. */
.pdp-back svg { width: 16px; height: 16px; flex-shrink: 0; }
.pdp-back { white-space: nowrap; }
.pdp-title { margin: 0 0 12px; font-size: clamp(var(--text-3xl), 3.6vw, var(--text-5xl)); }

.pdp-rating { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.pdp-stars { color: var(--yellow-deep); font-size: 1.0625rem; letter-spacing: 2px; }
.pdp-rating-count { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: var(--text-sm); color: var(--text-mid); }

.pdp-price {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: var(--text-3xl);
  color: var(--cta);
  margin-bottom: 18px;
}
.pdp-price del { color: var(--text-light); font-weight: 400; font-size: 0.7em; margin-right: 10px; }
.pdp-price ins { text-decoration: none; }
.pdp-price-unit {
  display: block;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-mid);
  margin-top: 4px;
}

/* ── VOLUME PRICING TABLE ───────────────────────── */
.pdp-tiers {
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.pdp-tiers-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--text);
  margin-bottom: 12px;
}
.pdp-tier-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-family: 'Nunito', sans-serif;
  font-size: var(--text-sm);
  color: var(--text-mid);
  font-weight: 700;
}
.pdp-tier-row.is-active { color: var(--cta); }
.pdp-tier-qty { display: inline-flex; align-items: center; gap: 8px; }
.pdp-tier-save { font-weight: 800; }
.pdp-tiers-note { font-size: var(--text-xs); color: var(--text-light); margin-top: 10px; }

/* ── VARIANT PILLS ──────────────────────────────── */
.pdp-option { margin-bottom: 20px; }
.pdp-option-label {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--text);
  margin-bottom: 10px;
}
.pdp-option-label .pdp-option-value { color: var(--text-mid); font-weight: 400; }
.pdp-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pdp-pill {
  min-height: 48px;
  min-width: 64px;
  padding: 12px 22px;
  border-radius: var(--r-md);
  border: 2px solid var(--border-mid);
  background: var(--surface);
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text);
  cursor: pointer;
  transition: all 160ms var(--ease);
}
.pdp-pill:hover { border-color: var(--text-mid); }
.pdp-pill.is-selected { background: var(--text); border-color: var(--text); color: #fff; }
.pdp-pill.is-unavailable {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}
/* Colour swatches */
.pdp-pill.is-swatch {
  min-width: 48px;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  position: relative;
  background: var(--swatch, var(--border-mid));
  font-size: 0;
}
.pdp-pill.is-swatch.is-selected {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--text);
  border-color: transparent;
}
/* The native selects stay in the DOM as the source of truth */
.pdp-native-options { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.pdp-no-js .pdp-native-options { position: static; width: auto; height: auto; clip: auto; }

.pdp-reset-variations {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: var(--text-xs);
  color: var(--cta);
  background: none;
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 0;
}

/* ── ADD TO CART ROW ────────────────────────────── */
.pdp-buy { display: flex; gap: 12px; align-items: stretch; margin-bottom: 14px; }
.pdp-qty {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--border-mid);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
  flex-shrink: 0;
}
.pdp-qty button {
  width: 46px;
  height: 100%;
  min-height: 56px;
  border: none;
  background: none;
  color: var(--text-mid);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}
.pdp-qty button:hover { background: var(--bg-alt); color: var(--cta); }
.pdp-qty button[disabled] { opacity: 0.35; cursor: not-allowed; }
.pdp-qty input {
  width: 48px;
  border: none;
  text-align: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--text);
  background: none;
  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-atc {
  flex: 1;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: var(--text-lg);
  color: #fff;
  background: var(--cta);
  border: none;
  border-radius: var(--r-md);
  padding: 14px 28px;
  cursor: pointer;
  box-shadow: var(--shadow-cta);
  transition: background 180ms var(--ease), transform 180ms var(--spring);
  position: relative;
}
.pdp-atc:hover { background: var(--cta-hover); transform: translateY(-2px); }
.pdp-atc:active { transform: scale(0.98); }
.pdp-atc[disabled] {
  background: var(--border-mid);
  color: var(--text-mid);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.pdp-atc.is-loading { color: transparent; }
.pdp-atc.is-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: jtSpin 700ms linear infinite;
}
@keyframes jtSpin { to { transform: rotate(360deg); } }

/* WooCommerce renders the variable-product form itself. These rules give
   it the same shape as the theme's own simple-product form. */
.pdp-form form.cart { margin: 0; }
.pdp-form form.cart .variations { width: 100%; margin-bottom: 4px; }
.pdp-form form.cart .variations th,
.pdp-form form.cart .variations td { display: block; text-align: left; padding: 0; }
.pdp-form form.cart .variations th label {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--text);
  margin-bottom: 10px;
  display: block;
}
.pdp-form form.cart .variations td { padding-bottom: 20px; }
.pdp-form form.cart .variations select {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 2px solid var(--border-mid);
  border-radius: var(--r-md);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text);
  background: var(--surface);
  outline: none;
}
.pdp-form form.cart .variations select:focus { border-color: var(--cta); }
.pdp-form form.cart .woocommerce-variation-price { margin-bottom: 16px; }
.pdp-form form.cart .woocommerce-variation-price .price {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: var(--text-2xl);
  color: var(--cta);
}
.pdp-form form.cart .woocommerce-variation-add-to-cart,
.pdp-form form.cart.grouped_form + .pdp-buy { display: flex; gap: 12px; align-items: stretch; }
.pdp-form form.cart .single_add_to_cart_button {
  flex: 1;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: var(--text-lg);
  color: #fff;
  background: var(--cta);
  border: none;
  border-radius: var(--r-md);
  padding: 14px 28px;
  cursor: pointer;
  box-shadow: var(--shadow-cta);
  transition: background 180ms var(--ease), transform 180ms var(--spring);
}
.pdp-form form.cart .single_add_to_cart_button:hover { background: var(--cta-hover); transform: translateY(-2px); }
.pdp-form form.cart .single_add_to_cart_button.disabled,
.pdp-form form.cart .single_add_to_cart_button[disabled] {
  background: var(--border-mid);
  color: var(--text-mid);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.pdp-form .stock { display: none; } /* The theme renders its own stock line. */

/* Inline badge row above the title */
.jt-badges.is-inline {
  position: static;
  flex-direction: row;
  gap: 8px;
  margin-bottom: 12px;
}

.pdp-stock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: var(--text-sm);
  margin-bottom: 22px;
}
.pdp-stock.is-low { color: #C2410C; }
.pdp-stock.is-in { color: var(--mint-deep); }
.pdp-stock.is-out { color: var(--text-mid); }

.pdp-short {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--text-mid);
  padding-top: 22px;
  border-top: 1.5px solid var(--border);
  margin-bottom: 8px;
}
.pdp-short p { margin-bottom: 14px; }
.pdp-short p:last-child { margin-bottom: 0; }

/* ── PAIRING NUDGE ──────────────────────────────── */
.pdp-pairing {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #EDFCF8, #D8F7F1);
  border-left: 4px solid var(--mint-deep);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 14px 18px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text);
  margin-bottom: 22px;
}

/* ── ACCORDIONS ─────────────────────────────────── */
.pdp-acc { border-top: 1.5px solid var(--border); margin-top: 10px; }
.pdp-acc details { border-bottom: 1.5px solid var(--border); }
.pdp-acc summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 2px;
  min-height: 56px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--text);
}
.pdp-acc summary::-webkit-details-marker { display: none; }
.pdp-acc summary::after {
  content: '';
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-right: 2.5px solid var(--text-light);
  border-bottom: 2.5px solid var(--text-light);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 220ms var(--ease);
}
.pdp-acc details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.pdp-acc-body { padding: 0 2px 22px; font-size: var(--text-base); line-height: 1.8; color: var(--text-mid); }
.pdp-acc-body ul { margin: 0 0 14px; }
.pdp-acc-body ul li { position: relative; padding-left: 22px; margin-bottom: 8px; }
.pdp-acc-body ul li::before { content: '✦'; position: absolute; left: 0; top: 2px; color: var(--cta); font-size: 0.7em; }
.pdp-acc-body p { margin-bottom: 14px; }
.pdp-acc-body table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.pdp-acc-body th, .pdp-acc-body td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }

/* ── TRUST STRIP ────────────────────────────────── */
.pdp-trust { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 24px; }
.pdp-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: var(--text-xs);
  color: var(--text-mid);
}
.pdp-trust-item .t-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--cta);
}
.pdp-trust-item .t-icon svg { width: 100%; height: 100%; }

/* ── CROSS SELL / RELATED ───────────────────────── */
.pdp-related { padding: 72px 0 96px; background: var(--surface); margin-top: 72px; border-top: 1.5px solid var(--border); }
.pdp-related .sec-head { margin-bottom: 32px; }

/* ── STICKY MOBILE ADD TO CART ──────────────────── */
.jt-atc-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 400;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 248, 251, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1.5px solid var(--border-mid);
  box-shadow: 0 -8px 32px rgba(205, 180, 219, 0.25);
  gap: 12px;
  align-items: center;
}
.jt-atc-bar-text { flex: 1; min-width: 0; }
.jt-atc-bar-title {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jt-atc-bar-price {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--cta);
}
.jt-atc-bar-btn {
  flex-shrink: 0;
  min-height: 48px;
  padding: 12px 26px;
  border: none;
  border-radius: var(--r-pill);
  background: var(--cta);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: var(--shadow-cta);
  cursor: pointer;
}

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 1024px) {
  .pdp-grid { grid-template-columns: 1fr; gap: 32px; }
  .pdp-info { position: static; }
}
@media (max-width: 768px) {
  .pdp { padding: 20px 0 0; }
  .pdp-mosaic { gap: 8px; }
  .pdp-shot.is-wide { aspect-ratio: 1 / 1; }
  .pdp-title { font-size: clamp(1.75rem, 7vw, 2.5rem); }
  .pdp-price { font-size: var(--text-2xl); }
  .pdp-trust { grid-template-columns: 1fr; }
  .pdp-related { padding: 48px 0 64px; margin-top: 48px; }
  /* Only once the real add-to-cart button has scrolled out of view. */
  .jt-atc-bar.is-visible { display: flex; }
  /* Room for the sticky bar */
  .pdp-related { padding-bottom: 120px; }
}

/* ── v5.2: SIZE GUIDE ────────────────────────────── */
.pdp-size-line {
  margin: -6px 0 14px;
  font-family: 'Nunito', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-mid);
}
.pdp-size-line[hidden] { display: none; }
.jt-size-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.jt-size-table th,
.jt-size-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.jt-size-table thead th { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-light); }
.jt-size-table tbody th { color: var(--text); font-weight: 800; }
.jt-size-note { font-size: var(--text-xs); color: var(--text-light); margin-top: 10px; }
