/**
 * Product page conversion pass (child theme). Loaded on product pages only — see pdp-boost.php.
 */

/* ── Price: the number shoppers look for first ── */
.shopify-woo-pdp__info .shopify-woo-pdp__price-wrap .price {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.85rem);
  font-weight: 800;
  color: var(--st-pink);
  line-height: 1.2;
}

/* No reviews yet: five grey stars read as "nobody liked this" — hide the empty row. */
.shopify-woo-pdp__info .shopify-woo-pdp__rating:has(.star-rating[aria-hidden="true"]) {
  display: none;
}

/* ── Offer chips under the price (sale / real free shipping / cash on delivery) ── */
.shopify-woo-pdp__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.25rem 0 1rem;
  padding: 0;
  list-style: none;
}
.shopify-woo-pdp__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--st-radius-pill, 999px);
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--st-navy-soft, rgba(13, 57, 115, 0.08));
  color: var(--st-navy, #0d3973);
}
.shopify-woo-pdp__chip--cod {
  background: var(--st-success-soft, rgba(129, 215, 66, 0.12));
  color: #2f6b12;
}
.shopify-woo-pdp__chip--cod::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #4caf1f;
}
.shopify-woo-pdp__chip--sale {
  background: var(--st-pink, #d92387);
  color: var(--st-on-brand, #fff);
}

/* ── Variations ── */
.shopify-woo-pdp__info .variations th.label label {
  font-size: 1rem;
  font-weight: 800;
  color: var(--st-text, #1a2d42);
}

/* One-colour products: colour is already chosen — show it as one compact line, not a big lone swatch. */
.shopify-woo-pdp__info .variations tr:has(.shopify-woo-variation--color .shopify-woo-swatch-group > .shopify-woo-swatch:only-child) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-block-end: 0.75rem;
}
.shopify-woo-pdp__info .variations tr:has(.shopify-woo-variation--color .shopify-woo-swatch-group > .shopify-woo-swatch:only-child) th.label,
.shopify-woo-pdp__info .variations tr:has(.shopify-woo-variation--color .shopify-woo-swatch-group > .shopify-woo-swatch:only-child) td.value {
  display: block;
  padding: 0;
  margin: 0;
}
.shopify-woo-pdp__info .variations tr:has(.shopify-woo-variation--color .shopify-woo-swatch-group > .shopify-woo-swatch:only-child) th.label label::after {
  content: ":";
}
.shopify-woo-pdp__info .variations tr:has(.shopify-woo-variation--color .shopify-woo-swatch-group > .shopify-woo-swatch:only-child) .shopify-woo-variation {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
/* !important: the parent selected-swatch rules use it (44px, 3 rings). */
.shopify-woo-pdp__info .variations tr:has(.shopify-woo-variation--color .shopify-woo-swatch-group > .shopify-woo-swatch:only-child) .shopify-woo-swatch {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  padding: 0 !important;
  border: 1px solid rgba(0, 0, 0, 0.2) !important;
  box-shadow: none !important;
  pointer-events: none;
  outline: none;
  transform: none !important;
}
.shopify-woo-pdp__info .variations tr:has(.shopify-woo-variation--color .shopify-woo-swatch-group > .shopify-woo-swatch:only-child) .shopify-woo-swatch::before,
.shopify-woo-pdp__info .variations tr:has(.shopify-woo-variation--color .shopify-woo-swatch-group > .shopify-woo-swatch:only-child) .shopify-woo-swatch::after {
  display: none !important;
}
.shopify-woo-pdp__info .variations tr:has(.shopify-woo-variation--color .shopify-woo-swatch-group > .shopify-woo-swatch:only-child) .shopify-woo-variation__selection {
  margin: 0;
  font-weight: 600;
}

/* Light colours (off-white, cream…) need an edge to be visible on white. */
.shopify-woo-pdp__info .shopify-woo-swatch--color {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}

/* "Clear" link: tapping the selected size again already clears it. */
.shopify-woo-pdp__info .reset_variations {
  display: none !important;
}

/* Size guide link right under the sizes */
.shopify-woo-size-guide__trigger-wrap--link {
  margin: 0.25rem 0 0.75rem;
}
.shopify-woo-size-guide__trigger-wrap--link .shopify-woo-size-guide__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--st-navy, #0d3973);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
.shopify-woo-size-guide__trigger-wrap--link .shopify-woo-size-guide__trigger:hover {
  color: var(--st-pink, #d92387);
}

/* Missing size: highlight the row and say so (pdp-boost.js) */
.shopify-woo-pdp__info .variations tr.is-attention td.value {
  animation: shopify-woo-pdp-nudge 0.5s ease 2;
}
.shopify-woo-pdp__info .variations tr.is-attention .shopify-woo-swatch--pill:not(.is-unavailable) {
  border-color: var(--st-pink, #d92387);
  box-shadow: 0 0 0 3px var(--st-pink-soft, rgba(217, 35, 135, 0.1));
}
.shopify-woo-pdp__pick-hint {
  margin: 0.25rem 0 0.75rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--st-radius-xs, 8px);
  background: var(--st-pink-soft, rgba(217, 35, 135, 0.1));
  color: var(--st-pink-dark, #b81d72);
  font-weight: 700;
  font-size: 0.9rem;
}
@keyframes shopify-woo-pdp-nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
@media (prefers-reduced-motion: reduce) {
  .shopify-woo-pdp__info .variations tr.is-attention td.value { animation: none; }
}

/* Buttons waiting for a size: keep them readable (they explain themselves on tap)
   instead of the washed-out 45% look; the tap goes to the wrapper (see pdp-boost.js). */
.shopify-woo-pdp__buy form:has(.single_add_to_cart_button.wc-variation-selection-needed) .single_add_to_cart_button,
.shopify-woo-pdp__buy form:has(.single_add_to_cart_button.wc-variation-selection-needed) .shopify-woo-buy-now {
  opacity: 0.85;
  pointer-events: none;
}
.shopify-woo-pdp__buy form:has(.single_add_to_cart_button.wc-variation-selection-needed) .shopify-woo-pdp__buttons {
  cursor: pointer;
}

/* ── One trust block under the buttons ── */
.shopify-woo-pdp__assure {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 1.25rem 0 0.5rem;
  padding: 0;
  list-style: none;
}
.shopify-woo-pdp__assure-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem;
  border: 1px solid var(--st-border, #dde5ee);
  border-radius: var(--st-radius-sm, 12px);
  background: var(--st-surface, #fff);
  margin: 0;
}
.shopify-woo-pdp__assure-item::before {
  content: none !important;
}
.shopify-woo-pdp__assure-icon {
  flex: 0 0 auto;
  color: var(--st-pink, #d92387);
  margin-block-start: 0.1rem;
}
.shopify-woo-pdp__assure-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.shopify-woo-pdp__assure-text strong {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--st-text, #1a2d42);
  line-height: 1.3;
}
.shopify-woo-pdp__assure-text small {
  font-size: 0.78rem;
  color: var(--st-muted, #5a6d82);
  line-height: 1.35;
}

/* ── Sticky buy bar vs bottom nav (mobile) ──
   The parent places the bar 64px up (--st-bottom-nav) but the nav is ~67px tall, and when
   "hidden" it slides down by its own height — straight onto the nav, above it in z-order,
   so the nav icons were covered. Give the nav one fixed height (its content is ~55px +
   padding + border, which overflowed 64px) and sit the bar exactly on it. Pure CSS: the
   bar is visible before FlyingPress runs the delayed scripts. When hidden, the bar is
   tucked behind the nav and cannot be tapped. */
@media (max-width: 768px) {
  body.shopify-woo-single-product-page {
    --shopify-woo-nav-h: calc(var(--st-bottom-nav, 64px) + 8px + env(safe-area-inset-bottom, 0px));
  }
  body.shopify-woo-single-product-page .shopify-woo-bottom-nav {
    height: var(--shopify-woo-nav-h);
  }
  body.shopify-woo-single-product-page .shopify-woo-sticky-cart {
    inset-block-end: var(--shopify-woo-nav-h);
    z-index: 179;
  }
  body.shopify-woo-single-product-page.shopify-woo-sticky-cart-on {
    padding-block-end: calc(var(--shopify-woo-nav-h) + var(--st-sticky-cart, 4.25rem) + 0.5rem);
  }
  body.shopify-woo-single-product-page .shopify-woo-sticky-cart:not(.is-visible) {
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }
  body.shopify-woo-single-product-page .shopify-woo-sticky-cart.is-visible {
    visibility: visible;
    transition: transform 0.25s ease, visibility 0s;
  }
}

/* ── Mobile ── */
@media (max-width: 900px) {
  /* The cart-recovery chat bubble sat on top of the sticky "Choose options" bar.
     Stack it above the WhatsApp button (which already clears the bar). */
  body.single-product .scr-chat {
    bottom: calc(var(--st-bottom-nav, 64px) + 140px + var(--st-safe-bottom, 0px)) !important;
  }
}
@media (max-width: 380px) {
  .shopify-woo-pdp__assure {
    gap: 0.5rem;
  }
  .shopify-woo-pdp__assure-item {
    padding: 0.6rem;
  }
}
