<?php
/**
 * Vape101 — product detail page enhancements.
 * Scoped to body.single-product so it only affects real WooCommerce product
 * pages (including those rendered through Elementor / woocommerce_content()).
 *
 * @package Vape101
 */

/* ---------- Layout: gallery left, details right ---------- */
body.single-product .hp-entry { padding-top: 0; }
body.single-product .hp-entry .product {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin: 0 0 40px;
}
body.single-product .woocommerce-product-gallery {
  position: sticky;
  /* top must be 0 so the gallery's top edge lines up with the summary column
     on the first paint. A non-zero top offsets it even before sticky kicks in. */
  top: 0;
  align-self: start;
  margin: 0;
  /* WooCommerce ships float + percentage widths; inside our grid they leave
     half the column empty. Force both columns to fill their grid track. */
  float: none !important;
  width: 100% !important;
  max-width: none !important;
}

/* ---------- Breadcrumb (injected by theme.js) ---------- */
.hp-pdp-crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 0 4px;
  font-size: 12px;
  color: var(--hp-muted);
}
.hp-pdp-crumb a { color: var(--hp-muted); }
.hp-pdp-crumb a:hover { color: var(--hp-blue); }
.hp-pdp-crumb .sep { color: #c7ccd1; }
.hp-pdp-crumb .current { color: var(--hp-dark); font-weight: 600; }

/* ---------- Gallery ---------- */
body.single-product .woocommerce-product-gallery__wrapper {
  margin: 0;
}
body.single-product .woocommerce-product-gallery:not(.hp-gallery-swapped) .woocommerce-product-gallery__wrapper {
  background: #fff;
  border: 1px solid var(--hp-line);
  border-radius: 14px;
  padding: 28px;
  overflow: hidden;
}
/* Fallback gallery: only the main image gets the white panel. */
body.single-product .woocommerce-product-gallery.hp-gallery-swapped .woocommerce-product-gallery__wrapper {
  background: #fff;
  border: 1px solid var(--hp-line);
  border-radius: 14px;
  padding: 28px;
  overflow: hidden;
  display: block;
}
/* Every product-image surface is pure white — WooCommerce/Elementor can set
   a grey placeholder background, so force it here for main and thumbnails. */
body.single-product .woocommerce-product-gallery__wrapper {
  background: #fff !important;
}
body.single-product .woocommerce-product-gallery__wrapper img,
body.single-product .hp-gallery-thumbstrip .woocommerce-product-gallery__image img {
  background: #fff !important;
}
body.single-product .woocommerce-product-gallery__wrapper {
  position: relative;
}
/* Sold-out flag and zoom affordance, matching the reference product media. */
.hp-pdp-soldout {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  background: #111318;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 7px 11px;
  border-radius: 4px;
  line-height: 1;
}
.hp-pdp-zoom {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--hp-line);
  border-radius: 50%;
  background: #fff;
  color: var(--hp-dark);
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease;
}
.hp-pdp-zoom svg { width: 18px; height: 18px; }
.hp-pdp-zoom:hover { border-color: #111318; color: #111318; }
.hp-pdp-zoom:focus-visible { outline: 2px solid var(--hp-blue); outline-offset: 2px; }
body.single-product .woocommerce-product-gallery__image,
body.single-product .woocommerce-product-gallery__image > a {
  display: block;
  width: 100%;
}
body.single-product .woocommerce-product-gallery__image img {
  width: 100%;
  height: auto;
  /* --hp-main-max is set by theme.js to align the gallery bottom with the
     summary column; fall back to a generous cap if JS is unavailable. */
  max-height: var(--hp-main-max, 900px);
  object-fit: contain;
  margin: 0 auto;
}
body.single-product .woocommerce-product-gallery .flex-control-thumbs,
body.single-product .woocommerce-product-gallery .flex-control-nav {
  display: flex !important;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0 !important;
  padding: 0;
  list-style: none;
}
body.single-product .woocommerce-product-gallery .flex-control-thumbs li,
body.single-product .woocommerce-product-gallery .flex-control-nav li {
  width: 76px !important;
  height: 76px;
  margin: 0;
  flex: 0 0 76px;
}
body.single-product .woocommerce-product-gallery .flex-control-thumbs img,
body.single-product .woocommerce-product-gallery .flex-control-nav img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--hp-line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease;
}
body.single-product .woocommerce-product-gallery .flex-control-thumbs img:hover,
body.single-product .woocommerce-product-gallery .flex-control-nav img:hover { border-color: #adb5bd; }
body.single-product .woocommerce-product-gallery .flex-control-thumbs img.flex-active,
body.single-product .woocommerce-product-gallery .flex-control-nav img.flex-active {
  border-color: var(--hp-dark);
  box-shadow: 0 0 0 1px var(--hp-dark);
}

/* ---------- Fallback gallery when WooCommerce flexslider is unavailable ----------
   Some builds (Elementor / optimisers) strip the gallery script, leaving the
   images stacked. theme.js detects this, moves all but the first into a
   .hp-gallery-thumbstrip and swaps the main image on click. These rules style
   that structure; the main image stays full-width, every strip item a thumb. */
body.single-product .woocommerce-product-gallery.hp-gallery-swapped .woocommerce-product-gallery__wrapper {
  display: block !important;
}
/* The single figure left in the wrapper is the main image. */
body.single-product .woocommerce-product-gallery.hp-gallery-swapped .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image {
  display: block;
  width: 100%;
  margin: 0;
}
body.single-product .woocommerce-product-gallery.hp-gallery-swapped .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image img {
  width: 100%;
  height: auto;
  max-height: var(--hp-main-max, 900px);
  object-fit: contain;
}
/* Thumbnail strip injected by theme.js. Give it clear breathing room above
   the tabs so the two never look merged together. */
body.single-product .hp-gallery-thumbstrip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 4px;
  padding: 18px 0 0;
  border-top: 1px solid var(--hp-line);
}
/* WooCommerce gives these figures/a/img a percentage width and a width="100"
   attribute; without !important they render ~160px and break the row. Pin
   every layer of the thumbnail to a fixed 76px square. */
