/* ==========================================================================
   silitech.css — Designsystem des Klebstoff-Finders
   Tokens exakt nach silitech.ch (Odoo-Theme + CI-Guidelines).
   Regler: Varianz 4 · Bewegung 2 · Dichte 7
   ========================================================================== */

:root {
  /* Marke */
  --primary: #0074B6;
  --primary-hover: #0099D6;
  --accent: #16B6FD;           /* nur auf dunklem Grund */
  --ink: #000B14;
  --navy: #001A2E;
  --ice: #EDF7FD;
  --ice-2: #E6F1F8;
  --badge-text: #005383;
  --gray: #F3F2F2;
  --link: #005A8D;
  --white: #FFFFFF;

  /* Abgeleitet */
  --text: var(--ink);
  --text-2: #3D4C59;
  --text-3: #5E707E;
  --line: #DCE8F0;
  --line-strong: #B9D2E2;
  --surface: #FFFFFF;
  --surface-2: var(--ice);

  /* Semantik (gedeckt, industriell) */
  --ok: #1B7A4B;   --ok-tint: #E7F4EC;
  --warn: #A05E03; --warn-tint: #FBF0DC;
  --neg: #B3261E;  --neg-tint: #F9E9E7;

  /* Kategorie-Farben: kleinflaechig (Badges, Swatches, Balken-Akzente) */
  --cat-ca: #A8321F;                 --cat-ca-tint: #F8ECE8;
  --cat-anaerobic: #1E5FA8;          --cat-anaerobic-tint: #E9F0F9;
  --cat-epoxy_1k: #6E6E1E;           --cat-epoxy_1k-tint: #F2F2E2;
  --cat-epoxy_2k: #8A6210;           --cat-epoxy_2k-tint: #F7F0DF;
  --cat-structural_acrylic: #0E7490; --cat-structural_acrylic-tint: #E4F3F7;
  --cat-uv_cure: #6D4FA8;            --cat-uv_cure-tint: #F0ECF8;
  --cat-polyurethane: #2E7D57;       --cat-polyurethane-tint: #E8F3EE;
  --cat-ms_polymer: #52646F;         --cat-ms_polymer-tint: #EDF1F4;
  --cat-accessory: #405B6E;          --cat-accessory-tint: #EBF0F3;

  /* Typografie */
  --font-display: 'Bricolage Grotesque', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', monospace;

  /* Radii */
  --r-s: 6px;  --r-m: 10px;  --r-l: 14px;  --r-pill: 999px;

  /* Spacing (8er-Raster) */
  --sp-4: 4px; --sp-8: 8px; --sp-12: 12px; --sp-16: 16px;
  --sp-24: 24px; --sp-32: 32px; --sp-48: 48px; --sp-64: 64px;

  /* Bewegung */
  --t-fast: 120ms;
  --t-med: 200ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  --container: 1500px;
}

/* ---------- Basis ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1 0 auto; }

img { max-width: 100%; display: block; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--primary-hover); }

h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); color: var(--text); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-24);
}

:focus-visible {
  outline: 2px solid var(--primary-hover);
  outline-offset: 2px;
}

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

/* ---------- Typo-Skala ---------- */

.t-h1 { font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 1.1; letter-spacing: -0.8px; }
.t-h2 { font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 1.15; letter-spacing: -0.5px; }
.t-h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.2; letter-spacing: -0.3px; }
.t-label {
  font-family: var(--font-body); font-weight: 600; font-size: 12px;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3);
}
.t-sm { font-size: 13px; }
.t-data { font-family: var(--font-mono); font-weight: 500; font-size: 13px; }
.t-data-lg { font-family: var(--font-mono); font-weight: 500; font-size: 17px; }
.t-muted { color: var(--text-3); }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex; align-items: center; gap: var(--sp-24);
  height: 64px;
}

.brand { display: flex; align-items: center; gap: var(--sp-16); min-width: 0; }
.brand-logo { height: 38px; width: auto; }
.brand-divider { width: 1px; height: 28px; background: var(--line-strong); }
.brand-product {
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  letter-spacing: -0.3px; color: var(--ink); white-space: nowrap;
}

.site-nav { display: flex; gap: var(--sp-8); margin-left: var(--sp-16); }
.site-nav a {
  font-weight: 500; font-size: 15px; color: var(--text-2);
  padding: var(--sp-8) var(--sp-12);
  border-bottom: 2px solid transparent;
  transition: color var(--t-fast) var(--ease);
}
.site-nav a:hover { color: var(--link); }
.site-nav a.active { color: var(--link); border-bottom-color: var(--primary); }
.site-nav .nav-short { display: none; }
@media (max-width: 760px) {
  .site-nav .nav-long { display: none; }
  .site-nav .nav-short { display: inline; }
}

