/*
 * CNC Designs Store — Phase 2 catalog discovery.
 * Conditionally loaded on the storefront and WooCommerce catalog requests.
 */

/* Discovery heading and future-ready live category navigation. */
body.cnc-catalog-context .cnc-catalog-discovery {
  clear: both;
  margin: 0 0 clamp(1.35rem, 3vw, 2.25rem);
}

body.cnc-catalog-context .cnc-catalog-heading {
  position: relative;
  margin: 0 0 1.15rem;
  padding: clamp(1.2rem, 2.6vw, 1.8rem);
  border: 1px solid rgba(201, 154, 97, 0.28);
  border-left: 4px solid var(--cnc-birch-500);
  border-radius: var(--cnc-radius-panel);
  background:
    linear-gradient(110deg, rgba(201, 154, 97, 0.08), transparent 44%),
    var(--cnc-steel-900);
}

body.cnc-catalog-context .cnc-catalog-heading__eyebrow {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--cnc-birch-500);
  font: 650 0.75rem/1.4 var(--cnc-font-data);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.cnc-catalog-context .cnc-catalog-heading h2 {
  margin: 0;
  color: var(--cnc-cut-white);
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.05;
  text-transform: uppercase;
}

body.cnc-catalog-context .cnc-catalog-heading p {
  max-width: 62ch;
  margin: 0.75rem 0 0;
  color: #c2cad1;
  font-size: 0.92rem;
  line-height: 1.65;
}

body.cnc-catalog-context .cnc-category-rail {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: rgba(201, 154, 97, 0.45) transparent;
  scrollbar-width: thin;
}

body.cnc-catalog-context .cnc-category-rail ul {
  display: flex;
  width: max-content;
  min-width: 100%;
  gap: 0.5rem;
  margin: 0;
  padding: 0.2rem 0 0.65rem;
  list-style: none;
}

