:root {
  color-scheme: light;
  --ink: #182b30;
  --muted: #53656a;
  --teal: #116255;
  --hero: #10383e;
  --mint: #a1e5d6;
  --line: #d6e1e3;
  --paper: #f4f7f8;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.12; }
p { color: var(--muted); }
a { color: inherit; text-underline-offset: .2em; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
button:disabled, select:disabled { cursor: default; opacity: .58; }
:focus-visible { outline: 3px solid #138373; outline-offset: 3px; }
.shell { width: min(100% - 32px, 1200px); margin-inline: auto; }
.skip { position: fixed; left: 12px; top: -100px; z-index: 8; background: #fff; padding: 12px; }
.skip:focus { top: 12px; }
.preview-bar { background: #dbeeea; text-align: center; padding: 6px 12px; font-size: .83rem; font-weight: 700; }
.preview-bar span { font-weight: 500; margin-left: .65em; }
.site-header { position: sticky; top: 0; z-index: 4; background: #fff; border-bottom: 1px solid var(--line); }
.header-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; min-width: 0; text-decoration: none; }
.brand img { width: clamp(130px, 46vw, 240px); height: auto; }
.site-header .brand { flex: 0 1 auto; }
.site-header .brand img { max-height: 66px; object-fit: contain; object-position: left; }
.gate-card .brand img { width: min(100%, 335px); }
.cart-button { flex-shrink: 0; }
@media (max-width: 420px) { .admin-header .brand img { width: 132px; } .admin-header .header-row { flex-wrap: wrap; } }
.header-nav { display: none; }
.header-nav a { text-decoration: none; }
.header-nav a:hover, .text-action:hover { text-decoration: underline; }
.cart-button, .primary, .secondary, .close-dialog {
  min-height: 44px; border-radius: 8px; border: 1px solid transparent; font-weight: 650;
}
.cart-button { background: #edf5f4; padding: 6px 10px; display: flex; align-items: center; gap: 8px; }
.cart-button svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cart-button b { background: var(--teal); color: white; border-radius: 4px; min-width: 22px; text-align: center; }
.hero { background: var(--hero); color: #fbfefe; overflow: hidden; }
.hero-grid { display: grid; align-items: center; min-height: 288px; }
.hero-copy { padding-block: 38px; position: relative; z-index: 1; }
.hero-makes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 17px; }
.hero-makes span { border: 1px solid #6b9c9d; color: #d2f2ed; border-radius: 4px; padding: 2px 8px; font-size: .84rem; }
.hero h1 { font-size: clamp(2.25rem, 6.2vw, 4.25rem); letter-spacing: -.054em; line-height: 1.04; font-weight: 750; }
.hero p { color: #cae2e2; max-width: 42ch; margin-top: 15px; }
.hero-link { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; margin-top: 10px; color: var(--mint); font-weight: 700; }
.hero-art { display: none; justify-self: end; width: 100%; height: auto; }
.finder { background: white; margin-top: 17px; border: 1px solid var(--line); border-radius: 12px; padding: 17px; }
.finder h2, .catalogue h2 { font-size: clamp(1.42rem, 3vw, 1.95rem); letter-spacing: -.027em; }
.finder-grid { display: grid; gap: 15px; margin-top: 13px; }
.finder form + form { border-top: 1px solid var(--line); padding-top: 12px; }
label { display: block; font-size: .93rem; font-weight: 650; }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #9baeb0; background: #fff; border-radius: 7px; padding: 8px 10px; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #5c6d71; }
label > input, label > select, label > textarea { display: block; margin-top: 4px; }
.input-action, .vehicle-fields, .sub-fields { display: grid; gap: 8px; margin-top: 6px; }
.input-action { grid-template-columns: minmax(0, 1fr) auto; }
.vehicle-fields, .sub-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vehicle-fields button { grid-column: 1/-1; }
.vehicle-details { margin-top: 5px; }
summary { width: fit-content; min-height: 36px; padding-block: 7px; color: var(--teal); font-size: .9rem; font-weight: 650; }
.primary { background: var(--teal); color: #fff; padding: 8px 14px; }
.primary:hover { background: #0b4d43; }
.secondary { border-color: #aec1c2; background: white; padding: 8px 13px; }
.secondary:hover { background: #edf4f3; }
.text-action { background: none; border: 0; padding: 0; min-height: 44px; color: var(--teal); font-weight: 650; }
.catalogue { padding-block: 26px 44px; scroll-margin-top: 77px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.section-head p { margin-top: 6px; }
.family-list { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 15px 10px; }
.family-list button { min-height: 40px; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 4px 10px; font-weight: 650; }
.family-list [aria-pressed="true"] { background: #e3f1ee; color: #104f45; border-color: #43887d; }
.results-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding-block: 6px 10px; }
.results-head label { display: flex; align-items: center; gap: 8px; }
.results-head select { margin: 0; min-height: 40px; width: auto; max-width: 100%; font-size: .9rem; }
.product-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.product {
  display: grid; grid-template-rows: 130px 1fr; min-width: 0;
  border: 1px solid var(--line); border-radius: 10px; background: white; overflow: hidden;
}
.product-media { display: grid; place-items: center; height: 100%; background: #edf3f4; position: relative; color: #4c6668; }
.product-media:has(img) { background: #f4f5f5; }
.product-media img { width: 100%; height: 130px; object-fit: contain; }
.product-media svg { width: 66px; height: 66px; stroke: #568082; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.product-media small { position: absolute; inset-inline-end: 9px; bottom: 6px; font-size: .75rem; }
.product-data { padding: 12px; display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 6px; }
.product-family { font-size: .84rem; font-weight: 600; color: var(--muted); }
.product h3 { font-size: 1.02rem; overflow-wrap: anywhere; }
.product h3 button { text-align: start; border: 0; padding: 0; color: inherit; background: none; font-weight: 700; }
.product h3 button:hover { text-decoration: underline; }
.ref { color: #104e59; font-weight: 700; font-size: .93rem; overflow-wrap: anywhere; }
.price { font-size: 1.22rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.product-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.product-bottom .primary { min-height: 42px; }
.stock { color: #17634e; font-size: .86rem; font-weight: 650; }
.stock.confirm { color: #785011; }
.empty { grid-column: 1/-1; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.empty p { margin: 8px 0; }
.more { display: block; margin: 16px auto 0; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); padding-block: 18px; }
.footer > div + div { display: flex; align-items: center; gap: 14px; }
.footer a { color: var(--teal); }
dialog { max-width: min(570px, calc(100% - 24px)); width: 100%; max-height: calc(100% - 26px); padding: 18px; border: 1px solid #a4b8bb; border-radius: 12px; color: var(--ink); box-shadow: 0 20px 50px #081e3033; }
dialog::backdrop { background: #0b232abd; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.dialog-head h2 { font-size: 1.35rem; }
.close-dialog { background: #edf3f4; padding: 0 12px; font-size: 1.45rem; min-width: 44px; }
.detail-media { margin-block: 12px; }
.detail-media .product-media { min-height: 130px; border-radius: 8px; }
.detail-actions, .row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
dialog form > label { margin-block: 12px; }
dialog form > p { margin-block: 8px; }
.cart-line { display: grid; grid-template-columns: minmax(0,1fr) 65px auto; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cart-line strong { font-size: .95rem; }
.cart-line small { display: block; }
.cart-total { margin-top: 10px; }
.confirmation { background: #e6f3ef; padding: 14px; border-radius: 8px; }
.error { color: #a32c3f; }
.toast { position: fixed; bottom: 15px; right: 15px; z-index: 7; padding: 10px 14px; background: #143c42; color: #fff; border-radius: 7px; max-width: calc(100% - 30px); }
.gate { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: #eaf2f1; }
.gate-card { width: min(100%, 445px); background: white; border: 1px solid var(--line); border-radius: 12px; padding: clamp(22px, 6vw, 36px); }
.gate-card .brand { margin-bottom: 24px; }
.gate-label { color: var(--teal); font-weight: 650; margin-bottom: 5px; }
.gate-card h1 { font-size: clamp(1.6rem, 4vw, 2.15rem); margin-bottom: 9px; }
.gate-card form { margin-block: 19px; display: grid; gap: 8px; }
.gate-card .error { margin-top: 10px; }
.gate-foot { border-top: 1px solid var(--line); padding-top: 12px; font-size: .89rem; }
.admin-main { padding-block: 24px; display: grid; gap: 14px; }
.admin-card { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.admin-card h2 { font-size: 1.35rem; margin-bottom: 8px; }
.admin-card p { margin-block: 5px; }
.admin-card label { margin-top: 10px; }
.admin-order { border-top: 1px solid var(--line); padding-block: 8px; overflow-wrap: anywhere; }
.check-label { display: flex; align-items: center; gap: 8px; }
.check-label input { width: 20px; height: 20px; min-height: 20px; margin: 0; }
@media (min-width: 730px) {
  .header-nav { display: flex; align-items: center; gap: 26px; font-weight: 650; }
  .hero-grid { grid-template-columns: 1.06fr .94fr; }
  .hero-art { display: block; }
  .finder { padding: 18px 20px; }
  .finder-grid { grid-template-columns: .93fr 1.07fr; gap: 18px; }
  .finder form + form { border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 18px; }
  .admin-main { grid-template-columns: 1fr 1fr; }
  .admin-main > h1 { grid-column: 1/-1; }
}
@media (min-width: 940px) {
  .vehicle-fields { grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; }
  .vehicle-fields button { grid-column: auto; }
  .finder { margin-top: 20px; }
}
@media (max-width: 410px) {
  .shell { width: calc(100% - 24px); }
  .finder { padding: 12px; }
  .input-action { grid-template-columns: 1fr; }
  .section-head { flex-wrap: wrap; }
  .family-list button { min-height: 44px; }
}
