/* Product category hero: upgrades Luchiana's existing semantic archive header. */
body.hpds-category-hero-active {
  --hpds-category-hero-height: 26.25rem;
  --hpds-category-hero-position: center;
}

body.hpds-category-hero--compact { --hpds-category-hero-height: 22.5rem; }
body.hpds-category-hero--standard { --hpds-category-hero-height: 26.25rem; }
body.hpds-category-hero--tall { --hpds-category-hero-height: 31.25rem; }
body.hpds-category-hero--focal-right { --hpds-category-hero-position: right center; }
body.hpds-category-hero--focal-center { --hpds-category-hero-position: center; }
body.hpds-category-hero--focal-left { --hpds-category-hero-position: left center; }

body.hpds-category-hero-active .c-page-header--product-list {
  background:
    radial-gradient(circle at 82% 20%, color-mix(in srgb, var(--hpds-color-accent-soft) 42%, transparent) 0 7rem, transparent 7.1rem),
    linear-gradient(135deg, color-mix(in srgb, var(--hpds-color-mist) 82%, white), var(--hpds-color-surface));
  border: 1px solid color-mix(in srgb, var(--hpds-color-border) 72%, transparent);
  border-radius: 0 0 clamp(1.75rem, 4vw, 3.5rem) clamp(1.75rem, 4vw, 3.5rem);
  box-sizing: border-box;
  direction: ltr;
  display: grid;
  gap: clamp(1rem, 2.8vw, 2.75rem);
  grid-template-areas:
    "media copy"
    "media breadcrumb"
    "orbit orbit";
  grid-template-columns: minmax(20rem, 1.15fr) minmax(18rem, .85fr);
  grid-template-rows: auto 1fr auto;
  inline-size: min(calc(100% - (2 * var(--hpds-gutter))), 110rem);
  margin: clamp(1rem, 2vw, 2rem) auto clamp(2rem, 4vw, 3.5rem);
  min-block-size: var(--hpds-category-hero-height);
  overflow: hidden;
  padding: clamp(2rem, 4vw, 4.5rem) clamp(1.5rem, 5vw, 5.5rem) 0;
  position: relative;
  isolation: isolate;
}

body.hpds-category-hero-active .c-page-header--product-list::before {
  align-self: stretch;
  background-color: color-mix(in srgb, var(--hpds-color-accent-soft) 35%, var(--hpds-color-surface));
  background-image: var(--hpds-category-hero-image);
  background-position: var(--hpds-category-hero-position);
  background-repeat: no-repeat;
  background-size: cover;
  border: clamp(.45rem, .8vw, .8rem) solid color-mix(in srgb, var(--hpds-color-surface) 84%, transparent);
  border-radius: 51% 49% 44% 56% / 57% 42% 58% 43%;
  box-shadow: 0 1.5rem 4rem rgb(38 26 23 / 14%);
  content: "";
  grid-area: media;
  justify-self: stretch;
  min-block-size: clamp(14rem, 24vw, 23rem);
  transform: rotate(-1.2deg);
  z-index: -1;
}

body.hpds-category-hero-active .c-page-header__wrap {
  align-self: end;
  direction: rtl;
  grid-area: copy;
  margin: 0;
  max-inline-size: 36rem;
  padding: 0;
  position: relative;
  text-align: start;
}

body.hpds-category-hero-active .c-page-header__wrap::before {
  color: var(--hpds-color-link);
  content: "HAIRPORT / CATEGORY";
  display: block;
  font-family: var(--hpds-font-sans);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .16em;
  margin-block-end: .9rem;
}

