:root {
  --background: #f7f9fb;
  --foreground: #1c2430;
  --card: #ffffff;
  --muted: #e8eef4;
  --muted-foreground: #5b6776;
  --border: #d5dee8;
  --primary: #1d6fa3;
  --primary-foreground: #f7fbff;
  --accent: #d7ebf7;
  --accent-foreground: #0f3d5e;
  --destructive: #b42318;
  --radius: 0.85rem;
  --font-sans: "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
  --font-heading: Outfit, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; border-color: var(--border); }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
}
h1, h2, h3, .font-heading { font-family: var(--font-heading); font-weight: 600; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; min-width: 0; }
.main { min-height: 70vh; padding: 2.5rem 1rem; }
.site-header { border-bottom: 1px solid var(--border); background: rgba(255,255,255,.9); backdrop-filter: blur(8px); }
.header-inner { display: flex; flex-direction: column; gap: 1rem; padding: 1rem; }
@media (min-width: 768px) {
  .header-inner { flex-direction: row; align-items: center; justify-content: space-between; }
}
.logo { font-family: var(--font-heading); font-size: 1.5rem; color: var(--primary); }
.header-brand { display: flex; align-items: center; gap: 1.5rem; min-width: 0; }
.nav { display: none; gap: 1.25rem; font-size: .9rem; }
@media (min-width: 768px) { .nav { display: flex; align-items: center; } }
.nav a { color: var(--muted-foreground); }
.nav a:hover { color: var(--foreground); }
.search { display: flex; gap: .5rem; }
.search input, select, input[type=text], input[type=password], input[type=number], textarea {
  border: 1px solid var(--border);
  border-radius: .6rem;
  padding: .5rem .7rem;
  font: inherit;
  background: #fff;
  color: inherit;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; height: 2.25rem; padding: .5rem 1rem;
  border-radius: .375rem; border: 1px solid transparent;
  background: var(--primary); color: var(--primary-foreground);
  font-size: .875rem; font-weight: 500; line-height: 1; white-space: nowrap;
  box-shadow: 0 1px 2px rgb(28 36 48 / 8%); cursor: pointer;
}
.btn:hover { background: #185e8a; }
.btn-outline {
  background: var(--background); color: var(--foreground); border-color: var(--border);
}
.btn-outline:hover { background: var(--accent); color: var(--accent-foreground); }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: .5rem;
  width: 100%;
  padding: 0 1.1rem 1.1rem;
  margin-top: auto;
  box-sizing: border-box;
}
.card-actions .btn { width: 100%; min-width: 0; }
.product-card { display: flex; flex-direction: column; align-items: stretch; height: 100%; overflow: hidden; }
.product-card .card-body { flex: 1; padding: 1.1rem; display: flex; flex-direction: column; gap: 1rem; }
.product-card-heading { display: flex; flex-direction: column; gap: .15rem; }
.product-card-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.product-card-heading h2 { margin: 0; font-size: 1.25rem; line-height: 1.2; }
.product-card-maker { margin: 0; font-size: .9rem; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.card-pad { padding: 1.1rem; }
.home-feature { display: flex; flex-direction: column; gap: .5rem; }
.home-feature h2, .home-feature p { margin: 0; }
.home-feature-icon {
  width: 1.5rem; height: 1.5rem; color: var(--primary); display: block;
}
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .cat-layout { grid-template-columns: 18rem minmax(0,1fr); }
}
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--primary); }
.muted { color: var(--muted-foreground); }
.primary { color: var(--primary); }
.space { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.space-lg { display: flex; flex-direction: column; gap: 2.5rem; }
.site-footer { margin-top: 4rem; border-top: 1px solid var(--border); background: var(--card); }
.footer-inner { display: grid; gap: 2rem; padding: 2.5rem 1rem; }
@media (min-width: 768px) { .footer-inner { grid-template-columns: 1fr 1fr 1fr; } }
.thumb { height: 10rem; background: var(--muted); display: flex; align-items: center; justify-content: center; color: var(--muted-foreground); overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge { font-size: .7rem; padding: .15rem .45rem; border-radius: 999px; background: #fde68a; color: #7c2d12; }
.filters {
  position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; padding-right: .4rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.filters h2 { margin: 0; }
.filters { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.filter-group { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: .5rem; }
.filter-group > p,
.filter-group legend { margin: 0; font-size: .875rem; font-weight: 600; }
.filter-checks {
  display: flex; flex-direction: column; align-items: stretch; gap: .25rem;
  max-height: 12rem; overflow: auto; padding-right: .25rem;
}
.filter-checks label {
  display: flex; align-items: center; gap: .5rem;
  font-size: .875rem; line-height: 1.3;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--border); padding: .65rem; text-align: left; vertical-align: top; }
.alert { padding: .75rem 1rem; border-radius: .7rem; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.admin-nav { display: flex; gap: 1rem; align-items: center; }
.compare-title { font-size: 2.25rem; }
.compare-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
@media (min-width: 1024px) {
  .compare-layout { flex-direction: row; align-items: flex-start; }
  .compare-bars { flex: 0 0 22rem; width: 22rem; max-width: 22rem; }
  .compare-table-wrap { flex: 1 1 0; min-width: 0; overflow-x: auto; }
}
.compare-bars {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 1rem;
}
.compare-bars[hidden] { display: none !important; }
.compare-bars-inner { display: flex; flex-direction: column; gap: 1.25rem; }
.bar-title { margin: 0 0 .5rem; font-size: .9rem; font-weight: 600; }
.bar-group { display: flex; flex-direction: column; gap: .4rem; }
.bar-row { display: flex; align-items: center; gap: .5rem; }
.bar-track { height: 1.5rem; min-width: 0; flex: 1; background: var(--muted); border-radius: .25rem; overflow: hidden; }
.bar-fill { height: 100%; display: flex; align-items: center; overflow: hidden; padding: 0 .4rem; color: #fff; font-size: 10px; line-height: 1; white-space: nowrap; }
.bar-value { width: 4rem; flex-shrink: 0; text-align: right; font-size: .75rem; color: var(--muted-foreground); }
.compare-table-wrap { overflow-x: auto; min-width: 0; max-width: 100%; }
.compare-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.compare-table th, .compare-table td {
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.compare-table th:first-child,
.compare-table td:first-child { width: 11rem; padding: .5rem; }
.compare-product-name { margin: 0; font-size: 1rem; }
.compare-product-name a:hover { color: var(--primary); text-decoration: underline; }
.compare-product-meta { margin: .15rem 0 .35rem; font-weight: 400; }
.compare-attr {
  width: 100%; border: 0; border-radius: .5rem; padding: .5rem .75rem;
  font: inherit; font-weight: 600; text-align: left; cursor: pointer;
  background: var(--accent); color: var(--primary);
}
.compare-attr:hover { background: #c5e0f1; }
tr.is-focused .compare-attr { background: var(--primary); color: var(--primary-foreground); }
tr.is-focused .compare-attr:hover { background: #185e8a; }
tr.is-focused td { color: var(--foreground); }
.compare-table td { color: var(--muted-foreground); }
tr.is-focused td { color: var(--foreground); }
.compare-rest-heading {
  background: #eef3f7;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding: .5rem 1rem !important;
}
.compare-tray-spacer { height: 7rem; }
.compare-tray {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.95);
  box-shadow: 0 -8px 24px rgba(28,36,48,.08);
  backdrop-filter: blur(8px);
}
.compare-tray-inner {
  display: flex; flex-direction: column; gap: .5rem; padding: .5rem 1rem;
}
@media (min-width: 640px) {
  .compare-tray-inner { flex-direction: row; align-items: center; justify-content: space-between; }
}
.compare-tray-title { margin: 0; font-size: .9rem; font-weight: 600; }
.compare-tray-notice { margin: .15rem 0 0; font-size: .75rem; }
.compare-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .35rem 0 0; padding: 0; list-style: none; }
.compare-chip {
  display: flex; align-items: center; gap: .5rem;
  border: 1px solid var(--border); background: var(--background);
  border-radius: .5rem; padding: .25rem .5rem; font-size: .85rem;
}
.compare-tray-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.hidden { display: none; }
label.stack { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.flex { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.product-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .product-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .product-grid { grid-template-columns: 1fr 1fr 1fr; } }
.weight-slider { display: flex; flex-direction: column; gap: .45rem; }
.weight-slider-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .9rem; font-weight: 600; }
.help-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1rem; height: 1rem; margin-left: .3rem; padding: 0;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--muted); color: var(--muted-foreground);
  font-size: .7rem; font-weight: 700; line-height: 1;
  cursor: help; vertical-align: middle;
}
.help-tip-pop {
  position: fixed; z-index: 400;
  max-width: min(18rem, calc(100vw - 1rem));
  padding: .55rem .7rem; border-radius: .5rem;
  background: #1c2430; color: #fff;
  font-size: .8rem; font-weight: 400; line-height: 1.4;
  text-align: left; white-space: pre-wrap;
  box-shadow: 0 10px 28px rgba(28, 36, 48, .22);
  pointer-events: none;
}
.help-tip-pop[hidden] { display: none !important; }
.weight-slider-head [data-weight-display] { font-weight: 500; font-variant-numeric: tabular-nums; }
.weight-slider input[type=range] {
  width: 100%; height: 1.5rem; margin: 0; padding: 0;
  accent-color: var(--primary); cursor: pointer;
}
.weight-slider-scale { display: flex; justify-content: space-between; font-size: .75rem; }
.range-filter { display: flex; flex-direction: column; gap: .45rem; }
.dual-range { position: relative; height: 1.5rem; }
.dual-range input[type=range] {
  position: absolute; left: 0; width: 100%; height: 1.5rem; margin: 0; padding: 0;
  background: transparent; pointer-events: none; accent-color: var(--primary); appearance: none;
}
.dual-range input[type=range]::-webkit-slider-runnable-track {
  height: .35rem; background: var(--muted); border-radius: 999px;
}
.dual-range input[type=range]::-webkit-slider-thumb {
  appearance: none; width: 1rem; height: 1rem; margin-top: -.32rem;
  border-radius: 999px; background: var(--primary); border: 0; pointer-events: auto; cursor: pointer;
}
.dual-range input[type=range]::-moz-range-track {
  height: .35rem; background: var(--muted); border-radius: 999px;
}
.dual-range input[type=range]::-moz-range-thumb {
  width: 1rem; height: 1rem; border-radius: 999px; background: var(--primary); border: 0; pointer-events: auto; cursor: pointer;
}
.dual-range input[data-range-max] { z-index: 2; }
.size-switcher { display: flex; flex-direction: column; gap: .4rem; }
.size-switcher-label { margin: 0; font-size: .9rem; font-weight: 600; }
.size-switcher-label [data-size-weight] { font-weight: 500; }
.size-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.size-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.25rem; height: 2.25rem; padding: .25rem .7rem;
  border-radius: .375rem; border: 1px solid var(--border);
  background: var(--card); color: var(--foreground);
  font-size: .875rem; font-weight: 500; line-height: 1; cursor: pointer;
}
.size-chip:hover:not(.is-disabled):not(.is-active) { background: var(--accent); color: var(--accent-foreground); }
.size-chip.is-active {
  background: var(--primary); color: var(--primary-foreground); border-color: var(--primary);
}
.size-chip.is-match:not(.is-active) {
  border-color: var(--primary); background: var(--accent); color: var(--accent-foreground);
}
.size-chip.is-disabled,
.size-chip:disabled {
  opacity: .4; cursor: not-allowed; background: var(--muted); color: var(--muted-foreground);
  pointer-events: none;
}
.size-switcher-hint { margin: 0; font-size: .75rem; }
.product-detail { display: flex; flex-direction: column; gap: 2rem; }
.product-crumb { margin: 0; font-size: .875rem; }
.product-crumb a:hover { color: var(--foreground); }
.product-detail-header {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.product-title-row { display: flex; align-items: center; gap: .75rem; min-width: 0; flex: 1 1 12rem; }
.product-detail-title { margin: 0; font-size: 2.25rem; line-height: 1.15; font-weight: 600; }
.product-detail-header .btn { flex: 0 0 auto; }
.product-detail-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 1024px) {
  .product-detail-grid { grid-template-columns: 1fr 1.2fr; }
}
.product-media { display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.product-photo {
  display: flex; align-items: center; justify-content: center;
  min-height: 16rem; border: 1px solid var(--border); border-radius: .85rem;
  background: var(--muted); color: var(--muted-foreground); overflow: hidden;
}
.product-photo:has(img) { min-height: 0; }
.product-photo img {
  display: block; width: 100%; max-height: 20rem;
  object-fit: cover; border-radius: .85rem;
}
.product-thumbs {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin: 0; padding: 0; list-style: none;
}
.product-thumb {
  display: block; width: 4.5rem; height: 4.5rem; padding: 0;
  border: 1px solid var(--border); border-radius: .5rem;
  background: var(--muted); overflow: hidden; cursor: pointer;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-thumb:hover, .product-thumb.is-active { border-color: var(--primary); }
.product-affiliate {
  display: flex; flex-direction: column; gap: .5rem;
  margin: 0; padding: 0; list-style: none;
}
.product-affiliate .btn { width: 100%; }
.product-docs {
  display: flex; flex-direction: column; gap: .35rem;
  margin: 0; padding: 0; list-style: none;
}
.product-docs a { color: var(--primary); }
.product-docs a:hover { text-decoration: underline; }
.product-specs-title { margin: 0 0 1rem; font-size: 1.5rem; }
.specs-scroll { overflow-x: auto; max-width: 100%; }
.specs-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.specs-table th, .specs-table td { padding: .75rem 0; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.specs-table th { width: 42%; font-weight: 500; color: var(--muted-foreground); }
.specs-table-sizes { min-width: 28rem; }
.specs-table-sizes th, .specs-table-sizes td { padding: .75rem .55rem; white-space: nowrap; }
.specs-table-sizes th:first-child,
.specs-table-sizes td:first-child { width: 9rem; min-width: 8rem; padding-left: 0; white-space: normal; }
.specs-table-sizes thead th { font-weight: 600; color: var(--foreground); text-align: center; }
.specs-table-sizes thead th:first-child { text-align: left; }
.specs-table-sizes td { text-align: center; }
.specs-table-sizes td:first-child { text-align: left; }
.specs-table-sizes .is-current { background: var(--accent); color: var(--accent-foreground); }
.specs-table-sizes thead a { display: block; }
.product-source { margin: 1rem 0 0; font-size: .875rem; }
button.linkish { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 0; }
.btn-danger { background: var(--destructive); color: #fff; }
.badge-ok { font-size: .7rem; padding: .15rem .45rem; border-radius: 999px; background: var(--accent); color: var(--accent-foreground); }
.admin-shell { display: block; min-height: 100vh; }
@media (min-width: 768px) { .admin-shell { display: flex; } }
.admin-aside {
  display: flex; flex-direction: column; gap: 1.5rem;
  padding: 1rem; border-bottom: 1px solid var(--border); background: var(--card);
}
@media (min-width: 768px) {
  .admin-aside { width: 15rem; border-bottom: 0; border-right: 1px solid var(--border); min-height: 100vh; }
}
.admin-side-nav { display: flex; flex-direction: column; gap: .25rem; }
.admin-link { border-radius: .5rem; padding: .5rem .75rem; font-size: .9rem; color: var(--muted-foreground); }
.admin-link:hover { background: var(--muted); color: var(--foreground); }
.admin-link.is-active { background: var(--accent); color: var(--accent-foreground); }
.admin-aside-actions { margin-top: auto; display: flex; flex-direction: column; gap: .5rem; }
.admin-main { min-width: 0; flex: 1; padding: 2rem 1rem; }
@media (min-width: 768px) { .admin-main { padding: 2rem; } }
