/* ===========================================================================
   Yamato Cars Agri — public stylesheet
   Built to the "Yamato Agri Industrial Core" design system (Stitch).

   Tokens, type scale, radii, elevation and spacing come from DESIGN.md.
   Ported to plain CSS (no Tailwind CDN) for reliable cPanel shared hosting.

   Principles:
     Authority through restraint — whitespace and weight carry hierarchy.
     Industrial precision — 8px rhythm throughout.
     Premium utility — no decoration that is not doing a job.
   =========================================================================== */

:root {
  /* ---- Colour (exact Stitch tokens) ------------------------------------ */
  --primary:        #001f3f;
  --primary-deep:   #000613;
  --secondary:      #1b4d3e;
  --secondary-mid:  #376757;
  --secondary-tint: #baeed9;
  --on-secondary-c: #1d4f40;

  --surface:        #f8f9fa;
  --surface-2:      #edeeef;
  --surface-3:      #e1e3e4;
  --white:          #ffffff;
  --line:           #e9ecef;
  --outline:        #c4c6cf;
  --outline-strong: #74777f;

  --text:           #191c1d;
  --text-variant:   #43474e;
  --text-muted:     #66696f;
  --inverse:        #f0f1f2;
  --inverse-dim:    #b9c0c6;

  --error:          #ba1a1a;
  --error-tint:     #ffdad6;
  --warn:           #8a6206;
  --warn-tint:      #fdf3e0;

  /* ---- Type ------------------------------------------------------------ */
  --display: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;

  /* ---- Shape (16px base for cards/buttons per design system) ----------- */
  --r-sm:   .25rem;
  --r:      .5rem;
  --r-md:   .75rem;
  --r-lg:   1rem;     /* 16px — cards, primary buttons */
  --r-xl:   1.5rem;
  --r-full: 9999px;

  /* ---- Elevation: soft, high-diffusion, navy-tinted -------------------- */
  --shadow-sm: 0 1px 2px rgba(0,31,63,.04), 0 2px 8px rgba(0,31,63,.05);
  --shadow-md: 0 2px 6px rgba(0,31,63,.05), 0 12px 28px rgba(0,31,63,.07);
  --shadow-lg: 0 4px 12px rgba(0,31,63,.06), 0 24px 48px rgba(0,31,63,.09);

  /* ---- Space: 8px base ------------------------------------------------- */
  --gutter: 24px;
  --wrap:   1280px;
  --margin: clamp(20px, 5vw, 64px);
  --band:   clamp(64px, 10vw, 120px);
  --gap:    var(--gutter);
}

/* ---------------------------------------------------------------- reset -- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font: 400 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.15rem; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700; line-height: 1.2; letter-spacing: -.02em;
  color: var(--primary-deep); margin: 0 0 .5em;
}
h2, h3 { font-weight: 600; letter-spacing: -.01em; }

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

.mono, .spec dd, .datasheet dd, .plate__stock, .panel__facts strong,
.hero__stats span, .figure__n, .plate__price, .panel__price, .pager__link,
.table td, .footer__list--mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

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

.skip {
  position: absolute; left: -999px; top: 0; z-index: 99;
  background: var(--primary); color: #fff; padding: 12px 16px;
  border-radius: 0 0 var(--r) 0; font: 600 14px var(--body);
}
.skip:focus { left: 0; }

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--margin));
  margin-inline: auto;
}

/* All-caps metadata — technical documentation style */
.eyebrow, .plate__category, .plate__stock, .step__no, .hero__quick-label,
.footer__head, .form__legend, .brand__sub, .hero__plate-label, .nav__link {
  font-family: var(--body);
  font-size: 12px; font-weight: 600; line-height: 1.2;
  letter-spacing: .1em; text-transform: uppercase;
}
.eyebrow { color: var(--secondary-mid); margin: 0 0 16px; }

/* Scroll reveal */
.js .reveal { opacity: 0; transform: translateY(24px); }
.js .reveal {
  transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1);
}
.js .reveal.is-in { opacity: 1; transform: none; }

.section--grid {
  background-color: var(--surface);
  background-image: radial-gradient(circle, var(--surface-3) 1px, transparent 1px);
  background-size: 40px 40px;
}

.section--surface { background: var(--surface); }

