﻿/* Product catalog / listing pages — requires bearing-common.css + bearing-layout.css */

.bearing-page .catalog-layout {
  padding: 0;
}

.bearing-page .catalog-hero {
  padding-bottom: 48px;
}

.catalog-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 26vw, 380px);
  gap: 40px;
  align-items: end;
  min-width: 0;
  padding-bottom: 18px;
}

.catalog-hero > * {
  min-width: 0;
}

.catalog-title {
  font-size: var(--font-display);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  overflow-wrap: anywhere;
}

.catalog-lead {
  max-width: 640px;
  margin-top: 24px;
  color: var(--color-text-secondary);
  font-size: var(--font-lead);
  line-height: var(--leading-relaxed);
}

.hero-product {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e4e7ec;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-product__img {
  display: block;
  width: 100%;
  object-fit: contain;
  background: #e4e7ec;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  min-width: 0;
  padding: 22px 0 64px;
}

.catalog-layout > aside,
.catalog-layout > section {
  min-width: 0;
}

.sidebar {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 18px;
}

.side-panel {
  padding: 18px;
}

.side-panel h3 {
  margin-bottom: 14px;
  font-size: var(--font-body);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.category-list {
  display: grid;
  gap: 5px;
}

.category-link {
  display: grid;
  grid-template-columns: 16px 1fr 14px;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  color: #2d3745;
  font-size: var(--font-body-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.category-link:hover:not(.active) {
  background: #f8fafc;
}

.category-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 110, 0, .12);
}

.category-link::before {
  content: "";
  width: 5px;
  height: 5px;
  border: 1px solid #7f8a98;
  border-radius: 50%;
}

.category-link::after {
  content: "\203A";
  justify-self: end;
  color: #687482;
  font-size: 17px;
}

.category-link.active {
  color: var(--blue);
  background: var(--blue-soft);
}

.category-link.active::before {
  border-color: var(--blue);
  background: var(--blue);
}

.range-field {
  margin-top: 12px;
}

.range-field label,
.select-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--color-text-muted);
  font-size: var(--font-label);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.range-slider {
  position: relative;
  height: 28px;
  margin-inline: 4px;
}

.range-slider__track {
  position: absolute;
  inset: 50% 0 auto;
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  transform: translateY(-50%);
  pointer-events: none;
}

.range-slider__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #168616);
}

.range-slider__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 28px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  pointer-events: none;
}

.range-slider__input::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
  border: 0;
}

.range-slider__input::-moz-range-track {
  height: 4px;
  background: transparent;
  border: 0;
}

.range-slider__input::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 110, 0, .22);
  cursor: grab;
  pointer-events: auto;
  transition: transform .12s ease, box-shadow .12s ease;
}

.range-slider__input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 110, 0, .22);
  cursor: grab;
  pointer-events: auto;
  transition: transform .12s ease, box-shadow .12s ease;
}

.range-slider__input:active::-webkit-slider-thumb,
.range-slider__input:active::-moz-range-thumb {
  cursor: grabbing;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 110, 0, .28);
}

.range-slider__input:focus {
  outline: none;
}

.range-slider__input:focus-visible::-webkit-slider-thumb,
.range-slider__input:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(0, 110, 0, .18), 0 2px 8px rgba(0, 110, 0, .22);
}

.range-slider__input--min {
  z-index: 2;
}

.range-slider__input--max {
  z-index: 1;
}

.range-slider.is-dragging-max .range-slider__input--max {
  z-index: 3;
}

.range-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: var(--font-caption);
  font-weight: 600;
  color: #1f2937;
}

.range-meta__min,
.range-meta__max {
  font-variant-numeric: tabular-nums;
}

.select-field {
  margin-top: 10px;
}

.custom-select {
  position: relative;
}

.custom-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.custom-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: var(--font-body-sm);
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(18, 28, 45, .04);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.custom-select__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select__chevron {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5 10 12.5 15 7.5' stroke='%2364748b' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .15s ease;
}

