/* ==========================================================================
   Single product.
   Loaded only on is_product(). Depends on product-card.css (related products).
   ========================================================================== */

.single-product div.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  /* Gallery and summary side by side, specs full width beneath them
     (inc/woocommerce.php, "specs out of the summary"). Under the gallery
     alone, a 703px spec list just moved Kube's void to the right column. */
  grid-template-areas:
    "gallery summary"
    "specs   specs";
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.single-product div.product > div.images { grid-area: gallery; }
.single-product div.product > .summary { grid-area: summary; }
.single-product div.product > .wop-product-specs { grid-area: specs; }

/* ---- Gallery ------------------------------------------------------------

   NO STICKY. It was tried and removed, deliberately — do not add it back.

   `position: sticky` on the gallery produced two separate bugs:

   1. WooCommerce core ships
      `.woocommerce div.product div.images.woocommerce-product-gallery
       { position: relative }` at (0,4,1). A plainer selector loses `position`
      but STILL applies `top`, and a `relative` element with a top offset is
      pushed down over the title that follows it on mobile — which reads as
      "the product title is missing", not as a layout bug.

   2. Even at matching specificity, the sticky gallery would not stay inside its
      grid row. Measured on the hamper product: at 3000px of scroll it overlapped
      the description tabs by 1602px, sliding over the body copy. Pinning
      `grid-row: 1 / 2` on every child improved it but did not fix it — the
      gallery still escaped past ~3400px.

   The gallery is ~433px tall next to a ~1300px summary, so sticky bought very
   little. A static gallery is correct at every width and cannot overlap
   anything.
   -------------------------------------------------------------------------- */

.single-product div.product div.images.woocommerce-product-gallery {
  width: 100% !important;   /* core hands out a float width */
  float: none !important;
  margin: 0;
}

.single-product .woocommerce-product-gallery__wrapper { margin: 0; }

.single-product .woocommerce-product-gallery__image img {
  width: 100%;
  border-radius: var(--wop-radius-lg);
  filter: var(--wop-img-filter);
}

/* Thumbnail strip.

   WooCommerce core sets `.flex-control-thumbs li { width: 25% }` from a
   selector that out-specifies a plain `.single-product .flex-control-thumbs li`.
   In a CSS grid that 25% resolves against the GRID TRACK, not the row — so a
   100px track produced 25px thumbnails. Hence the doubled class on the <ol> and
   the explicit width override: both are needed to beat core. */
.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  width: 100%;
  float: none;
}
.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li {
  width: 100% !important;   /* core's 25% resolves against the grid track */
  float: none;
  margin: 0;
  list-style: none;
}
.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 2px solid transparent;
  border-radius: var(--wop-radius-sm);
  opacity: .65;
  cursor: pointer;
  transition: opacity var(--wop-dur) var(--wop-ease),
              border-color var(--wop-dur) var(--wop-ease);
}
.single-product .woocommerce-product-gallery .flex-control-thumbs img:hover,
.single-product .woocommerce-product-gallery .flex-control-thumbs img.flex-active {
  opacity: 1;
  border-color: var(--wop-brand);
}

/* Fewer than five thumbs: keep them at a sane size instead of stretching. */
.single-product .woocommerce-product-gallery .flex-control-thumbs { justify-content: start; }
.single-product .woocommerce-product-gallery .flex-control-thumbs li { max-width: 120px; }

.single-product .woocommerce-product-gallery__trigger {
  top: 16px;
  right: 16px;
  z-index: 3;
}

/* ---- Summary ------------------------------------------------------------ */

.single-product div.product .summary {
  width: 100% !important;
  float: none !important;
  margin: 0;
}

.single-product div.product .product_title {
  margin: 0 0 10px;
  font-size: var(--wop-text-4xl);
  line-height: var(--wop-lh-tight);
  letter-spacing: var(--wop-ls-display);
}

.single-product div.product .summary > .price {
  display: block;
  margin: 0 0 18px;
  color: var(--wop-heading);
  font-size: var(--wop-text-2xl);
  font-weight: 700;
}
.single-product div.product .summary > .price del {
  margin-right: 8px;
  color: var(--wop-text-muted);
  font-size: var(--wop-text-lg);
  font-weight: 400;
}
.single-product div.product .summary > .price ins { text-decoration: none; background: transparent; }

.single-product .woocommerce-product-details__short-description {
  margin-bottom: 22px;
  color: var(--wop-text);
  font-size: var(--wop-text-base);
  line-height: var(--wop-lh-relaxed);
}
.single-product .woocommerce-product-details__short-description ul {
  margin: 0;
  padding-left: 1.1em;
}
.single-product .woocommerce-product-details__short-description li { margin-bottom: 6px; }
.single-product .wop-product-specs .woocommerce-product-details__short-description { margin-bottom: 0; }
/* Full width on desktop: two columns keep the line length readable. */
@media (min-width: 861px) {
  .single-product .wop-product-specs .woocommerce-product-details__short-description {
    columns: 2 320px;
    column-gap: clamp(28px, 4vw, 64px);
  }
  .single-product .wop-product-specs p,
  .single-product .wop-product-specs li { break-inside: avoid; }
}