/* --------------------------------------------------------------- topbar -- */
.topbar {
  background: var(--primary-deep); color: var(--inverse-dim);
  font: 400 13px/1.5 var(--body);
}
.topbar__inner {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  justify-content: space-between; align-items: center; padding-block: 10px;
}
.topbar__note { margin: 0; }
.topbar__links { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.topbar__links a { color: var(--inverse); text-decoration: none; }
.topbar__links a:hover { color: var(--secondary-tint); }

/* ------------------------------------------------------------- masthead -- */
.masthead {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.masthead__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-block: 14px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--primary-deep); }
.brand__mark img { display: block; width: 40px; height: 40px; border-radius: 10px; }
.brand__mark { color: var(--primary); display: flex; }
.brand__mark svg { border-radius: var(--r); }
.brand__text { display: flex; flex-direction: column; }
.brand__name {
  font-family: var(--display); font-weight: 700; font-size: 18px;
  letter-spacing: -.01em; line-height: 1.1;
}
.brand__sub { color: var(--secondary-mid); margin-top: 3px; font-size: 10px; }

.nav { display: flex; align-items: center; gap: 32px; }
.nav__link {
  font: 600 13px var(--body); text-decoration: none; color: var(--text-variant);
  padding-block: 6px; position: relative; letter-spacing: .08em;
}
.nav__link:hover { color: var(--primary); }
.nav__link.is-active { color: var(--primary); }
.nav__link.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--secondary); border-radius: var(--r-full);
}
.nav__cta { margin-left: 4px; }

.nav-toggle {
  display: none; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--outline); border-radius: var(--r);
  padding: 10px 12px; cursor: pointer; color: var(--primary);
  font: 600 12px var(--body); text-transform: uppercase; letter-spacing: .1em;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 18px; height: 2px; background: currentColor;
  border-radius: 2px; content: '';
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before { position: absolute; top: -6px; }
.nav-toggle__bars::after  { position: absolute; top: 6px; }

/* -------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px var(--body);
  padding: 16px 32px;
  border: 2px solid transparent; border-radius: var(--r-lg);
  text-decoration: none; cursor: pointer;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease,
              transform .2s ease, box-shadow .25s ease;
}
.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--secondary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn--ghost:hover { background: var(--primary); color: #fff; }
.btn--light { background: #fff; color: var(--primary-deep); }
.btn--light:hover { background: var(--secondary-tint); color: var(--on-secondary-c); }
.btn--sm { padding: 10px 20px; font-size: 13px; border-radius: var(--r); letter-spacing: .06em; text-transform: uppercase; }
.btn--block { width: 100%; }
.btn + .btn { margin-left: 12px; }

.link-arrow {
  font: 600 15px var(--body); text-decoration: none; color: var(--primary);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.link-arrow::after { content: '→'; transition: transform .2s ease; }
.link-arrow:hover { color: var(--secondary); }
.link-arrow:hover::after { transform: translateX(4px); }

.alert {
  border: 1px solid var(--line); border-left: 4px solid var(--outline-strong);
  background: var(--surface); border-radius: var(--r-lg);
  padding: 14px 18px; margin: 20px 0; font-size: 15px;
}
.alert--ok    { border-left-color: var(--secondary); background: rgba(55,103,87,.06); }
.alert--error { border-left-color: var(--error); background: var(--error-tint); color: #93000a; }
.alert--info  { border-left-color: var(--primary); }

.note {
  font-size: 14px; color: var(--text-variant);
  background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px;
}

/* ----------------------------------------------------------------- hero -- */

/* --------------------------------------------------------------- cinematic hero -- */
.hero--cinematic {
  position: relative;
  min-height: min(86vh, 840px);
  display: flex;
  align-items: center;
  padding: clamp(96px, 12vh, 148px) 0 clamp(80px, 11vh, 124px);
  background: var(--primary-deep, #000613);
  color: #fff;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 58%;
  display: block;
}
.hero__bg picture { display: block; width: 100%; height: 100%; }
.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg,
      rgba(0, 6, 19, 0.94) 0%,
      rgba(0, 6, 19, 0.86) 30%,
      rgba(0, 6, 19, 0.56) 50%,
      rgba(0, 6, 19, 0.14) 64%,
      rgba(0, 6, 19, 0.00) 72%),
    linear-gradient(0deg, rgba(0, 6, 19, 0.58) 0%, transparent 40%),
    rgba(0, 6, 19, 0.22);
}

.hero__content {
  position: relative;
  z-index: 1;
  /* No width here: .wrap governs the gutter, exactly as it does in the
     header and every other section, so the hero lines up with them. */
}

.hero__copy {
  max-width: 720px;
}

.hero__eyebrow {
  font: 600 12px/1.2 Inter, system-ui, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--secondary-tint, #baeed9);
  margin: 0 0 20px;
}

