:root {
  --kitabo-white: #FFFFFF;
  --kitabo-red: #D71920;
  --kitabo-red-dark: #B51218;
  --kitabo-blue: #174A7E;
  --kitabo-blue-dark: #10365D;
  --kitabo-text: #263645;
  --kitabo-text-muted: #5E6B76;
  --kitabo-border: #DCE4EB;
  --kitabo-blue-light: #F3F7FA;
  --primary: var(--kitabo-red);
  --primary-dark: var(--kitabo-red-dark);
  --background: var(--kitabo-white);
  --surface: var(--kitabo-white);
  --text: var(--kitabo-text);
  --muted-text: var(--kitabo-text-muted);
  --border: var(--kitabo-border);
  --focus: var(--kitabo-red);
  --soft: var(--kitabo-blue-light);
  --shadow: 0 22px 64px rgba(16, 54, 93, 0.09);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }

button,
input,
select {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  padding: 0.72rem 1rem;
  font-weight: 800;
  cursor: pointer;
}

button:hover { background: var(--primary-dark); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  background: var(--text);
  color: #fff;
  padding: 0.7rem 1rem;
  border-radius: 999px;
}

.skip-link:focus { top: 1rem; }

.browser-header,
main {
  width: min(100% - 40px, 1280px);
  margin-inline: auto;
}

.browser-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 0;
}

.brand-block {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  color: inherit;
  text-decoration: none;
}

.wordmark {
  color: var(--primary);
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.brand-block p,
.browser-nav,
.basket-indicator,
.status,
.muted {
  color: var(--muted-text);
}

.brand-block p {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
}

.browser-nav {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  font-weight: 750;
}

.browser-nav a,
.browser-footer a {
  color: inherit;
  font-weight: 750;
}

.browser-nav .nav-rfq {
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  text-decoration: none;
}

.browser-nav a:focus-visible,
.browser-footer a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.browser-footer {
  width: min(100% - 40px, 1280px);
  margin: 2rem auto 0;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted-text);
}

.browser-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.basket-indicator {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.browser-intro,
.category-nav,
.filter-panel,
.results-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.browser-intro {
  padding: clamp(1.4rem, 4vw, 3rem);
  margin: 1.1rem 0;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

h1 { font-size: clamp(2.2rem, 5vw, 4.8rem); }
h2 { font-size: clamp(1.35rem, 2.5vw, 2.1rem); }
h3 { font-size: 1.04rem; }

.search-panel {
  margin-top: 1.3rem;
}

.search-panel label,
.filter-panel label,
.results-toolbar label {
  display: grid;
  gap: 0.35rem;
  color: var(--text);
  font-weight: 800;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
}

.search-combobox { position: relative; min-width: 0; }

.search-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  max-height: min(62vh, 32rem);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.search-suggestions a {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.search-suggestions a:last-child { border-bottom: 0; }
.search-suggestions a:hover,
.search-suggestions a:focus { background: var(--soft); }
.search-suggestions img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 10px; }
.search-suggestions strong,
.search-suggestions small { display: block; }
.search-suggestions small { margin-top: 0.2rem; color: var(--muted-text); }
.search-empty { margin: 0; padding: 1rem; color: var(--muted-text); }
.secondary-button { background: var(--surface); color: var(--primary); border: 1px solid var(--primary); }
.secondary-button:hover { background: var(--soft); color: var(--primary-dark); }

input,
select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  padding: 0.72rem 1rem;
}

.category-nav {
  padding: 1rem;
  margin-bottom: 1rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.category-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--soft);
  text-decoration: none;
  color: var(--text);
}

.category-card img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.category-card span {
  display: block;
  color: var(--muted-text);
  font-size: 0.82rem;
}

.browser-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 1rem;
  align-items: start;
}

.filter-panel,
.results-panel {
  padding: 1rem;
}

.filter-panel {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 1rem;
}

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.filter-head button,
[data-close-filters] {
  display: none;
}

