:root {
  --navy: #0e2245;
  --blue: #0184ff;
  --blue-dark: #0d4894;
  --muted: #5d6472;
  --line: #e4e7eb;
  --bg: #f6f7f8;
  --white: #fff;
  --text: #121826;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Rubik, system-ui, sans-serif;
  color: var(--text);
  background: var(--white);
  min-height: 100vh;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--navy);
  text-decoration: none;
  margin-right: 8px;
}
.catalog-btn {
  background: var(--blue);
  color: var(--white);
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
}
.catalog-btn__chevron { display: inline-flex; padding: 2px; }
.catalog-btn[aria-expanded="true"] { background: var(--navy); }
.search { position: relative; flex: 1; min-width: 160px; }
.search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--bg);
}
.search__suggest {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 360px;
  overflow: auto;
  z-index: 30;
}
.search__suggest a {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.search__suggest a:hover { background: var(--bg); }
.search__suggest small { color: var(--muted); margin-left: 8px; }
.header__compare, .header__phone {
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  color: var(--navy);
}
.badge {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  margin-left: 4px;
}
.mega {
  border-top: 1px solid var(--line);
  background: var(--white);
}
.mega__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.mega a {
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
  text-decoration: none;
  background: var(--bg);
}
.mega a:hover { background: #eaf3ff; }
.mega a strong { display: block; }
.mega a span { color: var(--muted); font-size: 13px; }

#app { max-width: 1280px; margin: 0 auto; padding: 24px 20px 96px; }

.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.crumbs a { text-decoration: none; color: var(--blue-dark); }
.page-title { margin: 0 0 8px; font-size: 32px; color: var(--navy); }
.page-blurb { margin: 0 0 24px; color: var(--muted); max-width: 720px; }

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.hub-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  background: var(--white);
}
.hub-tile:hover { border-color: var(--blue); }
.hub-tile h2 { margin: 0 0 8px; font-size: 18px; color: var(--navy); }
.hub-tile p { margin: 0; color: var(--muted); font-size: 14px; }
.hub-tile .count { margin-top: 16px; font-weight: 600; color: var(--blue-dark); }

.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 13px;
  background: var(--white);
  cursor: pointer;
  color: inherit;
}
.chip span { color: var(--muted); font-size: 12px; }
.chip.is-active, .chip:hover { border-color: var(--blue); color: var(--blue-dark); background: #eaf3ff; }
.chip--type { padding: 10px 14px; font-weight: 500; }

.listing { display: grid; grid-template-columns: 260px 1fr; gap: 24px; }
.filters {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--bg);
  align-self: start;
  position: sticky;
  top: 80px;
}
.filters h3 { margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.filter-group { margin-bottom: 16px; }
.filter-group + .filter-group { border-top: 1px solid var(--line); padding-top: 12px; }
.filter-group h4 { margin: 0 0 8px; font-size: 14px; }
.filter-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin: 4px 0;
  cursor: pointer;
}
.filter-group .n { color: var(--muted); margin-left: auto; font-size: 12px; }
.filters-reset { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; }

.listing-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.listing-head select { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--white); }

.cards { display: flex; flex-direction: column; gap: 12px; }
.card {
  display: grid;
  grid-template-columns: 180px 1fr 168px;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--white);
}
.card__media { position: relative; background: var(--bg); border-radius: 8px; overflow: hidden; min-height: 140px; }
.card__media img { width: 100%; height: 160px; object-fit: contain; }
.card__actions { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.card__compare-btn.is-active { border-color: var(--blue); color: var(--blue-dark); background: #eaf3ff; }
.card h3 { margin: 0 0 4px; font-size: 18px; }
.card__about { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.card__chem { font-size: 12px; color: var(--blue-dark); font-weight: 500; margin-bottom: 4px; }
.card__specs { margin: 0; display: grid; gap: 4px; }
.card__specs div { display: grid; grid-template-columns: 140px 1fr; gap: 8px; font-size: 13px; }
.card__specs dt { color: var(--muted); }
.card__specs dd { margin: 0; }
.card__side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; text-align: right; }
.price-kg { font-size: 22px; font-weight: 700; color: var(--navy); }
.price-unit, .price-m2 { font-size: 13px; color: var(--muted); }
.btn {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.btn--primary { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }
.btn--primary:hover { background: var(--blue-dark); }
.card__side .btn { width: 100%; }

.compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--navy);
  color: #fff;
}
.compare-bar[hidden] { display: none; }
.compare-bar .btn { width: auto; }
.compare-bar .btn--primary { background: var(--blue); }

.empty { padding: 48px 0; color: var(--muted); }

.pdp { display: grid; grid-template-columns: 360px 1fr; gap: 32px; }
.pdp img { width: 100%; background: var(--bg); border-radius: 12px; }
.pdp__prices { display: flex; gap: 24px; margin: 16px 0; }
.pdp table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.pdp td { border-bottom: 1px solid var(--line); padding: 8px 0; }
.pdp td:first-child { color: var(--muted); width: 45%; }

.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td {
  border: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
  min-width: 180px;
}
.compare-table th { background: var(--bg); }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(14, 34, 69, 0.45);
  display: grid;
  place-items: center;
  z-index: 40;
}
.modal[hidden] { display: none; }
.modal__card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: min(440px, calc(100% - 32px));
}
.modal__card input, .modal__card textarea {
  width: 100%;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.modal__actions { display: flex; gap: 8px; margin-top: 8px; }

.related { margin-top: 40px; }
.related h2 { font-size: 22px; }

@media (max-width: 900px) {
  .listing { grid-template-columns: 1fr; }
  .filters { position: static; }
  .card { grid-template-columns: 1fr; }
  .card__side { align-items: stretch; text-align: left; }
  .pdp { grid-template-columns: 1fr; }
  .header__phone { display: none; }
}