.hero__title {
  font-family: var(--display, Montserrat, sans-serif);
  font-weight: 700;
  font-size: clamp(2.375rem, 5.2vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: #fff;
  margin: 0 0 24px;
  text-wrap: balance;
  text-shadow: 0 2px 28px rgba(0, 6, 19, 0.45);
}

.hero__lead {
  font-size: 18px;
  line-height: 1.7;
  color: rgba(244, 246, 247, 0.94);
  max-width: 46ch;
  margin: 0 0 36px;
  text-shadow: 0 1px 18px rgba(0, 6, 19, 0.5);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.btn--lg {
  padding: 16px 28px;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 16px;
}

.btn--ghost-light {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  padding: 14px 26px;
  font: 600 13px/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn--ghost-light:hover {
  background: #fff;
  color: var(--primary-deep, #000613);
  border-color: #fff;
}

.hero__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.hero__pills li {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.hero__pills li:has(a):hover {
  background: var(--secondary-tint, #baeed9);
  border-color: var(--secondary-tint, #baeed9);
  color: var(--on-secondary-c, #1d4f40);
}
.hero__pills strong {
  font-family: var(--display, Montserrat, sans-serif);
  font-weight: 700;
  font-size: 15px;
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
}
.hero__pills a {
  color: inherit;
  text-decoration: none;
}
.hero__pills li:has(a):hover a { color: inherit; }

@media (max-width: 720px) {
  .hero--cinematic {
    min-height: 72vh;
    padding: 88px 0 48px;
  }
  /* On a phone the copy spans the full width, so the side-lit scrim becomes a
     vertical one: the photograph frames the text from behind instead of
     sitting beside it. */
  .hero__scrim {
    background:
      linear-gradient(180deg,
        rgba(0, 6, 19, 0.62) 0%,
        rgba(0, 6, 19, 0.74) 42%,
        rgba(0, 6, 19, 0.92) 100%),
      rgba(0, 6, 19, 0.18);
  }
  .hero__bg img { object-position: 56% 52%; }
  .hero__title { font-size: clamp(2rem, 8.5vw, 2.75rem); }
  .hero__lead { font-size: 16px; max-width: none; }
  .hero__pills { gap: 8px; }
  .hero__pills li { padding: 8px 13px; font-size: 12px; }
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn--lg,
  .btn--ghost-light {
    width: 100%;
    text-align: center;
  }
}

/* legacy searchbar (catalogue pages) kept */

.searchbar {
  display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--r-lg); padding: 8px; margin: 32px 0 16px;
}
.searchbar__field { display: block; }
.searchbar input, .searchbar select {
  width: 100%; height: 100%;
  background: #fff; color: var(--text);
  border: 0; border-radius: var(--r); padding: 14px 16px;
  font: 400 15px var(--body);
}

.hero__quick { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 32px; }
.hero__quick-label { color: var(--inverse-dim); }
.hero__quick ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.hero__quick a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-full);
  border: 1px solid rgba(255,255,255,.22);
  font: 600 14px var(--body); color: var(--inverse); text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.hero__quick a:hover { background: var(--secondary-tint); border-color: var(--secondary-tint); color: var(--on-secondary-c); }
.hero__quick em { font-style: normal; font-size: 12px; color: var(--inverse-dim); }
.hero__quick a:hover em { color: var(--secondary); }

.hero__stats {
  display: flex; flex-wrap: wrap; gap: 24px 56px;
  list-style: none; margin: 0; padding: 32px 0 0;
  border-top: 1px solid rgba(255,255,255,.14);
  font-size: 12px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--inverse-dim);
}
.hero__stats span {
  display: block; font-size: 28px; font-weight: 700; letter-spacing: -.02em;
  color: #fff; margin-bottom: 4px; font-family: var(--display);
}

.hero__aside { position: relative; }
.hero__plate {
  background: var(--white); color: var(--text);
  border-radius: var(--r-xl); overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero__plate-media { position: relative; aspect-ratio: 4/3; background: var(--surface-2); }
.hero__plate-media img { width: 100%; height: 100%; object-fit: cover; }
.hero__plate-label {
  position: absolute; top: 16px; left: 16px;
  background: rgba(0,6,19,.82); color: #fff;
  padding: 6px 12px; border-radius: var(--r-sm);
}
.hero__plate-body { padding: 20px 24px 24px; }
.hero__plate-body h2 { font-size: 20px; margin: 0 0 8px; }
.hero__plate-meta { display: flex; gap: 16px; font-size: 14px; color: var(--text-variant); margin-bottom: 16px; }
.hero__plate-price { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--primary-deep); }
.hero__plate-cta { margin-top: 16px; }

/* -------------------------------------------------------------- sections -- */
.section { padding-block: var(--band); }
.section__head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end;
  gap: 16px 32px; margin-bottom: 48px;
}
.section__title {
  font-size: clamp(28px, 3.5vw, 36px); margin: 0;
  letter-spacing: -.015em;
}
.section__lead { color: var(--text-variant); max-width: 36rem; margin: 0; font-size: 17px; }

/* ------------------------------------------------------------- process cards -- */
.steps {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gutter); list-style: none; margin: 0; padding: 0;
}
.step {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 24px 32px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s ease, transform .25s ease;
  position: relative;
}
.step:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.step__icon {
  width: 48px; height: 48px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  font-size: 20px;
}
.step__no {
  position: absolute; top: 24px; right: 24px;
  font-family: var(--display); font-size: 42px; font-weight: 700;
  color: var(--surface-3); line-height: 1; letter-spacing: -.03em;
  transition: color .25s ease;
}
.step:hover .step__no { color: var(--outline); }
.step__title { font-size: 20px; margin: 0 0 12px; color: var(--primary-deep); }
.step p { margin: 0; color: var(--text-variant); font-size: 15px; line-height: 1.55; }

/* ---------------------------------------------------------------- categories -- */
.cats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter);
  list-style: none; margin: 0; padding: 0;
}
.cat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow .25s ease, transform .25s ease;
}
.cat:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cat a { display: block; text-decoration: none; color: inherit; height: 100%; }
.cat__media {
  aspect-ratio: 16/10; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
}
.cat__media img { width: 70%; height: 70%; object-fit: contain; }
.cat__body { padding: 20px 22px 24px; }
.cat__name { font-family: var(--display); font-weight: 600; font-size: 18px; margin: 0 0 6px; color: var(--primary-deep); }
.cat__desc { font-size: 14px; color: var(--text-variant); margin: 0; line-height: 1.45; }

