/* 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, 2.25rem) 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: .78rem; }
.t-catalog-sort select {
  min-height: 42px;
  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: 42px;
  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: 34px;
  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: auto;
  border: 1px solid var(--store-line);
  border-radius: 1rem;
  background: #fff;
}
.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: .78rem;
  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: 30px;
  margin: 0;
  color: var(--store-navy);
  cursor: pointer;
  font-size: .76rem;
}
.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: .68rem; }
.t-price-filter { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.t-price-filter label { display: grid; grid-template-columns: 1fr; gap: .25rem; color: var(--store-muted); font-size: .68rem; }
.t-price-filter input {
  width: 100%;
  min-height: 38px;
  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 {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .65rem;
  align-items: center;
  padding: 1rem;
}
.t-catalog-filters__actions .button {
  min-height: 40px;
  border: 0;
  border-radius: .65rem;
  background: var(--store-navy);
  color: #fff;
}
.t-catalog-filters__actions a { color: var(--store-blue); font-size: .74rem; font-weight: 750; text-decoration: none; }
.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;
  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-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: #7c3aed; }
.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: 0;
    left: 0;
    width: min(88vw, 360px);
    max-height: none;
    border: 0;
    border-radius: 0 1rem 1rem 0;
    box-shadow: 20px 0 50px rgba(3,16,39,.2);
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  .t-catalog-sidebar.is-open { transform: translateX(0); }
  .t-catalog-filters__head { position: sticky; z-index: 2; top: 0; background: #fff; }
  .t-catalog-filters__close { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 50%; background: var(--store-soft); color: var(--store-navy); font: inherit; font-size: 1.2rem; }
  .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: .18rem; margin-top: .45rem; font-size: .6rem; line-height: 1.3; }
  .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; }
}