.dynamic-filter {
  margin-top: 1rem;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-chip,
.result-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted-text);
  padding: 0.32rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.results-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.toolbar-actions {
  display: flex;
  align-items: end;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar-actions button,
.view-toggle button,
[data-clear-filters],
[data-filter-toggle],
.filter-head button {
  background: var(--soft);
  color: var(--text);
}

.toolbar-actions button:hover,
.view-toggle button:hover,
[data-clear-filters]:hover,
[data-filter-toggle]:hover,
.filter-head button:hover {
  background: var(--border);
}

.view-toggle {
  display: flex;
  gap: 0.35rem;
}

.view-toggle button[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.results-grid.list-view {
  grid-template-columns: 1fr;
}

.product-card {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: #fff;
  padding: 1rem;
}

.list-view .product-card {
  grid-template-columns: 120px 1fr auto;
  align-items: center;
}

.product-card img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: var(--soft);
  border-radius: 20px;
  padding: 0.55rem;
}

.list-view .product-card img {
  width: 120px;
  height: 120px;
}

.product-card p {
  margin: 0.45rem 0;
}

.card-meta,
.card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.card-action {
  align-self: end;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  padding: 0.72rem 1rem;
  text-decoration: none;
  font-weight: 850;
}

.card-action:hover {
  background: var(--primary-dark);
}

.no-results {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 20px;
  color: var(--muted-text);
  background: var(--soft);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.filters-open {
  overflow: hidden;
}

@media (max-width: 1120px) {
  .category-grid,
  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .browser-header,
  .browser-layout,
  .search-row {
    grid-template-columns: 1fr;
  }

  .browser-nav {
    justify-content: flex-start;
  }

  .filter-panel {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    max-height: 82vh;
    overflow: auto;
    border-radius: 28px 28px 0 0;
    transform: translateY(110%);
    transition: transform 180ms ease;
  }

  body.filters-open .filter-panel {
    transform: translateY(0);
  }

  .filter-head button,
  [data-close-filters] {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .browser-header,
  main {
    width: min(100% - 22px, 1280px);
  }

  .category-grid,
  .results-grid,
  .list-view .product-card {
    grid-template-columns: 1fr;
  }

  .results-toolbar,
  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .product-card img,
  .list-view .product-card img {
    width: 100%;
    height: 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

/* Approved public Kitabō white, red and laboratory-blue presentation. */
.brand-block { align-items: center; }
.brand-logo { display:block; width:174px; height:52px; overflow:hidden; flex:0 0 174px; }
.brand-logo img { display:block; width:284px; height:auto; max-width:none; transform:translate(-55px,-67px); }
.browser-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.browser-nav a { color: var(--kitabo-blue); font-weight: 700; }
.browser-nav a:hover,
.browser-nav a[aria-current="page"] { color: var(--kitabo-blue-dark); text-decoration: underline; text-underline-offset: 5px; }
.browser-nav .nav-rfq { color: var(--kitabo-white); text-decoration: none; }
h1, h2, h3 { color: var(--kitabo-blue); }
.eyebrow { color: var(--kitabo-blue); }
.filter-panel,
.results-panel,
.product-card,
.basket-indicator { border-color: var(--border); background: var(--surface); }
.category-card { background: var(--surface); border: 1px solid var(--border); }
.category-card:hover { background: var(--soft); border-color: var(--kitabo-blue); }
.category-card img,
.product-card img { object-fit: contain; background: var(--surface); }
input, select { border-color: var(--border); background: var(--surface); color: var(--text); }
@media (max-width: 640px) { .brand-logo { width:142px; height:44px; flex-basis:142px; } .brand-logo img { width:235px; transform:translate(-46px,-56px); } }

body[data-page-kind="index"] .category-nav { margin-bottom: 1rem; }
.category-card img { grid-row: 1 / span 4; }
.category-card strong,
.category-card p,
.category-card span,
.category-card b { grid-column: 2; }
.category-card p { margin: 0; color: var(--muted); line-height: 1.45; font-size: .9rem; }
.category-card b { color: var(--kitabo-red); text-decoration: underline; text-underline-offset: 4px; }
body[data-page-kind="category"] .category-nav .category-grid { grid-template-columns: 1fr; }
body[data-page-kind="category"] .category-card { grid-template-columns: minmax(180px, 300px) 1fr; align-items: center; }
body[data-page-kind="category"] .category-card img { grid-row: 1 / span 4; height: 230px; }
body[data-page-kind="category"] .category-card strong { font-size: clamp(1.5rem, 3vw, 2.25rem); }
@media (max-width: 720px) {
  body[data-page-kind="category"] .category-card { grid-template-columns: 1fr; }
  body[data-page-kind="category"] .category-card img { grid-row: auto; height: 210px; }
  body[data-page-kind="category"] .category-card strong,
  body[data-page-kind="category"] .category-card p,
  body[data-page-kind="category"] .category-card span,
  body[data-page-kind="category"] .category-card b { grid-column: 1; }
}
