/* ZooMag R26 — product page final balance layer.
   Loaded AFTER Products.css, gallery-clean and variants styles. */

.zoohub-product-showcase .zoohub-container {
  width: min(calc(100vw - 28px), 1400px) !important;
  max-width: 1400px !important;
  margin-inline: auto !important;
}

/* Main product area: photo is intentionally smaller than information. */
@media (min-width: 1200px) {
  .zoohub-product-showcase .zoohub-product-jungle {
    display: grid !important;
    grid-template-columns: 520px minmax(0, 1fr) !important;
    gap: 26px !important;
    align-items: start !important;
  }

  .zoohub-product-showcase .zoohub-gallery-den {
    width: 100% !important;
    max-width: 520px !important;
    position: sticky !important;
    top: 104px !important;
    align-self: start !important;
  }

  .zoohub-product-showcase .zoohub-image-frame {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 520px !important;
    aspect-ratio: 1 / 1 !important;
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .zoohub-product-showcase .zoohub-product-jungle {
    grid-template-columns: minmax(390px, .9fr) minmax(0, 1.1fr) !important;
    gap: 20px !important;
    align-items: start !important;
  }

  .zoohub-product-showcase .zoohub-gallery-den {
    position: sticky !important;
    top: 96px !important;
    max-width: 500px !important;
  }

  .zoohub-product-showcase .zoohub-image-frame {
    height: auto !important;
    min-height: 0 !important;
    max-height: 500px !important;
    aspect-ratio: 1 / 1 !important;
  }
}

@media (max-width: 991.98px) {
  .zoohub-product-showcase .zoohub-product-jungle {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .zoohub-product-showcase .zoohub-gallery-den {
    position: static !important;
    width: min(100%, 640px) !important;
    max-width: 640px !important;
    margin-inline: auto !important;
  }

  .zoohub-product-showcase .zoohub-image-frame {
    height: auto !important;
    min-height: 0 !important;
    max-height: 600px !important;
    aspect-ratio: 1 / 1 !important;
  }
}

@media (max-width: 575.98px) {
  .zoohub-product-showcase .zoohub-container {
    width: calc(100vw - 20px) !important;
  }

  .zoohub-product-showcase .zoohub-gallery-den,
  .zoohub-product-showcase .zoohub-info-sanctuary {
    padding: 12px !important;
    border-radius: 17px !important;
  }

  .zoohub-product-showcase .zoohub-image-frame {
    max-height: none !important;
  }

  .zoohub-product-showcase .zoohub-gallery-thumbnails {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }
}

.zoohub-product-showcase .zoohub-gallery-image {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  padding: clamp(6px, .9vw, 12px) !important;
}

/* No single text value may force the right column wider than its grid cell. */
.zoohub-product-showcase :is(
  .zoohub-product-title,
  .zoohub-fact-value,
  .zoohub-stock-text,
  .zoohub-price,
  .zoohub-buy-note,
  .zoohub-variant-name,
  .zoohub-variant-label,
  .zoohub-conversion-trust__text,
  .zoohub-conversion-trust__text strong,
  .zoohub-conversion-trust__text small
) {
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
}

.zoohub-product-showcase .zoohub-product-title {
  font-size: clamp(1.65rem, 2.25vw, 2.25rem) !important;
  line-height: 1.15 !important;
}

.zoohub-product-showcase .zoohub-facts-grid,
.zoohub-product-showcase .zoohub-conversion-trust {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.zoohub-product-showcase .zoohub-fact-item,
.zoohub-product-showcase .zoohub-conversion-trust__item {
  min-width: 0 !important;
  height: auto !important;
  min-height: 62px !important;
}

.zoohub-product-showcase :is(.zoohub-action-buttons, .zoohub-quantity-section, .zoohub-btn-group) {
  min-width: 0 !important;
  max-width: 100% !important;
  flex-wrap: wrap !important;
}

@media (max-width: 575.98px) {
  .zoohub-product-showcase .zoohub-product-title {
    font-size: clamp(1.35rem, 6.3vw, 1.75rem) !important;
  }

  .zoohub-product-showcase .zoohub-facts-grid {
    grid-template-columns: 1fr !important;
  }

  .zoohub-product-showcase .zoohub-conversion-trust {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 420px) {
  .zoohub-product-showcase .zoohub-conversion-trust {
    grid-template-columns: 1fr !important;
  }
}

/* Related products: replace Bootstrap width tug-of-war with one predictable grid. */
.zoohub-product-showcase .product-related {
  width: 100% !important;
  max-width: 100% !important;
  margin-top: clamp(28px, 4vw, 48px) !important;
  overflow: visible !important;
}

.zoohub-product-showcase .product-related > h2 {
  margin: 0 0 18px !important;
  font-size: clamp(1.45rem, 2vw, 2rem) !important;
  line-height: 1.2 !important;
}

.zoohub-product-showcase .product-related > .row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
  width: 100% !important;
  margin: 0 !important;
}

.zoohub-product-showcase .product-related > .row > .col {
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
}

.zoohub-product-showcase .product-related .petz-product-card {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.zoohub-product-showcase .product-related .petz-image-section {
  height: 210px !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  padding: 10px 10px 0 !important;
}

.zoohub-product-showcase .product-related .petz-image-link,
.zoohub-product-showcase .product-related .petz-image-container {
  height: 100% !important;
  aspect-ratio: auto !important;
}

.zoohub-product-showcase .product-related .petz-product-name {
  min-height: 3.45em !important;
  align-items: flex-start !important;
}

.zoohub-product-showcase .product-related .petz-product-name a {
  -webkit-line-clamp: 3 !important;
  line-height: 1.15 !important;
  overflow-wrap: anywhere !important;
}

.zoohub-product-showcase .product-related .petz-features {
  overflow: visible !important;
  min-height: 0 !important;
}

.zoohub-product-showcase .product-related .petz-btn-text,
.zoohub-product-showcase .product-related .petz-quantity-control label {
  white-space: normal !important;
}

@media (max-width: 1199.98px) {
  .zoohub-product-showcase .product-related > .row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 899.98px) {
  .zoohub-product-showcase .product-related > .row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .zoohub-product-showcase .product-related .petz-image-section {
    height: 200px !important;
  }
}

@media (max-width: 575.98px) {
  .zoohub-product-showcase .product-related > .row {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .zoohub-product-showcase .product-related .petz-image-section {
    height: 220px !important;
  }
}
