/* HEMPCITY Frontend v6.5.2 — archive + cart structural hotfix */

/* =========================================================
   CATEGORY ARCHIVES — one visual system everywhere
   ========================================================= */
body.tax-product_cat .site-main,
body.tax-product_cat #primary,
body.tax-product_cat .ast-container,
body.tax-product_cat .content-area {
  max-width: none !important;
}

body.tax-product_cat .hc-category-hero,
body.tax-product_cat .hc-archive-subcategories,
body.tax-product_cat .woocommerce-notices-wrapper,
body.tax-product_cat .woocommerce-result-count,
body.tax-product_cat .woocommerce-ordering,
body.tax-product_cat ul.products,
body.tax-product_cat .woocommerce-pagination,
body.tax-product_cat .hc-archive-assurance {
  width: min(calc(100% - 64px), var(--hc-container, 1440px)) !important;
  max-width: var(--hc-container, 1440px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

body.tax-product_cat .hc-archive-subcategories {
  padding: clamp(64px, 7vw, 104px) 0 clamp(54px, 6vw, 88px) !important;
}
body.tax-product_cat .hc-archive-subcategories__heading {
  margin-bottom: 34px !important;
}
body.tax-product_cat .hc-archive-subcategories__grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 22px !important;
}
body.tax-product_cat .hc-archive-subcategory {
  min-height: 330px !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}

/* WooCommerce native child-category cards receive the same premium treatment.
   This is the fallback when a taxonomy/theme renders children itself. */
body.tax-product_cat ul.products li.product-category {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  min-height: 330px !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #111 !important;
  box-shadow: 0 18px 46px rgba(17,17,17,.10) !important;
}
body.tax-product_cat ul.products li.product-category > a {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  padding: 24px !important;
  color: #fff !important;
  text-decoration: none !important;
}
body.tax-product_cat ul.products li.product-category > a::after {
  content: "→" !important;
  position: absolute !important;
  right: 24px !important;
  bottom: 25px !important;
  z-index: 3 !important;
  color: #fff !important;
  font-size: 30px !important;
  line-height: 1 !important;
}
body.tax-product_cat ul.products li.product-category img {
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: cover !important;
  opacity: .78 !important;
  transition: transform .45s ease, opacity .45s ease !important;
}
body.tax-product_cat ul.products li.product-category > a::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  background: linear-gradient(180deg, rgba(0,0,0,.02) 28%, rgba(0,0,0,.94) 100%) !important;
}
body.tax-product_cat ul.products li.product-category .woocommerce-loop-category__title {
  position: relative !important;
  z-index: 2 !important;
  margin: 0 44px 0 0 !important;
  color: #fff !important;
  font-size: clamp(25px, 2vw, 34px) !important;
  font-weight: 780 !important;
  line-height: 1.05 !important;
  letter-spacing: -.035em !important;
}
body.tax-product_cat ul.products li.product-category .count {
  display: block !important;
  margin-top: 10px !important;
  background: transparent !important;
  color: rgba(255,255,255,.72) !important;
  font-size: 13px !important;
  font-weight: 650 !important;
}
body.tax-product_cat ul.products li.product-category:hover img {
  transform: scale(1.035) !important;
  opacity: .9 !important;
}

/* Product grid starts cleanly after optional child categories. */
body.tax-product_cat .woocommerce-result-count {
  float: none !important;
  display: block !important;
  margin-top: 0 !important;
  margin-bottom: 18px !important;
}
body.tax-product_cat .woocommerce-ordering {
  float: none !important;
  display: block !important;
  margin-bottom: 28px !important;
}
body.tax-product_cat .woocommerce-ordering select {
  width: 100% !important;
  min-height: 52px !important;
}

/* =========================================================
   CART BLOCK — fix the actual WooCommerce Blocks structure
   ========================================================= */