/* --------------------------------------------------------------- plates (cards) -- */
.grid--plates {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter);
  list-style: none; margin: 0; padding: 0;
}
.plate {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: visible;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s ease, transform .25s ease;
}
.plate:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.plate--sold { opacity: .72; }
.plate--reserved .stencil--reserved { background: var(--warn-tint); color: var(--warn); }

.plate__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.plate__media {
  position: relative; aspect-ratio: 4/3; background: var(--surface-2); overflow: hidden;
}
.plate__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.plate:hover .plate__media img { transform: scale(1.03); }
.plate__head {
  position: absolute; inset: 12px 12px auto 12px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
}
.plate__stock {
  background: rgba(0,6,19,.78); color: #fff;
  padding: 5px 10px; border-radius: var(--r-sm); font-size: 11px;
}
.stencil {
  font: 600 11px/1.2 var(--body); letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: var(--r-sm);
}
.stencil--available { background: rgba(186,238,217,.95); color: var(--on-secondary-c); }
.stencil--reserved  { background: var(--warn-tint); color: var(--warn); }
.stencil--sold      { background: var(--surface-3); color: var(--text-muted); }

.plate__body { padding: 18px 20px 8px; flex: 1; }
.plate__category { color: var(--secondary-mid); margin: 0 0 6px; }
.plate__title {
  font-family: var(--display); font-weight: 600; font-size: 18px;
  margin: 0 0 14px; color: var(--primary-deep); line-height: 1.3;
}
.specs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 0; padding: 0; list-style: none;
}
.spec { margin: 0; }
.spec dt {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 2px;
}
.spec dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--text); }

.plate__foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px 18px; border-top: 1px solid var(--line); margin-top: auto;
}
.plate__price {
  font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--primary-deep);
}
.plate__cta {
  font: 600 13px var(--body); color: var(--secondary-mid); letter-spacing: .04em;
}

/* --------------------------------------------------------------- catalogue -- */
.pagehead { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: clamp(40px, 6vw, 72px); }
.pagehead__title { font-size: clamp(32px, 4.4vw, 48px); font-weight: 700; letter-spacing: -.02em; margin: 0 0 12px; }
.pagehead__lead { color: var(--text-variant); max-width: 65ch; margin: 0; font-size: 18px; }

.catalogue {
  display: grid; grid-template-columns: 280px 1fr; gap: 40px;
  padding-bottom: var(--band); align-items: start;
}
.filters {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  position: sticky; top: 88px;
}
.filters__group { display: grid; gap: 16px; margin-bottom: 20px; }
.filters__group--triple { grid-template-columns: 1fr; }
.filters__actions { display: grid; gap: 10px; margin-top: 8px; }
.filters__actions .btn { width: 100%; justify-content: center; }

