/* Машины по маркам на «Kaufen» / «Mieten» + мега-меню «Kaufen» в шапке (разметку строит clone/brands.mjs, поведение — site.js). */
.bmx-brands {
  --bmx-ink: #191919; --bmx-muted: #5c5c5c; --bmx-card: #f2f2f2; --bmx-line: #e2e2e2;
  --bmx-hfont: var(--font-kit-header-font, 'Rubik Dirt'), 'Rubik Dirt', system-ui, sans-serif;
  --bmx-tfont: var(--font-kit-text-font, Montserrat), Montserrat, system-ui, sans-serif;
  background: #fff; color: var(--bmx-ink); padding: 72px 0 24px;
  font-family: var(--bmx-tfont); font-size: 16px; line-height: 1.5;
}
.bmx-brands *, .bmx-brands *::before, .bmx-brands *::after { box-sizing: border-box; }
.bmx-wrap { max-width: 1232px; margin: 0 auto; padding: 0 16px; }
.bmx-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bmx-brands__head { text-align: center; max-width: 720px; margin: 0 auto 32px; }
.bmx-brands__head h2 { margin: 0 0 12px; font-family: var(--bmx-hfont); font-weight: 400; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; color: var(--bmx-ink); }
.bmx-brands__head p { margin: 0; color: var(--bmx-muted); }

/* переключатель марок */
.bmx-brandnav { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 56px; }
.bmx-brandnav__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 120px;
  padding: 20px 24px; border: 1px solid var(--bmx-line); border-radius: 16px; background: #fff; color: var(--bmx-ink);
  text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.bmx-brandnav__item img { display: block; width: auto; height: auto; max-width: 100%; max-height: 44px; }
.bmx-brandnav__item b { font-family: var(--bmx-hfont); font-weight: 400; font-size: 22px; }
.bmx-brandnav__item small { font-size: 13px; font-weight: 600; color: var(--bmx-muted); }
.bmx-brandnav__item:hover, .bmx-brandnav__item:focus-visible { border-color: var(--bmx-brand); box-shadow: 0 6px 20px rgba(17, 17, 26, .1); transform: translateY(-2px); }
.bmx-brandnav__item.bmx-plate--dark { background: var(--bmx-ink); border-color: var(--bmx-ink); }
.bmx-brandnav__item.bmx-plate--dark small { color: #c9c9c9; }
.bmx-brandnav__item.bmx-plate--dark:hover { border-color: var(--bmx-brand); }

/* блок марки */
.bmx-brand { scroll-margin-top: 110px; padding: 48px 0; border-top: 1px solid var(--bmx-line); }
.bmx-brand__head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-bottom: 28px; }
.bmx-plate {
  display: flex; align-items: center; justify-content: center; width: 240px; height: 84px; padding: 16px 24px;
  border: 1px solid var(--bmx-line); border-radius: 12px; background: #fff; flex: none;
}
.bmx-plate img { display: block; width: auto; height: auto; max-width: 100%; max-height: 52px; }
.bmx-plate--dark { background: var(--bmx-ink); border-color: var(--bmx-ink); }
.bmx-plate--text { width: auto; font-family: var(--bmx-hfont); font-size: 24px; color: var(--bmx-ink); }
.bmx-brand__meta { margin: 0; flex: 1 1 200px; color: var(--bmx-muted); font-size: 14px; font-weight: 600; }
.bmx-brand__tools { display: flex; flex-wrap: wrap; gap: 12px; }
.bmx-brand__tools[hidden] { display: none; }
.bmx-field { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 12px; font-weight: 600; color: var(--bmx-muted); text-transform: uppercase; letter-spacing: .04em; }
.bmx-field select {
  min-width: 210px; height: 46px; padding: 0 40px 0 14px; margin: 0; border: 1px solid #cfcfcf; border-radius: 8px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23191919' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--bmx-ink); font: 600 15px/1 var(--bmx-tfont);
  text-transform: none; letter-spacing: 0; appearance: none; -webkit-appearance: none; cursor: pointer;
}
.bmx-field select:hover { border-color: var(--bmx-ink); }
.bmx-field select:focus-visible { outline: 2px solid var(--bmx-brand); outline-offset: 2px; border-color: var(--bmx-brand); }

