#main{--machine-border:#c3d4e2;--machine-surface:#f3f8fc;}

.machine-detail .machine-hero {
  display: block;
  align-self: start;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
}
.machine-detail .machine-hero img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
#main .machine-description {
  display: grid;
  gap: clamp(24px, 4vw, 56px);
  margin-block: clamp(28px, 5vw, 64px);
}
#main .machine-description h2 { margin-block: 0 16px; }
.machine-description .machine-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
  margin: 0 0 24px;
}
.machine-specs > div {
  padding: 14px 18px;
  border: 1px solid var(--machine-border);
  border-radius: 10px;
  background: var(--machine-surface);
}
.machine-specs dt { font-size: .9em; }
.machine-specs dd { margin: 4px 0 0; font-weight: 650; }
.machine-description .machine-copy { max-width: 76ch; }
.machine-description .machine-copy > h3 { margin: 22px 0 7px; }
.machine-description .machine-copy > p { margin: 0; }
.machine-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr));
  gap: 16px;
}
.machine-photos figure {
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--machine-border);
  background: var(--machine-surface);
}
.machine-photos a { display: block; }
.machine-photos img { display: block; width: 100%; height: auto; object-fit: contain; }
.machine-photos figcaption { padding: 12px; line-height: 1.4; }
#main .capsule-card-photo.card-image {
  position: relative !important;
  inset: auto !important;
  grid-row: auto !important;
  margin: 0 !important;
}
#main .capsule-card-photo.card-image:focus-visible { outline-offset: 3px; }

#main[data-visible-category-video] .capsule-category-products [data-card-id="capsule-machine-100"] > .card-link,
#main[data-visible-category-video] .capsule-category-products [data-card-id="suppository-molds"] > .card-link {
  display: grid;
  grid-template-columns: minmax(0, 36%) minmax(0, 1fr);
  align-items: center;
}

/* The capsule collection uses horizontal linked photographs. */
html body.category-page #main .capsule-category-products > .category-products
  .product-card[data-card-id] > .card-link > .capsule-card-photo.card-image {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 3 / 2 !important;
  padding: 0 !important;
  align-self: center !important;
  border-radius: 9px !important;
  background: #eaf2f6 !important;
}
html body.category-page #main .capsule-category-products > .category-products
  .product-card[data-card-id] > .card-link > .capsule-card-photo.card-image > img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: cover !important;
  box-shadow: none !important;
  transform: none !important;
}
html body.category-page #main .capsule-category-products > .category-products .product-card .card-info {
  max-width: none !important;
}
html body.category-page #main .capsule-category-products > .category-products
  .product-card .card-info :is([data-compact-pack-select], [data-compact-pack-value]) {
  min-height: 50px !important;
  line-height: 1.25 !important;
}
html body.category-page #main .capsule-category-products > .category-products
  .product-card .card-info .mol-card-cart-add {
  min-height: 52px !important;
}
html body.category-page #main .capsule-category-products > .category-products
  .product-card .card-info .mol-card-add-label {
  font-size: clamp(16px, calc(1.2vw + 3px), 19px) !important;
  line-height: 1.25 !important;
}
html body.product-page #main.machine-detail .full-product > .machine-hero.product-visual {
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  background: #e3eff8 !important;
}
html body.product-page #main.machine-detail .full-product > .machine-hero.product-visual .zoom-link {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}
html body.product-page #main.machine-detail .full-product > .machine-hero.product-visual img {
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  box-shadow: none !important;
}

html body.category-page #main .capsule-category-products
  > .category-products.product-grid:has(> .product-card[data-group="capsules"])
  > .product-card[data-card-id="suppository-molds"] > .card-link > .capsule-card-photo.card-image {
  align-self: center !important;
}
/* Keep the photo area proportional to each source photograph. */
html body #main.machine-detail .machine-photos > figure {
  align-self: start;
  min-block-size: 0 !important;
  block-size: auto !important;
}
html body #main.machine-detail .machine-photos > figure > a {
  display: block !important;
  inline-size: 100%;
  min-block-size: 0 !important;
  block-size: auto !important;
}
html body #main.machine-detail .machine-photos > figure > a > img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  object-fit: contain;
}
@media (max-width: 767px) {
  @layer molisan-preview-product {
    #main.machine-detail > .product-detail[data-product-id="CAPSULE-MACHINE-100"] {
      display: grid !important;
      grid-template-columns: minmax(0, 1fr) !important;
    }
    #main.machine-detail > .product-detail[data-product-id="CAPSULE-MACHINE-100"]
      > :is(.machine-hero, .product-detail-copy) {
      grid-column: 1 !important;
      grid-row: auto !important;
      min-inline-size: 0 !important;
    }
    #main.machine-detail > .product-detail[data-product-id="CAPSULE-MACHINE-100"] > .machine-hero {
      width: 100% !important;
      height: auto !important;
      min-height: 0 !important;
      padding: 0 !important;
    }
    #main.machine-detail > .product-detail[data-product-id="CAPSULE-MACHINE-100"] > .machine-hero img {
      width: 100% !important;
      height: auto !important;
      min-height: 0 !important;
    }
  }
}
/* Align the capsule collection with its section heading and content edges. */
@layer molisan-storefront-refinements {
  #main[data-visible-category-video] .capsule-category-products
    > .category-products:has(.capsule-card-photo) {
    width: 100% !important;
    max-width: none !important;
    max-inline-size: none !important;
    margin-inline: 0 !important;
  }
}