.field { display: block; }
.field__label {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-variant); margin-bottom: 6px;
}
.field__input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r);
  font: 400 15px var(--body); background: var(--white); color: var(--text);
  transition: border-color .2s ease;
}
.field__input:focus { outline: none; border-color: var(--primary); border-width: 2px; padding: 11px 13px; }

.results__bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 24px;
}
.results__count { font-size: 14px; color: var(--text-variant); margin: 0; }
.results__sort { display: flex; align-items: center; gap: 10px; }
.results__sort label { font-size: 13px; color: var(--text-muted); }
.results__sort select { padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); font: 400 14px var(--body); }

.pager {
  display: flex; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap;
}
.pager__link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r);
  font: 600 14px var(--body); text-decoration: none; color: var(--text-variant);
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.pager__link:hover, .pager__link.is-active, .pager__link.is-current {
  background: var(--primary); border-color: var(--primary); color: #fff;
}

.empty {
  text-align: center; padding: 64px 24px;
  background: var(--surface); border-radius: var(--r-lg); border: 1px dashed var(--outline);
}
.empty h2 { margin-bottom: 12px; }
.empty p { color: var(--text-variant); max-width: 36ch; margin: 0 auto 24px; }

/* --------------------------------------------------------------- unit detail -- */
.unit {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(20px, 3vw, 40px);
  padding-block: 24px var(--band); align-items: start;
}
.unit__gallery { display: grid; gap: 12px; }
.unit__main {
  /* Column only — do not constrain aspect or clip; gallery__main owns the image frame */
  min-width: 0;
}
.unit__main > .gallery {
  margin-bottom: 0;
}
.unit__thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.unit__thumbs button {
  width: 80px; height: 60px; padding: 0; border: 2px solid transparent;
  border-radius: var(--r); overflow: hidden; cursor: pointer; background: var(--surface-2);
}
.unit__thumbs button.is-active { border-color: var(--primary); }
.unit__thumbs img { width: 100%; height: 100%; object-fit: cover; }

.unit__panel { position: sticky; top: 96px; display: grid; gap: 16px; }
.unit__status { margin-bottom: 12px; }
.unit__title { font-size: clamp(24px, 3vw, 30px); margin: 0 0 8px; }
.unit__meta { color: var(--text-variant); font-size: 15px; margin-bottom: 20px; }
.panel__price {
  font-family: var(--display); font-weight: 700; font-size: 28px;
  color: var(--primary-deep); margin-bottom: 4px;
}
.panel__note { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.panel__facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px;
  margin: 0 0 24px; padding: 0; list-style: none;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding-block: 20px;
}
.panel__facts li { margin: 0; }
.panel__facts span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
.panel__facts strong { font-size: 15px; font-weight: 600; color: var(--text); }
.panel__actions { display: grid; gap: 12px; }
.panel__actions .btn { width: 100%; }

.datasheet {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px;
  margin: 0; padding: 0;
}
.datasheet dt {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); margin-top: 16px;
}
.datasheet dd { margin: 4px 0 0; font-size: 16px; font-weight: 500; }
.unit__desc { margin-top: 40px; max-width: 68ch; }
.unit__desc h2 { font-size: 22px; margin-bottom: 16px; }
.unit__desc p { color: var(--text-variant); }

/* ---------------------------------------------------------------- forms -- */
.form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form__grid .field--full { grid-column: 1 / -1; }
.form__legend {
  font-family: var(--display); font-size: 18px; font-weight: 600;
  color: var(--primary-deep); margin: 0 0 20px; letter-spacing: normal; text-transform: none;
}
.form textarea.field__input { min-height: 120px; resize: vertical; }
.form__actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------------------------------------------------------------- CTA band -- */
.cta-band {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 24px; margin-top: 56px;
  background: var(--primary-deep); color: var(--inverse);
  border-radius: var(--r-xl); padding: 36px 40px;
}
.cta-band__title { color: #fff; font-size: 24px; margin: 0 0 8px; }
.cta-band p { margin: 0; color: var(--inverse-dim); max-width: 40ch; }

/* ---------------------------------------------------------------- trust strip -- */
.trust {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter);
  list-style: none; margin: 0; padding: 0;
}
.trust__item {
  text-align: center; padding: 24px 16px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.trust__n {
  font-family: var(--display); font-weight: 700; font-size: 32px;
  color: var(--primary-deep); letter-spacing: -.02em; margin-bottom: 6px;
}
.trust__l { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-variant); }

