/* Catalog archive — match /products/ feel */
.ihao-catalog-wrap {
  display: block;
  width: 100%;
  flex: 1 0 100%;
  max-width: 100%;
}

.ast-container:has(.ihao-catalog-wrap) {
  flex-wrap: wrap;
}

/* Full-bleed hero like /products/ Spectra banner */
.ihao-catalog-hero {
  display: block;
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-bottom: 0;
  flex: 1 0 100%;
}

.ihao-catalog-hero-inner > .wp-block-spectra-container,
.ihao-catalog-hero-inner > .spectra-container,
.ihao-catalog-hero-inner > [class*="spectra"] {
  max-width: none !important;
}

.ihao-catalog-hero-banner,
.ihao-catalog-hero-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 520px;
  padding: 220px 20px 160px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-color: #0f172a;
  box-shadow: inset 0 0 0 2000px rgba(15, 23, 42, 0.5);
}

.ihao-catalog-hero-title {
  margin: 0;
  color: #fff !important;
  text-align: center;
  text-transform: capitalize;
  font-size: clamp(2rem, 4vw, 3.25rem);
  letter-spacing: 0.02em;
  font-weight: 600;
}

/* Transparent header sits over hero like /products/ */
body.ihao-catalog-has-hero.ast-theme-transparent-header .ihao-catalog-hero {
  margin-top: 0;
}

/*
 * Astra transparent header is position:absolute, but shop archives still
 * leave a white gap before content. Pull the hero up under the header.
 */
body.ihao-catalog-has-hero.ast-theme-transparent-header #content > .ast-container {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

body.ihao-catalog-has-hero.ast-theme-transparent-header .ihao-catalog-wrap {
  margin-top: -70px;
}

body.ihao-catalog-has-hero.ast-theme-transparent-header .ihao-catalog-hero-banner,
body.ihao-catalog-has-hero.ast-theme-transparent-header .ihao-catalog-hero-fallback {
  padding-top: 250px;
  min-height: 560px;
}

body.ihao-catalog-has-hero.ast-theme-transparent-header #content,
body.ihao-catalog-has-hero.ast-theme-transparent-header .site-content {
  padding-top: 0 !important;
}

body.ihao-catalog-has-hero .ast-breadcrumbs-wrapper,
body.ihao-catalog-has-hero .woocommerce-breadcrumb,
body.ihao-catalog-has-hero .ast-archive-entry-banner,
body.ihao-catalog-has-hero .ast-archive-description,
body.ihao-catalog-has-hero .ast-breadcrumbs {
  display: none !important;
}

/* Keep header text/logo readable on dark hero */
body.ihao-catalog-has-hero.ast-theme-transparent-header .main-header-bar,
body.ihao-catalog-has-hero.ast-theme-transparent-header .ast-primary-header-bar,
body.ihao-catalog-has-hero.ast-theme-transparent-header #masthead,
body.ihao-catalog-has-hero.ast-theme-transparent-header .ast-builder-grid-row-container-inner {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

body.ihao-catalog-has-hero.ast-theme-transparent-header .site-title a,
body.ihao-catalog-has-hero.ast-theme-transparent-header .site-description,
body.ihao-catalog-has-hero.ast-theme-transparent-header .main-header-menu > .menu-item > .menu-link,
body.ihao-catalog-has-hero.ast-theme-transparent-header .ast-builder-menu .menu-link,
body.ihao-catalog-has-hero.ast-theme-transparent-header .ast-header-button-1 .ast-custom-button {
  color: #fff !important;
}

body.ihao-catalog-has-hero.ast-theme-transparent-header .site-logo-img img {
  /* Prefer light/transparent logo variants if present */
  filter: none;
}

@media (max-width: 921px) {
  .ihao-catalog-hero-banner,
  .ihao-catalog-hero-fallback {
    min-height: 320px;
    padding: 140px 20px 110px;
    background-attachment: scroll;
  }
}

/* Hide duplicate Woo title when hero is present */
.ihao-catalog-wrap .woocommerce-products-header__title {
  display: none;
}

/* Category description is intentionally not shown on catalog listings. */
.ihao-catalog-wrap .term-description,
.ihao-catalog-main .term-description,
.ihao-catalog-main .woocommerce-products-header .term-description,
.ihao-catalog-wrap .woocommerce-products-header__description {
  display: none !important;
}

.ihao-catalog-wrap .woocommerce-result-count,
.ihao-catalog-wrap .woocommerce-ordering {
  display: none !important;
}

.ihao-catalog-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

.ihao-catalog-sidebar {
  position: sticky;
  top: 6rem;
}

.ihao-cat-tree,
.ihao-cat-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ihao-cat-tree > li {
  margin: 0 0 0.65rem;
}

.ihao-cat-tree a {
  color: #1f2937;
  text-decoration: none;
  font-size: 0.95rem;
}

.ihao-cat-tree a:hover,
.ihao-cat-tree .current-cat > a,
.ihao-cat-tree .current-cat-parent > a {
  color: #0f172a;
  font-weight: 600;
}

.ihao-cat-tree .children {
  margin: 0.4rem 0 0.75rem 0.9rem;
}

.ihao-catalog-main .woocommerce-products-header__title {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
}

body.woocommerce ul.products,
body.woocommerce-page ul.products {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 1.75rem 1.5rem;
  list-style: none !important;
  margin: 0 0 2rem !important;
  padding: 0 !important;
  width: 100% !important;
  float: none !important;
}

body.woocommerce ul.products::before,
body.woocommerce ul.products::after,
body.woocommerce-page ul.products::before,
body.woocommerce-page ul.products::after {
  display: none !important;
  content: none !important;
}

body.woocommerce ul.products li.product,
body.woocommerce-page ul.products li.product {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
  clear: none !important;
  text-align: center;
}

body.woocommerce ul.products li.product a img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  margin: 0 0 0.75rem;
}

body.woocommerce ul.products li.product .button,
body.woocommerce ul.products li.product a.button,
body.woocommerce ul.products li.product .add_to_cart_button {
  display: none !important;
}

.ihao-catalog-bottom {
  display: block;
  width: 100%;
  flex: 1 0 100%;
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid #e5e7eb;
  clear: both;
}

@media (max-width: 921px) {
  .ihao-catalog-layout {
    grid-template-columns: 1fr;
  }
  .ihao-catalog-sidebar {
    position: static;
  }
  body.woocommerce ul.products,
  body.woocommerce-page ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 544px) {
  body.woocommerce ul.products,
  body.woocommerce-page ul.products {
    grid-template-columns: 1fr;
  }
}
