:root {
  --brait-red: #e31e24;
  --brait-red-dark: #b4161b;
  --ink: #1a1a1a;
  --ink-soft: #272524;
  --muted: #5c5856;
  --line: #e6e2df;
  --paper: #f6f4f2;
  --white: #ffffff;
  --ok: #1f7a4d;
  --warn: #b45309;
  --sidebar: 300px;
  --header: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Roboto", "Roboto Flex", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--brait-red); text-decoration: none; }
a:hover { text-decoration: underline; }

.app {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: var(--ink);
  color: var(--white);
  border-bottom: 4px solid var(--brait-red);
}
.topbar .logo {
  height: 28px;
  width: auto;
  display: block;
}
.topbar .brand-text {
  font-family: "Roboto Flex", "Roboto", sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 13px;
  text-transform: uppercase;
  color: #f3f3f3;
}
.topbar .brand-text span { color: var(--brait-red); }
.search {
  margin-left: auto;
  width: min(420px, 42vw);
}
.search input {
  width: 100%;
  height: 36px;
  border: 0;
  border-radius: 4px;
  padding: 0 12px;
  font: inherit;
  background: #32302e;
  color: var(--white);
}
.search input::placeholder { color: #9a9592; }

.layout {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: calc(100vh - var(--header));
}

.sidebar {
  background: var(--white);
  border-right: 1px solid var(--line);
  overflow: auto;
  max-height: calc(100vh - var(--header));
  position: sticky;
  top: var(--header);
}
.nav-section { border-bottom: 1px solid var(--line); }
.nav-section summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-section summary::-webkit-details-marker { display: none; }
.nav-section summary::after { content: "+"; color: var(--brait-red); font-size: 16px; }
.nav-section[open] summary::after { content: "–"; }
.nav-link, .tab {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 16px 8px 20px;
  font: inherit;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-link:hover, .tab:hover { background: #faf7f6; }
.nav-link.active, .tab.active {
  background: #fff2f2;
  border-left-color: var(--brait-red);
  color: var(--brait-red-dark);
  font-weight: 500;
}
.tab small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.content {
  padding: 28px 32px 64px;
  max-width: 1180px;
}

.hero {
  background: var(--ink);
  color: var(--white);
  padding: 28px 32px;
  margin: -28px -32px 28px;
  border-bottom: 4px solid var(--brait-red);
}
.hero h1 {
  margin: 0 0 8px;
  font-family: "Roboto Flex", sans-serif;
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.02em;
}
.hero p { margin: 0; max-width: 720px; color: #ddd; line-height: 1.5; }

h1, h2, h3 {
  font-family: "Roboto Flex", "Roboto", sans-serif;
  font-weight: 750;
  letter-spacing: -0.02em;
}
h2 { font-size: 22px; margin: 28px 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }

.grid-3, .grid-2, .cards {
  display: grid;
  gap: 14px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
}
.card.red { border-top: 3px solid var(--brait-red); }
.card.ok { border-top: 3px solid var(--ok); }
.card.warn { border-top: 3px solid var(--warn); }
.card p, .card li { color: var(--ink-soft); line-height: 1.5; font-size: 14px; }
.muted { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.chip:hover { border-color: var(--brait-red); color: var(--brait-red); }

.product-head {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 8px;
}
.photo-stage {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.photo-stage img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #ffffff;
}
.kicker {
  color: var(--brait-red);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.product-head h1 { margin: 0 0 10px; font-size: 30px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.badge {
  background: #fff2f2;
  color: var(--brait-red-dark);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}
.badge.dark { background: var(--ink); color: #fff; }
.badge.ok { background: #e8f6ee; color: var(--ok); }
.badge.warn { background: #fff4e5; color: var(--warn); }

.ttx {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 14px;
}
.ttx th, .ttx td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}
.ttx th { width: 48%; color: var(--muted); font-weight: 500; }
.ttx tr:last-child th, .ttx tr:last-child td { border-bottom: 0; }

.list { margin: 0; padding-left: 18px; }
.list li { margin: 6px 0; }

.why {
  background: #fff8f8;
  border-left: 3px solid var(--brait-red);
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.why b { color: var(--brait-red-dark); }
.card.must {
  border: 2px solid var(--brait-red);
  background: #fff8f8;
}
.must-flag {
  display: inline-block;
  background: var(--brait-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.acc-card h3 { display: flex; justify-content: space-between; gap: 8px; }
.acc-card .sku { color: var(--muted); font-size: 12px; font-weight: 400; }

.phrase {
  background: #111;
  color: #fff;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.55;
}
.phrase::before {
  content: "Фраза продавца";
  display: block;
  color: var(--brait-red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 24px;
}

.hidden { display: none !important; }

.search-results {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
}
.search-results button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
}
.search-results button:last-child { border-bottom: 0; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; top: 0; max-height: 280px; }
  .product-head, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .search { width: 40vw; }
  .hero { margin: -28px -16px 20px; }
  .content { padding: 20px 16px 48px; }
}