/* ---------------------------------------------------------------- table / faq -- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-variant);
  background: var(--surface); padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.table td { font-size: 15px; border-top: 1px solid var(--line); padding: 14px 16px; }
.table tbody tr:hover td { background: var(--surface); }

.faq { margin-top: 64px; }
.faq__item {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 24px; margin-bottom: 12px;
  transition: box-shadow .2s ease;
}
.faq__item[open] { box-shadow: var(--shadow-sm); }
.faq__item summary { cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--primary-deep); }
.faq__item p { margin: 16px 0 0; color: var(--text-variant); }

/* --------------------------------------------------------------- footer -- */
.footer { background: var(--primary-deep); color: var(--inverse-dim); padding-top: var(--band); }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 56px; }
.footer__brand { font-family: var(--display); font-weight: 700; font-size: 22px; color: #fff; margin: 0 0 16px; }
.footer__brand span { color: var(--secondary-tint); }
.footer__text { font-size: 15px; max-width: 44ch; line-height: 1.7; }
.footer__text--mono { font-size: 14px; color: var(--text-muted); }
.footer__head { color: #fff; margin: 0 0 20px; }
.footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.footer__list a { text-decoration: none; font-size: 15px; }
.footer__list a:hover { color: var(--secondary-tint); }
.footer__list--mono { font-size: 14px; }
.footer__base {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,.1); padding-block: 24px;
  font-size: 13px; color: var(--text-muted);
}
.footer__base p { margin: 0; }
.footer__base a { text-decoration: none; }
.footer__base a:hover { color: var(--secondary-tint); }

/* ----------------------------------------------------------- responsive -- */
@media (max-width: 1100px) {
  .grid--plates { grid-template-columns: repeat(2, 1fr); }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .catalogue { grid-template-columns: 1fr; }
  .filters { position: static; }
  .unit { grid-template-columns: 1fr; }
  .unit__panel { position: static; }
  .trust { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: 0; padding: 12px var(--margin) 20px;
    box-shadow: var(--shadow-md);
  }
  .nav.is-open { display: flex; }
  .nav__link { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav__cta { margin: 16px 0 0; width: 100%; justify-content: center; }

  .searchbar { grid-template-columns: 1fr; }
  .grid--plates, .cats { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .form__grid { grid-template-columns: 1fr; }
  .datasheet { grid-template-columns: 1fr; }
  .trust { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .cta-band { padding: 28px 24px; }
  .specs { grid-template-columns: repeat(3, 1fr); }
  .panel__facts { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .plate:hover, .step:hover, .cat:hover { transform: none; }
  .btn--primary:hover { transform: none; }
}

/* ============================================================
   Compatibility styles for detail, forms, and list pages
   (from original implementation, refined to design system)
   ============================================================ */

.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--text-muted); padding-top: 24px; list-style: none; margin: 0; padding-left: 0; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--primary); }
.crumbs li + li::before { content: '/'; margin-right: 8px; color: var(--outline); }

.gallery__main {
  position: relative; margin: 0;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-xl); aspect-ratio: 4 / 3; overflow: hidden;
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__main figcaption { position: absolute; top: 16px; left: 16px; }
/* .gallery__thumbs layout is defined in the product gallery block below */
.gallery__thumb {
  padding: 0; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: var(--r); cursor: pointer; overflow: hidden; aspect-ratio: 4 / 3;
  transition: border-color .2s ease;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb.is-current { border-color: var(--primary); border-width: 2px; }

.unit__section { margin-top: 56px; }
.unit__h2 { font-size: 24px; font-weight: 600; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.prose { max-width: 70ch; font-size: 17px; color: var(--text-variant); }

.datasheet { margin: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--white); }
.datasheet__row { display: flex; align-items: baseline; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--line); }
.datasheet__row:first-child { border-top: 0; }
.datasheet__row:nth-child(odd) { background: var(--surface); }
.datasheet dt { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); min-width: 160px; }
.datasheet dd { margin: 0 0 0 auto; font: 600 15px var(--body); text-align: right; color: var(--text); }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 28px; box-shadow: var(--shadow-sm); }
.panel--quiet { background: var(--surface); box-shadow: none; }
.panel__h2 { font-size: 20px; font-weight: 600; margin: 0 0 8px; }
.panel__lead { font-size: 15px; color: var(--text-variant); margin: 0 0 20px; }
.panel--price { border-top: 3px solid var(--primary); }
.panel__stock { color: var(--text-muted); margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.panel__title { font-size: 26px; font-weight: 700; margin-bottom: 12px; }
.panel__price { font-family: var(--display); font-weight: 700; font-size: 32px; line-height: 1.1; margin: 0 0 24px; color: var(--primary-deep); }
.panel__price span { display: block; font: 600 12px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-top: 8px; }
.panel__facts { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.panel__facts li { background: var(--surface); border-radius: var(--r); padding: 12px 14px; margin: 0; }
.panel__facts span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.panel__facts strong { font: 600 16px var(--body); }
.panel__notice { font-size: 14px; color: var(--warn); background: var(--warn-tint); border-radius: var(--r); padding: 12px 14px; margin-bottom: 16px; }
.panel .btn + .btn { margin-left: 0; margin-top: 12px; }

.split { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(24px, 4vw, 48px); padding-block: var(--band); align-items: start; }
.split__aside { display: grid; gap: 16px; position: sticky; top: 96px; }

.form { display: grid; gap: 20px; }
.form--panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow-sm);
}
.form__legend { color: var(--secondary-mid); border-bottom: 1px solid var(--line); padding-bottom: 12px; margin: 12px 0 0; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.form__legend:first-of-type { margin-top: 0; }
.form__note { font-size: 14px; color: var(--text-muted); margin: 0; }

.field { display: block; }
.field__label { display: block; font: 600 14px var(--body); margin-bottom: 8px; color: var(--text); }
.req { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--secondary-mid); margin-left: 6px; }
.field__input {
  width: 100%; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; font: 400 16px var(--body); color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field__input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(0,31,63,.12); }