body.cnc-catalog-context .cnc-category-link,
body.cnc-catalog-context .cnc-category-link:visited {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.62rem 0.8rem;
  border: 1px solid rgba(174, 184, 195, 0.24);
  border-radius: var(--cnc-radius-control);
  background: #10151b;
  color: #d5dbe0;
  font-size: 0.875rem;
  font-weight: 680;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

body.cnc-catalog-context .cnc-category-link strong {
  display: inline-grid;
  min-width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  padding-inline: 0.35rem;
  border: 1px solid rgba(174, 184, 195, 0.2);
  border-radius: 3px;
  color: #c8d0d6;
  font: 650 0.75rem/1 var(--cnc-font-data);
}

body.cnc-catalog-context .cnc-category-link:hover,
body.cnc-catalog-context .cnc-category-link:focus-visible,
body.cnc-catalog-context .cnc-category-link--current {
  border-color: rgba(201, 154, 97, 0.72);
  background: rgba(201, 154, 97, 0.12);
  color: #ffffff;
  transform: translateY(-1px);
}

body.cnc-catalog-context .cnc-category-link--current strong {
  border-color: rgba(201, 154, 97, 0.45);
  color: #f0d8b8;
}

/* Archive heading, result count, sorting, and category description. */
body.cnc-catalog-context .cnc-category-intro {
  margin: 0 0 clamp(1.4rem, 3vw, 2.2rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  border-top: 3px solid var(--cnc-birch-500);
  border-right: 1px solid var(--cnc-rule);
  border-bottom: 1px solid var(--cnc-rule);
  border-left: 1px solid var(--cnc-rule);
  border-radius: 0 0 var(--cnc-radius-panel) var(--cnc-radius-panel);
  background: var(--cnc-steel-900);
}

body.cnc-catalog-context .cnc-category-title {
  margin: 0;
  color: var(--cnc-cut-white);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

body.cnc-catalog-context .cnc-category-description {
  max-width: var(--cnc-readable);
  margin-top: 0.85rem;
  color: #c5ccd2;
  font-size: 0.95rem;
  line-height: 1.7;
}

body.cnc-catalog-context .cnc-category-description > :last-child {
  margin-bottom: 0;
}

body.cnc-catalog-context .woocommerce-result-count {
  float: none;
  margin: 0.35rem 1rem 1.25rem 0;
  color: #c8d0d6;
  font: 600 0.8rem/44px var(--cnc-font-data);
  letter-spacing: 0.035em;
}

body.cnc-catalog-context .woocommerce-ordering {
  float: right;
  margin: 0.35rem 0 1.25rem;
}

body.cnc-catalog-context .woocommerce-ordering select {
  min-width: 220px;
  min-height: 44px;
  padding: 0.55rem 2.4rem 0.55rem 0.75rem;
  border: 1px solid rgba(174, 184, 195, 0.3);
  border-radius: var(--cnc-radius-control);
  background-color: var(--cnc-steel-900);
  color: var(--cnc-cut-white);
  font-size: 0.82rem;
}

/* Premium, stable WooCommerce product cards with live catalog markup. */
body.cnc-catalog-context ul.products {
  clear: both;
  row-gap: clamp(1rem, 2vw, 1.5rem);
}

body.cnc-catalog-context ul.products li.product {
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgba(174, 184, 195, 0.22) !important;
  border-radius: var(--cnc-radius-card) !important;
  background: #12171d !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2) !important;
  isolation: isolate;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

body.cnc-catalog-context ul.products li.product:hover,
body.cnc-catalog-context ul.products li.product:focus-within {
  border-color: rgba(201, 154, 97, 0.56) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3) !important;
  transform: translateY(-3px);
}

body.cnc-catalog-context ul.products li.product .astra-shop-thumbnail-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--cnc-sheet-100);
}

body.cnc-catalog-context ul.products li.product .woocommerce-LoopProduct-link {
  display: block;
  height: 100%;
}

body.cnc-catalog-context ul.products li.product .astra-shop-thumbnail-wrap img,
body.cnc-catalog-context ul.products li.product .woocommerce-loop-product__link img {
  width: 100%;
  height: 100%;
  margin: 0 !important;
  object-fit: cover;
  transition: transform 240ms ease;
}

body.cnc-catalog-context ul.products li.product:hover .astra-shop-thumbnail-wrap img,
body.cnc-catalog-context ul.products li.product:focus-within .astra-shop-thumbnail-wrap img {
  transform: scale(1.025);
}

body.cnc-catalog-context ul.products li.product .astra-shop-summary-wrap {
  display: flex;
  min-height: 224px;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 1rem !important;
  background: #12171d !important;
}

body.cnc-catalog-context ul.products li.product .woocommerce-loop-product__title {
  display: -webkit-box;
  min-height: 4.15em;
  margin: 0 !important;
  overflow: hidden;
  color: #f1f3f5 !important;
  font-family: var(--cnc-font-body);
  font-size: clamp(0.98rem, 1.3vw, 1.08rem) !important;
  font-weight: 690 !important;
  letter-spacing: -0.01em;
  line-height: 1.38 !important;
  text-wrap: pretty;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body.cnc-catalog-context ul.products li.product .ast-woo-product-category {
  margin-top: 0.65rem;
  color: #c8d0d6 !important;
  font: 650 0.75rem/1.3 var(--cnc-font-data) !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.cnc-catalog-context ul.products li.product .price {
  min-height: 2.1rem;
  margin: 0.75rem 0 0 !important;
  color: #efc796 !important;
  font-size: 0.95rem !important;
  font-weight: 720 !important;
  line-height: 1.45;
}

body.cnc-catalog-context ul.products li.product .price del {
  color: #9ba6b0 !important;
  font-size: 0.82em;
  opacity: 0.86;
}

body.cnc-catalog-context ul.products li.product .price ins {
  color: #efc796 !important;
  text-decoration: none;
}

body.cnc-catalog-context ul.products li.product .cnc-card-action,
body.cnc-catalog-context ul.products li.product .button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: auto 0 0 !important;
  padding: 0.65rem 0.8rem !important;
  border: 1px solid rgba(46, 120, 240, 0.72) !important;
  border-radius: var(--cnc-radius-control) !important;
  background: #205fc4 !important;
  color: #ffffff !important;
  font-size: 0.875rem !important;
  font-weight: 720 !important;
  letter-spacing: 0.055em;
  line-height: 1.2 !important;
  text-transform: uppercase;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

body.cnc-catalog-context ul.products li.product .cnc-card-action::after {
  content: '→';
  font-size: 1rem;
  line-height: 1;
}

body.cnc-catalog-context ul.products li.product .cnc-card-action:hover,
body.cnc-catalog-context ul.products li.product .cnc-card-action:focus-visible,
body.cnc-catalog-context ul.products li.product .button:hover,
body.cnc-catalog-context ul.products li.product .button:focus-visible {
  border-color: #6ea4ff !important;
  background: #2e78f0 !important;
  transform: translateY(-1px);
}

body.cnc-catalog-context ul.products li.product .onsale,
body.cnc-catalog-context ul.products li.product .ast-onsale-card {
  top: 0.75rem !important;
  right: auto !important;
  left: 0.75rem !important;
  z-index: 2;
  min-height: 28px;
  padding: 0.45rem 0.6rem !important;
  border: 1px solid rgba(201, 154, 97, 0.66) !important;
  border-radius: var(--cnc-radius-control) !important;
  background: rgba(9, 12, 15, 0.92) !important;
  color: #f0d8b8 !important;
  font: 700 0.75rem/1 var(--cnc-font-data) !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Homepage filter and archive sidebar use the same technical-panel language. */
body.cnc-catalog-context .cnc-filter,
body.cnc-catalog-context #secondary .widget {
  border: 1px solid rgba(174, 184, 195, 0.22) !important;
  border-radius: var(--cnc-radius-panel) !important;
  background: var(--cnc-steel-900) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2) !important;
}

body.cnc-catalog-context .cnc-filter {
  position: sticky;
  top: 1.5rem;
}

body.cnc-catalog-context .cnc-filter__label,
body.cnc-catalog-context #secondary .widget-title {
  color: var(--cnc-birch-500) !important;
  font-family: var(--cnc-font-data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.cnc-catalog-context .cnc-filter__check,
body.cnc-catalog-context #secondary,
body.cnc-catalog-context #secondary a {
  color: #c8d0d6 !important;
}

body.cnc-catalog-context .cnc-filter__search,
body.cnc-catalog-context .cnc-filter__select,
body.cnc-catalog-context #secondary input,
body.cnc-catalog-context #secondary select {
  min-height: 44px;
  border-color: rgba(174, 184, 195, 0.3) !important;
  border-radius: var(--cnc-radius-control) !important;
  background: #0d1116 !important;
  color: var(--cnc-cut-white) !important;
}

body.cnc-catalog-context .cnc-filter__toggle,
body.cnc-catalog-context .cnc-filter__reset {
  min-height: 44px;
  border-radius: var(--cnc-radius-control) !important;
}

/* Pagination and empty states remain crawlable, clear, and recoverable. */
body.cnc-catalog-context .woocommerce-pagination {
  clear: both;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

body.cnc-catalog-context .woocommerce-pagination ul.page-numbers {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
}

body.cnc-catalog-context .woocommerce-pagination .page-numbers li {
  border: 0;
}

body.cnc-catalog-context .woocommerce-pagination a.page-numbers,
body.cnc-catalog-context .woocommerce-pagination span.page-numbers {
  display: inline-grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid rgba(174, 184, 195, 0.25);
  border-radius: var(--cnc-radius-control);
  background: var(--cnc-steel-900);
  color: #d7dde2;
}

body.cnc-catalog-context .woocommerce-pagination .page-numbers.current {
  border-color: rgba(201, 154, 97, 0.72);
  background: rgba(201, 154, 97, 0.14);
  color: #ffffff;
}

body.cnc-catalog-context .woocommerce-no-products-found,
body.cnc-catalog-context .woocommerce-info {
  clear: both;
  border: 1px solid rgba(174, 184, 195, 0.24);
  border-top: 3px solid var(--cnc-birch-500);
  border-radius: 0 0 var(--cnc-radius-panel) var(--cnc-radius-panel);
  background: var(--cnc-steel-900);
  color: #d2d8dd;
}

body.cnc-catalog-context .cnc-catalog-empty {
  clear: both;
  margin-top: 1rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--cnc-rule);
  border-radius: var(--cnc-radius-panel);
  background: #10151b;
}

body.cnc-catalog-context .cnc-catalog-empty > span {
  color: var(--cnc-birch-500);
  font: 650 0.75rem/1.4 var(--cnc-font-data);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

body.cnc-catalog-context .cnc-catalog-empty h2 {
  margin: 0.6rem 0 0;
  color: var(--cnc-cut-white);
  font-size: clamp(1.55rem, 4vw, 2.2rem);
  text-transform: uppercase;
}

body.cnc-catalog-context .cnc-catalog-empty p {
  max-width: 60ch;
  margin: 0.75rem 0 0;
  color: #bcc5cc;
}

body.cnc-catalog-context .cnc-catalog-empty__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

body.cnc-catalog-context .cnc-catalog-empty__actions a {
  min-height: 44px;
}

/* Final polish P4 — compact catalog hierarchy and faster product comparison. */
body.cnc-catalog-context #primary {
  margin-block: clamp(1.5rem, 3vw, 2.5rem);
}

body.cnc-catalog-context .ast-woocommerce-container {
  padding: clamp(1.5rem, 3.5vw, 2.75rem) clamp(1.1rem, 3.8vw, 3.5rem);
  background:
    radial-gradient(circle at 9% 4%, rgba(213, 160, 95, 0.045), transparent 24rem),
    #0d0e0f;
}

body.cnc-catalog-context .woocommerce-breadcrumb {
  margin: 0 0 1rem;
}

body.cnc-catalog-context .cnc-category-intro {
  margin-bottom: 1.15rem;
  padding: clamp(1.15rem, 2.4vw, 1.6rem);
  border-top-width: 2px;
  background:
    linear-gradient(110deg, rgba(213, 160, 95, 0.055), transparent 45%),
    #181817;
}

body.cnc-catalog-context .cnc-category-title {
  font-size: clamp(2rem, 4.2vw, 2.85rem);
  line-height: 1.04;
  text-transform: none;
}

body.cnc-catalog-context .cnc-category-description {
  margin-top: 0.65rem;
}

body.cnc-catalog-context .cnc-catalog-discovery {
  margin-bottom: 1rem;
}

body.cnc-catalog-context .cnc-category-rail ul {
  padding-bottom: 0.4rem;
}

body.cnc-catalog-context .cnc-category-link,
body.cnc-catalog-context .cnc-category-link:visited {
  background: #161716;
  font-family: var(--cnc-font-body);
  text-transform: none;
}

body.cnc-catalog-context .woocommerce-result-count {
  float: left;
  margin: 0.3rem 1rem 1rem 0;
  line-height: 44px;
}

body.cnc-catalog-context .woocommerce-ordering {
  float: right;
  margin: 0.3rem 0 1rem;
}

body.cnc-catalog-context .woocommerce-ordering select {
  background-color: #171817;
}

body.cnc-catalog-context ul.products {
  clear: both;
}

body.cnc-catalog-context ul.products li.product {
  border-color: rgba(228, 222, 212, 0.14) !important;
  background: #171716 !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18) !important;
}

body.cnc-catalog-context ul.products li.product:hover,
body.cnc-catalog-context ul.products li.product:focus-within {
  border-color: rgba(213, 160, 95, 0.52) !important;
}

body.cnc-catalog-context ul.products li.product .astra-shop-thumbnail-wrap {
  background: #0b0d0f;
}

body.cnc-catalog-context ul.products li.product .astra-shop-summary-wrap {
  min-height: 210px;
  background: #171716 !important;
}

body.cnc-catalog-context ul.products li.product .cnc-card-action,
body.cnc-catalog-context ul.products li.product .button {
  border-color: var(--cnc-action) !important;
  background: var(--cnc-action) !important;
  color: var(--cnc-action-ink) !important;
  font-family: var(--cnc-font-body);
  letter-spacing: 0.01em;
  text-transform: none;
}

body.cnc-catalog-context ul.products li.product .cnc-card-action:hover,
body.cnc-catalog-context ul.products li.product .cnc-card-action:focus-visible,
body.cnc-catalog-context ul.products li.product .button:hover,
body.cnc-catalog-context ul.products li.product .button:focus-visible {
  border-color: var(--cnc-action-hover) !important;
  background: var(--cnc-action-hover) !important;
  color: var(--cnc-action-ink) !important;
}

@media (max-width: 600px) {
  body.cnc-catalog-context #primary {
    margin-block: 1rem 2rem;
  }

  body.cnc-catalog-context .ast-woocommerce-container {
    padding: 1rem 0.75rem 1.75rem;
  }

  body.cnc-catalog-context .cnc-category-intro {
    padding: 1rem;
  }

  body.cnc-catalog-context .cnc-category-title {
    font-size: clamp(2rem, 10vw, 2.55rem);
  }
}