/* промо (напр. Eurocomach Sommerdeal) */
.bmx-promo {
  display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 32px; align-items: center;
  margin-bottom: 32px; padding: 24px; border-radius: 16px; background: #fff4e6;
}
.bmx-promo__img { display: block; width: 100%; height: auto; border-radius: 12px; }
.bmx-promo__title { margin: 0 0 16px; font-family: var(--bmx-hfont); font-weight: 400; font-size: clamp(24px, 3vw, 34px); line-height: 1.35; }
.bmx-promo__title span { background: #c51315; color: #fff; padding: 2px 10px; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.bmx-promo p { margin: 0; font-size: 16px; line-height: 1.7; }

/* карточки */
.bmx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.bmx-card {
  display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; background: var(--bmx-card); color: var(--bmx-ink);
  text-decoration: none; box-shadow: 0 1px 4px rgba(17, 17, 26, .05), 0 0 8px rgba(17, 17, 26, .1); transition: box-shadow .2s, transform .2s;
}
.bmx-card[hidden] { display: none; }
.bmx-card__img { aspect-ratio: 4 / 3; overflow: hidden; background: #d7d7d7; }
.bmx-card__img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.bmx-card__body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; flex: 1; padding: 20px 24px 24px; }
.bmx-card__type { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--bmx-muted); }
.bmx-card__title { margin: 0; font-family: var(--bmx-hfont); font-weight: 400; font-size: 20px; line-height: 1.25; color: var(--bmx-ink); }
.bmx-card__price { font-family: var(--bmx-hfont); font-size: 18px; color: var(--bmx-brand); margin-bottom: 12px; }
.bmx-card__btn {
  margin-top: auto; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 22px;
  border-radius: 8px; background: var(--bmx-brand); color: #fff; font-weight: 600; font-size: 15px; transition: background .2s;
}
.bmx-card:hover, .bmx-card:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(17, 17, 26, .16); }
.bmx-card:hover .bmx-card__img img { transform: scale(1.05); }
.bmx-card:hover .bmx-card__btn { background: #d56f00; }
.bmx-card:focus-visible { outline: 2px solid var(--bmx-brand); outline-offset: 3px; }

/* логотипы в первом экране — ссылки на блок марки */
.bmx-herologo-box { position: relative; }
.bmx-herologo { position: absolute; inset: 0; z-index: 2; border-radius: 6px; }
.bmx-herologo:focus-visible { outline: 2px solid var(--bmx-brand); outline-offset: 2px; }

@media (max-width: 899px) {
  .bmx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .bmx-promo { grid-template-columns: 1fr; gap: 20px; }
  .bmx-promo__img { max-width: 420px; }
}
@media (max-width: 599px) {
  .bmx-brands { padding-top: 48px; }
  .bmx-brandnav { grid-template-columns: 1fr; gap: 10px; margin-bottom: 32px; }
  .bmx-brandnav__item { flex-direction: row; justify-content: space-between; min-height: 72px; padding: 14px 18px; }
  .bmx-brandnav__item img { max-width: 60%; max-height: 32px; }
  .bmx-brand { padding: 36px 0; scroll-margin-top: 80px; }
  .bmx-plate { width: 100%; height: 76px; }
  .bmx-brand__tools { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .bmx-field select { min-width: 0; width: 100%; font-size: 14px; padding-right: 32px; background-position: right 10px center; }
  .bmx-grid { grid-template-columns: 1fr; gap: 12px; }
  .bmx-promo { padding: 16px; }
  /* на телефоне — компактные карточки: фото слева, текст справа */
  .bmx-card { flex-direction: row; border-radius: 12px; }
  .bmx-card__img { flex: 0 0 42%; aspect-ratio: auto; min-height: 150px; }
  .bmx-card__body { padding: 14px 14px 14px 16px; gap: 4px; min-width: 0; }
  .bmx-card__type { font-size: 11px; }
  .bmx-card__title { font-size: 17px; }
  .bmx-card__price { font-size: 16px; margin-bottom: 8px; }
  .bmx-card__btn { min-height: 40px; padding: 8px 16px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .bmx-card, .bmx-card__img img, .bmx-brandnav__item { transition: none; }
  .bmx-card:hover, .bmx-brandnav__item:hover, .bmx-card:hover .bmx-card__img img { transform: none; }
}

/* ---------- мега-меню «Kaufen» (десктоп) ---------- */
.bmx-has-mega { position: relative; }
.bmx-chev {
  display: inline-block; width: 7px; height: 7px; margin: 0 0 3px 8px; vertical-align: middle;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s;
}
.bmx-mega {
  position: absolute; top: 100%; left: 50%; z-index: 600; width: min(700px, calc(100vw - 32px)); padding-top: 22px;
  opacity: 0; visibility: hidden; transform: translate(-50%, 8px); transition: opacity .18s, transform .18s, visibility 0s .18s;
  font-family: var(--font-kit-text-font, Montserrat), Montserrat, system-ui, sans-serif;
}
.bmx-has-mega:hover > .bmx-mega, .bmx-has-mega:focus-within > .bmx-mega {
  opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .18s, transform .18s, visibility 0s;
}
.bmx-has-mega:hover .bmx-chev, .bmx-has-mega:focus-within .bmx-chev { transform: translateY(3px) rotate(225deg); }
.bmx-has-mega.bmx-mega-off > .bmx-mega { opacity: 0; visibility: hidden; transition: none; }
.bmx-has-mega.bmx-mega-off .bmx-chev { transform: rotate(45deg); }
.bmx-mega__panel {
  background: #fff; color: #191919; border-radius: 14px; padding: 20px; border-top: 3px solid var(--bmx-brand);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
.bmx-mega__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 4px 14px; }
.bmx-mega__head span { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5c5c5c; }
.bmx-mega__head a { font-size: 14px; font-weight: 600; color: var(--bmx-brand); text-decoration: none; white-space: nowrap; }
.bmx-mega__head a:hover { text-decoration: underline; }
.bmx-mega__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 12px; }
.bmx-mega__brand {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 14px; border: 1px solid #e2e2e2; border-radius: 12px;
  color: #191919; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.bmx-mega__brand:hover, .bmx-mega__brand:focus-visible { border-color: var(--bmx-brand); box-shadow: 0 6px 18px rgba(17, 17, 26, .12); transform: translateY(-2px); outline: none; }
.bmx-mega__logo { display: flex; align-items: center; justify-content: center; height: 64px; padding: 10px 14px; margin-bottom: 8px; border-radius: 8px; background: #fff; }
.bmx-mega__logo.bmx-plate--dark { background: #191919; }
.bmx-mega__logo img { display: block; width: auto; height: auto; max-width: 100%; max-height: 38px; }
.bmx-mega__brand b { padding: 0 4px; font-size: 14px; font-weight: 700; }
.bmx-mega__brand small { padding: 0 4px; font-size: 12px; line-height: 1.4; color: #5c5c5c; }
@media (max-width: 991px) { .bmx-mega, .bmx-chev { display: none; } }
@media (prefers-reduced-motion: reduce) { .bmx-mega, .bmx-chev, .bmx-mega__brand { transition: none !important; } }

/* подпункты «Kaufen» в мобильном меню */
.bmx-mnav__sub { display: flex; gap: 18px; margin-top: -8px; }
.bmx-mnav .bmx-mnav__sub a { font-size: 15px; font-weight: 500; color: #cfcfcf; }
.bmx-mnav .bmx-mnav__sub a:hover { color: var(--bmx-brand); }
