/* Product thumbnails are ordinary links, including every edge and corner. */
body.page .products-grid .products-filter .grid-item::before { content:none; }
body #page .product-thumbnail { display:block; grid-area:1/1; cursor:pointer; }
body #page .product-thumbnail::after,
body #page .grid-item h4 a::after,
body.search #page .post-thumbnail::after { content:none; }
body #page .product-thumbnail img,
body.search #page .post-thumbnail img { transition:filter .16s ease; }
body #page .product-thumbnail:hover img,
body.search #page .post-thumbnail:hover img { filter:brightness(.92); }
body #page .grid-item h4 a { color:inherit; }
/* Match the catalog's static header without affecting Home or other pages. */
body.single-product { padding-top:0; }
body.single-product #masthead { position:relative; top:auto; }
body.single-product #masthead::before { display:none; }
/* Add space in document flow without reducing the reserved photo height. */
body.single-product #page #primary { padding-top:16px; }
body.single-product #page #primary .product-hero { padding-top:0; }
/* November 18: add 32 authored pixels to the shared 583px frame.
   Desktop compilation scales this with width, never with window height. */
body.single-product #page main#primary section.product-hero .product-image {
  height:615px;
  background:transparent; display:flex; align-items:center; justify-content:center;
}
body.single-product #page main#primary section.product-hero .product-image + .product-image { margin-top:12px; }
body.single-product #page main#primary section.product-hero .product-image img {
  display:block; width:100%; height:100%; min-width:0; max-width:100%;
  /* Contain scales the complete file as far as either shared bound allows.
     Its unused width/height is transparent, exposing the unchanged page gray. */
  object-fit:contain; object-position:center; transition:none;
}
body.single-product #page main#primary section.product-hero h1.product-title {
  font-size:32px; line-height:1.25; letter-spacing:3px; margin:14px 0 12px;
  text-align:center; overflow-wrap:anywhere; text-transform:none;
}
body.single-product #page main#primary section.product-details { margin:0 0 32px; }
/* Spend some slab footer clearance on the approved larger photograph.
   Tile/accessory spacing stays at 32px; the footer still fills unused room. */
body.single-product #page main#primary[data-product-family="slabs"] section.product-details { margin-bottom:12px; }
body.single-product #page main#primary section.product-details .details-table {
  display:grid; grid-template-columns:minmax(0,1fr) minmax(0,3.4fr) repeat(3,minmax(0,1fr));
  justify-content:center; font-size:15px; line-height:1.4;
}
body.single-product #page main#primary[data-product-family="slabs"] section.product-details .details-table {
  grid-template-columns:repeat(5,minmax(0,1fr)); max-width:1100px; margin:auto;
}
body.single-product #page main#primary section.product-details .details-table.second-row {
  grid-template-columns:repeat(3,minmax(0,1fr)); border-top:0;
}
body.single-product #page main#primary section.product-details .details-table .details-column {
  padding:8px 16px 12px; min-width:0; overflow-wrap:anywhere; border-top:0;
}
body.single-product #page main#primary section.product-details .details-table .details-column + .details-column { border-left:1px solid #575552; }
body.single-product #page main#primary section.product-details h3.details-label {
  font-size:17px; line-height:1.3; letter-spacing:2px; margin:0 0 6px;
}
body.single-product #page .details-value p { margin:0 0 6px; }
body.single-product #page .details-value p:last-child { margin-bottom:0; }
@media(max-width:1100px) {
  body.single-product #page main#primary section.product-details .details-table { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.single-product #page main#primary section.product-details .details-table .details-column { border-bottom:1px solid #575552; }
}
@media(max-width:650px) {
  body.single-product #page main#primary section.product-hero .product-image { height:clamp(312px,calc(70vw + 32px),615px); }
  body.single-product #page main#primary section.product-hero h1.product-title { font-size:26px; letter-spacing:2px; }
  body.single-product #page main#primary[data-product-family="slabs"] section.product-details .details-table,
  body.single-product #page main#primary section.product-details .details-table.second-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.single-product #page main#primary section.product-details .details-table .details-column { padding:10px; }
  body.single-product #page main#primary section.product-details .details-table .details-column:nth-child(odd) { border-left:0; }
}
@media(prefers-reduced-motion:reduce) {
  body #page .product-thumbnail img, body.search #page .post-thumbnail img { transition:none; }
}
/* Product-detail content only. Keep the shared header/footer surface variable
   and all photograph pixels, transparent image frames and geometry unchanged. */
body.single-product { background-color:var(--cactus-content-background,#302e2b) !important; }
