/* Chỉ nạp cho danh mục Greenkite: nền trắng phẳng kiểu catalog B2B — không họa tiết, không hộp; ngăn bằng đường kẻ mảnh. */
.kmb-catalog-sidebar {
  display: none;
}

.gk-catalog-layout .kmb-catalog-pagination .page-numbers {
  border-radius: var(--radius-control);
}

.gk-filter-row {
  display: flex;
  min-height: 2.25rem;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  color: var(--color-body);
  font-size: 0.875rem;
}

/* Bảng lọc mobile (catalog-directory-mobile.php): hàng cao 44px cho ngón tay. */
.gk-filter-sheet .gk-filter-row {
  min-height: 2.75rem;
}

.gk-filter-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.gk-filter-row:hover .gk-filter-label {
  color: var(--color-link-hover);
}

.gk-filter-check {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: var(--color-action);
}

.gk-filter-row:has(.gk-filter-check:checked) {
  color: var(--color-link);
  font-weight: 600;
}

.gk-filter-logo {
  width: 3rem;
  height: 1.5rem;
  flex-shrink: 0;
  object-fit: contain;
}

.gk-sector-link {
  display: flex;
  min-height: 2.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-left: 2px solid transparent;
  padding-inline: 0.75rem;
  color: var(--color-body);
}

.gk-sector-link:hover {
  color: var(--color-link-hover);
}

.gk-sector-link[aria-current='page'] {
  border-left-color: var(--color-line-action);
  color: var(--color-link);
  font-weight: 600;
}

.gk-sector-link[aria-current='page'] .gk-sector-count {
  color: inherit;
}

/* Mobile: sidebar mở bằng nút Lọc; từ lg luôn hiện, nút Lọc ẩn. */
.gk-catalog-layout[data-filters-open] .kmb-catalog-sidebar {
  display: grid;
}

.gk-catalog-consultation {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background-color: var(--color-consultation);
}

.gk-catalog-consultation-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.2;
  object-fit: cover;
  object-position: right center;
}

.gk-catalog-consultation-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.5rem;
}

@media (width >= 768px) {
  .gk-catalog-consultation {
    display: flex;
    align-items: center;

    /* Cao theo đúng tỉ lệ ảnh (2058×764) để ảnh phủ kín mà không cắt mất sản phẩm; nội dung dài hơn thì khối tự cao thêm. */
    aspect-ratio: 2058 / 764;
  }

  /* Thêm bản .woocommerce-page (0,2,0) để thắng .woocommerce-page img { height: auto } của WooCommerce (0,1,1):
     thua thì ảnh cao theo tỉ lệ gốc, dính mép trên và bị khối cắt mất đáy. */
  .gk-catalog-consultation-image,
  .woocommerce-page .gk-catalog-consultation-image {
    position: absolute;
    inset: 0;
    height: 100%;
    aspect-ratio: auto;
    object-position: center;
  }

  .gk-catalog-consultation-content {
    width: 44%;
    padding: 2rem;
  }
}

@media (width >= 1024px) {
  .gk-catalog-layout {
    grid-template-columns: 17rem minmax(0, 1fr);
  }

  /* Dính dưới header (top/--kmb-filter-offset của lõi); cây ngành hàng + bộ lọc dài hơn màn hình nên cả cột tự cuộn. */
  .gk-catalog-layout .kmb-catalog-sidebar {
    display: grid;
    max-height: calc(100dvh - var(--kmb-filter-offset) - 1rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .gk-catalog-layout .kmb-catalog-sidebar form {
    max-height: none;
    overflow: visible;
  }

  .gk-filter-toggle {
    display: none;
  }

  .gk-catalog-products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (width >= 1440px) {
  .gk-catalog-products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Lõi tô nền trang danh mục bằng bg-surface-muted trên <body>; Greenkite giữ nền trắng phẳng. */
body.bg-surface-muted {
  background-color: var(--color-surface);
}

/* Ô tìm trong danh mục: góc vuông nhẹ như ô chọn sắp xếp, không dạng viên. */
.gk-catalog-results .kmb-search-field,
.gk-catalog-results .kmb-search-field-action {
  border-radius: var(--radius-control);
}

/* Mobile: lõi tô nền xám nhạt quanh thẻ kiểu app; Greenkite giữ nền trắng, thẻ ngăn bằng đường kẻ. */
body.kmb-catalog-device-mobile {
  background-color: var(--color-surface);
}

/* Đường kẻ 1px giữa các ô sản phẩm: nền lưới lộ qua khe `gap-px` (màu đường kẻ, không phải nền). */
.gk-catalog-products {
  background-color: var(--color-line);
}