body.single-product .hp-gallery-thumbstrip .woocommerce-product-gallery__image,
body.single-product .hp-gallery-thumbstrip .woocommerce-product-gallery__image > a {
  display: block !important;
  width: 76px !important;
  height: 76px !important;
  max-width: 76px !important;
  flex: 0 0 76px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  cursor: pointer;
}
body.single-product .hp-gallery-thumbstrip .woocommerce-product-gallery__image img {
  width: 76px !important;
  height: 76px !important;
  max-width: 76px !important;
  object-fit: contain;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--hp-line);
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color .18s ease, box-shadow .18s ease;
}
body.single-product .hp-gallery-thumbstrip .woocommerce-product-gallery__image:hover img { border-color: #adb5bd; }
body.single-product .hp-gallery-thumbstrip .woocommerce-product-gallery__image.is-active img {
  border-color: var(--hp-dark);
  box-shadow: 0 0 0 1px var(--hp-dark);
}

/* ---------- Product summary ---------- */
body.single-product .summary.entry-summary {
  padding: 6px 0 0;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
}
body.single-product .product_title.entry-title,
body.single-product .summary.entry-summary h1 {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--hp-dark);
  margin: 0 0 12px;
}
body.single-product .woocommerce-product-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 13px;
}
body.single-product .woocommerce-product-rating .star-rating { color: #f5a623; }
body.single-product .woocommerce-product-rating .woocommerce-review-link { color: var(--hp-muted); }
body.single-product .summary.entry-summary .price,
body.single-product .summary.entry-summary p.price {
  display: block;
  font-size: 27px;
  font-weight: 700;
  color: var(--hp-dark);
  margin: 0 0 20px;
  line-height: 1.2;
}
body.single-product .summary.entry-summary .price del { color: var(--hp-muted); font-size: 17px; font-weight: 400; margin-right: 10px; }
body.single-product .summary.entry-summary .price ins { text-decoration: none; }
body.single-product .summary.entry-summary .onsale { background: #c8451a; }

/* Stock availability badge (works in default / Elementor product template) */
body.single-product .summary.entry-summary .hp-stock,
body.single-product .hp-product-info .hp-stock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 7px 13px;
  border: 1px solid var(--hp-line);
  border-radius: 999px;
  background: var(--hp-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--hp-gray);
}
body.single-product .summary .hp-stock__dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
body.single-product .summary .hp-stock--in { color: var(--hp-success); background: #eaf6f0; border-color: #cde9dc; }
body.single-product .summary .hp-stock--low { color: var(--hp-warning); background: #fdf5e6; border-color: #f0dfb8; }
body.single-product .summary .hp-stock--out { color: var(--hp-danger); background: #fdecea; border-color: #f4d2cd; }
body.single-product .summary .hp-stock--select { color: var(--hp-muted); background: var(--hp-soft); border-color: var(--hp-line); }

/* Short description */
body.single-product .summary.entry-summary .woocommerce-product-details__short-description,
body.single-product .summary.entry-summary > p:not(.price) {
  color: var(--hp-gray);
  font-size: 14px;
  line-height: 1.75;
  margin: 0 0 22px;
}

/* ---------- Variations ---------- */
body.single-product .summary form.cart { display: block; margin: 0 0 22px; }
body.single-product .summary table.variations { width: 100%; margin: 0 0 18px; }
body.single-product .summary table.variations tr { display: block; margin-bottom: 14px; }
body.single-product .summary table.variations td,
body.single-product .summary table.variations th {
  display: block;
  border: 0;
  padding: 0;
  text-align: left;
}
body.single-product .summary table.variations label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--hp-dark);
  margin: 0 0 8px;
}
body.single-product .summary table.variations select {
  width: 100%;
  max-width: 340px;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #d9dee3;
  border-radius: 8px;
  background: #fff;
  color: var(--hp-dark);
  font-size: 14px;
  cursor: pointer;
}
body.single-product .summary table.variations select:focus { outline: 2px solid var(--hp-blue); outline-offset: 1px; }
body.single-product .summary .reset_variations { font-size: 12px; color: var(--hp-muted); margin-left: 12px; }
body.single-product .summary .woocommerce-variation-price { margin: 0 0 18px; font-size: 22px; font-weight: 700; color: var(--hp-dark); }

/* ---------- Add to cart row ---------- */
body.single-product .summary .woocommerce-variation-add-to-cart,
body.single-product .summary form.cart:not(.variations_form) {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}
body.single-product .summary .quantity {
  display: inline-flex;
  align-items: center;
  height: 54px;
  border: 1px solid #d9dee3;
  border-radius: 8px;
  overflow: hidden;
  flex: 0 0 auto;
}
body.single-product .summary .quantity input.qty,
body.single-product .summary .quantity input[type="number"] {
  width: 58px;
  height: 100%;
  border: 0;
  padding: 0 4px 0 12px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--hp-dark);
  background: #fff;
  -moz-appearance: textfield;
  appearance: textfield;
}
body.single-product .summary .quantity input::-webkit-outer-spin-button,
body.single-product .summary .quantity input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
body.single-product .summary .quantity input:focus { outline: none; }

/* Quantity stepper buttons (injected by theme.js) */
.hp-qty-minus, .hp-qty-plus {
  width: 36px;
  height: 100%;
  border: 0;
  background: #f7f8fa;
  color: var(--hp-dark);
  font-size: 19px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background .15s ease;
}
.hp-qty-minus:hover, .hp-qty-plus:hover { background: #eceff2; }
.hp-qty-minus:focus-visible, .hp-qty-plus:focus-visible { outline: 2px solid var(--hp-blue); outline-offset: -2px; }

body.single-product .summary button.single_add_to_cart_button,
body.single-product .summary button.button.alt {
  flex: 1 1 220px;
  min-height: 54px;
  height: 54px;
  padding: 0 32px;
  border: 1px solid #111318 !important;
  border-radius: 8px !important;
  background: #111318 !important;
  color: #fff !important;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .18s ease, transform .1s ease;
}
body.single-product .summary button.single_add_to_cart_button:hover,
body.single-product .summary button.button.alt:hover { background: #000 !important; border-color: #000 !important; color: #fff !important; }
body.single-product .summary button.single_add_to_cart_button:active { transform: translateY(1px); }
body.single-product .summary button.single_add_to_cart_button:focus-visible { outline: 2px solid var(--hp-blue); outline-offset: 2px; }
body.single-product .summary button.single_add_to_cart_button.disabled,
body.single-product .summary button.single_add_to_cart_button:disabled {
  background: #111318 !important;
  border-color: #111318 !important;
  color: #fff !important;
  opacity: .65;
  cursor: not-allowed;
}
body.single-product .summary .compare.button,
body.single-product .summary .woosc-btn {
  min-height: 54px;
  border: 1px solid #d9dee3 !important;
  border-radius: 8px;
  background: #fff !important;
  color: var(--hp-dark) !important;
  font-weight: 600;
  padding: 0 18px;
}
/* Wishlist action injected by theme.js when no wishlist plugin is active. */
body.single-product .summary .hp-pdp-wishlist {
  flex: 0 0 auto;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid #d9dee3;
  border-radius: 8px;
  background: #fff;
  color: var(--hp-dark);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease;
}
body.single-product .summary .hp-pdp-wishlist svg { width: 18px; height: 18px; }
body.single-product .summary .hp-pdp-wishlist:hover { border-color: #111318; }
body.single-product .summary .hp-pdp-wishlist.is-active { border-color: #111318; color: #111318; }
body.single-product .summary .hp-pdp-wishlist.is-active svg { fill: #111318; }
body.single-product .summary .hp-pdp-wishlist:focus-visible { outline: 2px solid var(--hp-blue); outline-offset: 2px; }

/* ---------- Product attributes + trust, anchored bottom-right ----------
   theme.js wraps SKU / Category / Brand (normalised into spec rows) together
   with the trust hints into one .hp-pdp-attributes block appended at the very
   end of the summary column, i.e. the bottom-right of the purchase area. */
.hp-pdp-attributes {
  border: 1px solid var(--hp-line);
  border-radius: 12px;
  background: #fff;
  padding: 20px 22px;
  margin-top: 24px;
}
/* The attribute card sits directly after the description tabs, occupying the
   same full-width slot the FAQ used to. It is a sibling of the FAQ section,
   matching the FAQ card's width and horizontal alignment. */
body.single-product .woocommerce-tabs + .hp-pdp-attributes,
body.single-product .hp-pdp-attributes {
  width: 100%;
}

/* Spec rows: label left, value right, soft dashed divider — matches the
   "Specifications" table look in the reference screenshots. */
.hp-pdp-attributes .hp-pdp-attr-list { display: block; }
.hp-pdp-attributes .hp-pdp-attr-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--hp-line);
  font-size: 13px;
  line-height: 1.5;
}
.hp-pdp-attributes .hp-pdp-attr-row:first-child { padding-top: 0; }
.hp-pdp-attributes .hp-pdp-attr-label { flex: 0 0 auto; color: var(--hp-muted); font-weight: 500; }
.hp-pdp-attributes .hp-pdp-attr-value { flex: 1 1 auto; text-align: right; color: var(--hp-dark); font-weight: 600; word-break: break-word; }
.hp-pdp-attributes .hp-pdp-attr-value a { color: var(--hp-dark); font-weight: 600; }
.hp-pdp-attributes .hp-pdp-attr-value a:hover { color: var(--hp-blue); }
/* Fallback for any raw WooCommerce meta markup that JS could not normalise. */
body.single-product .product_meta {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--hp-line);
  padding-top: 18px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--hp-muted);
}
body.single-product .product_meta span { display: block; }
body.single-product .product_meta a { color: var(--hp-dark); font-weight: 600; }
body.single-product .product_meta a:hover { color: var(--hp-blue); }
/* When inside our attribute block, drop the standalone border/padding so it
   reads as one unified card. */
.hp-pdp-attributes .product_meta { border-top: 0; padding-top: 0; margin-top: 0; }

/* ---------- Trust / delivery hints (injected by theme.js) ---------- */
.hp-pdp-trust {
  margin-top: 24px;
  background: var(--hp-soft);
  border: 1px solid var(--hp-line);
  border-radius: 12px;
  padding: 16px 20px;
  display: grid;
  gap: 10px;
}
.hp-pdp-trust div {
  position: relative;
  padding-left: 22px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--hp-gray);
}
.hp-pdp-trust div::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1b8f5a;
  box-shadow: inset 0 0 0 3px #fff, 0 0 0 1px #1b8f5a;
}
/* Inside the bottom attribute card, the trust block sits directly under the
   spec rows without its own heavy border. */
