/* СПСК 1.8.3 — uniform catalog cards and purchase controls for every product.
   Load after store.css and gallery.css. Product data and image galleries stay intact. */
.productGrid {
  --spsc-card-photo-height: 404px;
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.productGrid > .product {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: #fff;
}

/* White photo areas for every category, including kits, tubing and equipment. */
.productGrid > .product:hover,
.productGrid > .product .productMark.waterStage,
.productPage .galleryFrame.waterStage,
.zoomStage,
.requestPhoto {
  background: #fff !important;
}
.productGrid > .product .productMark.waterStage::before,
.productGrid > .product .productMark.waterStage::after,
.productPage .galleryFrame.waterStage::before,
.productPage .galleryFrame.waterStage::after,
.requestPhoto::before,
.requestPhoto::after {
  display: none !important;
}

.productGrid > .product > .spscSed12Preview.isCard {
  flex: 0 0 auto;
  min-width: 0;
}

/* Every photo has the same frame, including neighboring equipment and kits.
   Full-frame source images are contained, never stretched or cropped. */
.productGrid > .product .productMark.waterStage {
  box-sizing: border-box;
  display: block;
  flex: 0 0 auto;
  height: var(--spsc-card-photo-height);
  min-height: var(--spsc-card-photo-height);
  margin: 8px;
  padding: 40px 18px 54px;
}

.productGrid > .product .productMark > .catalogPhoto,
.productGrid > .product .productMark > .kitPhoto {
  display: block;
  width: 100%;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  transform: none;
}

/* Preserve the existing four-column kit composite. */
.productGrid > .product .productMark > .kitPhoto {
  display: grid;
}

.productGrid > .product .productMark:hover > .catalogPhoto,
.productGrid > .product .productMark:hover > .kitPhoto {
  transform: none;
}

.productGrid > .product .productMark .photoMeta {
  bottom: 30px;
}

/* Keep the full-size image in a native img element, with the same usable
   image area as the existing gallery. Extra top padding makes labels smaller. */
.productGrid > .product .spscSed12Preview.isCard .productMark {
  padding: 10px 12px 50px;
}
.productGrid > .product .spscSed12Preview .catalogPhoto {
  filter: none;
  transform: none;
  image-rendering: auto;
  transition: none;
}

/* A moving parent composites the photo while the hover animation runs. */
@media (min-width: 761px) {
  .productGrid > .product:hover { transform: none; }
}

.productGrid > .product .productBody {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 14px 16px 16px;
}

.productGrid > .product .productName {
  min-height: 4.35em;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Let long titles/descriptions increase the common row height. No line clamp. */
.productGrid > .product .productBody > .price,
.productGrid > .product .productBody > .spscSed12PriceStock {
  margin-top: auto;
  margin-bottom: 12px;
  padding-top: 12px;
  min-height: 2.1em;
  flex-shrink: 0;
}

.productGrid > .product .productActions {
  flex-shrink: 0;
  margin-top: 0;
  min-height: 44px;
  align-items: flex-end;
}

.productGrid > .product .spscSed12PurchaseRow {
  max-width: none;
}

/* Purchase and availability are independent of the photo-gallery feature. */
.productGrid > .product .spscSed12PriceStock,
.productPage .spscSed12PriceStock {
  flex-wrap: wrap;
  row-gap: 3px;
}
.productGrid > .product .spscSed12Stock,
.productPage .spscSed12Stock {
  color: #15803d;
}
.productPage .spscSed12PriceStock {
  margin-top: 0;
}
.productPage .spscSed12UnitPrice strong {
  font-size: 24px;
}

@media (min-width: 601px) and (max-width: 760px) {
  .productGrid {
    --spsc-card-photo-height: 324px;
  }
}

/* Retain a full-width mobile card and comfortable quantity controls. */
@media (max-width: 600px) {
  .productGrid {
    --spsc-card-photo-height: 384px;
    grid-template-columns: minmax(0, 1fr);
  }

  .productGrid > .product {
    grid-column: 1 / -1;
  }

  .productGrid > .product .productMark.waterStage {
    margin: 5px;
    padding: 38px 16px 54px;
  }

  .productGrid > .product .productBody {
    padding: 14px 16px 16px;
  }
}
