/* GQ and Glass Rescue: preserve the compact v96 card layout and brand palette.
   Grid, type, card spacing, radii, thumbnails and buttons use shop-design-v90.css.
   These additions support the accurate v97 product data and contain each image. */
html[data-product-cards="97"] {
  --card-ink:var(--ink,#182f43);
  --card-muted:var(--muted,#465e73);
  --card-action:var(--partner-action,var(--brand,#155acb));
  --card-offer:#a74816;
}

/* The original image stage is square. Keep its dimensions independent of the
   image's intrinsic ratio. #main also outranks the legacy height:auto!important
   rule; an absolutely inset anchor cannot grow beyond and be clipped by it. */
html[data-product-cards="97"] #main .product-card[data-product-card] .product-photo-wrap {
  position:relative;
  flex:none;
  width:100%;
  min-width:0;
  aspect-ratio:1 / 1;
  overflow:hidden;
  background:#fff;
}
html[data-product-cards="97"] #main .product-card[data-product-card] .product-photo-wrap>.photo {
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  width:100%;
  height:100%!important;
  min-width:0;
  min-height:0;
  max-height:none;
  aspect-ratio:auto;
  margin:0;
  padding:0;
  border:0;
  overflow:hidden;
  background:#fff;
}
html[data-product-cards="97"] #main .product-card[data-product-card] .photo img {
  display:block;
  box-sizing:border-box;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  max-width:100%;
  max-height:100%;
  object-fit:contain!important;
  object-position:center;
  padding:4px;
  transform:none!important;
  background:#fff;
}

/* Save stays alongside the category, without the enlarged v97 heading row. */
html[data-product-cards="97"] #main .product-card[data-product-card] .card-topline {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
html[data-product-cards="97"] #main .product-card[data-product-card] .card-save {
  min-width:44px;
  min-height:28px;
  margin:0;
  padding:4px 0;
  border:0;
  background:transparent;
  box-shadow:none;
  color:var(--card-muted);
  font-size:11px;
  font-weight:400;
  line-height:1.4;
  text-decoration:underline;
  text-underline-offset:3px;
}
html[data-product-cards="97"] #main .product-card[data-product-card] .card-save[aria-pressed="true"] {
  color:var(--card-action);
  font-weight:600;
}

/* Let the original compact specification visibility and spacing apply. */
html[data-product-cards="97"] .card-specification .card-size {display:block;}
html[data-product-cards="97"] .card-specification .card-spec-label {
  margin-right:4px;
  color:var(--card-muted);
  font-size:11px;
  font-weight:400;
}
html[data-product-cards="97"] .card-specification strong {font-size:12px;font-weight:600;}
html[data-product-cards="97"] .card-specification small {
  display:block;
  font-size:10px;
  font-weight:400;
  color:var(--card-muted);
}
html[data-product-cards="97"] .card-specification .card-features {
  display:block;
  color:var(--card-muted);
  font-size:11px;
  font-weight:400;
}

/* Price values retain the original 25px / 20px desktop / mobile sizing. */
html[data-product-cards="97"] .card-price-value {font-variant-numeric:tabular-nums;}
html[data-product-cards="97"] .price-each {white-space:nowrap;}
html[data-product-cards="97"] :is(.product-card,.product-layout) .price>small.card-price-scope,
html[data-product-cards="97"] .product-layout .shop-top-price>small.card-price-scope {
  display:block;
  margin-top:2px;
}
html[data-product-cards="97"] :is(.product-card,.product-layout) :is(.price,.shop-top-price)>.door-offer {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:3px 6px;
  padding:0;
  margin:6px 0;
  color:var(--card-offer);
  background:transparent;
  border:0;
  box-shadow:none;
}
html[data-product-cards="97"] .door-offer :is(del,strong,span) {
  font-size:11px;
  line-height:1.4;
  letter-spacing:0;
}
html[data-product-cards="97"] .door-offer del {color:var(--card-muted);}
html[data-product-cards="97"] .door-offer strong {color:var(--card-offer);font-weight:600;}