.hp-pdp-attributes .hp-pdp-trust {
  margin-top: 18px;
  border: 0;
  padding: 0;
  background: transparent;
}

/* ---------- Tabs ---------- */
body.single-product .woocommerce-tabs.wc-tabs-wrapper {
  clear: both;
  margin: 32px 0 44px;
  padding-top: 8px;
  border-top: 1px solid var(--hp-line);
}
/* Segmented card tabs: a soft track holding individual pill cards. High
   specificity (matching WooCommerce's own selectors) plus !important on the
   colours is required — WooCommerce 10.x sets `li.active a { color: inherit }`
   which otherwise leaves dark text on the dark active card. */
body.single-product .woocommerce-tabs .tabs.wc-tabs {
  display: inline-flex;
  gap: 6px;
  max-width: 100%;
  border: 0;
  padding: 5px !important;
  margin: 0 0 24px;
  background: #f1f3f5;
  border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
body.single-product .woocommerce-tabs .tabs.wc-tabs::-webkit-scrollbar { display: none; }
body.single-product div.product .woocommerce-tabs ul.tabs.wc-tabs li {
  border: 0 !important;
  background: transparent !important;
  margin: 0;
  padding: 0;
  border-radius: 0;
  flex: 0 0 auto;
}
/* Remove WooCommerce's default vertical dividers between tab items. */
body.single-product .woocommerce-tabs .tabs.wc-tabs li::before,
body.single-product .woocommerce-tabs .tabs.wc-tabs li::after {
  content: none !important;
  display: none !important;
}
body.single-product div.product .woocommerce-tabs ul.tabs.wc-tabs li a {
  display: block;
  padding: 11px 22px !important;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #6b7280 !important;
  background: transparent !important;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
/* Active card — dark pill with clearly readable white text and a soft lift. */
body.single-product div.product .woocommerce-tabs ul.tabs.wc-tabs li.active a {
  background: var(--hp-dark) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(33, 37, 41, .22);
}
/* Hovering an inactive card gives a subtle white raised surface. */
body.single-product div.product .woocommerce-tabs ul.tabs.wc-tabs li:not(.active) a:hover {
  background: #fff !important;
  color: var(--hp-dark) !important;
  box-shadow: 0 1px 4px rgba(33, 37, 41, .1);
}
body.single-product .woocommerce-tabs .tabs.wc-tabs li a:focus-visible {
  outline: 2px solid var(--hp-blue);
  outline-offset: 2px;
}
body.single-product .woocommerce-tabs .panel,
body.single-product .woocommerce-tabs .woocommerce-Tabs-panel {
  border: 1px solid var(--hp-line);
  border-radius: 12px;
  padding: 28px 30px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(33, 37, 41, .04);
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
}
body.single-product .woocommerce-tabs .panel h2 { font-size: 19px; margin: 0 0 14px; }
body.single-product .woocommerce-tabs table.shop_attributes { width: 100%; border-collapse: collapse; }
body.single-product .woocommerce-tabs table.shop_attributes th,
body.single-product .woocommerce-tabs table.shop_attributes td { padding: 9px 12px; border-bottom: 1px solid var(--hp-line); text-align: left; }
body.single-product .woocommerce-tabs table.shop_attributes th { font-weight: 600; color: var(--hp-dark); width: 30%; }
body.single-product .woocommerce-tabs .star-rating { color: #f5a623; float: none; }

/* ---------- FAQ (theme fallback) ---------- */
body.single-product .hp-pdp-faq {
  /* Shift down so the attribute spec card can occupy the slot above it. */
  margin: 24px 0 44px;
  padding: 28px 30px;
  background: #fff;
  border: 1px solid var(--hp-line);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(33, 37, 41, .04);
}
body.single-product .hp-pdp-faq h2 {
  font-size: 19px;
  margin: 0 0 10px;
  color: var(--hp-dark);
}
body.single-product .hp-pdp-faq details { border-top: 1px solid var(--hp-line); }
body.single-product .hp-pdp-faq details:first-of-type { border-top: 0; }
body.single-product .hp-pdp-faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--hp-dark);
}
body.single-product .hp-pdp-faq summary::-webkit-details-marker { display: none; }
body.single-product .hp-pdp-faq summary::after {
  content: '+';
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 400;
  color: var(--hp-muted);
}
body.single-product .hp-pdp-faq details[open] summary::after { content: '\2212'; }
body.single-product .hp-pdp-faq details p {
  margin: 0 0 16px;
  color: var(--hp-gray);
  font-size: 14px;
  line-height: 1.75;
}
body.single-product .hp-pdp-faq details a { color: var(--hp-blue); }

/* ---------- Related products ---------- */
body.single-product .related.products { margin: 10px 0 50px; }
body.single-product .related.products > h2,
body.single-product .related.products > .woocommerce-loop-heading {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 22px;
}
body.single-product .related.products ul.products {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
body.single-product .related.products ul.products li.product {
  width: auto !important;
  margin: 0;
  float: none;
  text-align: left;
  border: 1px solid var(--hp-line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow .2s ease, transform .2s ease;
}
body.single-product .related.products ul.products li.product:hover { box-shadow: 0 10px 28px rgba(0,0,0,.08); transform: translateY(-2px); }
body.single-product .related.products ul.products li.product img { width: 100%; height: 200px; object-fit: contain; background: #fff; }
body.single-product .related.products ul.products li.product .woocommerce-loop-product__title { font-size: 14px; font-weight: 600; padding: 14px 16px 0; margin: 0; min-height: 42px; }
body.single-product .related.products ul.products li.product .price { display: block; padding: 6px 16px 0; font-weight: 700; color: var(--hp-dark); }
body.single-product .related.products ul.products li.product .button { margin: 12px 16px 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  body.single-product .hp-entry .product { gap: 30px; }
  body.single-product .product_title.entry-title,
  body.single-product .summary.entry-summary h1 { font-size: 27px; }
  body.single-product .related.products ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  body.single-product .hp-entry .product { grid-template-columns: 1fr; gap: 22px; }
  body.single-product .woocommerce-product-gallery { position: static; }
  body.single-product .woocommerce-product-gallery__wrapper { padding: 16px; }
  body.single-product .woocommerce-product-gallery__image img { max-height: 700px; }
  body.single-product .related.products ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .hp-pdp-crumb { padding: 14px 0 2px; font-size: 11px; }
  body.single-product .product_title.entry-title,
  body.single-product .summary.entry-summary h1 { font-size: 23px; }
  body.single-product .summary.entry-summary .price,
  body.single-product .summary.entry-summary p.price { font-size: 23px; }
  body.single-product .summary table.variations select { max-width: none; }
  body.single-product .summary .hp-pdp-wishlist { flex: 1 1 100%; }
  body.single-product .hp-pdp-faq { padding: 20px 16px; }
  body.single-product .related.products ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  body.single-product .woocommerce-tabs .panel,
  body.single-product .woocommerce-tabs .woocommerce-Tabs-panel { padding: 18px 16px; }
}

/* Respect reduced motion. */
@media (prefers-reduced-motion: reduce) {
  body.single-product .related.products ul.products li.product { transition: none; }
}

/* ---------- Flavour swatches (injected by theme.js) ----------
   Clickable text pills replace the bare flavour <select>. The native
   WooCommerce row is visually hidden but kept for all variation logic. */
body.single-product .summary table.variations tr.hp-flavour-native {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
body.single-product .summary .hp-flavour-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 22px;
}
body.single-product .summary .hp-flavour {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 10px 20px;
  border: 1px solid var(--hp-line-strong, #d5dce2);
  border-radius: 999px;
  background: #fff;
  color: var(--hp-dark);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, color .16s ease;
}
body.single-product .summary .hp-flavour:hover:not(.is-oos) {
  border-color: var(--hp-dark);
}
body.single-product .summary .hp-flavour.is-selected {
  border-color: var(--hp-dark);
  box-shadow: 0 0 0 1px var(--hp-dark) inset;
}
body.single-product .summary .hp-flavour__name {
  display: block;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 500;
  text-align: center;
  color: var(--hp-dark, #212529);
  white-space: nowrap;
}
/* Sold-out flavour: pale outline + light grey label, no strike-through.
   Colours sampled from the reference screenshot (#f0f0f0 border, #b8b8bb text). */
body.single-product .summary .hp-flavour.is-oos {
  cursor: not-allowed;
  border-color: #f0f0f0;
  background: #fff;
  opacity: 1;
}
body.single-product .summary .hp-flavour.is-oos .hp-flavour__name {
  color: #b8b8bb;
  text-decoration: none;
}
body.single-product .summary .hp-flavour:focus-visible { outline: 2px solid var(--hp-blue); outline-offset: 2px; }
@media (max-width: 600px) {
  body.single-product .summary .hp-flavour-swatches { gap: 8px; }
  body.single-product .summary .hp-flavour { padding: 9px 16px; }
  body.single-product .summary .hp-flavour__name { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  body.single-product .summary .hp-flavour { transition: none; }
}