.field__input.has-error { border-color: var(--error); background: var(--error-tint); }
textarea.field__input { resize: vertical; min-height: 120px; }
.field__error { display: block; font-size: 14px; color: var(--error); margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1100px) {
  .unit { grid-template-columns: 1fr; }
  .unit__panel { position: static; }
  .split { grid-template-columns: 1fr; }
  .split__aside { position: static; }
}
@media (max-width: 720px) {
  .form-grid, .form-grid--3 { grid-template-columns: 1fr; }
  .panel__facts { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Additional layout helpers for content pages
   ============================================================ */
.prose-wrap { max-width: 760px; margin: 0 auto; padding-block: 0 var(--band); }
.prose-wrap .steps { margin-top: 32px; }
.steps--stacked {
  display: grid; grid-template-columns: 1fr; gap: 20px;
}
.steps--stacked .step { padding: 28px 32px; }
.steps--stacked .step__no { position: static; display: block; margin-bottom: 8px; font-size: 12px; color: var(--secondary-mid); opacity: 1; }
.steps--stacked .step__title { font-size: 22px; }

.cards-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter);
  margin-block: 32px var(--band);
}
.cards-3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter);
  margin-block: 32px var(--band);
}

.catalogue__results { min-width: 0; }
.grid { display: grid; }
.grid--plates { grid-template-columns: repeat(3, 1fr); gap: var(--gutter); list-style: none; margin: 0; padding: 0; }
.empty--panel {
  text-align: center; padding: 48px 24px;
  background: var(--surface); border-radius: var(--r-lg); border: 1px dashed var(--outline);
}
.empty--tall { margin-block: var(--band); }

/* Compare bar (floating) */
.compare-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--primary-deep); color: #fff;
  padding: 14px 0; transform: translateY(110%);
  transition: transform .3s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 -8px 32px rgba(0,31,63,.2);
}
.compare-bar.is-visible { transform: translateY(0); }
.compare-bar__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.compare-bar__list { display: flex; gap: 12px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.compare-bar__item {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1); border-radius: var(--r); padding: 6px 12px; font-size: 14px;
}
.compare-bar__item button {
  background: none; border: 0; color: var(--secondary-tint); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px;
}
.compare-bar__actions { display: flex; gap: 10px; align-items: center; }
.compare-bar__count { font-size: 13px; color: var(--inverse-dim); margin-right: 8px; }

/* Compare page table */
.compare-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.compare-table th, .compare-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare-table th { background: var(--surface); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-variant); }
.compare-table .compare-col-head { text-align: center; min-width: 180px; }
.compare-table .compare-col-head img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--r); margin-bottom: 12px; background: var(--surface-2); }
.compare-table .compare-col-head a { font-family: var(--display); font-weight: 600; font-size: 16px; text-decoration: none; color: var(--primary-deep); }
.compare-table tr:last-child td { border-bottom: 0; }
.compare-table .label-col { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); width: 140px; white-space: nowrap; }

