.products-page .site-header,
.product-detail-page .site-header {
  position: sticky;
  top: 0;
}

#all-products-title {
  scroll-margin-top: 140px;
}

.products-page main {
  background: var(--injd-page-bg);
}

.products-breadcrumb {
  background: #f4f8fb;
}

.products-breadcrumb .container {
  display: flex;
  min-height: 50px;
  align-items: center;
}

.products-breadcrumb .breadcrumbs {
  gap: 10px;
  color: #24364b;
  font-size: 14px;
}

.products-breadcrumb .breadcrumbs li,
.products-breadcrumb .breadcrumbs a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.products-breadcrumb .breadcrumbs a {
  color: #172c43;
}

.products-breadcrumb .breadcrumbs .icon {
  width: 18px;
  height: 18px;
  color: #0879c9;
}

.products-hero {
  position: relative;
  overflow: hidden;
  background: #062d58;
}

.products-hero::before {
  position: absolute;
  inset: 0 0 0 43%;
  background: url("../images/product-hero.jpg") center / cover no-repeat;
  content: "";
  filter: saturate(0.8);
  transform: scale(1.03);
}

.products-hero::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #062d58 0%, #073a70 38%, rgb(6 45 88 / 82%) 53%, rgb(6 45 88 / 15%) 100%);
  content: "";
}

.products-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 208px;
  align-items: center;
}

.products-hero__content {
  width: min(720px, 60%);
  padding-block: 28px;
}

.products-hero h1 {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 12px;
  color: var(--color-white);
  font-size: 46px;
  letter-spacing: -1.5px;
}

.products-hero h1::before {
  width: 9px;
  height: 42px;
  flex: 0 0 auto;
  background: #008cff;
  content: "";
  transform: skew(-20deg);
}

.products-hero__content > p {
  max-width: 700px;
  margin: 0;
  color: #f2f7fc;
  font-size: 18px;
  line-height: 1.65;
}

.products-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 30px;
  padding-top: 40px;
  padding-bottom: 52px;
}

.filters {
  align-self: start;
  padding: 22px;
  border: 1px solid #e3e9f0;
  border-radius: 12px;
  background: #f5f7f9;
  box-shadow: 0 10px 30px rgb(16 24 40 / 6%);
}

.filters__title {
  margin-bottom: 19px;
  font-size: 20px;
  letter-spacing: -0.3px;
}

.filters__mobile-header,
.filters__apply {
  display: none;
}

.filter-group {
  padding: 15px 0;
  border-top: 1px solid #edf0f4;
}

.filter-group__heading {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  padding: 0;
  color: var(--color-text);
  background: transparent;
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-align: left;
}

button.filter-group__heading > span {
  color: var(--color-muted);
  font-size: 17px;
  transition: transform var(--transition-fast);
}

button.filter-group__heading[aria-expanded="false"] > span {
  transform: rotate(180deg);
}

.filter-group__heading[aria-expanded="false"] + .filter-group__body {
  display: none;
}

.filter-group__body {
  display: grid;
  gap: 10px;
}

.check-filter {
  display: grid;
  min-width: 0;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 13px;
  cursor: pointer;
}

.check-filter:hover {
  color: var(--color-primary);
  background: var(--color-surface);
}

.check-filter:has(input:checked) {
  color: var(--color-primary);
  font-weight: 700;
}

.check-filter input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.filter-search {
  padding-bottom: 12px;
}

.filter-search form {
  display: flex;
  height: 36px;
  overflow: hidden;
  border: 1px solid #dce3eb;
  border-radius: var(--radius-sm);
}

.filter-search input {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 0;
  outline: 0;
  font-size: var(--font-size-xs);
}

.filter-search input:focus {
  box-shadow: inset 0 0 0 2px rgb(0 109 255 / 25%);
}

.filter-search button[type="submit"] {
  display: grid;
  width: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--color-white);
  background: var(--color-primary);
}

.filter-search button[type="submit"]:hover {
  background: var(--color-primary-dark);
}

.filter-search .filters__reset {
  margin-top: 10px;
}

.filter-search button .icon {
  width: 18px;
  height: 18px;
}

.filters__reset {
  padding: 0;
  color: var(--color-primary);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.filter-backdrop,
.mobile-filter-button {
  display: none;
}

.products-content {
  min-width: 0;
}

.all-products-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 20px;
}

.all-products-heading h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.4px;
}