/* All listed sizes, frame builds and prices keep the original compact rows. */
html[data-product-cards="97"] .listed-stock-prices .stock-opening {display:block;}
html[data-product-cards="97"] .listed-stock-prices a>span {flex:1;min-width:0;}
html[data-product-cards="97"] .listed-stock-prices a>strong {flex:none;font-variant-numeric:tabular-nums;}
html[data-product-cards="97"] .listed-stock-prices a[data-selected="true"]>strong {color:var(--card-action);}
html[data-product-cards="97"] .listed-stock-prices>small {margin-top:5px;}
html[data-product-cards="97"] #main .product-card[data-product-card] .card-actions>.primary {gap:6px;}
html[data-product-cards="97"] #main .product-card[data-product-card] .product-info>p.card-availability {
  display:block;
  min-height:0;
  margin:8px 0 0;
  overflow:visible;
  -webkit-line-clamp:unset;
  color:var(--card-muted);
  line-height:1.4;
}
html[data-product-cards="97"] .product-information.product-information-text {grid-template-columns:minmax(0,1fr);}

/* Distinct contractor product presentations; supply pricing stays shared. */
html[data-storefront="mtm"] body[data-shop-page="product"] .product-layout{gap:32px}
html[data-storefront="mtm"] body[data-shop-page="product"] .product-heading{border-top:4px solid #454d58;padding-top:22px}
html[data-storefront="mtm"] body[data-shop-page="product"] .product-heading h1{font-weight:550;letter-spacing:-.035em}
html[data-storefront="mtm"] body[data-shop-page="product"] .product-gallery{border-radius:2px;border-color:#cfd4da;background:#f3f4f6}
html[data-storefront="mtm"] body[data-shop-page="product"] .gallery-stage{background:linear-gradient(145deg,#f0f2f4,#fff)}
html[data-storefront="mtm"] body[data-shop-page="product"] .purchase-panel,html[data-storefront="mtm"] body[data-shop-page="product"] #configuration{border-radius:3px}
html[data-storefront="mtm"] .product-information{border-top:1px solid #cdd2d8;padding-top:30px}
html[data-storefront="mtm"] .product-information figure{margin:0}
html[data-storefront="mtm"] .product-information img{width:100%;height:auto;object-fit:contain}
html[data-storefront="glassrescue"] body[data-shop-page="product"] .product-heading{border-left:4px solid #f15a24;padding-left:18px}
html[data-storefront="glassrescue"] body[data-shop-page="product"] .product-gallery{background:#fff7f1;border-radius:20px;border-color:#f0dacd}
html[data-storefront="glassrescue"] body[data-shop-page="product"] .gallery-stage{background:linear-gradient(150deg,#fff4e9,#fff)}
html[data-storefront="glassrescue"] .product-information{background:#fff6ef;padding:26px;border-radius:20px;gap:28px}
html[data-storefront="glassrescue"] .product-information figure{margin:0}
html[data-storefront="glassrescue"] .product-information img{border-radius:14px;width:100%;height:auto;object-fit:contain}
.product-information figcaption{font-size:12px;line-height:1.5;color:var(--muted);margin-top:10px}
@media(max-width:640px){html[data-storefront="mtm"] body[data-shop-page="product"] .product-layout{gap:20px}html[data-storefront="glassrescue"] .product-information{padding:18px}}


/* Unframed product photography; selection is a quiet underline. */
#productGallery,#productGallery .gallery-stage{background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important}
#productGallery .gallery-caption,#productGallery .gallery-thumb-label,.generated-product-gallery .tool-photo-caption{display:none!important}
.product-media:has([data-gallery-3d][aria-pressed="false"]) #viewHint{display:none!important}
#productGallery .gallery-thumbnails{height:auto!important;max-height:none!important;overflow-y:hidden!important;padding:8px 0 12px!important;gap:10px!important}
#productGallery .gallery-thumbnails .gallery-thumb,.generated-product-gallery .tool-photo-options button{background:transparent!important;border:0!important;border-bottom:2px solid transparent!important;border-radius:0!important;box-shadow:none!important;padding:4px!important;min-height:78px!important;height:78px!important;display:flex!important;align-items:center!important;justify-content:center!important}
#productGallery .gallery-thumbnails .gallery-thumb[aria-pressed="true"],.generated-product-gallery .tool-photo-options button[aria-pressed="true"]{border-bottom-color:var(--partner-action,var(--accent))!important}
#productGallery .gallery-thumbnails .gallery-thumb img,.generated-product-gallery .tool-photo-options button img{height:64px!important;max-height:64px!important;object-fit:contain!important;border-radius:0!important;flex:none!important}
#productGallery .gallery-nav{background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important}
#productGallery .gallery-3d-launch{display:none!important}
@media(max-width:700px){#productGallery .gallery-thumbnails .gallery-thumb,.generated-product-gallery .tool-photo-options button{min-height:66px!important;height:66px!important}#productGallery .gallery-thumbnails .gallery-thumb img,.generated-product-gallery .tool-photo-options button img{height:52px!important;max-height:52px!important}}
