/* RESPONSIVE LAYER (approved 2026-11-08; loaded on every page after paper-theme.css).
   Three behaviours:
   1 Wide screens (> 1440px, or browser zoomed out): responsive.js scales the whole 1440 canvas, so nothing floats.
   2 Between phone and 1440px: type, spacing, images and grids are fluid; nothing jumps at fixed breakpoints.
   3 Height-aware: the home hero fills the first screen, and section spacing follows the window height. */

:root { --z: 1; --vh: 1vh; }

/* Viewport units are scaled along with the page, so divide them back out */
body { min-height: calc(100vh / var(--z)); }
.folder.grow { left: calc(4vw / var(--z)) !important; top: calc(9vh / var(--z)) !important; width: calc(92vw / var(--z)) !important; height: calc(100vh / var(--z)) !important; }
.page { max-width: 1920px; padding-left: clamp(16px, calc(7vw / var(--z)), 130px); padding-right: clamp(16px, calc(7vw / var(--z)), 130px); }

/* ---------- 2 Fluid type: reaches the design size at 1440px, never jumps ---------- */
h1 { font-size: clamp(34px, calc(26px + 1.75vw), 51px); line-height: 1.02; }
h2, .h2 { font-size: clamp(28px, calc(19px + 1.25vw), 37px); }
.hero-sub { font-size: clamp(17px, calc(13px + .5vw), 20px); }
.hero-body { font-size: clamp(15px, calc(13px + .25vw), 16.5px); line-height: 1.65; }
.brand-name { font-size: clamp(16px, calc(11px + .85vw), 23px); }

/* Fluid images: keep their shape instead of a fixed height */
.product-img { height: auto; aspect-ratio: 4 / 3; }
.hero-image { height: auto; aspect-ratio: 4 / 3; max-height: calc(var(--vh) * 62); }
.map-large { height: clamp(260px, calc(var(--vh) * 45), 460px); }

/* ---------- 3 Height-aware spacing ---------- */
.section { padding-top: clamp(64px, calc(var(--vh) * 13), 126px); }
.hero + .section { padding-top: clamp(56px, calc(var(--vh) * 11), 108px); }
#feedback { padding-top: clamp(60px, calc(var(--vh) * 12), 112px); }
.footer { margin-top: clamp(64px, calc(var(--vh) * 12), 118px); }

@media (min-width: 901px) {
  /* Home hero fills the first screen (minus the header) and centres its content; shorter or taller windows reflow it */
  body[data-page="home"] .hero { min-height: clamp(520px, calc(var(--vh) * 100 - 120px), 980px); align-items: center; padding-top: clamp(24px, calc(var(--vh) * 6), 80px); padding-bottom: clamp(24px, calc(var(--vh) * 6), 80px); }
  body[data-page="home"] .hero-image { margin-top: 0; }
  .hero { gap: clamp(28px, 4vw, 60px); }
}

/* ---------- Grids that fill their rows ---------- */
/* Dealer cards: rows fill left to right and a short last row is centred (7 brands: 4 + 3, then 2 + 2 + 2 + 1, then 1) */
.brand-grid { display: flex; flex-wrap: wrap; justify-content: center; }
.brand-grid > .brand-card { flex: 0 0 calc((100% - 3 * 24px) / 4); }
@media (max-width: 1100px) { .brand-grid > .brand-card { flex-basis: calc((100% - 24px) / 2); } }
@media (max-width: 640px) { .brand-grid > .brand-card { flex-basis: 100%; } }
/* Category and product cards */
.products { gap: clamp(24px, 3vw, 46px) clamp(16px, 2.8vw, 40px); }
@media (min-width: 561px) and (max-width: 900px) { .products { grid-template-columns: repeat(2, 1fr); } }
/* Values strip: 6 across, then 3, then 2 */
@media (max-width: 1100px) and (min-width: 901px) { .values { grid-template-columns: repeat(3, 1fr); } }
/* Reviews: 6, 3, 2 */
@media (max-width: 1300px) and (min-width: 901px) { .feedback { grid-template-columns: repeat(3, 1fr); } }
/* About page */
@media (max-width: 1100px) and (min-width: 901px) { .value-grid { grid-template-columns: repeat(2, 1fr); } }
/* Product detail: the spec label column shrinks with the card */
.specs div { grid-template-columns: minmax(140px, 28%) 1fr; }
@media (max-width: 900px) { .specs div { grid-template-columns: 1fr; } }

/* ---------- Cards adapt to their own width (container queries) ---------- */
.brand-card, .value-card, .review { container-type: inline-size; }
@container (max-width: 240px) {
  .brand-card h3 { font-size: 23px; }
  .brand-logo-box { height: 70px; }
}

/* ---------- Background grid stays visible at any zoom ---------- */
/* At low zoom a 1px line becomes a fraction of a screen pixel and the browser drops it; the scaled canvas
   keeps lines at whole pixels, and this keeps the faint lines a touch stronger on high-density screens */
@media (min-resolution: 2dppx) {
  body { background-image:
    linear-gradient(rgba(11, 26, 34, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 26, 34, .12) 1px, transparent 1px),
    linear-gradient(rgba(11, 26, 34, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 26, 34, .06) 1px, transparent 1px); }
}
