/*
 * Cloud Heaven storefront layout foundation.
 *
 * Device-neutral structure lives here. Desktop, tablet and mobile geometry is
 * owned by the three media-scoped layout files.
 */

:root {
  --ch-content-width: 1240px;
  --ch-wide-content-width: 1500px;
  --ch-gutter: clamp(18px, 3vw, 32px);
  --ch-section-space: clamp(42px, 6vw, 84px);
  --ch-grid-gap: clamp(18px, 2.2vw, 28px);
  --ch-card-radius: 8px;
  --ch-card-border: rgba(10, 10, 10, 0.07);
  --ch-card-shadow: 0 12px 32px rgba(10, 10, 10, 0.045);
  --ch-product-card-title-min: 3.6em;
  --ch-product-card-price-min: 34px;
  --ch-product-card-action-min: 136px;
  --ch-product-media-max: 650px;
  --ch-product-summary-max: 500px;
  --ch-product-gap: 42px;
}

body.woocommerce-page .ch-theme-wc-page,
body.single-product .ch-theme-wc-page {
  box-sizing: border-box;
  max-width: none;
  margin-inline: auto;
}

body.woocommerce-shop .ch-theme-catalog-page,
body.tax-product_cat .ch-theme-catalog-page,
body.tax-product_tag .ch-theme-catalog-page {
  width: 100%;
  max-width: none;
  padding-inline: 0;
}

.cloud-heaven-catalog-section {
  width: 100%;
  padding-inline: max(var(--ch-gutter), calc((100vw - var(--ch-wide-content-width)) / 2));
}

.cloud-heaven-catalog-grid {
  width: 100%;
}

.cloud-heaven-catalog-pagination {
  display: flex;
  justify-content: center;
  margin-top: 42px;
}

.woocommerce-result-count,
.woocommerce-ordering,
.woocommerce .woocommerce-ordering {
  display: none;
}

.product-grid,
.woocommerce ul.products {
  box-sizing: border-box;
  display: grid;
  width: 100%;
  margin: 0;
  padding: 0;
  align-items: stretch;
  grid-auto-rows: 1fr;
  list-style: none;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
  display: none;
}

.woocommerce ul.products li.product,
.woocommerce ul.products li.product.product-card,
.woocommerce ul.products li.product.ch-product-card,
.product-card,
.product-card.ch-product-card {
  box-sizing: border-box;
  display: grid;
  float: none;
  clear: none;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--ch-card-border);
  border-radius: var(--ch-card-radius);
  background: #fff;
  box-shadow: var(--ch-card-shadow);
  justify-self: stretch;
  text-align: center;
}

.product-card .product-card-media,
.woocommerce ul.products li.product.product-card .product-card-media {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f7f7f3;
}

.product-card .product-card-image,
.product-card .product-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: cover;
  object-position: center;
}

.product-card .product-card-body {
  box-sizing: border-box;
  display: grid;
  width: 100%;
  min-width: 0;
  height: 100%;
  grid-template-rows:
    minmax(var(--ch-product-card-title-min), auto)
    minmax(var(--ch-product-card-price-min), auto)
    minmax(var(--ch-product-card-action-min), 1fr);
  align-content: start;
  gap: 10px;
  padding: 18px;
  text-align: center;
}

.product-card .product-card-body h3,
.woocommerce ul.products li.product.product-card .woocommerce-loop-product__title {
  width: 100%;
  min-width: 0;
  min-height: var(--ch-product-card-title-min);
  max-height: var(--ch-product-card-title-min);
  margin: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.18;
}

.product-card .product-card-body .price,
.product-card .product-card-status {
  display: flex;
  width: 100%;
  min-height: var(--ch-product-card-price-min);
  align-items: center;
  justify-content: center;
  margin: 0;
  line-height: 1.25;
}

.product-card .product-card-actions {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: var(--ch-product-card-action-min);
  align-self: end;
  align-content: end;
  gap: 10px;
}

.product-card .product-card-form {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 0;
  align-self: end;
  align-content: end;
  gap: 10px;
}

.product-card .product-card-variations {
  display: grid;
  width: 100%;
  min-height: 79px;
  grid-template-columns: repeat(2, minmax(48px, max-content));
  justify-content: center;
  gap: 7px;
}

.product-card .product-card-variation {
  min-width: 48px;
  min-height: 36px;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid rgba(10, 10, 10, 0.14);
  border-radius: 999px;
  background: #fff;
  color: var(--color-black, #0a0a0a);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.product-card .product-card-variation[aria-pressed="true"],
.product-card .product-card-variation.is-selected {
  border-color: var(--color-accent-dark, #63765f);
  background: var(--color-accent, #8a9d83);
  color: #fff;
}

.product-card .product-card-actions .button,
.product-card .product-card-actions a.button,
.product-card .product-card-submit,
.woocommerce ul.products li.product.product-card .product-card-actions .button,
.woocommerce ul.products li.product.product-card .product-card-actions a.button {
  width: 100%;
  min-width: 0;
  height: auto;
  padding-inline: 14px;
  overflow-wrap: anywhere;
  line-height: 1.12;
  white-space: normal;
}

/* WooCommerce and FlexSlider write floats/inline widths. These resets are the
 * narrow compatibility layer that keeps product media inside the theme grid. */
body.single-product .woocommerce div.product::before,
body.single-product .woocommerce div.product::after,
.woocommerce ul.products::before,
.woocommerce ul.products::after {
  display: none !important;
}

body.single-product .woocommerce div.product div.images,
body.single-product .woocommerce div.product div.images .flex-viewport,
body.single-product .woocommerce div.product div.images .woocommerce-product-gallery__wrapper,
body.single-product .woocommerce div.product div.images .woocommerce-product-gallery__image,
body.single-product .woocommerce div.product div.images .woocommerce-product-gallery__image > a {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none;
  min-width: 0;
}

body.single-product .woocommerce div.product div.images,
body.single-product .woocommerce div.product div.images .woocommerce-product-gallery__image,
body.single-product .woocommerce ul.products li.product {
  float: none !important;
  clear: none !important;
}

body.single-product .woocommerce div.product div.images .flex-viewport {
  overflow: hidden;
}

body.single-product .woocommerce div.product div.images .woocommerce-product-gallery__wrapper,
body.single-product .woocommerce div.product div.images .woocommerce-product-gallery__image {
  margin: 0 !important;
}

body.single-product .woocommerce div.product div.images .woocommerce-product-gallery__image > a {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

body.single-product .woocommerce div.product div.images .woocommerce-product-gallery__image img,
body.single-product .woocommerce div.product div.images .woocommerce-product-gallery__image > a img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  object-fit: cover !important;
  object-position: center;
}

body.single-product .woocommerce div.product div.summary {
  box-sizing: border-box;
  float: none !important;
  min-width: 0;
  margin: 0;
}

body.single-product .woocommerce div.product .woocommerce-tabs,
body.single-product .woocommerce div.product .related.products,
body.single-product .woocommerce div.product .upsells.products {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  min-width: 0;
}

body.single-product .woocommerce div.product .related.products ul.products,
body.single-product .woocommerce div.product .upsells.products ul.products {
  display: grid;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0;
  align-items: stretch;
}

body.single-product .woocommerce div.product .related.products ul.products li.product,
body.single-product .woocommerce div.product .upsells.products ul.products li.product {
  width: 100% !important;
  max-width: none;
  min-width: 0;
  margin: 0;
}
