/* Shared styles for the motors catalog and product pages (generated by _build/build_motors.py) */
:root {
  --ground: #F4F4F3;
  --ink: #262626;
  --graphite: #5E605F;
  --steel: #DCDDDB;
  --ember: #B01118;
  --ok: #2E7D32;
  --wide: 125%;
  --gutter: clamp(16px, 4vw, 56px);
  --nav-h: 68px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.display { font-stretch: var(--wide); font-weight: 800; letter-spacing: -0.02em; line-height: 1.02; margin: 0; }
.kicker { margin: 0 0 14px; font-size: 13px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--graphite); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav__logo img { height: 40px; width: auto; }
.nav__links { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.nav__links a:not(.btn) { text-decoration: none; color: var(--graphite); }
.nav__links a:not(.btn):hover, .nav__links a[aria-current] { color: var(--ink); }
.nav__cart { display: inline-flex; align-items: center; gap: 6px; }
.nav__count:not(:empty) {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--ember); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 20px;
  border-radius: 6px;
  border: 1.5px solid var(--ink);
  background: var(--ink); color: var(--ground);
  font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background-color .4s, color .4s, border-color .4s;
}
.btn:hover { background: var(--ember); border-color: var(--ember); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); }

/* ---------- Catalog ---------- */
.catalog { padding: clamp(40px, 8vh, 96px) var(--gutter) clamp(56px, 8vw, 112px); max-width: 1200px; }
.catalog h1 { font-size: clamp(36px, 6vw, 76px); padding-bottom: 18px; border-bottom: 3px solid var(--ink); }
.catalog .lead { margin: 24px 0 32px; font-size: clamp(17px, 1.5vw, 20px); max-width: 60ch; }

.filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 12px; }
.filters label { display: grid; gap: 6px; font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--graphite); }
.filters input, .filters select {
  width: 100%; padding: 11px 12px;
  border: 1.5px solid var(--steel); border-radius: 6px;
  background: #fff; color: var(--ink);
  font: inherit; font-size: 15px; text-transform: none; letter-spacing: 0;
}
.filters input:focus, .filters select:focus { border-color: var(--ink); outline: none; }
.count { margin: 20px 0 8px; font-size: 14px; color: var(--graphite); }

