:root {
  --ink: #18212b;
  --muted: #5e6b78;
  --line: #d8dee6;
  --soft: #f3f6f8;
  --accent: #b7192b;
  --accent-dark: #8e1220;
  --steel: #2f4557;
  --gold: #c99536;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #fff; line-height: 1.5; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px; justify-content: space-between;
  padding: 14px 28px; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; background: var(--accent); color: #fff; border-radius: 6px; }
nav { display: flex; gap: 16px; flex-wrap: wrap; }
nav a, .footer a { color: var(--muted); text-decoration: none; }

.button, button {
  border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 6px;
  padding: 10px 14px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.button.primary, button.primary, .cart-add { background: var(--accent); color: #fff; border-color: var(--accent); }
.button.primary:hover, button.primary:hover, .cart-add:hover { background: var(--accent-dark); }
.cart-button { white-space: nowrap; gap: 4px; }

.hero { height: clamp(500px, calc(100vh - 150px), 620px); display: grid; align-items: stretch; position: relative; overflow: hidden; background: var(--steel); }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .62; }
.hero-copy { grid-area: 1/1; align-self: center; max-width: 760px; padding: 56px 7vw; color: #fff; }
.hero h1 { font-size: clamp(44px, 7vw, 86px); line-height: .95; margin: 10px 0 18px; letter-spacing: 0; }
.hero p { max-width: 620px; font-size: 20px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-actions .button:not(.primary) { background: rgba(255,255,255,.92); }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .08em; font-weight: 800; font-size: 13px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.stats div { padding: 24px 28px; border-right: 1px solid var(--line); }
.stats strong { display: block; font-size: 30px; color: var(--accent); }
.stats span { color: var(--muted); }
.compact-stats { margin: 20px 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }

.section, .page { max-width: 1220px; margin: 0 auto; padding: 42px 28px; }
.page-head { display: grid; gap: 14px; }
h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1; margin: 0 0 12px; letter-spacing: 0; }
h2 { margin-top: 0; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 14px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs span { color: var(--ink); }

.toolbar { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto auto; gap: 10px; align-items: center; }
.catalog-toolbar { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.catalog-toolbar input:first-child { min-width: min(280px, 100%); }
.compact-toolbar { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 12px 13px; font: inherit; background: #fff;
}
textarea { min-height: 96px; resize: vertical; }

.filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); }
.filter-row label { display: inline-flex; align-items: center; gap: 7px; }
.filter-row input { width: auto; }
#catalogCount { margin-left: auto; font-weight: 800; color: var(--accent); }

.catalog-guide, .selection-tree {
  display: grid;
  grid-template-columns: minmax(240px, .75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: start;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.catalog-guide h2, .selection-tree h2, .section-head h2 { margin-bottom: 8px; }
.catalog-guide p, .selection-tree p, .section-head p { color: var(--muted); margin-top: 0; }
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.guide-card {
  display: grid;
  gap: 6px;
  justify-items: start;
  min-height: 128px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  border-color: var(--line);
  text-decoration: none;
}
.guide-card:hover, .tree-group button:hover, .family-card:hover { border-color: var(--accent); }
.guide-card span { color: var(--muted); font-weight: 400; }
.guide-card em { color: var(--accent); font-style: normal; font-size: 13px; }
.tree-list { display: grid; gap: 10px; }
.tree-group {
  display: grid;
  grid-template-columns: minmax(190px, 270px) 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft);
}
.tree-group button { justify-content: flex-start; text-align: left; background: #fff; }
.tree-group span { color: var(--muted); }
.family-strip-wrap { margin-top: 24px; }
.section-head {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.family-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 24px;
}
.family-card {
  display: grid;
  gap: 4px;
  min-height: 82px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  text-decoration: none;
  background: var(--soft);
}
.family-card strong { font-size: 17px; }
.family-card span { color: var(--muted); }

.product-list { display: grid; gap: 12px; margin-top: 24px; }
.product-card {
  display: grid; grid-template-columns: 170px 1fr 190px; gap: 18px; align-items: center;
  border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fff;
}
.product-card img { width: 170px; height: 118px; object-fit: cover; border-radius: 6px; }
.product-title { font-size: 20px; font-weight: 800; text-decoration: none; }
.product-card p { margin: 6px 0; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.badges span { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; color: var(--muted); font-size: 12px; background: var(--soft); }
.product-card dl, .specs { display: grid; grid-template-columns: repeat(2, auto 1fr); gap: 4px 10px; margin: 8px 0 0; font-size: 14px; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 700; }
.product-buy { display: grid; justify-items: stretch; gap: 10px; }
.product-buy strong { font-size: 20px; color: var(--accent); }
.old-price { color: var(--muted); text-decoration: line-through; font-size: 14px; }

.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; }
.product-detail img, .split > img { border-radius: 8px; aspect-ratio: 4/3; object-fit: cover; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.admin-grid article { border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: var(--soft); display: grid; gap: 10px; align-content: start; }
.notice { background: #fff7e6; border: 1px solid #efd59c; padding: 12px 14px; border-radius: 6px; }
.seo-copy {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.seo-copy p { max-width: 980px; color: var(--muted); }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 20px; }
.checko-table { width: 100%; border-collapse: collapse; min-width: 980px; background: #fff; }
.checko-table th, .checko-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.checko-table th { background: var(--soft); font-size: 13px; text-transform: uppercase; color: var(--muted); }
.checko-table td span { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.status-pill { display: inline-flex; border-radius: 999px; padding: 4px 9px; background: var(--soft); color: var(--ink); font-size: 13px; white-space: nowrap; }
.status-pill.site_found { background: #e7f7ee; color: #17643a; }
.status-pill.needs_site { background: #fff7e6; color: #7a5200; }
.status-pill.needs_review { background: #eef4ff; color: #244b86; }

.academy .page-head p { max-width: 780px; color: var(--muted); font-size: 18px; }
.learning-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 28px; }
.learning-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #fff;
}
.learning-grid h2 { font-size: 22px; margin-bottom: 10px; }
.learning-grid p { color: var(--muted); }
.learning-grid li { margin: 7px 0; }
.term-list { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0; }
.term-list dt { font-weight: 800; color: var(--accent); }
.learning-band {
  margin-top: 20px;
  padding: 22px;
  border-radius: 8px;
  background: var(--steel);
  color: #fff;
}
.learning-band p { max-width: 920px; }

.cart {
  position: fixed; right: 18px; top: 78px; width: min(440px, calc(100vw - 36px)); max-height: calc(100vh - 96px);
  overflow: auto; background: #fff; border: 1px solid var(--line); box-shadow: 0 20px 70px rgba(20,30,40,.22); border-radius: 8px; padding: 16px; z-index: 40;
}
.cart-head, .cart-line, .cart-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cart-head button { width: 34px; height: 34px; padding: 0; font-size: 24px; }
.cart-lines { display: grid; gap: 10px; margin: 14px 0; }
.cart-line { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.cart-line input { width: 86px; }
.cart-logistics { border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: var(--soft); color: var(--muted); font-size: 14px; }
.request-form { display: grid; gap: 10px; margin-top: 14px; }
.request-form .form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.request-form .consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.4; color: var(--muted); }
.request-form .consent input { width: 16px; min-width: 16px; height: 16px; margin-top: 1px; }
.request-form .consent a { color: inherit; text-decoration: underline; }
.form-status { margin: 0; color: var(--muted); }

.footer { display: flex; gap: 18px; flex-wrap: wrap; padding: 28px; border-top: 1px solid var(--line); color: var(--muted); }

@media (max-width: 900px) {
  .topbar { align-items: center; flex-direction: row; flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .topbar nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; padding: 2px 0 5px; }
  .topbar nav { scrollbar-width: none; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a { white-space: nowrap; }
  .stats, .toolbar, .catalog-toolbar, .compact-toolbar, .catalog-guide, .selection-tree, .tree-group, .product-card, .product-detail, .split, .admin-grid, .learning-grid { grid-template-columns: 1fr; }
  .section-head { display: grid; align-items: start; }
  #catalogCount { margin-left: 0; }
  .product-card img { width: 100%; height: auto; aspect-ratio: 16/9; }
  .product-card dl, .specs { grid-template-columns: auto 1fr; }
  .term-list { grid-template-columns: 1fr; }
  .hero { height: clamp(430px, calc(100vh - 220px), 560px); }
  .hero-copy { padding: 34px 20px; }
  .hero p { font-size: 17px; }
}