.custom-select__trigger:hover {
  border-color: #c7e2c7;
  background: #fcfdff;
}

.custom-select__trigger:focus,
.custom-select__trigger:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 110, 0, .12);
}

.custom-select.is-open .custom-select__trigger {
  border-color: var(--blue);
  background: #fcfdff;
  box-shadow: 0 0 0 3px rgba(0, 110, 0, .12);
}

.custom-select.is-open .custom-select__chevron {
  transform: rotate(180deg);
}

.custom-select__menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 16px 40px rgba(18, 28, 45, .14);
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.custom-select__menu::-webkit-scrollbar {
  width: 6px;
}

.custom-select__menu::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd5e1;
}

.custom-select__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink);
  font-size: var(--font-body-sm);
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}

.custom-select__option::after {
  content: "";
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 10.5 8.5 14 15 7' stroke='%230b5cff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: opacity .12s ease;
}

.custom-select__option:hover,
.custom-select__option.is-focused {
  background: #f1f5f9;
}

.custom-select__option.is-selected {
  color: var(--blue);
  background: var(--blue-soft);
}

.custom-select__option.is-selected::after {
  opacity: 1;
}

.custom-select__option.is-disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Fallback when JS has not enhanced the select yet */
.select-field select:not(.custom-select__native) {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5 10 12.5 15 7.5' stroke='%2364748b' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  color: var(--ink);
  font-size: var(--font-body-sm);
  font-weight: 600;
  cursor: pointer;
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.structure-drawing {
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #e4e7ec;
}

.structure-drawing__img {
  display: block;
  width: 100%;
  object-fit: contain;
  background: #e4e7ec;
}

.legend {
  display: grid;
  gap: 10px;
  color: var(--color-text-secondary);
  font-size: var(--font-body);
  line-height: 1.45;
}

.legend span {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 8px;
}

.legend b {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}

.content-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 14px;
}

.content-head h2 {
  font-size: var(--font-h2);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}

.bearing-page .content-head h2::after {
  display: none;
}

.view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.toggle-btn {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #3f4a58;
  font-size: var(--font-body-sm);
  font-weight: 700;
}

.toggle-btn.active {
  color: var(--blue);
  background: var(--blue-soft);
}

.series-note {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 14px;
  padding: 0 18px;
  border-radius: 8px;
  background: #f0f5ff;
  color: #334155;
  font-size: var(--font-body);
  line-height: var(--leading-relaxed);
}

.series-note .dot {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--blue);
  border-radius: 50%;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
}

.spec-table {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 14px 34px rgba(18, 28, 45, .055);
}

.spec-row {
  display: grid;
  grid-template-columns:
    48px
    minmax(56px, .82fr)
    repeat(5, minmax(40px, .68fr))
    minmax(80px, .85fr)
    minmax(44px, .58fr)
    52px
    34px;
  column-gap: 6px;
  align-items: center;
  min-height: 54px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  font-size: var(--font-body-sm);
  transition: background .15s ease;
}

.spec-row:not(.header):hover {
  background: #fafbfd;
}

.spec-row > * {
  display: flex;
  align-items: center;
  align-self: stretch;
  min-width: 0;
  padding: 8px 2px;
  line-height: 1.35;
}

