/**
 * Chemesis Core — Products archive styles.
 * Port of the approved Vercel /products composition.
 * Prefix: .chc-* for archive blocks; product card uses the shared .chh-card system.
 */

/* ------------------------------------------------------------------
   Discovery strip
   ------------------------------------------------------------------ */
.chc-strip {
  border-bottom: 1px solid var(--ch-line);
  background: #fff;
}

.chc-strip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2.5rem;
  padding-block: 1.25rem;
}

.chc-strip-lead {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ch-blue-600);
}

.chc-strip-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ch-muted);
}

.chc-strip-item svg {
  color: var(--ch-blue);
  flex-shrink: 0;
}

.chc-strip-link {
  margin-left: auto;
  display: none;
  font-size: var(--ch-type-body-sm);
}

@media (min-width: 1024px) {
  .chc-strip-link {
    display: inline-flex;
  }
}

/* ------------------------------------------------------------------
   Explorer shell
   ------------------------------------------------------------------ */
.chc-explorer {
  background: var(--ch-paper);
  padding-block: 2.5rem;
}

@media (min-width: 768px) {
  .chc-explorer {
    padding-block: 3.5rem;
  }
}

/* Locked category context row (category archives) */
.chc-context {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.chc-context-text {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ch-faint);
}

.chc-context-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ch-blue);
  flex-shrink: 0;
}

.chc-context-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--ch-type-body-sm);
  font-weight: 500;
  color: var(--ch-blue-600);
  text-decoration: none;
}

.chc-context-link svg {
  transition: transform 0.4s var(--ch-ease-expo);
}

.chc-context-link:hover svg {
  transform: translateX(4px);
}

/* Single-result catalogue renders at standard card width (V2 sparse handling) */
.chc-grid--single {
  max-width: 420px;
}

.chc-bar {
  border-radius: var(--ch-radius-md);
  border: 1px solid var(--ch-line);
  background: #fff;
}

.chc-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
}

@media (min-width: 768px) {
  .chc-bar-row {
    flex-direction: row;
    align-items: center;
  }
}

.chc-search {
  position: relative;
  width: 100%;
}

@media (min-width: 768px) {
  .chc-search {
    max-width: 28rem;
  }
}

.chc-search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ch-faint);
  pointer-events: none;
}

.chc-input {
  height: 3rem;
}

.chc-search-input {
  padding-left: 2.5rem;
}

.chc-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--ch-faint);
  cursor: pointer;
  transition: color 0.3s var(--ch-ease-expo);
  display: flex;
}

.chc-clear:hover {
  color: var(--ch-ink-900);
}

.chc-clear[hidden] {
  display: none !important;
}

.chc-bar-side {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .chc-bar-side {
    margin-left: auto;
  }
}

.chc-count {
  white-space: nowrap;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-mono);
  color: var(--ch-faint);
}

.chc-sort {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .chc-sort {
    display: flex;
  }
}

.chc-sort-label {
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ch-faint);
}

.chc-select {
  width: 12rem;
  font-size: var(--ch-input-font);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234b556a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}

.chc-select-full {
  width: 100%;
}

.chc-filters-btn {
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .chc-filters-btn {
    display: none;
  }
}

.chc-hairline {
  height: 1px;
  background: var(--ch-line);
}

.chc-filterrow {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1.5rem;
  row-gap: 0.75rem;
  padding: 1rem;
}

@media (min-width: 768px) {
  .chc-filterrow {
    display: flex;
  }
}

.chc-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .chc-filter-group-divider {
    border-left: 1px solid var(--ch-line);
    padding-left: 1.5rem;
  }
}

.chc-filter-label {
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ch-faint);
}

.chc-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.chh-cats-chip--sm {
  padding: 0.625rem 1rem;
}

.chh-cats-chip--sm:hover:not(.is-active) {
  border-color: rgba(0, 12, 48, 0.3);
  color: var(--ch-ink-900);
}

.chc-reset {
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: var(--ch-type-body-sm);
  font-weight: 500;
  color: var(--ch-blue-600);
  cursor: pointer;
  position: relative;
}

.chc-reset::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 1px;
  width: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ch-ease-expo);
}

.chc-reset:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.chc-reset[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------
   Mobile filter sheet
   ------------------------------------------------------------------ */
.chc-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.chc-sheet[hidden] {
  display: none !important;
}

@media (min-width: 768px) {
  .chc-sheet {
    display: none;
  }
}

.chc-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(1, 6, 26, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.chc-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 82vh;
  overflow-y: auto;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  border-top: 1px solid var(--ch-line);
  background: #fff;
  padding: 1.25rem;
}

.chc-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chc-sheet-title {
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ch-faint);
}

.chc-sheet-close {
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius-sm);
  background: transparent;
  color: var(--ch-muted);
  cursor: pointer;
}

.chc-sheet-section {
  margin-top: 1.25rem;
}

.chc-sheet-section .chc-chips,
.chc-sheet-section .chc-select-full {
  margin-top: 0.75rem;
}

