/*
 * Double Seam German product gallery size lock.
 * Loaded LAST on every /de/product/ page so image aspect ratio, image count,
 * and product-specific gallery CSS cannot change the approved media stage size.
 * English pages are intentionally unaffected.
 */

/* Every ordinary German product gets the same approved main media stage. */
html[lang="de"] body .product-detail .detail-layout > .detail-photo:not(.gauge-gallery):not(.decoiler-gallery) {
  box-sizing: border-box !important;
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  min-width: 0 !important;
  height: clamp(340px, 46vh, 410px) !important;
  min-height: clamp(340px, 46vh, 410px) !important;
  max-height: 410px !important;
  padding: 14px !important;
  overflow: hidden !important;
}

/* Real images inside ordinary product stages always fit the stage; they never size it. */
html[lang="de"] body .product-detail .detail-layout > .detail-photo:not(.gauge-gallery):not(.decoiler-gallery) > img,
html[lang="de"] body .product-detail .detail-layout > .detail-photo:not(.gauge-gallery):not(.decoiler-gallery) > picture,
html[lang="de"] body .product-detail .detail-layout > .detail-photo:not(.gauge-gallery):not(.decoiler-gallery) > picture > img {
  display: block !important;
  width: 100% !important;
  max-width: 650px !important;
  height: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  object-position: center center !important;
}

/* Multi-photo galleries: wrapper can grow only for the thumbnail strip;
   the main media stage itself is locked to the exact same approved size. */
html[lang="de"] body .product-detail .detail-layout > .gauge-gallery,
html[lang="de"] body .product-detail .detail-layout > .decoiler-gallery {
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 14px !important;
  overflow: visible !important;
  border: 0 !important;
  background: #f1eee7 !important;
}

html[lang="de"] body .product-detail .gauge-gallery-main,
html[lang="de"] body .product-detail .decoiler-gallery-main {
  box-sizing: border-box !important;
  display: block !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: 650px !important;
  height: clamp(340px, 46vh, 410px) !important;
  min-height: clamp(340px, 46vh, 410px) !important;
  max-height: 410px !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #f1eee7 !important;
}

/* Thumbnail count must never alter the main image stage. Extra thumbnails scroll. */
html[lang="de"] body .product-detail .gauge-gallery-thumbs,
html[lang="de"] body .product-detail .decoiler-gallery-thumbs {
  box-sizing: border-box !important;
  display: flex !important;
  flex: 0 0 68px !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 68px !important;
  min-height: 68px !important;
  max-height: 68px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 0 0 2px !important;
  scrollbar-width: thin;
}

html[lang="de"] body .product-detail .gauge-thumb,
html[lang="de"] body .product-detail .decoiler-thumb {
  box-sizing: border-box !important;
  display: block !important;
  flex: 0 0 82px !important;
  width: 82px !important;
  min-width: 82px !important;
  max-width: 82px !important;
  height: 62px !important;
  min-height: 62px !important;
  max-height: 62px !important;
  padding: 3px !important;
  border: 2px solid transparent !important;
  background: #fff !important;
  cursor: pointer !important;
}

html[lang="de"] body .product-detail .gauge-thumb.active,
html[lang="de"] body .product-detail .decoiler-thumb.active {
  border-color: #08716b !important;
}

html[lang="de"] body .product-detail .gauge-thumb img,
html[lang="de"] body .product-detail .decoiler-thumb img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
}

/* Tablet: every German product still shares one common stage size. */
@media (max-width: 900px) {
  html[lang="de"] body .product-detail .detail-layout > .detail-photo:not(.gauge-gallery):not(.decoiler-gallery),
  html[lang="de"] body .product-detail .gauge-gallery-main,
  html[lang="de"] body .product-detail .decoiler-gallery-main {
    height: clamp(330px, 48vh, 390px) !important;
    min-height: clamp(330px, 48vh, 390px) !important;
    max-height: 390px !important;
  }

  html[lang="de"] body .product-detail .detail-layout > .detail-photo:not(.gauge-gallery):not(.decoiler-gallery) > img,
  html[lang="de"] body .product-detail .detail-layout > .detail-photo:not(.gauge-gallery):not(.decoiler-gallery) > picture,
  html[lang="de"] body .product-detail .detail-layout > .detail-photo:not(.gauge-gallery):not(.decoiler-gallery) > picture > img,
  html[lang="de"] body .product-detail .gauge-gallery-main,
  html[lang="de"] body .product-detail .decoiler-gallery-main {
    max-width: 620px !important;
  }
}

/* Mobile: one fixed responsive stage across the whole German range. */
@media (max-width: 560px) {
  html[lang="de"] body .product-detail .detail-layout > .detail-photo:not(.gauge-gallery):not(.decoiler-gallery),
  html[lang="de"] body .product-detail .gauge-gallery-main,
  html[lang="de"] body .product-detail .decoiler-gallery-main {
    height: 300px !important;
    min-height: 300px !important;
    max-height: 300px !important;
  }

  html[lang="de"] body .product-detail .detail-layout > .detail-photo:not(.gauge-gallery):not(.decoiler-gallery),
  html[lang="de"] body .product-detail .detail-layout > .gauge-gallery,
  html[lang="de"] body .product-detail .detail-layout > .decoiler-gallery {
    padding: 10px !important;
  }

  html[lang="de"] body .product-detail .detail-layout > .detail-photo:not(.gauge-gallery):not(.decoiler-gallery) > img,
  html[lang="de"] body .product-detail .detail-layout > .detail-photo:not(.gauge-gallery):not(.decoiler-gallery) > picture,
  html[lang="de"] body .product-detail .detail-layout > .detail-photo:not(.gauge-gallery):not(.decoiler-gallery) > picture > img,
  html[lang="de"] body .product-detail .gauge-gallery-main,
  html[lang="de"] body .product-detail .decoiler-gallery-main {
    max-width: 100% !important;
  }

  html[lang="de"] body .product-detail .gauge-gallery-thumbs,
  html[lang="de"] body .product-detail .decoiler-gallery-thumbs {
    flex-basis: 64px !important;
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
  }

  html[lang="de"] body .product-detail .gauge-thumb,
  html[lang="de"] body .product-detail .decoiler-thumb {
    flex-basis: 72px !important;
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
  }
}