.spec-row.header {
  min-height: 56px;
  background: #fbfcfe;
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.spec-row.header > * {
  justify-content: center;
}

.spec-row.header > :nth-child(2) {
  justify-content: flex-start;
}

.spec-row:last-child {
  border-bottom: 0;
}

.spec-row strong {
  font-weight: 750;
}

.spec-row:not(.header) > :nth-child(2) {
  justify-content: flex-start;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -.02em;
}

.spec-row:not(.header) > :nth-child(3),
.spec-row:not(.header) > :nth-child(4),
.spec-row:not(.header) > :nth-child(5),
.spec-row:not(.header) > :nth-child(6),
.spec-row:not(.header) > :nth-child(7),
.spec-row:not(.header) > :nth-child(9) {
  justify-content: center;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.spec-row:not(.header) > :nth-child(8) {
  justify-content: center;
  color: #475569;
  font-size: var(--font-caption);
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.spec-row > .table-thumb {
  align-self: center;
  justify-self: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 32%, #1f2328 33% 39%, #f4f5f6 40% 52%, #9aa1aa 53% 58%, #23272c 59% 64%, #fff 65%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

.spec-row > :first-child,
.spec-row > :last-child {
  justify-content: center;
  padding-inline: 0;
}

.spec-row > :last-child {
  align-self: center;
}

.view-link {
  justify-content: center;
  align-self: center;
  min-width: 46px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #c7e2c7;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: var(--font-caption);
  font-weight: 700;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.view-link:hover {
  background: #e5f2e5;
  border-color: #b1e2b1;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.download-link::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12M8 11l4 4 4-4M5 21h14'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12M8 11l4 4 4-4M5 21h14'/%3E%3C/svg%3E") center / contain no-repeat;
}

.download-link:hover {
  border-color: #c7e2c7;
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(0, 110, 0, .12);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 6px 0;
  color: #334155;
  font-size: var(--font-body-sm);
}

.pages {
  display: flex;
  gap: 8px;
  align-items: center;
}

.page-btn {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 800;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.page-btn:not(.active):not(.is-disabled):hover {
  border-color: #c7e2c7;
  color: var(--blue);
  background: #fcfdff;
}

.page-btn.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.page-btn.is-disabled {
  opacity: .45;
  cursor: not-allowed;
}

.page-ellipsis {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 32px;
  color: #64748b;
  font-weight: 700;
  user-select: none;
}

@media (max-width: 1080px) {
  .catalog-hero,
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .catalog-hero {
    gap: 28px;
    align-items: stretch;
  }

  .sidebar {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .spec-table {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }

  .spec-table::-webkit-scrollbar {
    height: 6px;
  }

  .spec-table::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #cbd5e1;
  }

  .spec-row {
    min-width: 980px;
    column-gap: 4px;
  }
}

@media (max-width: 720px) {
  .page,
  .catalog-shell {
    width: min(var(--container), calc(100% - 32px));
  }

  .catalog-title {
    font-size: clamp(28px, 8vw, 36px);
    line-height: 1.18;
  }

  .catalog-lead {
    max-width: none;
    margin-top: 16px;
    font-size: 15px;
    line-height: 1.65;
  }

  .catalog-hero {
    gap: 20px;
    padding-bottom: 24px;
  }

  .content-head h2,
  .section-title {
    font-size: clamp(24px, 6.5vw, 30px);
  }

  .section-eyebrow {
    font-size: 10px;
    letter-spacing: .18em;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .content-head,
  .pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .content-head {
    gap: 12px;
  }

  .view-toggle {
    align-self: flex-start;
  }

  .series-note {
    font-size: var(--font-caption);
    line-height: 1.55;
  }

  .section-title {
    overflow-wrap: anywhere;
  }

  .spec-table {
    border-radius: 10px;
  }

  .spec-row {
    min-width: 860px;
    min-height: 48px;
    padding: 0 8px;
    column-gap: 2px;
    font-size: 12px;
    grid-template-columns:
      40px
      minmax(48px, .82fr)
      repeat(5, minmax(32px, .68fr))
      minmax(68px, .85fr)
      minmax(36px, .58fr)
      44px
      28px;
  }

  .spec-row.header {
    min-height: 44px;
    font-size: 9px;
    letter-spacing: .1em;
  }

  .spec-row > * {
    padding: 6px 0;
  }

  .spec-row > .table-thumb {
    width: 24px;
    height: 24px;
  }

  .view-link {
    min-width: 40px;
    height: 26px;
    font-size: 11px;
  }

  .download-link {
    width: 26px;
    height: 26px;
  }

  .download-link::before {
    width: 12px;
    height: 12px;
  }

  .pagination {
    gap: 12px;
  }

  .pagination .pages {
    justify-content: center;
    flex-wrap: wrap;
  }
}