.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--steel); }
.list li { border-bottom: 1px solid var(--steel); }
.list a {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 24px; align-items: baseline;
  padding: 14px 4px; text-decoration: none;
}
.list a:hover { background: #fff; }
.list a:hover .list__name { text-decoration: underline; }
.list__name { font-weight: 600; }
.list__ref { grid-column: 1; font-size: 14px; color: var(--graphite); }
.list__price { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 700; font-stretch: 112%; white-space: nowrap; }

/* ---------- Product ---------- */
.product { padding: clamp(24px, 5vh, 56px) var(--gutter) clamp(56px, 8vw, 112px); max-width: 1200px; }
.crumbs { font-size: 14px; color: var(--graphite); margin-bottom: 24px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.product__top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.product__photo { margin: 0; background: #fff; border-radius: 8px; overflow: hidden; aspect-ratio: 1; display: grid; place-items: center; }
.product__nophoto { display: grid; justify-items: center; gap: 18px; color: var(--graphite); font-size: 14px; }
.product__nophoto img { width: min(60%, 260px); }
.product__name { margin: 0; font-size: clamp(26px, 3vw, 40px); font-stretch: 112%; font-weight: 750; letter-spacing: -0.015em; line-height: 1.12; }
.product__ref { margin: 12px 0 0; color: var(--graphite); }
.product__price { margin: 28px 0 0; font-size: clamp(34px, 4vw, 48px); font-weight: 800; font-stretch: var(--wide); letter-spacing: -0.02em; line-height: 1; }
.product__tax { margin: 6px 0 0; font-size: 15px; color: var(--graphite); }
.product__stock { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; font-weight: 600; color: var(--ok); }
.product__stock .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.product__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.product__added { margin: 12px 0 0; font-size: 15px; font-weight: 600; color: var(--ok); }
.product__added:empty { display: none; }
button.btn { cursor: pointer; font-family: inherit; }
.product__note { margin: 16px 0 0; font-size: 14px; color: var(--graphite); max-width: 52ch; }

.product__section { margin-top: clamp(40px, 6vw, 72px); max-width: 80ch; }
.product__section h2 { margin: 0 0 12px; font-size: 22px; font-stretch: 112%; font-weight: 750; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.product__section h3 { margin: 28px 0 8px; font-size: 13px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--graphite); }
.highlights { margin: 16px 0 0; padding-left: 20px; }
.highlights li { margin-bottom: 6px; }
.specs { margin: 0; }
.specs div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--steel); }
.specs dt { color: var(--graphite); }
.specs dd { margin: 0; font-weight: 550; }

/* ---------- Cart ---------- */
.section-title { margin: 0 0 4px; font-size: 22px; font-stretch: 112%; font-weight: 750; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.enquiry-page .enquiry { margin-top: clamp(40px, 6vw, 72px); max-width: 80ch; }
.cart__empty { margin: 20px 0 0; }
.cart__list { list-style: none; margin: 0; padding: 0; }
.cart__item {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; gap: 8px 24px; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--steel);
}
.cart__thumb { display: grid; place-items: center; width: 96px; aspect-ratio: 1; background: #fff; border-radius: 6px; overflow: hidden; }
.cart__thumb--logo img { width: 72%; }
.cart__name { font-weight: 650; text-decoration: none; }
.cart__name:hover { text-decoration: underline; }
.cart__meta { margin: 4px 0 0; font-size: 14px; color: var(--graphite); }
.cart__unit { margin: 6px 0 0; font-size: 14px; font-weight: 600; }
.cart__qty { display: flex; align-items: center; border: 1.5px solid var(--steel); border-radius: 6px; background: #fff; }
.cart__qty input {
  width: 56px; padding: 8px 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 16px; font-weight: 600; text-align: center; -moz-appearance: textfield;
}
.cart__qty input::-webkit-inner-spin-button, .cart__qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cart__step { width: 36px; height: 40px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 20px; cursor: pointer; }
.cart__step:hover { color: var(--ember); }
.cart__line { display: grid; justify-items: end; gap: 4px; min-width: 110px; }
.cart__total { margin: 0; font-size: 18px; font-weight: 750; font-stretch: 112%; white-space: nowrap; }
.cart__remove { padding: 0; border: 0; background: none; color: var(--graphite); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
.cart__remove:hover { color: var(--ember); }
.cart__sum { display: grid; grid-template-columns: 1fr auto; gap: 2px 24px; align-items: baseline; padding: 20px 0 0; }
.cart__sum-label { margin: 0; font-weight: 650; }
.cart__sum-value { margin: 0; font-size: clamp(26px, 3vw, 34px); font-weight: 800; font-stretch: var(--wide); letter-spacing: -0.02em; }
.cart__sum-note { grid-column: 1 / -1; margin: 0; font-size: 14px; color: var(--graphite); text-align: right; }

/* ---------- Enquiry ---------- */
.enquiry { scroll-margin-top: calc(var(--nav-h) + 16px); }
.enquiry__form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 20px; }
.enquiry__form label { display: grid; gap: 6px; font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--graphite); }
.enquiry__form input, .enquiry__form select, .enquiry__form textarea {
  width: 100%; padding: 11px 12px;
  border: 1.5px solid var(--steel); border-radius: 6px;
  background: #fff; color: var(--ink);
  font: inherit; font-size: 16px; text-transform: none; letter-spacing: 0;
}
.enquiry__form textarea { resize: vertical; }
.enquiry__form :is(input, select, textarea):focus { border-color: var(--ink); outline: none; }
.enquiry__wide { grid-column: 1 / -1; }
.enquiry__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.enquiry__submit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 4px; }
.enquiry__submit .btn { cursor: pointer; font-family: inherit; }
.enquiry__submit .btn[disabled] { opacity: .5; cursor: not-allowed; }
.enquiry__status { margin: 0; font-size: 15px; font-weight: 600; }
.enquiry__status.is-ok { color: var(--ok); }
.enquiry__status.is-error { color: var(--ember); }

/* ---------- Footer ---------- */
footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
  padding: 32px var(--gutter) 40px;
  font-size: 14px; color: var(--graphite);
}
footer img { height: 32px; width: auto; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer__links a { text-decoration: none; }
.footer__links a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 820px) {
  body { font-size: 16px; }
  .nav__links a:not(.btn):not(.nav__cart) { display: none; }
  .nav__links { gap: 16px; }
  .nav__links .btn { padding: 10px 16px; font-size: 14px; }
  .nav__logo img { height: 32px; }
  :root { --nav-h: 60px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters__search { grid-column: 1 / -1; }
  .product__top { grid-template-columns: 1fr; }
  .product__photo { max-width: 420px; }
  .specs div { grid-template-columns: 1fr; gap: 2px; }
  .enquiry__form { grid-template-columns: 1fr; }
  .cart__item { grid-template-columns: 72px minmax(0, 1fr); align-items: start; }
  .cart__thumb { width: 72px; }
  .cart__qty { grid-column: 2; justify-self: start; }
  .cart__line { grid-column: 2; grid-row: 3; justify-self: end; margin-top: -44px; }
}