/* ---- Variation preview (single-column layouts only) --------------------- */
.wop-variation-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  padding: 8px;
  border: 1px solid var(--wop-border);
  border-radius: var(--wop-radius);
  background: var(--wop-card-bg);
}
.wop-variation-preview[hidden] { display: none; }
.wop-variation-preview__img {
  flex: none;
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: calc(var(--wop-radius) - 2px);
  background: #fff;
}
.wop-variation-preview__label { font-size: .9rem; font-weight: 600; color: var(--wop-text); }
@media (min-width: 861px) {
  .wop-variation-preview { display: none !important; }   /* gallery is beside the form here */
}

/* ---- Add to cart -------------------------------------------------------- */

.single-product form.cart {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  margin: 0 0 22px;
}

.single-product form.cart.variations_form { display: block; }

.single-product .quantity { display: inline-flex; }
.single-product .quantity input.qty {
  width: 86px;
  min-height: var(--wop-tap-min);
  padding: 10px 12px;
  border: 1px solid var(--wop-border);
  border-radius: var(--wop-btn-radius);
  background: var(--wop-card-bg);
  color: var(--wop-text);
  font-family: inherit;
  font-size: var(--wop-text-base);
  text-align: center;
}

/* Add to basket.
   WooCommerce ships `.woocommerce button.button.alt { background-color: #7f54b3 }`
   and this button carries `alt`. That selector and the theme's old one were BOTH
   0,3,1, and woocommerce.css is enqueued after the theme — so the tie broke
   Woo's way and the button rendered in WooCommerce purple on a navy site, while
   the theme's padding and radius still applied. Hence a button that looked
   half-styled rather than unstyled.

   Fixed by naming `.alt` here too, which wins the tie outright, and matching
   live: #09274B, white, 3px, uppercase. */
.single-product form.cart button.single_add_to_cart_button,
.single-product form.cart button.single_add_to_cart_button.alt {
  flex: 1 1 200px;
  min-height: var(--wop-tap-min);
  padding: 14px 28px;
  border: 1px solid transparent;
  border-radius: var(--wop-btn-radius);
  background: var(--wop-btn-bg);
  color: var(--wop-text-invert);
  font-family: inherit;
  font-size: var(--wop-text-base);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--wop-ls-caps);
  cursor: pointer;
  transition: background var(--wop-dur) var(--wop-ease);
}
.single-product form.cart button.single_add_to_cart_button:hover,
.single-product form.cart button.single_add_to_cart_button.alt:hover {
  background: var(--wop-brand);
  color: var(--wop-text-invert);
}

/* ---- Variations (product 240 has a local `scents` attribute, 10 options) -- */

.single-product table.variations {
  width: 100%;
  margin: 0 0 16px;
  border: 0;
  border-collapse: collapse;
}
.single-product table.variations th,
.single-product table.variations td {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  text-align: left;
}
.single-product table.variations th.label {
  margin-bottom: 6px;
  color: var(--wop-heading);
  font-size: var(--wop-text-sm);
  font-weight: 600;
}
.single-product table.variations td.value { margin-bottom: 14px; }

.single-product table.variations select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: var(--wop-input-h);
  padding: 12px 42px 12px 16px;
  border: 1px solid var(--wop-border);
  border-radius: var(--wop-radius);
  background-color: var(--wop-card-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%2312111f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  color: var(--wop-text);
  font-family: inherit;
  font-size: var(--wop-text-base);
  cursor: pointer;
}

.single-product .reset_variations {
  display: inline-block;
  margin-top: 8px;
  color: var(--wop-text-muted);
  font-size: var(--wop-text-sm);
}

.single-product .woocommerce-variation-price { margin-bottom: 14px; }
.single-product .woocommerce-variation-price .price {
  color: var(--wop-heading);
  font-size: var(--wop-text-xl);
  font-weight: 700;
}

/* ---- Meta --------------------------------------------------------------- */

.single-product .product_meta {
  padding-top: 18px;
  border-top: 1px solid var(--wop-divider);
  color: var(--wop-text-muted);
  font-size: var(--wop-text-sm);
  line-height: 1.9;
}
.single-product .product_meta > span { display: block; }
.single-product .product_meta a { color: var(--wop-text); text-decoration: none; }
.single-product .product_meta a:hover { color: var(--wop-heading); text-decoration: underline; }

