/* ==========================================================================
   Single product.
   ========================================================================== */

/* Grid areas rather than two columns, so the TITLE can be placed:
   beside the gallery at desktop, above it on mobile. The old build stacked
   the gallery first on mobile and the visitor met the photo before the name. */
.effectus-product .effectus-product__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "title"
    "gallery"
    "summary";
  gap: 8px clamp(24px, 4vw, 56px);
  align-items: start;
}

@media (min-width: 861px) {
  .effectus-product .effectus-product__layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "gallery title"
      "gallery summary";
    align-content: start;
  }
}

.effectus-product .effectus-product__gallery { grid-area: gallery; }
.effectus-product .effectus-product__title   { grid-area: title; }
.effectus-product .effectus-product__summary { grid-area: summary; }

/* GOTCHA 4 — the sticky offset must not survive the collapse to one column.
   WooCommerce core forces .woocommerce-product-gallery { position: relative },
   so a `top` left in place on mobile shifts the gallery DOWN OVER the <h1>
   that now precedes it. The image literally covers the title, which reads as
   "the title is missing". Sticky is scoped to the two-column breakpoint and
   explicitly reset below it. */
@media (min-width: 861px) {
  .effectus-product .effectus-product__gallery {
    position: sticky;
    top: calc(var(--effectus-header-height) + 20px);
  }
}

@media (max-width: 860px) {
  .effectus-product .effectus-product__gallery {
    position: static;
    top: auto;
  }
}

.woocommerce div.product .effectus-product__gallery div.images,
.woocommerce div.product .effectus-product__gallery .woocommerce-product-gallery {
  float: none;
  width: 100%;
  margin: 0;
}

.woocommerce div.product .woocommerce-product-gallery__image img {
  width: 100%;
  height: auto;
}

/* Gallery thumbnails. woocommerce_thumbnail_cropping is off, so the source
   images are every ratio going and a raw strip steps up and down. A square box
   with contain-fit squares the strip off without cropping a rack photo. */
.woocommerce div.product .flex-control-thumbs li img {
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: contain;
}

/* -- title ---------------------------------------------------------------- */

.effectus-product .effectus-product__title,
.woocommerce div.product .effectus-product__title {
  margin: 0 0 .35em;
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  font-weight: var(--effectus-weight-heading);
  line-height: 1.2;
  color: var(--effectus-text);
}

/* -- summary column ------------------------------------------------------- */

.woocommerce div.product .effectus-product__summary {
  float: none;
  width: 100%;
  margin: 0;
}

/* No product on this site has a price. Nothing should render one, and nothing
   should reserve space for one. */
.woocommerce div.product .effectus-product__summary p.price,
.woocommerce div.product .effectus-product__summary span.price,
.woocommerce div.product .effectus-product__summary .woocommerce-product-rating,
.woocommerce div.product form.cart {
  display: none;
}

/* -- the spec list (post_content, verbatim) ------------------------------- */

.effectus-product__description {
  margin: 0 0 24px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--effectus-text);
}

.effectus-product__description ul {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.effectus-product__description li { margin-bottom: .4em; }

/* ONE product (PNY GeForce RTX 4070 Ti SUPER 16GB, ID 1118) has a hand-typed
   <h3 class="product-title"> at the top of its post_content that repeats the
   page title word for word, immediately under the <h1>. The decision was to
   copy the spec content exactly as authored rather than re-key 51 products, so
   the duplicate is hidden here instead of edited in the database. The class is
   hand-typed and exists on that product alone; scoped to the product content
   so it can never hide anything else. */
.effectus-product__description > h3.product-title { display: none; }

/* -- meta (SKU / Categories / Tags) --------------------------------------- */

.woocommerce div.product .effectus-product__summary .product_meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 22px;
  padding-top: 20px;
  border-top: 1px solid var(--effectus-border);
  font-size: .92rem;
  color: var(--effectus-text-muted);
}

.woocommerce div.product .effectus-product__summary .product_meta > span { display: block; }

.woocommerce div.product .effectus-product__summary .product_meta a { color: var(--effectus-brand); }

/* -- manufacturer datasheet ----------------------------------------------- */

/* 49 products carry this URL in a visible custom attribute and the old
   template rendered it nowhere at all. */
.effectus-product__datasheet { margin: 0 0 22px; }

.effectus-product__datasheet a {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-size: .95rem;
  font-weight: 600;
  color: var(--effectus-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.effectus-product__datasheet a:hover { color: var(--effectus-accent); }

/* -- enquiry CTA ---------------------------------------------------------- */

.effectus-product__cta-wrap { margin: 0; }

.woocommerce div.product .effectus-product__cta {
  border-radius: 3px;
  padding: .85em 1.7em;
  background: var(--effectus-brand);
  color: var(--effectus-text-invert);
  font-size: 1rem;
  font-weight: 600;
}
.woocommerce div.product .effectus-product__cta:hover { background: var(--effectus-accent); }
