/* Product directory: remove the redundant category chips, search and breadcrumb panel. */
main > section:has(input[placeholder="Search products"]),
main > section:has(input[placeholder="Поиск продукции"]) {
  display: none !important;
}

/* Header product dropdown: keep category names and arrows, hide item totals. */
.products-dropdown-count {
  display: none !important;
}

.hongxin-product-card-image-link,
.hongxin-product-card-title-link {
  cursor: pointer;
}

.hongxin-product-card-category {
  display: none !important;
}

.hongxin-product-card-summary {
  display: none !important;
}

.hongxin-product-card-category + .hongxin-product-card-title-link {
  margin-top: 0 !important;
}

.hongxin-product-card-image-link {
  position: relative;
  outline: none;
}

.hongxin-product-card-logo::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  width: clamp(48px, 4vw, 64px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 13%;
  background-color: transparent;
  background-image: var(
    --hongxin-series-product-logo,
    url("../../dist/assets/images/brand/hongxin-logo-transparent.png")
  );
  background-position: center;
  background-size: 76% auto;
  background-repeat: no-repeat;
  filter: drop-shadow(0 3px 6px rgba(6, 31, 36, 0.18));
  pointer-events: none;
}

.hongxin-product-card-image-link img {
  transition: transform 220ms ease;
}

.hongxin-product-card-image-link:hover img,
.hongxin-product-card-image-link:focus-visible img {
  transform: scale(1.035);
}

.hongxin-product-card-title-link {
  width: fit-content;
  transition: color 160ms ease;
  outline: none;
}

.hongxin-product-card-title-link:hover,
.hongxin-product-card-title-link:focus-visible {
  color: #106ce2 !important;
}

.hongxin-product-card-range {
  display: -webkit-box !important;
  box-sizing: border-box;
  height: calc(2 * 1.45em);
  min-height: calc(2 * 1.45em);
  margin: 7px 0 0;
  overflow: hidden;
  color: #55657a;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.hongxin-minimal main main article > div:last-child > h3 + p.hongxin-product-card-range {
  display: -webkit-box !important;
}

.hongxin-product-card-range--empty {
  visibility: hidden;
}

.hongxin-product-card-range__label {
  color: #26384f;
  font-weight: 600;
}

.hongxin-product-card-image-link:focus-visible,
.hongxin-product-card-title-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(47, 134, 246, 0.28);
}

/* Product directory: replace the long category tree with four collapsed groups. */
.hongxin-product-source-nav {
  display: none !important;
}

[data-hongxin-product-toggle] {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

[data-hongxin-product-toggle]::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 4px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 160ms ease;
}

[data-hongxin-product-toggle][aria-expanded="true"]::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

.hongxin-product-accordion {
  border-right: 1px solid #e3e9f1;
  border-left: 1px solid #e3e9f1;
  background: #fff;
}

.hongxin-product-accordion[hidden] {
  display: none !important;
}

.hongxin-product-accordion__group {
  border-bottom: 1px solid #e3e9f1;
}

.hongxin-product-accordion__trigger,
.hongxin-product-accordion__item {
  width: 100%;
  min-width: 0;
  border: 0;
  background: #fff;
  color: #161d27;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.hongxin-product-accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px 12px 22px;
  font-size: 15px;
  font-weight: 600;
}

.hongxin-product-accordion__trigger:hover,
.hongxin-product-accordion__trigger:focus-visible,
.hongxin-product-accordion__trigger[aria-expanded="true"] {
  background: #f2f6fb;
  color: #005dff;
  outline: none;
}

.hongxin-product-accordion__label {
  min-width: 0;
  line-height: 1.3;
}

.hongxin-product-accordion__chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 160ms ease;
}

.hongxin-product-accordion__trigger[aria-expanded="true"] .hongxin-product-accordion__chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.hongxin-product-accordion__panel[hidden] {
  display: none !important;
}

.hongxin-product-accordion__item {
  min-height: 42px;
  padding: 10px 14px 10px 34px;
  border-top: 1px solid #edf1f6;
  font-size: 14px;
  line-height: 1.45;
}

.hongxin-product-accordion__item:hover,
.hongxin-product-accordion__item:focus-visible {
  background: #f7f9fc;
  color: #005dff;
  outline: none;
}

/* Product directory: show six products per page in a two-row, three-column grid. */
.hongxin-product-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

.hongxin-product-grid > article[hidden] {
  display: none !important;
}

.hongxin-product-count {
  display: none !important;
}

.hongxin-product-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.hongxin-product-pagination[hidden] {
  display: none !important;
}

.hongxin-product-pagination__button {
  min-width: 42px;
  height: 42px;
  padding: 0 13px;
  border: 1px solid #c9d5e3;
  background: #fff;
  color: #061733;
  font-size: 14px;
  font-weight: 600;
  line-height: 40px;
  text-align: center;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.hongxin-product-pagination__button:hover,
.hongxin-product-pagination__button:focus-visible {
  border-color: #005dff;
  color: #005dff;
  outline: none;
}

.hongxin-product-pagination__button[aria-current="page"] {
  border-color: #030c2e;
  background: #030c2e;
  color: #fff;
}

.hongxin-product-pagination__button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

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

@media (min-width: 1280px) {
  .hongxin-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 639px) {
  .hongxin-product-card-logo::after {
    top: 10px;
    left: 10px;
    width: 52px;
  }
}
