:root {
  --blue: #052b67;
  --blue-2: #0b4d96;
  --red: #a4162b;
  --yellow: #ffd23f;
  --ink: #172033;
  --muted: #627086;
  --line: #d8dde6;
  --paper: #ffffff;
  --soft: #f4f7fb;
  --shadow: 0 10px 28px rgba(11, 34, 70, .10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #f7f8fa;
}

.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-strip {
  height: 6px;
  background: linear-gradient(90deg, var(--red), var(--yellow) 32%, var(--blue) 32%, var(--blue-2));
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
}

.identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.amg-logo { width: 96px; height: auto; flex: 0 0 auto; }
.brand-logo { width: 82px; height: 54px; object-fit: contain; flex: 0 0 auto; }
.divider { width: 1px; height: 44px; background: var(--line); flex: 0 0 auto; }

h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; line-height: 1.15; }
.identity p { margin-top: 4px; color: var(--muted); font-size: 13px; }

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 20px 48px;
}

button, input, select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover { background: var(--blue-2); }
.ghost {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--line);
}
.ghost:hover { background: var(--soft); }
.interest-toggle {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.interest-toggle span {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: #1f2a3b;
  font-weight: 700;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) minmax(160px, 210px) auto;
  gap: 12px;
  align-items: end;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}

label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0;
}

input, select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  padding: 0 10px;
}

.stats {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}
.stats div {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
}
.stats b {
  display: block;
  color: var(--blue);
  font-size: 24px;
}
.stats span { color: var(--muted); font-size: 13px; }

.category-nav {
  margin: 14px 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.category-nav button {
  flex: 0 0 auto;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.category-nav span {
  color: var(--muted);
  margin-left: 4px;
}

.group {
  margin-top: 22px;
}
.group-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 10px;
}
.group-head h2 { font-size: 20px; }
.group-head p { color: var(--muted); margin-top: 4px; font-size: 13px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 430px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.visual {
  position: relative;
  height: 210px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.visual span {
  position: absolute;
  left: 10px;
  top: 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  background: rgba(255, 210, 63, .94);
  color: var(--blue);
  font-weight: 800;
  font-size: 11px;
}
.card-body {
  min-width: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.line {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}
.category {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.price {
  color: var(--red);
  font-weight: 800;
  white-space: nowrap;
}
.card h3 {
  font-size: 16px;
  line-height: 1.25;
}
.sku {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.official-link {
  color: var(--blue-2);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.official-link:hover { text-decoration: underline; }
.specs {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.specs div {
  min-width: 0;
  background: var(--soft);
  border-radius: 6px;
  padding: 8px;
}
.specs dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.specs dd {
  margin: 3px 0 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.interest-btn {
  width: 100%;
  margin-top: auto;
}
.interest-btn.active {
  background: var(--red);
}

.empty {
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.interest-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(440px, 100vw);
  height: 100vh;
  background: #fff;
  box-shadow: -18px 0 42px rgba(0,0,0,.16);
  z-index: 30;
  transform: translateX(102%);
  transition: transform .18s ease;
  display: flex;
  flex-direction: column;
}
.interest-panel.open { transform: translateX(0); }
.interest-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.interest-head p { color: var(--muted); margin-top: 4px; }
.interest-items {
  flex: 1;
  overflow: auto;
  padding: 12px;
}
.interest-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.interest-row b, .interest-row span {
  display: block;
  overflow-wrap: anywhere;
}
.interest-row span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.interest-row button {
  background: #fff;
  color: var(--red);
  border: 1px solid var(--line);
}
.interest-empty {
  color: var(--muted);
  padding: 24px;
}
.interest-actions {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 840px) {
  .topbar-inner { align-items: flex-start; flex-direction: column; }
  .toolbar { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  main { padding: 14px 12px 36px; }
  .topbar-inner { padding: 12px; }
  .identity { align-items: flex-start; flex-wrap: wrap; }
  .identity h1 { font-size: 18px; }
  .amg-logo { width: 84px; }
  .brand-logo { width: 74px; height: 46px; }
  .divider { display: none; }
  .stats { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .visual { height: 190px; }
  .specs { grid-template-columns: 1fr; }
  .interest-actions { grid-template-columns: repeat(2, 1fr); }
}