/* Plate compare toggle */
.plate__compare {
  position: absolute; bottom: 12px; right: 12px; z-index: 2;
}
.plate__compare label {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.95); border-radius: var(--r-sm);
  padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow-sm); color: var(--primary-deep);
}
.plate__compare input { margin: 0; accent-color: var(--primary); }

@media (max-width: 1100px) {
  .cards-2, .cards-3 { grid-template-columns: 1fr; }
  .grid--plates { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .grid--plates { grid-template-columns: 1fr; }
  .compare-bar__inner { flex-direction: column; align-items: stretch; }
  .compare-table { display: block; overflow-x: auto; }
}

/* Space for the fixed compare tray so it never covers the last cards */
body { padding-bottom: 0; }
body:has(#compare-bar.is-visible) { padding-bottom: 88px; }
@supports not selector(:has(*)) {
  .compare-bar.is-visible ~ * { /* fallback: tray only */ }
}


/* Featured inventory uses the category card shell with real photos */
.cat__media--photo {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  overflow: hidden;
}
.cat__media--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.cat:hover .cat__media--photo img {
  transform: scale(1.04);
}
.plate__price--ask {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--secondary-mid);
  text-transform: uppercase;
  font-size: 15px;
}

/* ============================================================
   Product gallery — fixed layout for many images
   ============================================================ */

/* Gallery lives only in the left column; never spill into the sidebar */
.unit > .unit__main > .gallery,
.unit__main .gallery {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

/* Hero stage: fixed frame, image fully visible (no aggressive crop) */
.gallery__stage {
  position: relative;
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden; /* keeps arrows inside */
  background: transparent;
  border: 1px solid var(--line);
  /* Height follows the photo’s natural ratio — no crop, no letterbox */
  height: auto;
  line-height: 0;
}

.gallery__hero {
  position: relative;
  width: 100%;
  height: auto;
  max-height: none;
  display: block;
  object-fit: unset;
  object-position: center;
  transition: opacity 0.15s ease;
  background: transparent;
}

.gallery__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  pointer-events: none;
}

/* Arrows strictly inside the stage */
.gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #191c1d;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  transition: background 0.15s ease, transform 0.15s ease;
}
.gallery__nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.05);
}
.gallery__nav--prev { left: 10px; }
.gallery__nav--next { right: 10px; }

.gallery__meta {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 3;
  pointer-events: none;
}
.gallery__count {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font: 600 12px/1 Inter, system-ui, sans-serif;
  padding: 6px 10px;
  border-radius: 999px;
}

/* Filmstrip: one horizontal row only, never wraps or overlaps */
.gallery__filmstrip {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 6px;
  box-sizing: border-box;
}

.gallery__film-arrow {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.gallery__film-arrow:hover {
  background: #f0f1f2;
  color: #000;
}

.gallery__thumbs {
  display: flex !important;
  flex-wrap: nowrap !important; /* critical: no wrapping */
  flex: 1 1 auto;
  min-width: 0; /* allows shrink so overflow scrolls */
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 2px 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.gallery__thumbs::-webkit-scrollbar { height: 4px; }
.gallery__thumbs::-webkit-scrollbar-thumb {
  background: #c4c6cf;
  border-radius: 4px;
}

.gallery__thumb {
  flex: 0 0 auto !important; /* never shrink/grow into overlap */
  width: 84px;
  height: 63px;
  padding: 0;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #e8eaec;
  scroll-snap-align: start;
  opacity: 0.75;
  transition: border-color 0.15s ease, opacity 0.15s ease;
  position: relative;
}
.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.gallery__thumb:hover {
  opacity: 1;
  border-color: #a0a4ab;
}
.gallery__thumb.is-current {
  opacity: 1;
  border-color: #001f3f;
  box-shadow: 0 0 0 1px #001f3f;
}

/* Unit grid: left column must not overflow into sidebar */
.unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: clamp(20px, 3vw, 40px);
  padding-block: 24px var(--band);
  align-items: start;
}
.unit__main {
  min-width: 0; /* grid overflow fix */
  max-width: 100%;
}
.unit__panel {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
  align-self: start;
}

@media (max-width: 1100px) {
  .unit {
    grid-template-columns: 1fr;
  }
  .unit__panel {
    position: static;
  }
  .gallery__stage {
    height: auto;
  }
}

@media (max-width: 720px) {
  .gallery__stage {
    height: auto;
  }
  .gallery__nav {
    width: 34px;
    height: 34px;
  }
  .gallery__thumb {
    width: 68px;
    height: 51px;
  }
}