/* ---- Tabs ---------------------------------------------------------------

   Every selector here is prefixed `.woocommerce div.product` to MATCH
   WooCommerce's own specificity. Its tab rules are
   `.woocommerce div.product .woocommerce-tabs ul.tabs` — more specific than a
   plain `.single-product .woocommerce-tabs ul.tabs`, and woocommerce.css is
   enqueued after the theme. The previous rules lost outright, which is why the
   bar rendered with Woo's stray 17px left indent, its 8.5px vertical padding
   and no active state: the theme's tab styling was never actually applied.

   Styled after live: square, uppercase, the active tab filled navy. */

.woocommerce div.product .woocommerce-tabs,
.single-product .woocommerce-tabs {
  grid-column: 1 / -1;
  margin-top: clamp(40px, 5vw, 72px);
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 24px;
  padding: 0;                       /* Woo ships padding-left: 1em */
  border-bottom: 2px solid var(--wop-border);
  list-style: none;
}
.woocommerce div.product .woocommerce-tabs ul.tabs::before,
.woocommerce div.product .woocommerce-tabs ul.tabs::after { display: none; }

.woocommerce div.product .woocommerce-tabs ul.tabs li {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after { display: none; }

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  display: block;
  padding: 11px 20px;
  color: var(--wop-brand);
  font-size: var(--wop-text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--wop-ls-caps);
  text-decoration: none;
  background: var(--wop-bg-alt);
  transition: background var(--wop-dur) var(--wop-ease), color var(--wop-dur) var(--wop-ease);
}
.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
  background: var(--wop-border);
  color: var(--wop-brand);
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
  background: var(--wop-btn-bg);
  color: var(--wop-text-invert);
}

.single-product .woocommerce-Tabs-panel { max-width: var(--wop-measure); }
.single-product .woocommerce-Tabs-panel h2 { font-size: var(--wop-text-xl); }

/* ---- Related products --------------------------------------------------- */

.single-product .related.products,
.single-product .up-sells {
  grid-column: 1 / -1;
  margin-top: clamp(40px, 5vw, 72px);
}
.single-product .related.products > h2,
.single-product .up-sells > h2 {
  margin-bottom: var(--wop-stack);
  font-size: var(--wop-text-2xl);
}
/* Four across, matching the shop grid, so the cards are the same object the
   customer has already seen. At three they were 363px wide and 616px tall —
   a column of near-full-height tiles that dominated the page. */
.single-product .related.products ul.products,
.single-product .up-sells ul.products { --wop-cols: 4; }

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 860px) {
  .single-product div.product {
    grid-template-columns: minmax(0, 1fr);
    /* One column: title, price and options first, then the specs. */
    grid-template-areas: "gallery" "summary" "specs";
    gap: var(--wop-stack);
  }
  .single-product .related.products ul.products { --wop-cols: 2; }
}

@media (max-width: 420px) {
  .single-product .related.products ul.products { --wop-cols: 1; }
  .single-product form.cart button.single_add_to_cart_button { flex-basis: 100%; }
}

/* --------------------------------------------------------------------------
   Quote route. The site's real conversion path, so it sits directly under the
   add-to-cart rather than below the fold.
   -------------------------------------------------------------------------- */

.wop-product-quote {
  margin: 24px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--wop-border);
  border-radius: var(--wop-radius);
  background: var(--wop-bg);
}
.wop-product-quote__lead { margin: 0 0 12px; font-weight: 600; color: var(--wop-text); }
.wop-product-quote__lead .wop-tel { color: var(--wop-brand); white-space: nowrap; }

/* Quantity price table (inc/quantity-tiers.php), under the price note. */
.wop-qty-tiers {
  width: 100%;
  max-width: 360px;
  margin: 0 0 20px;
  border-collapse: collapse;
  font-size: .92rem;
}
.wop-qty-tiers caption {
  text-align: left;
  font-weight: 600;
  padding-bottom: 6px;
  color: var(--wop-text);
}
.wop-qty-tiers th,
.wop-qty-tiers td {
  padding: 7px 10px;
  border: 1px solid var(--wop-border);
  text-align: left;
}
.wop-qty-tiers thead th { background: var(--wop-bg); font-weight: 600; }
.wop-qty-tiers__hint { font-size: .85rem; color: var(--wop-text-muted); }

/* Delivery/VAT note, directly under the price. */
.wop-price-note {
  margin: -4px 0 16px;
  font-size: .9rem;
  color: var(--wop-text-muted);
}
.wop-product-quote__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.wop-product-quote__phone {
  font-weight: 600;
  color: var(--wop-brand);
  text-decoration: none;
  white-space: nowrap;
}
.wop-product-quote__phone:hover { text-decoration: underline; }
.wop-product-quote__note {
  margin: 12px 0 0;
  font-size: .85rem;
  color: var(--wop-text-muted);
}