.chc-sheet-actions {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chc-sheet-actions .chc-show {
  flex: 1;
}

.chc-sheet-actions .ch-btn[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------
   Grid + empty state + loading
   ------------------------------------------------------------------ */
.chc-grid-wrap {
  margin-top: 1.5rem;
  transition: opacity 0.25s var(--ch-ease-expo);
}

.chc-grid-wrap.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.chc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .chc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .chc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .chc-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.chc-grid > .ch-reveal {
  display: contents;
}

.chc-empty {
  border-radius: var(--ch-radius-md);
  border: 1px solid var(--ch-line);
  background: #fff;
  padding: 5rem 1.5rem;
  text-align: center;
}

.chc-empty-title {
  font-family: var(--ch-font-display);
  font-size: var(--ch-type-h4);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ch-ink-900);
}

.chc-empty-text {
  margin: 0.75rem auto 0;
  max-width: 28rem;
  font-size: var(--ch-type-body);
  line-height: 1.65;
  color: var(--ch-muted);
}

.chc-empty .ch-btn {
  margin-top: 1.5rem;
}

/* ------------------------------------------------------------------
   Shared product card — grid variant + archive foot
   ------------------------------------------------------------------ */
.chh-card--grid {
  width: 100%;
}

.chh-card--grid .chh-card-media img {
  padding: 1.75rem;
}

.chh-card-foot-archive {
  justify-content: space-between;
}

.chh-buy {
  border: 0;
  background: transparent;
  margin: 0;
  display: inline-flex;
  align-items: center;
  line-height: 1rem;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ch-muted);
  cursor: pointer;
  transition: color 0.3s var(--ch-ease-expo);
}

/* Approved neutral state for products without a render */
.chh-card-neutral {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chh-card-neutral img {
  position: static;
  inset: auto;
  width: 54%;
  height: auto;
  padding: 0;
  opacity: 0.9;
}

.chh-buy:hover {
  color: var(--ch-blue-600);
}

.chh-card-arrow {
  flex-shrink: 0;
  color: var(--ch-faint);
  transition: transform 0.3s var(--ch-ease-expo), color 0.3s var(--ch-ease-expo);
}

.chh-card:hover .chh-card-arrow,
.chh-card:focus-within .chh-card-arrow {
  transform: translate(2px, -2px);
  color: var(--ch-blue);
}

/* ------------------------------------------------------------------
   Bulk procurement CTA
   ------------------------------------------------------------------ */
.chc-bulk-sec {
  background: #fff;
  padding-bottom: 5rem;
}

@media (min-width: 768px) {
  .chc-bulk-sec {
    padding-bottom: 7rem;
  }
}

.chc-bulk {
  position: relative;
  overflow: hidden;
  border-radius: var(--ch-radius-md);
  background: var(--ch-ink-950);
  padding: 2.5rem 2rem;
}

@media (min-width: 768px) {
  .chc-bulk {
    padding: 3rem;
  }
}

.chc-bulk .chh-grid-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.chc-bulk-glow {
  position: absolute;
  top: -6rem;
  right: -6rem;
  height: 320px;
  width: 320px;
  border-radius: 9999px;
  opacity: 0.16;
  filter: blur(64px);
  background: radial-gradient(circle, #0054fc 0%, transparent 65%);
  pointer-events: none;
}

.chc-bulk-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.75rem;
}

@media (min-width: 1024px) {
  .chc-bulk-inner {
    flex-direction: row;
    align-items: center;
  }
}

.chc-bulk-label {
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ch-blue-300);
}

.chc-bulk-title {
  margin-top: 0.75rem;
  font-family: var(--ch-font-display);
  font-size: var(--ch-type-h3);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}

.chc-bulk-text {
  margin-top: 0.5rem;
  max-width: 36rem;
  font-size: var(--ch-type-body-sm);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.6);
}

.chc-bulk-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chc-bulk-note {
  position: relative;
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  font-family: var(--ch-font-mono);
  font-size: var(--ch-type-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.45);
}

/* ------------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .chc-grid-wrap,
  .chh-card-arrow,
  .chc-sheet-panel {
    transition: none;
  }
}

/* ------------------------------------------------------------------
   Elementor kit/theme button shield for archive blocks
   ------------------------------------------------------------------ */
body :is(.chc-strip, .chc-explorer, .chc-bulk-sec) button,
body :is(.chc-strip, .chc-explorer, .chc-bulk-sec) button:hover,
body :is(.chc-strip, .chc-explorer, .chc-bulk-sec) button:focus,
body :is(.chc-strip, .chc-explorer, .chc-bulk-sec) button:focus-visible {
  background: transparent;
  color: inherit;
  padding: 0;
}

body .chc-explorer .chh-cats-chip,
body .chc-explorer .chh-cats-chip:hover,
body .chc-explorer .chh-cats-chip:focus,
body .chc-explorer .chh-cats-chip:focus-visible {
  padding: 0.625rem 1rem;
}

body .chc-explorer .chh-cats-chip.is-active {
  border-color: var(--ch-ink-900);
  background: var(--ch-ink-900);
  color: #fff;
}

body .chc-explorer .chc-filters-btn {
  padding: 0.55rem 1.05rem;
  background: transparent;
  color: var(--ch-ink-900);
}

body .chc-explorer .chc-sheet-close {
  padding: 0;
  color: var(--ch-muted);
}

body .chc-explorer .chc-sheet-actions .ch-btn-primary,
body .chc-bulk-sec .ch-btn-primary {
  background: var(--ch-blue);
  color: #fff;
  padding-inline: var(--ch-btn-padding);
}

body .chc-explorer .chc-sheet-actions .ch-btn-primary:hover,
body .chc-bulk-sec .ch-btn-primary:hover {
  background: var(--ch-blue-600);
  color: #fff;
}

body .chc-explorer .chc-sheet-actions .ch-btn-outline,
body .chc-explorer .chh-cat-empty .ch-btn-outline {
  background: transparent;
  color: var(--ch-ink-900);
  padding-inline: var(--ch-btn-padding);
}

body .chc-bulk-sec .ch-btn-outline-light {
  background: transparent;
  color: #fff;
  padding-inline: var(--ch-btn-padding);
}