.header-actions { margin-left: auto; display: flex; gap: var(--sp-8); align-items: center; }

.lang-switch {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
}
.lang-btn {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-2);
  cursor: pointer;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--line); }
.lang-btn:hover { background: var(--ice); }
.lang-btn[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
}
@media (max-width: 700px) {
  .lang-btn { padding: 4px 7px; }
}

/* ---------- Footer ---------- */

.site-footer {
  flex-shrink: 0;
  margin-top: var(--sp-64);
  background: var(--primary);
  color: var(--white);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: var(--sp-48);
  padding-top: var(--sp-48);
  padding-bottom: var(--sp-32);
}

.footer-brand {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  letter-spacing: 0.06em;
}

.footer-heading {
  font-weight: 600; font-size: 13px; letter-spacing: 0.05em;
  text-transform: uppercase; opacity: 0.85; margin-bottom: var(--sp-12);
}

.footer-note { font-size: 13px; line-height: 1.6; opacity: 0.85; margin: var(--sp-8) 0 0; }

.footer-link {
  display: flex; align-items: center; gap: var(--sp-8);
  color: var(--white); font-size: 14px; padding: 3px 0;
}
.footer-link:hover { color: var(--white); text-decoration: underline; }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  padding-top: var(--sp-16); padding-bottom: var(--sp-16);
  font-size: 13px; opacity: 0.9;
}
.footer-bottom a { color: var(--white); text-decoration: underline; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-8);
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  padding: 14px 26px;
  border-radius: var(--r-l);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-hover); color: var(--white); }

.btn-secondary { background: var(--white); color: var(--badge-text); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--ice); color: var(--badge-text); }

.btn-ghost-dark {
  background: rgba(255, 255, 255, 0.06); color: var(--white);
  border-color: rgba(255, 255, 255, 0.5);
}
.btn-ghost-dark:hover { background: rgba(255, 255, 255, 0.14); color: var(--white); }

.btn-sm { padding: 9px 16px; font-size: 14px; border-radius: var(--r-m); }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Badges & Chips ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--ice-2); color: var(--badge-text);
  font-weight: 600; font-size: 12px; line-height: 1;
  padding: 4px 10px; border-radius: var(--r-pill);
  white-space: nowrap;
}

.badge-cat { background: var(--cat-tint, var(--ice-2)); color: var(--cat-color, var(--badge-text)); }

.badge-outline {
  background: transparent; border: 1px solid var(--line-strong); color: var(--text-2);
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body); font-weight: 500; font-size: 13px; line-height: 1;
  color: var(--text-2);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 7px 13px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  text-decoration: none;
}
.chip:hover { background: var(--ice); color: var(--text-2); }
.chip[aria-pressed="true"], .chip.active {
  background: var(--ice-2); color: var(--badge-text); border-color: var(--primary);
}
.chip .ti { font-size: 15px; }

.chip-remove { border-style: dashed; }
.chip-remove:hover { border-color: var(--neg); color: var(--neg); }

/* ---------- Kategorien-Liste (Sidebar) ---------- */

.cat-row {
  display: flex; align-items: center; gap: var(--sp-8);
  width: 100%;
  padding: 7px 10px;
  border: 0; background: none; cursor: pointer;
  border-radius: var(--r-s);
  font-family: var(--font-body); font-size: 14px; color: var(--text-2);
  text-align: left;
  transition: background var(--t-fast) var(--ease);
}
.cat-row:hover { background: var(--ice); }
.cat-row.active { background: var(--ice); color: var(--ink); font-weight: 600; }
.cat-swatch {
  width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0;
  background: var(--cat-color, var(--primary));
}
.cat-count {
  margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--text-3);
}

/* ---------- Formulare ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-weight: 600; font-size: 12px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-3);
}

input[type="text"], input[type="search"], input[type="number"], select, textarea {
  font-family: var(--font-body); font-size: 15px; color: var(--text);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 12px;
  width: 100%;
}
input::placeholder { color: var(--text-3); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235E707E' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.field-error { font-size: 13px; color: var(--neg); }

/* ---------- Dual-Slider (Viskositaet) ---------- */

.range-wrap { position: relative; height: 26px; }
.range-wrap input[type="range"] {
  position: absolute; inset: 0; width: 100%;
  appearance: none; -webkit-appearance: none;
  background: none; pointer-events: none; margin: 0;
}
.range-track {
  position: absolute; left: 0; right: 0; top: 11px; height: 4px;
  background: var(--line); border-radius: 2px;
}
.range-fill { position: absolute; top: 11px; height: 4px; background: var(--primary); border-radius: 2px; }
.range-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--primary);
  cursor: pointer; pointer-events: auto;
  margin-top: 0;
}
.range-wrap input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--primary);
  cursor: pointer; pointer-events: auto;
}
.range-values {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 12px; color: var(--badge-text);
}

