/* Zoomag r9 — rein in coin travel, enlarge and equalize related products. */

body.zm-storefront-r9 {
  --zm-ui-site-max: 2140px;
  --zm-ui-gutter: clamp(18px, 1.4vw, 34px);
}

body.zm-storefront-r9 :where(.container, .container-fluid, .zm-container),
body.zm-storefront-r9 .zm-classic-nav__inner,
body.zm-storefront-r9 .zm-classic-nav__desktop-panel-inner {
  width: min(calc(100% - (var(--zm-ui-gutter) * 2)), var(--zm-ui-site-max)) !important;
  max-width: var(--zm-ui-site-max) !important;
  margin-inline: auto !important;
}

/* ---------------- Header / logo / coin ---------------- */
body.zm-storefront-r9 .zoomag_header_layout {
  grid-template-columns: minmax(650px, 790px) minmax(520px, 1fr) minmax(160px, 230px) !important;
}
body.zm-storefront-r9 .zoomag_logo_with_coins {
  --zm-coin-logo-size: clamp(206px, 11vw, 242px);
  --zm-coin-left-stage: clamp(96px, 5.8vw, 122px);
  flex: 0 0 calc(var(--zm-coin-logo-size) + var(--zm-coin-left-stage)) !important;
  width: calc(var(--zm-coin-logo-size) + var(--zm-coin-left-stage)) !important;
  min-width: calc(var(--zm-coin-logo-size) + var(--zm-coin-left-stage)) !important;
}
body.zm-storefront-r9 .zoomag_logo_with_coins .zoomag_logo_image {
  left: var(--zm-coin-left-stage) !important;
  width: var(--zm-coin-logo-size) !important;
  height: var(--zm-coin-logo-size) !important;
  min-width: var(--zm-coin-logo-size) !important;
  max-width: var(--zm-coin-logo-size) !important;
  max-height: var(--zm-coin-logo-size) !important;
}
body.zm-storefront-r9 .zoomag_logo_with_coins .coin,
body.zm-storefront-r9 .zoomag_logo_with_coins .coin.coin-slide-right {
  left: calc(var(--zm-coin-left-stage) - (var(--zm-coin-logo-size) * .16)) !important;
  width: calc(var(--zm-coin-logo-size) * .96) !important;
  height: calc(var(--zm-coin-logo-size) * .96) !important;
  min-width: calc(var(--zm-coin-logo-size) * .96) !important;
  max-width: calc(var(--zm-coin-logo-size) * .96) !important;
  max-height: calc(var(--zm-coin-logo-size) * .96) !important;
  animation: zmCoinSlideLeftCompactR9 180s ease-in-out 5s infinite !important;
}
@keyframes zmCoinSlideLeftCompactR9 {
  0%, 1% { opacity: 0; transform: translate3d(0,0,0) scale(.94); }
  2% { opacity: 1; transform: translate3d(0,0,0) scale(1); }
  7%, 93% { opacity: 1; transform: translate3d(calc(var(--zm-coin-left-stage) * -0.82), 0, 0) scale(1); }
  96% { opacity: 1; transform: translate3d(calc(var(--zm-coin-left-stage) * -0.82), 0, 0) scale(1); }
  98% { opacity: 1; transform: translate3d(0,0,0) scale(1); }
  99%,100% { opacity: 0; transform: translate3d(0,0,0) scale(.94); }
}
body.zm-storefront-r9 .zoomag_logo_text { max-width: 318px !important; }
body.zm-storefront-r9 .zoomag_logo_title { font-size: clamp(3.2rem, 3vw, 4rem) !important; }
body.zm-storefront-r9 .zoomag_logo_subtitle { font-size: clamp(1.06rem, 1.06vw, 1.22rem) !important; }

