:root {
  --bg:       #080808;
  --surface:  #0f0f0f;
  --surface2: #141414;
  --border:   rgba(245, 245, 245, 0.07);
  --border2:  rgba(245, 245, 245, 0.13);
  --white:    #f5f5f5;
  --blue:     #022E64;
  --sidebar-w: 240px;
  --panel-w:   400px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 18px; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 2rem;
  border-right: 1px solid var(--border);
  background: var(--bg);
  z-index: 20;
  overflow-y: auto;
}

.sidebar-top { display: flex; flex-direction: column; }

.back-link {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 245, 245, 0.25);
  text-decoration: none;
  transition: color 0.2s;
}
.back-link:hover { color: var(--white); }

.sidebar-divider {
  width: 20px; height: 1px;
  background: rgba(245, 245, 245, 0.15);
  margin: 1.8rem 0;
}

/* ── SEARCH ── */
.search-wrap { margin-bottom: 1.4rem; }

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.74rem;
  font-weight: 300;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.2s;
  letter-spacing: 0.02em;
}
.search-input::placeholder { color: rgba(245, 245, 245, 0.2); }
.search-input:focus { border-color: var(--border2); }

/* ── FILTER CHIPS ── */
.filter-label {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 245, 245, 0.22);
  margin-bottom: 0.6rem;
}

.filter-chips { display: flex; flex-direction: column; gap: 4px; }

.chip {
  background: transparent;
  border: 1px solid transparent;
  color: rgba(245, 245, 245, 0.35);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 10px;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.chip:hover {
  color: var(--white);
  background: var(--surface);
  border-color: var(--border);
}
.chip.active {
  color: var(--white);
  background: var(--surface);
  border-color: var(--border);
}
.chip.active::before {
  content: '·';
  color: var(--blue);
  margin-right: 0.45em;
  font-size: 1rem;
  line-height: 0;
  vertical-align: -1px;
}

/* ── COUNT ── */
.product-count {
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 245, 245, 0.18);
}

/* ── MAIN ── */
main {
  margin-left: var(--sidebar-w);
  padding: 3.5rem 3rem 6rem;
  min-height: 100vh;
}

.section-eyebrow {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.45rem;
}

.page-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.page-title em { font-style: italic; }

.page-desc {
  font-size: 0.76rem;
  color: rgba(245, 245, 245, 0.33);
  line-height: 1.8;
  max-width: 520px;
  margin-bottom: 2.5rem;
}

/* ── PRODUCT LIST ── */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 640px;
}

.product-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  position: relative;
  animation: fadeUp 0.35s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.product-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--blue);
  transition: width 0.3s ease;
}
.product-card:hover { background: #131313; border-color: var(--border2); }
.product-card:hover::after { width: 100%; }

.card-img-wrap {
  width: 50px; height: 50px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.card-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.82);
  transition: filter 0.3s;
}
.product-card:hover .card-img-wrap img { filter: brightness(1); }

.card-no-img { display: none; }

.card-info { flex: 1; min-width: 0; }

.card-name {
  font-size: 0.84rem;
  font-weight: 400;
  color: var(--white);
  letter-spacing: 0.01em;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 0.68rem;
  color: rgba(245, 245, 245, 0.32);
  letter-spacing: 0.03em;
}

.card-badges {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  flex-shrink: 0;
}

.badge {
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border: 1px solid var(--border);
  color: rgba(245, 245, 245, 0.35);
  white-space: nowrap;
}

.badge-illegal {
  border-color: rgba(180, 60, 60, 0.3);
  color: #b87070;
}

.no-results {
  font-size: 0.76rem;
  color: rgba(245, 245, 245, 0.22);
  margin-top: 1.5rem;
  letter-spacing: 0.04em;
}

.hidden { display: none !important; }

/* ── OVERLAY ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 4, 0.78);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.overlay.open { opacity: 1; pointer-events: all; }

/* ── DETAIL PANEL ── */
.detail-panel {
  position: fixed;
  top: 0; right: 0;
  width: var(--panel-w);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 40;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.detail-panel.open { transform: translateX(0); }

.panel-close {
  position: sticky;
  top: 0;
  width: 100%;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-left: none; border-right: none; border-top: none;
  color: rgba(245, 245, 245, 0.25);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 1;
}
.panel-close:hover { color: var(--white); }

.panel-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.panel-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.75);
}
.panel-img-wrap.no-img { display: none; }

.panel-body { padding: 1.8rem 2rem 3rem; }

.panel-type {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.5rem;
}

.panel-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--white);
  line-height: 1.25;
  margin-bottom: 0.3rem;
}

.panel-brand {
  font-size: 0.7rem;
  color: rgba(245, 245, 245, 0.32);
  letter-spacing: 0.06em;
}

.panel-divider {
  width: 20px; height: 1px;
  background: rgba(245, 245, 245, 0.15);
  margin: 1.4rem 0;
}

.panel-section-label {
  font-size: 0.55rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 245, 245, 0.22);
  margin-bottom: 0.85rem;
}

/* ── FINDINGS ── */
.panel-findings {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.8rem;
}

.finding-comparison {
  display: grid;
  grid-template-columns: 1fr 18px 1fr;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.finding-comparison:first-child { border-top: 1px solid var(--border); }

.finding-col { display: flex; flex-direction: column; gap: 2px; }

.finding-col-label {
  font-size: 0.5rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 245, 245, 0.18);
}

.finding-col-val {
  font-size: 0.74rem;
  color: rgba(245, 245, 245, 0.65);
  line-height: 1.3;
}
.finding-col-val.zero { color: rgba(245, 245, 245, 0.22); }

.finding-arrow {
  font-size: 0.65rem;
  color: rgba(245, 245, 245, 0.12);
  text-align: center;
}

.finding-note {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  color: rgba(245, 245, 245, 0.45);
  line-height: 1.5;
}
.finding-note:first-child { border-top: 1px solid var(--border); }

.finding-header {
  padding: 8px 0 4px;
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 245, 245, 0.22);
}

.finding-contam {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.71rem;
  color: rgba(210, 140, 80, 0.75);
  line-height: 1.4;
}
.finding-contam:first-child { border-top: 1px solid var(--border); }

.finding-warning {
  padding: 9px 12px;
  background: rgba(100, 20, 20, 0.18);
  border: 1px solid rgba(160, 50, 50, 0.22);
  color: #b87070;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  line-height: 1.5;
  margin-top: 10px;
}

/* ── PANEL ACTIONS ── */
.panel-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-btn {
  display: block;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: rgba(245, 245, 245, 0.6);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.74rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  position: relative;
  text-align: left;
}
.action-btn::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--blue);
  transition: width 0.3s ease;
}
.action-btn:hover {
  background: #131313;
  color: var(--white);
  border-color: var(--border2);
}
.action-btn:hover::after { width: 100%; }

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
    overflow-y: visible;
    flex-direction: column;
    gap: 1rem;
  }
  .sidebar-top { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 1rem; }
  .search-wrap { margin-bottom: 0; flex: 1; min-width: 160px; }
  .filter-chips { flex-direction: row; flex-wrap: wrap; }
  .filter-label { display: none; }
  .sidebar-divider { display: none; }
  .sidebar-bottom { display: none; }

  main { margin-left: 0; padding: 2rem 1.5rem 4rem; }
}

@media (max-width: 520px) {
  :root { --panel-w: 100vw; }
  .card-badges { display: none; }
}
