/**
 * Category / Shop archive header — image band + tightened chrome.
 * Goal: Filters + start of product grid closer to first viewport
 * without gutting the brand (balanced tighten).
 */

/* -------------------------------------------------------------------------
 * 1) Space above breadcrumb (big gap under header on desktop)
 * Elementor archive section #shop-pottery / .elementor-element-0bbc5df
 * ------------------------------------------------------------------------- */
body.woocommerce-shop #shop-pottery.elementor-element-0bbc5df,
body.tax-product_cat #shop-pottery.elementor-element-0bbc5df,
body.post-type-archive-product #shop-pottery.elementor-element-0bbc5df,
body.woocommerce-shop .elementor-element-0bbc5df.elementor-top-section,
body.tax-product_cat .elementor-element-0bbc5df.elementor-top-section {
  padding-top: 14px !important; /* was 48px desktop / 16px mobile */
}

body.woocommerce-shop .elementor-element-0bbc5df > .elementor-container > .elementor-column > .elementor-widget-wrap,
body.tax-product_cat .elementor-element-0bbc5df > .elementor-container > .elementor-column > .elementor-widget-wrap {
  padding-top: 2px !important; /* was ~10px */
}

body.woocommerce-shop .elementor-widget-woocommerce-breadcrumb,
body.tax-product_cat .elementor-widget-woocommerce-breadcrumb,
body.post-type-archive-product .elementor-widget-woocommerce-breadcrumb {
  margin-top: 0 !important;
  margin-bottom: 8px !important; /* was 20px */
}

/* -------------------------------------------------------------------------
 * 2) H1 leading — lines were nearly touching (lh === font-size)
 * Widget container also had 30px / 10px vertical padding.
 * ------------------------------------------------------------------------- */
body.woocommerce-shop .elementor-widget-theme-archive-title .elementor-widget-container,
body.tax-product_cat .elementor-widget-theme-archive-title .elementor-widget-container,
body.post-type-archive-product .elementor-widget-theme-archive-title .elementor-widget-container {
  padding-top: 6px !important;  /* was 30px desktop / 10px mobile */
  padding-bottom: 6px !important;
}

body.woocommerce-shop .elementor-widget-theme-archive-title,
body.tax-product_cat .elementor-widget-theme-archive-title,
body.post-type-archive-product .elementor-widget-theme-archive-title {
  margin-bottom: 8px !important; /* was 20px */
}

body.woocommerce-shop .elementor-widget-theme-archive-title h1.elementor-heading-title,
body.tax-product_cat .elementor-widget-theme-archive-title h1.elementor-heading-title,
body.post-type-archive-product .elementor-widget-theme-archive-title h1.elementor-heading-title,
body.woocommerce-shop h1.elementor-heading-title.elementor-size-default,
body.tax-product_cat h1.elementor-heading-title.elementor-size-default {
  line-height: 1.3 !important; /* was 1.0 (45/45, 27/27) */
}

@media (max-width: 767px) {
  body.woocommerce-shop .elementor-widget-theme-archive-title h1.elementor-heading-title,
  body.tax-product_cat .elementor-widget-theme-archive-title h1.elementor-heading-title,
  body.post-type-archive-product .elementor-widget-theme-archive-title h1.elementor-heading-title,
  body.woocommerce-shop h1.elementor-heading-title.elementor-size-default,
  body.tax-product_cat h1.elementor-heading-title.elementor-size-default {
    font-size: 24px !important; /* was 27px — keeps multi-line H1 from exploding with new leading */
    line-height: 1.3 !important;
  }
}

/* -------------------------------------------------------------------------
 * Category archive image band — modest, centered, under intro / above filters.
 * ------------------------------------------------------------------------- */
.ecp-category-image-band {
  width: 100%;
  margin: 0.35rem auto 0; /* was 0.75rem / 0.25rem */
  padding: 0 1rem;
  box-sizing: border-box;
}

.ecp-category-image-band__inner {
  max-width: 720px;
  margin: 0 auto;
  border-radius: 6px;
  overflow: hidden;
  line-height: 0;
  background: #f5f2ee;
}

.ecp-category-image-band__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 140px; /* was 180px */
  object-fit: cover;
  object-position: center;
}

/* Hand-drawn Type-filter line art: contain on white, reduced visual weight. */
.ecp-category-image-band--hand-drawn .ecp-category-image-band__inner {
  max-width: 160px; /* was 280px (~43% width) */
  background: #fff;
  border-radius: 8px;
}