/* ---------------- Related products: wider, equalized cards ---------------- */
body.zm-storefront-r9 #product-product .zoohub-product-showcase .zm-related-showcase,
body.zm-storefront-r9 #product-product .zoohub-product-showcase .product-related {
  width: min(100%, 1980px) !important;
  max-width: 1980px !important;
}
@media (min-width: 1280px) {
  body.zm-storefront-r9 #product-product .zm-related-showcase {
    --zr-visible: 3 !important;
    --zr-gap: 28px !important;
    width: min(100%, 1980px) !important;
    max-width: 1980px !important;
    padding: 34px !important;
  }
  body.zm-storefront-r9 #product-product .zm-related-showcase .zm-related-showcase__viewport {
    overflow: hidden !important;
  }
  body.zm-storefront-r9 #product-product .zm-related-showcase .zm-related-showcase__slide,
  body.zm-storefront-r9 #product-product .zm-related-showcase .zm-related-showcase__card-shell,
  body.zm-storefront-r9 #product-product .zm-related-showcase .petz-product-card {
    height: 100% !important;
  }
  body.zm-storefront-r9 #product-product .zm-related-showcase .petz-product-card {
    display: flex !important;
    flex-direction: column !important;
    border-radius: 22px !important;
  }
  body.zm-storefront-r9 #product-product .zm-related-showcase .petz-image-section {
    height: 340px !important;
    padding: 16px 16px 0 !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }
  body.zm-storefront-r9 #product-product .zm-related-showcase .petz-image-link,
  body.zm-storefront-r9 #product-product .zm-related-showcase .petz-image-container {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 18px !important;
  }
  body.zm-storefront-r9 #product-product .zm-related-showcase .petz-product-image {
    width: auto !important;
    height: auto !important;
    max-width: 90% !important;
    max-height: 90% !important;
    object-fit: contain !important;
    padding: 0 !important;
    margin: 0 auto !important;
  }
  body.zm-storefront-r9 #product-product .zm-related-showcase .petz-content-section {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 16px 18px 18px !important;
  }
  body.zm-storefront-r9 #product-product .zm-related-showcase .petz-header {
    min-height: 108px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
  }
  body.zm-storefront-r9 #product-product .zm-related-showcase .petz-product-name {
    min-height: 4.5em !important;
  }
  body.zm-storefront-r9 #product-product .zm-related-showcase .petz-product-name a {
    font-size: 18px !important;
    line-height: 1.28 !important;
    -webkit-line-clamp: 3 !important;
  }
  body.zm-storefront-r9 #product-product .zm-related-showcase .petz-price-main,
  body.zm-storefront-r9 #product-product .zm-related-showcase .petz-special-price {
    font-size: 26px !important;
  }
  body.zm-storefront-r9 #product-product .zm-related-showcase .petz-btn.petz-btn-primary {
    min-height: 54px !important;
  }
  body.zm-storefront-r9 #product-product .zm-related-showcase .petz-btn-text {
    font-size: 16px !important;
  }
}
@media (min-width: 992px) and (max-width: 1279.98px) {
  body.zm-storefront-r9 #product-product .zm-related-showcase {
    --zr-visible: 2 !important;
    --zr-gap: 22px !important;
  }
  body.zm-storefront-r9 #product-product .zm-related-showcase .petz-image-section { height: 300px !important; }
}

/* Slightly wider product shell so related block doesn't feel detached. */
body.zm-storefront-r9 #product-product .zoohub-product-showcase .zoohub-container {
  width: min(calc(100vw - 34px), 2080px) !important;
  max-width: 2080px !important;
}
body.zm-storefront-r9 #product-product .zoohub-product-showcase .zoohub-product-jungle,
body.zm-storefront-r9 #product-product .zoohub-product-showcase .zoohub-tabs-savannah {
  width: min(100%, 1980px) !important;
  max-width: 1980px !important;
}

/* Responsive logo corrections */
@media (max-width: 1399.98px) and (min-width: 1200px) {
  body.zm-storefront-r9 .zoomag_logo_with_coins {
    --zm-coin-logo-size: clamp(176px, 10.2vw, 204px);
    --zm-coin-left-stage: clamp(82px, 5.5vw, 100px);
  }
}
@media (max-width: 1199.98px) and (min-width: 768px) {
  body.zm-storefront-r9 .zoomag_logo_with_coins {
    --zm-coin-logo-size: clamp(128px, 13vw, 156px);
    --zm-coin-left-stage: clamp(58px, 6vw, 74px);
  }
}
@media (max-width: 767.98px) {
  body.zm-storefront-r9 .zoomag_logo_with_coins {
    --zm-coin-logo-size: clamp(92px, 22vw, 118px);
    --zm-coin-left-stage: clamp(34px, 8vw, 44px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.zm-storefront-r9 .zoomag_logo_with_coins .coin.coin-slide-right {
    animation: none !important;
    opacity: 1 !important;
    transform: translate3d(calc(var(--zm-coin-left-stage) * -0.45), 0, 0) scale(1) !important;
  }
}
