.header-inner {
  height: auto;
  min-height: 96px;
  gap: 20px;
}

.header .brand {
  display: grid;
  grid-template-columns: 48px max-content;
  align-items: center;
  gap: 4px 8px;
  padding: 10px 0;
}

.header .brand > img { width: 48px; height: 48px; }
.header .brand > span:first-of-type { gap: 2px; }
.header .brand small { padding-left: 25px; }
.header .brand-tagline {
  grid-column: 1 / -1;
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
}

.header nav { gap: clamp(14px, 2.6vw, 34px); white-space: nowrap; }
html { scroll-padding-top: 112px; }
.search-box { border: 1px solid #9cb6ca; background: #f8fbfd; }
.catalog-toolbar { gap: 15px; }
.search-sort { flex-wrap: wrap; }

.category-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  background: transparent;
  border: 0;
}

.category-grid > .category-card:nth-child(n) {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  min-height: 68px;
  padding: 10px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: left;
}

.category-grid .category-icon { flex: 0 0 32px; width: 32px; height: 32px; }
.category-grid .category-icon svg { width: 19px; height: 19px; }
.category-grid .category-card > span:nth-child(2) { width: auto; min-width: 0; }
.category-grid .category-card strong { font-size: 13px; line-height: 1.35; }
.category-grid .category-card small,
.category-grid .category-card > .icon { display: none; }

.product-grid.catalog-grouped { display: block; }
.catalog-group {
  margin: 0 0 28px;
  padding: 16px;
  background: #f5f7f9;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.catalog-group-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.catalog-group-heading h3 { margin: 0; font-size: 21px; line-height: 1.35; }
.catalog-group-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.catalog-group-heading button,
.catalog-group-heading > a {
  border: 1px solid #cbd5df;
  border-radius: 6px;
  padding: 7px 9px;
  background: white;
  font-size: 12px;
  white-space: nowrap;
}

.catalog-group .product-grid,
#product-grid:not(.catalog-grouped) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

.product-card { display: flex; flex-direction: column; min-width: 0; background: #fff; }
.product-card .product-art { height: clamp(114px, 12vw, 156px); padding: 8px; flex: none; }
.product-card .product-art img { width: 100%; height: 100%; object-fit: contain; }
.product-card .product-body { display: flex; flex: 1; flex-direction: column; min-width: 0; padding: 10px; }
.product-card .product-category { margin: 0 0 4px; font-size: 10px; line-height: 1.4; }
.product-card .product-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.4;
  min-height: 2.8em;
  margin: 0 0 6px;
}

.product-card .spec-tags {
  display: block;
  margin: 0 0 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card .spec-tags:empty { display: none; }
.product-card .spec-tags span { margin-right: 3px; }
.product-card .card-warranty,
.product-card .card-stock {
  overflow: hidden;
  margin: 2px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card .product-price { margin-top: auto; padding-top: 6px; min-height: 0; }
.product-card .product-price small { font-size: 10px; }
.product-card .product-price strong { font-size: 17px; line-height: 1.4; }
.product-card .product-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
  padding-top: 6px;
}

.product-card .product-actions .text-button,
.product-card .product-actions .add-quote {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 4px 2px;
  text-align: center;
  font-size: 11px;
  line-height: 1.3;
}

.product-card .product-actions a[href^="/dat-hang"] { border-radius: 5px; background: var(--blue); color: #fff; }
.product-page-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.breadcrumbs > span:last-child,
.product-information h1,
.product-description { overflow-wrap: anywhere; }
.product-description { white-space: pre-line; }

@media (max-width: 950px) {
  .category-grid .category-card strong { font-size: 12px; }
  .catalog-group .product-grid,
  #product-grid:not(.catalog-grouped) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .header-inner { min-height: 76px; gap: 8px; }
  .header .brand { grid-template-columns: 39px max-content; gap: 3px 6px; padding: 7px 0; }
  .header .brand > img { width: 39px; height: 39px; }
  .header .brand small { padding-left: 22px; }
  .header .brand-tagline { font-size: 8px; }
  .header nav { top: 100%; gap: 8px 18px; }
  .header nav a { padding: 10px 0; }
  html { scroll-padding-top: 86px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .header-actions { gap: 4px; }
  .header .button, .header .menu-toggle { min-height: 44px; }
  .header .menu-toggle { min-width: 40px; }
  .category-grid > .category-card:nth-child(n) { min-height: 49px; padding: 7px 9px; }
  .catalog-group { padding: 7px; margin-bottom: 16px; }
  .catalog-group-heading h3 { font-size: 17px; }
  .catalog-group-heading p { display: none; }
  .catalog-group-heading button, .catalog-group-heading > a { font-size: 11px; }
  .catalog-group .product-grid,
  #product-grid:not(.catalog-grouped) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .product-card .product-art { height: clamp(84px, 25vw, 118px); }
  .product-card .product-body { padding: 7px; }
  .product-card .product-category { font-size: 9px; }
  .product-card .product-title { font-size: 12px; margin-bottom: 4px; }
  .product-card .card-warranty, .product-card .spec-tags { display: none; }
  .product-card .card-stock, .product-card .product-price small { font-size: 10px; }
  .product-card .product-price strong { font-size: 14px; }
  .product-card .product-actions .text-button,
  .product-card .product-actions .add-quote { font-size: 10px; }
  .product-page-grid { grid-template-columns: minmax(0, 1fr); }
  .gallery-main { min-height: 0; }
  .gallery-main img { height: clamp(185px, 60vw, 280px); }
}
