/* Stage 2 catalog, category and brand refinements. */

.commerce-main.t-catalog-main { padding-block: 0; }
.t-catalog-app {
  padding-block: clamp(1.25rem, 2.5vw, 1.5rem) 4rem;
}
.t-catalog-header {
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--store-line);
}
.t-catalog-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  margin-bottom: .6rem;
  color: var(--store-muted);
  font-size: .76rem;
}
.t-catalog-breadcrumbs a { color: var(--store-blue); text-decoration: none; }
.t-catalog-header h1 {
  margin: 0;
  color: var(--store-navy);
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
}
.t-catalog-header > p {
  max-width: 52rem;
  margin: .65rem 0 0;
  color: var(--store-muted);
  line-height: 1.6;
}
.t-catalog-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding-block: 1rem;
}
.t-catalog-count { margin: 0; color: var(--store-muted); font-size: .86rem; }
.t-catalog-sort { display: flex; gap: .65rem; align-items: center; color: var(--store-muted); font-size: .875rem; }
.t-catalog-sort select {
  min-height: 44px;
  border: 1px solid var(--store-line);
  border-radius: .7rem;
  padding: .45rem 2.1rem .45rem .75rem;
  background-color: #fff;
  color: var(--store-navy);
  font: inherit;
  font-weight: 700;
}
.t-filter-toggle {
  display: none;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 1px solid var(--store-line);
  border-radius: .7rem;
  background: #fff;
  color: var(--store-navy);
  font: inherit;
  font-size: .82rem;
  font-weight: 750;
}
.t-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0 0 1rem;
}
.t-filter-chips[hidden] { display: none; }
.t-filter-chips button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .45rem;
  border: 1px solid #cfe1f6;
  border-radius: 999px;
  padding: .4rem .7rem;
  background: #eef6ff;
  color: var(--store-navy);
  cursor: pointer;
  font: inherit;
  font-size: .74rem;
  font-weight: 700;
}
.t-filter-chips .t-filter-reset-chip { border-color: transparent; background: transparent; color: var(--store-blue); }
.t-catalog-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}
.t-catalog-sidebar {
  position: sticky;
  top: 138px;
  z-index: 10;
  max-height: calc(100vh - 155px);
  overflow: hidden;
  border: 1px solid var(--store-line);
  border-radius: 1rem;
  background: #fff;
}
.t-catalog-filters { display: flex; flex-direction: column; min-height: 0; max-height: inherit; margin: 0; }
.t-catalog-filters__fields { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.t-catalog-filters__head { flex: 0 0 auto; background: #fff; }
.t-catalog-layout.is-unfiltered-empty { grid-template-columns: 1fr; }
.t-catalog-app [data-filter-drawer][hidden],
.t-catalog-app .t-filter-backdrop[hidden],
.t-catalog-app .t-filter-toggle[hidden],
.t-catalog-app .t-catalog-sort[hidden],
.t-catalog-feedback[hidden] { display: none !important; }
.t-catalog-app button:focus-visible,
.t-catalog-app a:focus-visible,
.t-catalog-app input:focus-visible,
.t-catalog-app select:focus-visible { outline: 3px solid var(--store-blue); outline-offset: 3px; }
.t-catalog-results:focus-visible { outline: 3px solid var(--store-blue); outline-offset: 5px; }
.t-catalog-feedback { margin: 0 0 1rem; padding: .8rem; border: 1px solid #dca6a6; border-radius: .7rem; background: #fff4f4; color: #712525; }
.t-catalog-feedback p { margin: 0 0 .55rem; font-size: .875rem; line-height: 1.5; }
.t-catalog-feedback button { min-height: 44px; padding: .5rem .85rem; border: 1px solid currentColor; border-radius: .55rem; background: #fff; color: #712525; font: inherit; font-size: .875rem; font-weight: 700; cursor: pointer; }
.t-catalog-filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--store-line);
  padding: .9rem 1rem;
  color: var(--store-navy);
}
.t-catalog-filters__close { display: none; }
.t-catalog-filter {
  display: grid;
  gap: .55rem;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--store-line);
  padding: .9rem 1rem 1rem;
}
.t-catalog-filter legend {
  width: 100%;
  margin: 0 0 .35rem;
  color: var(--store-navy);
  font-size: .875rem;
  font-weight: 800;
}
.t-catalog-filter__options {
  display: grid;
  gap: .2rem;
  max-height: 200px;
  overflow: auto;
}
.t-catalog-filter label,
.t-filter-radio {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: .55rem;
  align-items: center;
  min-height: 44px;
  margin: 0;
  color: var(--store-navy);
  cursor: pointer;
  font-size: .875rem;
  line-height: 1.4;
}
.t-catalog-filter input[type="checkbox"],
.t-catalog-filter input[type="radio"] { accent-color: var(--store-blue); }
.t-catalog-filter label small { color: var(--store-muted); font-size: .8125rem; }
.t-price-filter { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.t-price-filter label { display: grid; grid-template-columns: 1fr; gap: .35rem; color: var(--store-muted); font-size: .8125rem; }
.t-price-filter input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--store-line);
  border-radius: .55rem;
  padding: .35rem .55rem;
  color: var(--store-navy);
  font: inherit;
}
.t-catalog-filter--status label { grid-template-columns: auto 1fr; }
.t-catalog-filters__actions {
  position: sticky;
  z-index: 3;
  bottom: 0;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .55rem;
  align-items: center;
  border-top: 1px solid var(--store-line);
  padding: .8rem;
  background: #fff;
  box-shadow: 0 -5px 18px rgba(11,31,54,.05);
}
.t-catalog-filters__actions .button {
  min-height: 44px;
  padding: .65rem .75rem;
  border: 0;
  border-radius: .65rem;
  background: var(--store-navy);
  color: #fff;
  font-size: .875rem;
  line-height: 1.3;
  white-space: normal;
}
.t-catalog-filters__actions a { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: .45rem .3rem; color: var(--store-blue); font-size: .8125rem; font-weight: 750; text-decoration: none; text-align: center; }
.t-catalog-filters__actions .t-catalog-feedback { grid-column: 1 / -1; margin: 0; }
.t-catalog-results .t-save-action { min-height: 44px; }
.t-catalog-results { min-width: 0; transition: opacity .18s ease; }
.t-catalog-app.is-loading .t-catalog-results { opacity: .45; pointer-events: none; }
.t-catalog-results .products {
  width: 100% !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: .8rem !important;
}
.t-catalog-results .products li.product {
  position: relative;
  min-height: 100%;
  padding: .8rem;
}
.t-catalog-results .products li.product > a.woocommerce-loop-product__link {
  display: flex !important;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}