body.woocommerce-cart .entry-header,
body.woocommerce-cart .entry-title {
  width: min(calc(100% - 64px), var(--hc-container, 1440px)) !important;
  max-width: var(--hc-container, 1440px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
body.woocommerce-cart .entry-content,
body.woocommerce-cart .entry-content > .wp-block-woocommerce-cart,
body.woocommerce-cart .wp-block-woocommerce-cart {
  width: min(calc(100% - 64px), var(--hc-container, 1440px)) !important;
  max-width: var(--hc-container, 1440px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.woocommerce-cart .wc-block-components-sidebar-layout,
body.woocommerce-cart .wc-block-cart .wc-block-components-sidebar-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1.85fr) minmax(340px, .82fr) !important;
  gap: clamp(28px, 4vw, 60px) !important;
  align-items: start !important;
  width: 100% !important;
  max-width: none !important;
}
body.woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-main,
body.woocommerce-cart .wc-block-cart__main {
  grid-column: 1 !important;
  width: 100% !important;
  max-width: none !important;
  flex-basis: auto !important;
  padding: 0 !important;
  margin: 0 !important;
}
body.woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-sidebar,
body.woocommerce-cart .wc-block-cart__sidebar {
  grid-column: 2 !important;
  position: sticky !important;
  top: 112px !important;
  width: 100% !important;
  max-width: none !important;
  flex-basis: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  align-self: start !important;
}
body.woocommerce-cart .wc-block-cart-items {
  width: 100% !important;
  table-layout: fixed !important;
  border: 1px solid var(--hc-line, #e3e1db) !important;
  border-radius: 12px !important;
  background: #fff !important;
  overflow: hidden !important;
}
body.woocommerce-cart .wc-block-cart-items__header {
  background: var(--hc-surface-soft, #f6f5f2) !important;
}
body.woocommerce-cart .wc-block-cart-items__row {
  min-height: 190px !important;
}
body.woocommerce-cart .wc-block-cart-item__image {
  width: 128px !important;
  padding: 24px 12px 24px 24px !important;
}
body.woocommerce-cart .wc-block-cart-item__image img {
  width: 104px !important;
  height: 104px !important;
  object-fit: contain !important;
}
body.woocommerce-cart .wc-block-cart-item__product {
  padding: 24px 18px !important;
}
body.woocommerce-cart .wc-block-cart-item__total {
  width: 130px !important;
  padding: 24px !important;
  text-align: right !important;
}
body.woocommerce-cart .wc-block-components-sidebar {
  border: 1px solid var(--hc-line, #e3e1db) !important;
  border-radius: 12px !important;
  background: var(--hc-surface-soft, #f6f5f2) !important;
  overflow: hidden !important;
}
body.woocommerce-cart .wc-block-components-sidebar > * {
  padding-left: 28px !important;
  padding-right: 28px !important;
}
body.woocommerce-cart .wc-block-cart__submit {
  padding: 0 28px 28px !important;
}
body.woocommerce-cart .wc-block-cart__submit-button {
  min-height: 60px !important;
  width: 100% !important;
  border-radius: 7px !important;
  background: #111 !important;
  color: #fff !important;
  font-weight: 760 !important;
}

body.woocommerce-cart .hc-cart-recommendations {
  clear: both !important;
  width: min(calc(100% - 64px), var(--hc-container, 1440px)) !important;
  max-width: var(--hc-container, 1440px) !important;
  margin: 72px auto 0 !important;
  padding: 64px 0 0 !important;
  border-top: 1px solid var(--hc-line, #e3e1db) !important;
}
body.woocommerce-cart .hc-cart-recommendations ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 22px !important;
}
body.woocommerce-cart .hc-cart-recommendations ul.products li.product {
  width: auto !important;
  margin: 0 !important;
}

@media (max-width: 1100px) {
  body.tax-product_cat .hc-archive-subcategories__grid,
  body.tax-product_cat ul.products.columns-4:has(li.product-category) {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  }
  body.woocommerce-cart .wc-block-components-sidebar-layout,
  body.woocommerce-cart .wc-block-cart .wc-block-components-sidebar-layout {
    grid-template-columns: 1fr !important;
  }
  body.woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-main,
  body.woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-sidebar,
  body.woocommerce-cart .wc-block-cart__main,
  body.woocommerce-cart .wc-block-cart__sidebar {
    grid-column: 1 !important;
  }
  body.woocommerce-cart .wc-block-components-sidebar-layout .wc-block-components-sidebar,
  body.woocommerce-cart .wc-block-cart__sidebar {
    position: static !important;
  }
  body.woocommerce-cart .hc-cart-recommendations ul.products {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  }
}

@media (max-width: 640px) {
  body.tax-product_cat .hc-category-hero,
  body.tax-product_cat .hc-archive-subcategories,
  body.tax-product_cat .woocommerce-notices-wrapper,
  body.tax-product_cat .woocommerce-result-count,
  body.tax-product_cat .woocommerce-ordering,
  body.tax-product_cat ul.products,
  body.tax-product_cat .woocommerce-pagination,
  body.tax-product_cat .hc-archive-assurance,
  body.woocommerce-cart .entry-header,
  body.woocommerce-cart .entry-title,
  body.woocommerce-cart .entry-content,
  body.woocommerce-cart .entry-content > .wp-block-woocommerce-cart,
  body.woocommerce-cart .wp-block-woocommerce-cart,
  body.woocommerce-cart .hc-cart-recommendations {
    width: calc(100% - 32px) !important;
  }
  body.tax-product_cat .hc-archive-subcategories__grid {
    grid-template-columns: 1fr !important;
  }
  body.tax-product_cat ul.products li.product-category {
    min-height: 300px !important;
  }
  body.woocommerce-cart .wc-block-cart-item__image {
    width: 88px !important;
    padding: 18px 8px 18px 16px !important;
  }
  body.woocommerce-cart .wc-block-cart-item__image img {
    width: 72px !important;
    height: 72px !important;
  }
  body.woocommerce-cart .wc-block-cart-item__product {
    padding: 18px 12px !important;
  }
  body.woocommerce-cart .wc-block-cart-item__total {
    width: auto !important;
    padding: 18px 16px 18px 0 !important;
  }
}