.ecp-category-image-band--hand-drawn .ecp-category-image-band__img {
  width: auto;
  max-width: 100%;
  max-height: 88px; /* was 160px (~45% height) */
  margin: 0.2rem auto;
  object-fit: contain;
  object-position: center;
}

@media (min-width: 768px) {
  .ecp-category-image-band {
    margin: 0.45rem auto 0; /* was 1rem / 0.35rem */
    padding: 0 1.25rem;
  }

  .ecp-category-image-band__inner {
    max-width: 840px;
  }

  .ecp-category-image-band__img {
    max-height: 180px; /* was 220px */
  }

  .ecp-category-image-band--hand-drawn .ecp-category-image-band__inner {
    max-width: 220px; /* was 320px */
  }

  .ecp-category-image-band--hand-drawn .ecp-category-image-band__img {
    max-height: 120px; /* was 200px */
    margin: 0.35rem auto;
  }
}

/* -------------------------------------------------------------------------
 * Mobile: hide hand-drawn / category image band (Malco — restore by removing).
 * Desktop keeps the (already smaller) art. Easy CSS-only toggle.
 * ------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .ecp-category-image-band {
    display: none !important;
  }
}

/* Collapse the Elementor spacer that sits between archive description and products
   when the image band is present — fills the white gap Malco boxed. */
body.ecp-has-category-image-band .elementor-widget-woocommerce-archive-description + .elementor-widget-spacer {
  display: none !important;
}

/* 4) Padding below image / between description ↔ art ↔ filter bar */
body.ecp-has-category-image-band .elementor-widget-woocommerce-archive-description,
body.woocommerce-shop .elementor-widget-woocommerce-archive-description,
body.tax-product_cat .elementor-widget-woocommerce-archive-description {
  margin-bottom: 4px !important; /* was 20px */
}

body.woocommerce-shop #ecp-filter-bar.ecp-filter-bar,
body.tax-product_cat #ecp-filter-bar.ecp-filter-bar {
  margin-top: 0 !important;
}


/* -------------------------------------------------------------------------
 * Product search chrome (WC archive template, not Elementor #179073)
 * Match Shop/category content width, centered archive title, no breadcrumb.
 * ------------------------------------------------------------------------- */
body.ecp-search-active .content-area,
body.ecp-search-active .site-main {
  max-width: 100% !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 4em !important;
  padding-right: 4em !important;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  body.ecp-search-active .content-area,
  body.ecp-search-active .site-main {
    padding-left: 2em !important;
    padding-right: 2em !important;
  }
}

@media (max-width: 767px) {
  body.ecp-search-active .content-area,
  body.ecp-search-active .site-main {
    padding-left: 1em !important;
    padding-right: 1em !important;
  }
}

/* Title: match Elementor theme-archive-title on categories
 * (widget 0e5eea3): Merriweather / primary navy #2A3A52, centered, 45/30/27.
 */
body.ecp-search-active .woocommerce-products-header {
  text-align: center;
  margin: 0 auto 0.35rem;
  padding: 1.5rem 1rem 0.5rem;
}

body.ecp-search-active .woocommerce-products-header__title,
body.ecp-search-active .woocommerce-products-header__title.page-title,
body.ecp-search-active h1.woocommerce-products-header__title {
  text-align: center !important;
  font-family: "Merriweather", serif !important;
  color: var(--e-global-color-primary, var(--ecp-navy, #2a3a52)) !important;
  font-size: 45px !important;
  font-weight: 500 !important;
  letter-spacing: normal !important;
  line-height: 1.3 !important;
  margin: 0 auto !important;
  float: none !important;
  width: 100% !important;
  max-width: 1180px;
  text-transform: none !important;
}

@media (max-width: 1024px) {
  body.ecp-search-active .woocommerce-products-header__title,
  body.ecp-search-active .woocommerce-products-header__title.page-title,
  body.ecp-search-active h1.woocommerce-products-header__title {
    font-size: 30px !important;
  }
}

@media (max-width: 767px) {
  body.ecp-search-active .woocommerce-products-header__title,
  body.ecp-search-active .woocommerce-products-header__title.page-title,
  body.ecp-search-active h1.woocommerce-products-header__title {
    font-size: 24px !important;
  }
}

/* Hide breadcrumb on product search */
body.ecp-search-active .woocommerce-breadcrumb,
body.ecp-search-active nav.woocommerce-breadcrumb,
body.ecp-search-active .woocommerce-breadcrumb-wrapper {
  display: none !important;
}