@media (max-width: 921px) {
  body.cnc-catalog-context .cnc-filter {
    position: static;
  }

  body.cnc-catalog-context .woocommerce-result-count,
  body.cnc-catalog-context .woocommerce-ordering {
    float: none;
    margin: 0 0 0.85rem;
  }

  body.cnc-catalog-context .woocommerce-ordering select {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 600px) {
  body.cnc-catalog-context .cnc-catalog-heading {
    padding: 1.1rem;
  }

  body.cnc-catalog-context .cnc-catalog-heading h2 {
    font-size: 1.75rem;
  }

  body.cnc-catalog-context ul.products li.product .astra-shop-summary-wrap {
    min-height: 222px;
    padding: 0.78rem !important;
  }

  body.cnc-catalog-context ul.products li.product .woocommerce-loop-product__title {
    min-height: 4.3em;
    font-size: 0.95rem !important;
    line-height: 1.42 !important;
  }

  body.cnc-catalog-context ul.products li.product .ast-woo-product-category {
    font-size: 0.75rem !important;
  }

  body.cnc-catalog-context ul.products li.product .price {
    font-size: 0.95rem !important;
  }

  body.cnc-catalog-context ul.products li.product .cnc-card-action,
  body.cnc-catalog-context ul.products li.product .button {
    padding-inline: 0.65rem !important;
    font-size: 0.875rem !important;
  }
}