/* ---- Inline quote form ---------------------------------------------------

   The site's primary conversion path, on the page rather than one click away.
   Two columns on desktop so it reads as a panel and not as a second page. */

.wop-quote-inline {
  grid-column: 1 / -1;
  margin-top: clamp(40px, 5vw, 72px);
  padding: clamp(24px, 3.5vw, 44px);
  background: var(--wop-bg-alt);
  border-radius: var(--wop-radius);
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  /* The summary CTA is an in-page anchor; keep the heading clear of the
     sticky header when it lands. */
  scroll-margin-top: calc(var(--wop-header-offset) + 16px);
}

.wop-quote-inline__heading { margin-top: 0; font-size: var(--wop-text-2xl); color: var(--wop-brand); }
.wop-quote-inline__intro p { color: var(--wop-text-muted); }
.wop-quote-inline__phone a { color: var(--wop-accent-text); font-weight: 600; }

.wop-quote-inline .wpcf7-form p { margin: 0 0 14px; }
.wop-quote-inline .wpcf7-form label { display: block; font-weight: 600; font-size: var(--wop-text-sm); }
.wop-quote-inline .wpcf7-form input[type="text"],
.wop-quote-inline .wpcf7-form input[type="email"],
.wop-quote-inline .wpcf7-form input[type="tel"],
.wop-quote-inline .wpcf7-form input[type="number"],
.wop-quote-inline .wpcf7-form textarea {
  width: 100%;
  margin-top: 5px;
  padding: 11px 14px;
  border: 1px solid var(--wop-border-strong);
  border-radius: var(--wop-btn-radius);
  background: var(--wop-card-bg);
  font: inherit;
  font-size: var(--wop-text-sm);
}
.wop-quote-inline .wpcf7-form input:focus-visible,
.wop-quote-inline .wpcf7-form textarea:focus-visible {
  outline: none;
  border-color: var(--wop-accent);
  box-shadow: 0 0 0 3px rgba(42, 136, 234, .18);
}
.wop-quote-inline .wpcf7-form input[type="submit"] {
  width: auto;
  padding: 14px 28px;
  border: 0;
  border-radius: var(--wop-btn-radius);
  background: var(--wop-btn-bg);
  color: var(--wop-text-invert);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--wop-ls-caps);
  cursor: pointer;
}
.wop-quote-inline .wpcf7-form input[type="submit"]:hover { background: var(--wop-brand); }

@media (max-width: 860px) {
  .wop-quote-inline { grid-template-columns: 1fr; }
}

/* ---- Downloads (spec sheets and installation PDFs) -----------------------

   inc/product-documents.php has always emitted .wop-product-docs*, and no
   stylesheet ever defined any of it — so on every product carrying a document
   the list rendered as a raw browser <ul>: disc bullets at a 40px indent,
   underlined default-blue links. Several hundred product pages.

   The port exists to fix the pipe-delimited link bug; it also has to look like
   the rest of the page. */

.wop-product-docs {
  grid-column: 1 / -1;
  margin-top: clamp(28px, 3vw, 44px);
}
.wop-product-docs__heading {
  margin: 0 0 12px;
  font-size: var(--wop-text-lg);
  color: var(--wop-brand);
}
.wop-product-docs__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.wop-product-docs__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--wop-border-strong);
  border-radius: var(--wop-btn-radius);
  background: var(--wop-card-bg);
  color: var(--wop-brand);
  font-size: var(--wop-text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--wop-dur) var(--wop-ease), background var(--wop-dur) var(--wop-ease);
}
/* A document icon, so a download does not read as an ordinary link. */
.wop-product-docs__link::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--wop-doc-icon) center / contain no-repeat;
          mask: var(--wop-doc-icon) center / contain no-repeat;
}
.wop-product-docs__link:hover {
  border-color: var(--wop-accent);
  background: var(--wop-bg-alt);
}

/* ---- "+ VAT" and lead time (Gareth, 9 Oct 2026) ---------------------------
   The VAT marker sits inside .price, which is 700 and 2xl on the product page;
   it should read as a qualifier of the number, not as part of it. */

.wop-price-vat {
  font-size: .6em;
  font-weight: 500;
  color: var(--wop-text-muted);
  white-space: nowrap;
}

/* Woo's own `.woocommerce div.product .stock` is 0,3,1 and green; matched here
   so the lead time reads as information rather than as a success message. */
.woocommerce div.product p.stock.wop-lead-time {
  margin: 0 0 4px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--wop-heading);
}
.woocommerce div.product .wop-lead-time__note {
  margin: 0 0 14px;
  font-size: .8rem;
  color: var(--wop-text-muted);
}

.wop-product-quote__note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.wop-product-quote__note a:hover { color: var(--wop-brand); }