.all-products-heading h2 span {
  color: var(--color-muted);
  font-weight: 500;
  white-space: nowrap;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dce4ed;
  border-radius: 12px;
  background: var(--color-white);
  box-shadow: 0 3px 12px rgb(16 24 40 / 4%);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.product-card:hover {
  border-color: #a9c7ee;
  box-shadow: 0 12px 28px rgb(16 24 40 / 12%);
  transform: translateY(-4px);
}

.product-card[hidden] {
  display: none;
}

.product-card__media {
  position: relative;
  height: 225px;
  padding: 48px 12px 12px;
  overflow: hidden;
  background: var(--color-white);
}

.product-card__image {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 5px;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.product-card:hover .product-card__image {
  transform: scale(1.035);
}

.product-brand {
  position: absolute;
  top: 15px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  color: var(--color-navy);
  background: var(--color-white);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.product-brand--bosch {
  color: #d71920;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.product-brand--bosch::before {
  display: inline-grid;
  width: 23px;
  height: 23px;
  margin-right: 7px;
  place-items: center;
  border: 1.5px solid #4b5563;
  border-radius: 50%;
  color: #4b5563;
  content: "H";
  font-family: Georgia, serif;
  font-size: 12px;
}

.product-brand--delphi {
  color: #d72c32;
  font-style: italic;
}

.product-brand--denso {
  color: #c6262d;
  font-style: italic;
}

.product-brand--cummins {
  color: #111d55;
}

.product-brand--caterpillar {
  color: #171717;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.6px;
}

.product-brand--vdo {
  color: #1b256b;
  font-style: italic;
  letter-spacing: 1px;
}

.product-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 5px;
  color: var(--color-white);
  background: var(--color-primary);
  box-shadow: 0 3px 8px rgb(0 109 255 / 18%);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.product-badge--cyan {
  background: #0787c9;
}

.product-badge--dark {
  background: var(--color-navy);
}

.product-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px 18px 20px;
}

.product-card h3 {
  margin: 0 0 14px;
  color: var(--color-navy);
  font-size: 18px;
  line-height: 1.35;
}

.product-card__specs {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.product-card__specs > div {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

.product-card__specs dt {
  flex: 0 0 auto;
}

.product-card__specs dt::after {
  content: ":";
}

.product-card__specs dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.product-card__actions {
  display: flex;
  margin-top: auto;
}

.product-card__quote {
  display: none;
}

.product-card__details {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 9px;
  padding: 0;
  color: var(--color-primary);
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.product-card__details > span {
  font-size: 20px;
  transition: transform var(--transition-fast);
}

.product-card__details:hover {
  color: var(--color-primary-dark);
}

.product-card__details:hover > span {
  transform: translateX(4px);
}

.empty-products {
  padding: 58px 20px;
  border: 1px solid #dce5ef;
  border-radius: 12px;
  background: var(--color-white);
  box-shadow: 0 8px 24px rgb(16 24 40 / 5%);
  text-align: center;
}

.empty-products h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.empty-products p {
  margin-bottom: 20px;
  color: var(--color-muted);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 34px;
}

/* 分页是真链接（服务端出页），所以样式挂在 .pagination__item 上，
   当前页与不可用的首/末页用 span 渲染。 */
.pagination__item {
  display: grid;
  min-width: 38px;
  height: 38px;
  place-items: center;
  padding: 0 9px;
  border: 1px solid #dfe5ed;
  border-radius: 8px;
  background: var(--color-white);
  font-size: 13px;
  transition: border-color var(--transition-fast), color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.pagination__item:hover:not(.is-disabled):not(.is-active),
.pagination__item.is-active {
  border-color: var(--color-primary);
  color: var(--color-white);
  background: var(--color-primary);
}

.pagination__item.is-active {
  box-shadow: 0 5px 12px rgb(0 109 255 / 22%);
}

.pagination__item.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.pagination__dots {
  padding-inline: 3px;
  color: var(--color-muted);
}

.product-dialog__image {
  border-radius: 10px;
  background: var(--injd-page-bg);
}

.product-dialog__close {
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.product-dialog__close:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

@media (min-width: 1920px) {
  .products-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 36px;
  }

  .product-card__media {
    height: 200px;
  }

  .product-card h3 {
    font-size: 16px;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .products-layout {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 22px;
  }

  .filters {
    padding: 16px;
  }

  .products-hero h1 {
    font-size: 36px;
  }

  .products-hero__content {
    width: 62%;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .all-products-heading {
    align-items: flex-start;
  }

}

@media (min-width: 768px) and (max-width: 1023px) {
  .products-hero__inner {
    min-height: 208px;
  }

  .products-hero__content {
    width: 67%;
  }

  .products-hero h1 {
    font-size: 32px;
  }

  .products-layout {
    grid-template-columns: 218px minmax(0, 1fr);
    gap: 20px;
    padding-top: 28px;
  }

  .filters {
    padding: 15px;
  }

  .filters__title {
    font-size: 18px;
  }

  .filter-group__heading,
  .check-filter {
    font-size: 12px;
  }

  .all-products-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product-card__media {
    height: 170px;
  }

}

@media (max-width: 767px) {
  .products-breadcrumb .container {
    min-height: 44px;
  }

  .products-hero::before {
    inset: 0;
    opacity: 0.35;
  }

  .products-hero::after {
    background: linear-gradient(90deg, rgb(6 45 88 / 96%), rgb(6 45 88 / 72%));
  }

  .products-hero__inner {
    min-height: 238px;
  }

  .products-hero__content {
    width: 100%;
    padding-block: 30px;
  }

  .products-hero h1 {
    gap: 14px;
    font-size: 34px;
    letter-spacing: -1px;
  }

  .products-hero h1::before {
    width: 7px;
    height: 34px;
  }

  .products-hero__content > p {
    font-size: 16px;
    line-height: 1.6;
  }

  .products-layout {
    display: block;
    padding-top: 26px;
    padding-bottom: 34px;
  }

  .filters {
    position: fixed;
    z-index: 110;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(360px, 88vw);
    padding: 18px 22px 28px;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    box-shadow: 10px 0 40px rgb(0 0 0 / 20%);
    transform: translateX(-105%);
    transition: transform var(--transition-base);
  }

  .filters.is-open {
    transform: translateX(0);
  }

  .filters__title {
    display: none;
  }

  .filters__mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 20px;
  }

  .filters__mobile-header button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--color-muted);
    background: var(--color-surface);
    font-size: 25px;
  }

  .filters__apply {
    display: flex;
    width: 100%;
    margin-top: 22px;
  }

  .filter-backdrop {
    position: fixed;
    z-index: 105;
    inset: 0;
    background: rgb(4 15 29 / 60%);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
  }

  .filter-backdrop.is-visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-filter-button {
    display: inline-flex;
    min-height: 38px;
    padding: 8px 13px;
  }

  .mobile-filter-button .icon {
    width: 18px;
    height: 18px;
  }

  .all-products-heading {
    flex-flow: row wrap;
    align-items: center;
    gap: 14px;
    margin-top: 0;
  }

  .all-products-heading h2 {
    font-size: 20px;
  }

  .all-products-heading .mobile-filter-button {
    margin-left: auto;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product-card__media {
    height: 160px;
  }

  .product-card__body {
    padding: 16px 12px 12px;
  }

  .product-card h3 {
    font-size: 14px;
  }

  .product-card__specs > div {
    font-size: 11px;
  }

  .product-card__actions {
    gap: 8px;
  }

  .product-card__quote,
  .product-card__details {
    min-height: 42px;
    padding-inline: 8px;
    font-size: 12px;
  }

  .product-brand {
    font-size: 13px;
  }

  .product-brand--bosch,
  .product-brand--delphi,
  .product-brand--caterpillar {
    font-size: 11px;
  }

  .product-brand--bosch::before {
    display: none;
  }

  .product-badge {
    padding: 5px 7px;
    font-size: 9px;
  }

  .pagination {
    gap: 4px;
  }

  .pagination__item {
    min-width: 31px;
    height: 32px;
    padding-inline: 6px;
  }

}

@media (max-width: 767px) {
  .product-card__media {
    height: 190px;
  }

  .product-card h3 {
    font-size: 16px;
  }

  .product-card__specs > div {
    font-size: 12px;
  }

  .product-card__details {
    min-height: 30px;
    padding-inline: 0;
    font-size: 14px;
  }
}

@media (max-width: 479px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-card__media {
    height: 190px;
  }

  .product-card h3 {
    font-size: 16px;
  }

  .product-brand,
  .product-brand--bosch,
  .product-brand--delphi,
  .product-brand--caterpillar {
    font-size: 14px;
  }

  .product-badge {
    font-size: 9px;
  }


}

.product-card--catalog {
  min-height: 320px;
  padding: 18px;
  border-color: #e1e6ea;
  border-radius: 10px;
  background: var(--color-white);
}

.product-card--catalog:hover {
  border-color: #b7d6eb;
  box-shadow: 0 10px 24px rgb(16 55 85 / 8%);
  transform: translateY(-2px);
}

.product-card--catalog .product-card__media {
  height: 150px;
  margin: 0 0 14px;
  padding: 0;
  overflow: hidden;
  background: var(--color-white);
}

.product-card--catalog .product-card__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.product-card--catalog > h3 {
  margin: 0 0 5px;
  color: var(--color-navy);
  font-size: 19px;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.product-card--catalog > .product-card__name {
  min-height: 40px;
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.4;
  /* 标题固定两行，超出裁掉并收省略号，保证同一行的卡片高度一致 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: break-word;
}

 .product-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.product-card__badges span {
  padding: 4px 10px;
  border-radius: 4px;
  color: #4b5563;
  background: #f2f4f6;
  font-size: 13px;
  line-height: 1.3;
}

.product-card__badges span:first-child {
  color: var(--color-white);
  background: #0879c9;
}

.product-card--catalog > .product-card__details {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: auto;
  padding: 8px 12px;
  border: 1px solid #dce3e8;
  border-radius: 6px;
  color: #0759a6;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  transition: border-color var(--transition-fast), color var(--transition-fast), background-color var(--transition-fast);
}

.product-card--catalog > .product-card__details:hover {
  border-color: #0879c9;
  color: var(--color-white);
  background: #0879c9;
}

@media (max-width: 767px) {
  .product-card--catalog .product-card__media {
    height: 190px;
  }
}

@media (max-width: 479px) {
  .product-card--catalog {
    min-height: 0;
  }

  .product-card--catalog > .product-card__name {
    min-height: 0;
  }
}

.product-card--catalog .product-card__media {
  height: auto;
  aspect-ratio: 4 / 3;
}