body.hpds-category-hero-active .c-page-header__title {
  color: var(--hpds-color-text);
  font-family: var(--hpds-font-display);
  font-size: clamp(2.25rem, 4.3vw, 4.8rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: .98;
  margin: 0;
  max-inline-size: 11ch;
  text-wrap: balance;
}

body.hpds-category-hero-active .hpds-category-hero__description {
  color: var(--hpds-color-text-muted);
  font-size: clamp(.95rem, 1.35vw, 1.12rem);
  line-height: 1.65;
  margin: 1.15rem 0 0;
  max-inline-size: 35rem;
}

body.hpds-category-hero-active .c-page-header--product-list > .c-breadcrumbs {
  align-self: start;
  direction: rtl;
  grid-area: breadcrumb;
  margin: 0;
  padding: 0;
  text-align: start;
}

body.hpds-category-hero-active .c-breadcrumbs__list {
  justify-content: flex-start;
}

body.hpds-category-hero-active .c-breadcrumbs__item,
body.hpds-category-hero-active .c-breadcrumbs__item a {
  color: var(--hpds-color-text-muted);
  font-size: .78rem;
}

body.hpds-category-hero-active .c-page-header__sub-cat {
  align-self: end;
  background: color-mix(in srgb, var(--hpds-color-surface) 94%, transparent);
  border-block-start: 1px solid color-mix(in srgb, var(--hpds-color-border) 72%, transparent);
  direction: rtl;
  grid-area: orbit;
  margin: clamp(1.3rem, 3vw, 3rem) calc(clamp(1.5rem, 5vw, 5.5rem) * -1) 0;
  min-inline-size: 0;
  padding: 1rem clamp(1.25rem, 4vw, 4rem) 1.2rem;
}

body.hpds-category-hero-active .c-page-header__sub-cat-list {
  align-items: flex-start;
  display: flex !important;
  gap: clamp(.8rem, 1.5vw, 1.35rem);
  inline-size: 100% !important;
  justify-content: flex-start;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: .2rem .1rem .55rem;
  scroll-snap-type: inline proximity;
  scrollbar-color: color-mix(in srgb, var(--hpds-color-accent) 55%, transparent) transparent;
  scrollbar-width: thin;
  transform: none !important;
}

body.hpds-category-hero-active .c-page-header__sub-cat-item {
  flex: 0 0 clamp(5.5rem, 7vw, 7.1rem) !important;
  inline-size: auto !important;
  margin: 0 !important;
  scroll-snap-align: start;
}

body.hpds-category-hero-active .c-page-header__sub-cat-item > a {
  align-items: center;
  color: var(--hpds-color-text);
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-block-size: 100%;
  text-decoration: none;
}

body.hpds-category-hero-active .c-sub-categories__thumb-wrap {
  align-items: center;
  background: linear-gradient(145deg, var(--hpds-color-surface), var(--hpds-color-surface-subtle));
  border: 1px solid var(--hpds-color-border);
  border-radius: 50%;
  box-shadow: 0 .5rem 1.5rem rgb(38 26 23 / 7%);
  display: flex;
  inline-size: clamp(4.5rem, 5.6vw, 5.6rem);
  block-size: clamp(4.5rem, 5.6vw, 5.6rem);
  justify-content: center;
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

body.hpds-category-hero-active .c-sub-categories__thumb-wrap img {
  block-size: 100%;
  inline-size: 100%;
  object-fit: cover;
}

body.hpds-category-hero-active .hpds-category-orbit__fallback {
  align-items: center;
  color: var(--hpds-color-link);
  display: flex;
  font-family: var(--hpds-font-display);
  font-size: 1.8rem;
  font-weight: 600;
  justify-content: center;
}

body.hpds-category-hero-active .woocommerce-loop-category__title {
  color: var(--hpds-color-text);
  font-family: var(--hpds-font-sans);
  font-size: clamp(.7rem, .85vw, .82rem);
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  max-inline-size: 9rem;
  text-align: center;
}

body.hpds-category-hero-active .woocommerce-loop-category__title .count {
  display: none;
}

body.hpds-category-hero-active .c-page-header__sub-cat-item > a:hover .c-sub-categories__thumb-wrap,
body.hpds-category-hero-active .c-page-header__sub-cat-item > a:focus-visible .c-sub-categories__thumb-wrap {
  border-color: var(--hpds-color-accent);
  box-shadow: 0 0 0 .28rem color-mix(in srgb, var(--hpds-color-accent-soft) 50%, transparent), 0 .75rem 1.6rem rgb(38 26 23 / 11%);
  transform: translateY(-.18rem);
}

body.hpds-category-hero-active .c-page-header__sub-cat-item > a:focus-visible {
  border-radius: .5rem;
  outline: 2px solid var(--hpds-color-focus);
  outline-offset: .25rem;
}

body.hpds-category-hero--tone-light .c-page-header--product-list {
  background: linear-gradient(125deg, #171216, #2b2025);
}

body.hpds-category-hero--tone-light .c-page-header__title,
body.hpds-category-hero--tone-light .c-page-header__wrap::before {
  color: var(--hpds-color-surface);
}

body.hpds-category-hero--tone-light .hpds-category-hero__description,
body.hpds-category-hero--tone-light .c-page-header--product-list > .c-breadcrumbs :where(.c-breadcrumbs__item, a) {
  color: color-mix(in srgb, var(--hpds-color-surface) 76%, transparent);
}

body.hpds-category-hero--orbits-hidden .c-page-header__sub-cat {
  display: none;
}

@media (max-width: 900px) {
  body.hpds-category-hero-active .c-page-header--product-list {
    gap: 1.5rem;
    grid-template-areas:
      "copy"
      "breadcrumb"
      "media"
      "orbit";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(12rem, 1fr) auto;
    min-block-size: auto;
    padding-block-start: clamp(1.75rem, 6vw, 3.25rem);
  }

  body.hpds-category-hero-active .c-page-header--product-list::before {
    background-image: var(--hpds-category-hero-mobile-image);
    min-block-size: clamp(12rem, 48vw, 20rem);
  }

  body.hpds-category-hero-active .c-page-header__title {
    font-size: clamp(2.15rem, 8vw, 3.8rem);
    max-inline-size: 16ch;
  }

  body.hpds-category-hero-active .c-page-header__sub-cat {
    margin-block-start: 0;
  }
}

@media (max-width: 600px) {
  body.hpds-category-hero-active .c-page-header--product-list {
    border-radius: 0 0 1.75rem 1.75rem;
    inline-size: calc(100% - 1rem);
    margin-block-start: .5rem;
    padding-inline: 1.1rem;
  }

  body.hpds-category-hero-active .c-page-header--product-list::before {
    border-width: .4rem;
    border-radius: 46% 54% 48% 52% / 58% 44% 56% 42%;
  }

  body.hpds-category-hero-active .c-page-header__sub-cat {
    margin-inline: -1.1rem;
    padding-inline: 1rem;
  }

  body.hpds-category-hero-active .c-page-header__sub-cat-item {
    flex-basis: 5.2rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.hpds-category-hero-active .c-sub-categories__thumb-wrap {
    transition: none;
  }
}