.t-catalog-results .products li.product .woocommerce-loop-product__title { min-height: 3.9em; font-size: .9rem; }
.t-catalog-results .products li.product .price { margin-top: .65rem; padding-top: 0; }
.t-catalog-results .products li.product .button { margin-top: .65rem; }
.t-catalog-results .t-product-saved-actions { margin-top: .55rem; }
.t-catalog-results .t-save-action { padding-inline: .5rem; font-size: .68rem; }
.t-card-stock {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin: .45rem 0 0;
  font-size: .7rem;
  font-weight: 750;
}
.t-card-stock span { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.t-card-stock.is-in-stock { color: var(--store-success); }
.t-card-stock.is-preorder { color: var(--store-blue); }
.t-card-stock.is-out-of-stock { color: var(--store-danger); }
.t-product-badges {
  position: absolute;
  z-index: 3;
  top: .7rem;
  left: .7rem;
  display: flex;
  max-width: calc(100% - 1.4rem);
  flex-wrap: wrap;
  gap: .3rem;
  pointer-events: none;
}
.t-product-badge {
  border-radius: .42rem;
  padding: .3rem .45rem;
  background: var(--store-navy);
  color: #fff;
  font-size: .62rem;
  font-weight: 850;
  line-height: 1;
}
.t-product-badge--sale { background: var(--store-danger); }
.t-product-badge--new { background: var(--store-blue); }
.t-product-badge--preorder { background: var(--store-navy); }
.t-catalog-empty {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: .75rem;
  border: 1px dashed #b9cee4;
  border-radius: 1.2rem;
  padding: 1.5rem;
  background: #fff;
  color: var(--store-muted);
  text-align: center;
}
.t-catalog-empty span {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  border-radius: 1rem;
  background: #eaf4ff;
  color: var(--store-blue);
  font-size: 1.8rem;
}
.t-catalog-empty p { max-width: 34rem; margin: 0; }
.t-catalog-pagination { margin-top: 1.5rem; }
.t-filter-backdrop { display: none; }

/* Compact category directory with purpose-specific line icons. */
.t-category-directory {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: .85rem;
  margin-top: 1.5rem;
}
.t-category-directory__card {
  display: grid;
  grid-template-columns: 3.5rem minmax(0,1fr) auto;
  gap: 1rem;
  align-items: center;
  min-height: 132px;
  border: 1px solid var(--store-line);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  background: #fff;
  color: var(--store-navy);
  text-decoration: none;
  box-shadow: 0 8px 26px rgba(11,31,54,.045);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.t-category-directory__card:hover,
.t-category-directory__card:focus-visible { transform: translateY(-2px); border-color: #b8d6f4; box-shadow: 0 14px 34px rgba(11,31,54,.08); }
.t-category-directory__icon {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  border-radius: .9rem;
  background: #eaf4ff;
  color: var(--store-blue);
}
.t-category-directory__icon svg { width: 1.8rem; height: 1.8rem; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.t-category-directory__body { display: grid; gap: .38rem; min-width: 0; }
.t-category-directory__body > strong { font-size: .98rem; line-height: 1.25; }
.t-category-directory__children { display: flex; flex-wrap: wrap; gap: .3rem .65rem; color: var(--store-muted); font-size: .72rem; }
.t-category-directory__children span:not(:last-child)::after { content: "·"; margin-left: .65rem; }
.t-category-directory__body small { color: var(--store-blue); font-size: .7rem; font-weight: 750; }
.t-category-directory__arrow { color: var(--store-blue); font-size: 1.3rem; }

/* Normalized brand marks: one neutral color, one optical box. */
.t-brand-directory {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: .8rem;
  margin-top: 1.5rem;
}
.t-brand-directory__card {
  display: grid;
  min-height: 138px;
  place-items: center;
  align-content: center;
  gap: .55rem;
  border: 1px solid var(--store-line);
  border-radius: 1rem;
  padding: 1rem;
  background: #fff;
  color: var(--store-navy);
  text-align: center;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(11,31,54,.045);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.t-brand-directory__card:hover,
.t-brand-directory__card:focus-visible { transform: translateY(-2px); border-color: #b8d6f4; box-shadow: 0 14px 34px rgba(11,31,54,.08); }
.t-brand-directory__logo { display: grid; width: min(100%, 160px); height: 48px; place-items: center; }
.t-brand-directory__logo img { display: block; width: 100%; max-width: 150px; height: 44px; object-fit: contain; }

.t-brand-directory__wordmark { color: #17304d; font-size: 1.25rem; font-weight: 900; letter-spacing: -.03em; }
.t-brand-directory__card strong { font-size: .78rem; }
.t-brand-directory__card small { color: var(--store-muted); font-size: .68rem; }
.t-brand-directory.is-compact { grid-template-columns: repeat(6, minmax(0,1fr)); }
.t-brand-directory.is-compact .t-brand-directory__card { min-height: 96px; padding: .65rem; }
.t-brand-directory.is-compact .t-brand-directory__logo { height: 34px; }
.t-brand-directory.is-compact .t-brand-directory__logo img { height: 32px; }

@media (max-width: 1240px) {
  .t-catalog-results .products { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .t-brand-directory { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .t-brand-directory.is-compact { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .t-catalog-toolbar { grid-template-columns: auto 1fr auto; }
  .t-filter-toggle { display: inline-flex; }
  .t-catalog-layout { grid-template-columns: 1fr; }
  .t-catalog-sidebar {
    position: fixed;
    z-index: 1002;
    top: 0;
    bottom: var(--t-preview-bottom, 0px);
    left: 0;
    width: min(92vw, 380px);
    max-height: calc(100dvh - var(--t-preview-bottom, 0px));
    border: 0;
    border-radius: 0 1rem 1rem 0;
    box-shadow: 20px 0 50px rgba(3,16,39,.2);
    transform: translateX(-105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease;
  }
  .t-catalog-sidebar.is-open { transform: translateX(0); visibility: visible; pointer-events: auto; }
  .t-catalog-sidebar .t-catalog-filters { height: 100%; max-height: 100%; }
  .t-catalog-filter__options { max-height: none; overflow: visible; }
  .t-catalog-filters__head { padding-top: max(.65rem, env(safe-area-inset-top)); }
  .t-catalog-filters__actions { padding-bottom: max(.8rem, env(safe-area-inset-bottom)); }
  .t-price-filter input { font-size: 1rem; }
  .t-catalog-filters__close { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 50%; background: var(--store-soft); color: var(--store-navy); font: inherit; font-size: 1.4rem; cursor: pointer; }
  .t-filter-backdrop {
    position: fixed;
    z-index: 1001;
    inset: 0;
    border: 0;
    background: rgba(3,16,39,.48);
  }
  .t-filter-drawer-open { overflow: hidden; }
  .t-filter-drawer-open .t-filter-backdrop { display: block; }
  .t-catalog-results .products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .t-category-directory { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .t-catalog-app { padding-top: .8rem; }
  .t-catalog-header h1 { font-size: clamp(1.8rem, 9vw, 2.45rem); }
  .t-catalog-toolbar { grid-template-columns: 1fr auto; gap: .65rem; }
  .t-catalog-count { grid-column: 1 / -1; }
  .t-catalog-sort > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .t-catalog-sort select { max-width: 54vw; }
  .t-catalog-results .products { gap: .55rem !important; }
  .t-catalog-results .products li.product { padding: .65rem; }
  .t-catalog-results .products li.product .woocommerce-loop-product__title { min-height: 4.2em; font-size: .82rem; }
  .t-catalog-results .products li.product a img { margin-bottom: .55rem; }
  .t-catalog-results .tectronis-product-specs { display: grid; gap: .3rem; margin-top: .45rem; font-size: .8125rem; line-height: 1.45; }
  .t-catalog-results .tectronis-product-specs li { gap: .25rem; }
  .t-catalog-results .t-product-saved-actions { grid-template-columns: 1fr 1fr; gap: .3rem; }
  .t-catalog-results .t-save-action { min-width: 0; padding: .42rem; }
  .t-catalog-results .t-save-action [data-t-save-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .t-category-directory__card { grid-template-columns: 3.1rem minmax(0,1fr) auto; min-height: 116px; padding: .85rem; }
  .t-category-directory__icon { width: 3.1rem; height: 3.1rem; }
  .t-brand-directory,
  .t-brand-directory.is-compact { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 360px) {
  .t-catalog-results .products { grid-template-columns: 1fr !important; }
}
@media (prefers-reduced-motion: reduce) {
  .t-catalog-sidebar,
  .t-category-directory__card,
  .t-brand-directory__card { transition: none; }
}

/* Brand directory: catalog links first; empty brands lead to one useful request path. */
.t-brand-directory-section { margin-block: 1rem 2rem; }
.t-brand-directory-section h2,
.t-brand-request h2 { margin: 0 0 .85rem; color: var(--store-navy); font-size: clamp(1.25rem, 2.5vw, 1.65rem); line-height: 1.3; }
.t-brand-request { margin-block: 1.5rem; padding: clamp(1rem, 3vw, 1.6rem); border: 1px solid var(--store-line); border-radius: 1rem; background: var(--store-soft); }
.t-brand-request p { max-width: 65ch; margin: 0 0 1rem; color: var(--store-muted); font-size: .9375rem; line-height: 1.65; }
.t-brand-request__names { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.2rem; padding: 0; list-style: none; }
.t-brand-request__names li { margin: 0; padding: .4rem .65rem; border: 1px solid var(--store-line); border-radius: .5rem; background: #fff; color: var(--store-navy); font-size: .875rem; line-height: 1.4; }
.t-brand-request > .t-button { min-height: 44px; white-space: normal; text-align: center; }
