/*
 * ZUVA Hakoura Universal 10.10 — catalogue alignment refinement.
 * Presentation only: no product, price, cart, add-on, API or checkout logic.
 */

/* Website catalogue only. The installed PWA receives its own list treatment. */
html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) .wp-block-woocommerce-product-template,
html:not(.zuva-pwa-standalone) body.zuva-universal-theme .zuva-universal-shop .wp-block-woocommerce-product-template {
  align-items: stretch !important;
}

html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) .wc-block-product,
html:not(.zuva-pwa-standalone) body.zuva-universal-theme .zuva-universal-shop .wc-block-product {
  display: grid !important;
  grid-template-rows: auto 66px 82px 34px 66px !important;
  align-content: start !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  text-align: center !important;
}

html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) .wc-block-product > :is(.wc-block-components-product-image,.wp-block-woocommerce-product-image),
html:not(.zuva-pwa-standalone) body.zuva-universal-theme .zuva-universal-shop .wc-block-product > :is(.wc-block-components-product-image,.wp-block-woocommerce-product-image) {
  grid-row: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) .wc-block-product :is(.wp-block-post-title,.wc-block-components-product-title),
html:not(.zuva-pwa-standalone) body.zuva-universal-theme .zuva-universal-shop .wc-block-product :is(.wp-block-post-title,.wc-block-components-product-title) {
  grid-row: 2 !important;
  display: -webkit-box !important;
  align-self: center !important;
  width: calc(100% - 36px) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-height: 2.3em !important;
  margin: 0 auto !important;
  padding: 8px 0 0 !important;
  overflow: hidden !important;
  font-size: clamp(1.48rem, 2vw, 1.78rem) !important;
  line-height: 1.08 !important;
  text-align: center !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}

html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) .wc-block-product :is(.wp-block-woocommerce-product-summary,.wc-block-components-product-summary,.wp-block-post-excerpt),
html:not(.zuva-pwa-standalone) body.zuva-universal-theme .zuva-universal-shop .wc-block-product :is(.wp-block-woocommerce-product-summary,.wc-block-components-product-summary,.wp-block-post-excerpt) {
  grid-row: 3 !important;
  display: -webkit-box !important;
  align-self: center !important;
  width: min(100% - 38px, 260px) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-height: 4.5em !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: hidden !important;
  color: rgba(40,37,31,.66) !important;
  font-size: clamp(.88rem, 1.05vw, 1rem) !important;
  line-height: 1.46 !important;
  text-align: center !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  hyphens: none !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
}

html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) .wc-block-product :is(.wp-block-woocommerce-product-summary,.wc-block-components-product-summary,.wp-block-post-excerpt) :is(p,div),
html:not(.zuva-pwa-standalone) body.zuva-universal-theme .zuva-universal-shop .wc-block-product :is(.wp-block-woocommerce-product-summary,.wc-block-components-product-summary,.wp-block-post-excerpt) :is(p,div) {
  margin: 0 !important;
  padding: 0 !important;
  line-height: inherit !important;
}

html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) .wc-block-product :is(.wp-block-woocommerce-product-price,.wc-block-components-product-price),
html:not(.zuva-pwa-standalone) body.zuva-universal-theme .zuva-universal-shop .wc-block-product :is(.wp-block-woocommerce-product-price,.wc-block-components-product-price) {
  position: static !important;
  grid-row: 4 !important;
  display: flex !important;
  min-height: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 18px 2px !important;
  line-height: 1 !important;
  transform: none !important;
}

html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) .wc-block-product :is(.wp-block-woocommerce-product-button,.wc-block-components-product-button,.zuva-customize-button-wrap),
html:not(.zuva-pwa-standalone) body.zuva-universal-theme .zuva-universal-shop .wc-block-product :is(.wp-block-woocommerce-product-button,.wc-block-components-product-button,.zuva-customize-button-wrap) {
  grid-row: 5 !important;
  display: flex !important;
  width: 100% !important;
  height: 66px !important;
  min-height: 66px !important;
  max-height: 66px !important;
  flex: none !important;
  align-items: flex-start !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 4px 18px 18px !important;
  aspect-ratio: auto !important;
  box-sizing: border-box !important;
}

html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) .wc-block-product :is(.wp-block-woocommerce-product-button,.wc-block-components-product-button,.zuva-customize-button-wrap) > :is(a,button),
html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) .wc-block-product .zuva-customize-product-link,
html:not(.zuva-pwa-standalone) body.zuva-universal-theme .zuva-universal-shop .wc-block-product :is(.wp-block-woocommerce-product-button,.wc-block-components-product-button,.zuva-customize-button-wrap) > :is(a,button),
html:not(.zuva-pwa-standalone) body.zuva-universal-theme .zuva-universal-shop .wc-block-product .zuva-customize-product-link {
  width: min(184px, calc(100% - 4px)) !important;
  max-width: 184px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  margin: 0 auto !important;
}

/* Classic WooCommerce loop fallback. */
html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) ul.products li.product {
  display: flex !important;
  height: 100% !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) ul.products li.product :is(.woocommerce-loop-product__title,.zuva-loop-short-description,.price) {
  width: calc(100% - 38px) !important;
  margin-inline: auto !important;
  text-align: center !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
}

html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) ul.products li.product .zuva-loop-short-description {
  display: -webkit-box !important;
  min-height: 4.38em !important;
  max-height: 4.38em !important;
  margin-block: 8px 10px !important;
  overflow: hidden !important;
  line-height: 1.46 !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
}

html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) ul.products li.product .price {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
}

html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) ul.products li.product > :is(.button,.zuva-customize-product-link) {
  margin: 0 auto 18px !important;
}

@media (max-width: 980px) and (min-width: 783px) {
  html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) .wc-block-product,
  html:not(.zuva-pwa-standalone) body.zuva-universal-theme .zuva-universal-shop .wc-block-product {
    grid-template-rows: auto 62px 80px 32px 64px !important;
  }
}

@media (max-width: 782px) {
  /* Public responsive website keeps its grid, but the text remains readable. */
  html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) .wc-block-product,
  html:not(.zuva-pwa-standalone) body.zuva-universal-theme .zuva-universal-shop .wc-block-product {
    grid-template-rows: auto 58px 76px 31px 62px !important;
  }

  html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) .wc-block-product :is(.wp-block-post-title,.wc-block-components-product-title),
  html:not(.zuva-pwa-standalone) body.zuva-universal-theme .zuva-universal-shop .wc-block-product :is(.wp-block-post-title,.wc-block-components-product-title) {
    width: calc(100% - 24px) !important;
    font-size: clamp(1.32rem, 6vw, 1.58rem) !important;
  }

  html:not(.zuva-pwa-standalone) body.zuva-universal-theme:is(.woocommerce-shop,.post-type-archive-product,.tax-product_cat,.tax-product_tag) .wc-block-product :is(.wp-block-woocommerce-product-summary,.wc-block-components-product-summary,.wp-block-post-excerpt),
  html:not(.zuva-pwa-standalone) body.zuva-universal-theme .zuva-universal-shop .wc-block-product :is(.wp-block-woocommerce-product-summary,.wc-block-components-product-summary,.wp-block-post-excerpt) {
    width: calc(100% - 24px) !important;
    font-size: .82rem !important;
    line-height: 1.42 !important;
  }
}