/* ---------- Karten ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--sp-16) 18px;
  transition: border-color var(--t-fast) var(--ease);
}
.card:hover { border-color: var(--primary-hover); }

/* ---------- Skeleton ---------- */

.skeleton {
  background: var(--ice-2);
  border-radius: var(--r-s);
  position: relative; overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .skeleton::after {
    content: ''; position: absolute; inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    animation: shimmer 1.2s infinite;
  }
  @keyframes shimmer { 100% { transform: translateX(100%); } }
}

/* ---------- Tabellen ---------- */

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-weight: 600; font-size: 12px;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3);
  padding: 8px 10px;
  border-bottom: 2px solid var(--line-strong);
}
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:hover td { background: rgba(237, 247, 253, 0.5); }
.tbl .num { font-family: var(--font-mono); font-weight: 500; font-size: 13px; text-align: right; white-space: nowrap; }
.tbl-scroll { overflow-x: auto; }

.tbl-subhead td {
  font-weight: 600; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--badge-text); background: var(--ice); border-bottom: 1px solid var(--line-strong);
  padding-top: 10px;
}
.tbl-subhead:hover td { background: var(--ice); }

/* ---------- Collapsible ---------- */

details.collapsible {
  border: 1px solid var(--line); border-radius: var(--r-s);
  margin-bottom: var(--sp-8);
}
details.collapsible summary {
  display: flex; align-items: center; gap: var(--sp-8);
  cursor: pointer; padding: 11px 14px;
  font-weight: 600; font-size: 14px;
  list-style: none;
}
details.collapsible summary::-webkit-details-marker { display: none; }
details.collapsible summary .ti-chevron-down { margin-left: auto; transition: transform var(--t-med) var(--ease); }
details.collapsible[open] summary .ti-chevron-down { transform: rotate(180deg); }
details.collapsible .collapsible-body { padding: 0 14px 14px; font-size: 14px; color: var(--text-2); }

/* ---------- Drawer (Filter mobil) ---------- */

.drawer-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 11, 20, 0.4);
}

/* ---------- Vergleichs-Tray ---------- */

.compare-tray {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  background: var(--white);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -8px 24px rgba(0, 11, 20, 0.12);
}
.tray-inner { display: flex; align-items: center; gap: var(--sp-16); padding-top: var(--sp-12); padding-bottom: var(--sp-12); }
.tray-count { font-weight: 600; font-size: 14px; white-space: nowrap; }
.tray-items { display: flex; gap: var(--sp-8); flex-wrap: wrap; flex: 1; }
.tray-actions { display: flex; gap: var(--sp-8); }
body.tray-open { padding-bottom: 76px; }

/* ---------- Experten-Modus ---------- */

.x-only { display: none !important; }
html.expert .x-only { display: revert !important; }
html.expert .x-only-flex { display: flex !important; }
html.expert .x-only-block { display: block !important; }

.expert-toggle .ti-check { display: none; }
html.expert .expert-toggle { background: var(--ice-2); color: var(--badge-text); border-color: var(--primary); }
html.expert .expert-toggle .ti-adjustments-horizontal { display: none; }
html.expert .expert-toggle .ti-check { display: inline; }

/* ---------- Empty / Meldungen ---------- */

.empty-state {
  grid-column: 1 / -1;
  max-width: 560px;
  text-align: left;
  padding: var(--sp-48) var(--sp-32);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--text-2);
}
.empty-state .ti { font-size: 28px; color: var(--text-3); }
.empty-state h3 { margin: var(--sp-8) 0; }
.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-12);
  margin-top: var(--sp-16);
}
.empty-actions .btn .ti { font-size: 16px; color: inherit; }
.empty-contact {
  margin-top: var(--sp-24);
  padding-top: var(--sp-16);
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.empty-contact a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.empty-contact a:hover { text-decoration: underline; }
.empty-contact .ti { font-size: 15px; color: inherit; }

/* ---------- Reduzierte Bewegung ---------- */

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

/* ---------- Responsive Basis ---------- */

@media (max-width: 1280px) {
  .container { padding: 0 var(--sp-16); }
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr; gap: var(--sp-24); }
}

@media (max-width: 640px) {
  .brand-product { display: none; }
  .brand-divider { display: none; }
  .brand-logo { height: 26px; }
  .expert-toggle-label { display: none; }
  .header-inner { gap: var(--sp-8); }
  .container { padding: 0 var(--sp-12); }
  .site-nav { margin-left: 0; gap: 0; }
  .site-nav a { padding: var(--sp-8) 7px; font-size: 14px; }
  .chip { padding: 7px 10px; }
  .t-h1 { font-size: 30px; }
  .t-h2 { font-size: 22px; }
}
