/* ==========================================================
   Немцу хорошо — редизайн. Токены, темы, компоненты.
   ========================================================== */
:root, [data-theme="light"] {
  --nh-bg: #EEF1F4; --nh-surface: #FFFFFF; --nh-surface2: #F5F7F9;
  --nh-line: #DDE2E8; --nh-line2: #C5CDD6;
  --nh-text: #18212C; --nh-text2: #3F4A57; --nh-muted: #566271;
  --nh-accent: #1D5FC4; --nh-accent-hover: #15489A; --nh-link: #1D5FC4; --nh-accent-soft: #E7EEF9;
  --nh-brand: #1D5FC4; --nh-photo: #C9D1DA; --nh-bigcode: #DDE2E8;
  --nh-band: #18212C; --nh-tile: #2C3845; --nh-warn: #B8520A;
  --nh-shadow: 0 6px 18px rgba(16, 40, 80, .18);
  --nh-font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nh-display: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --nh-bg: #0E141B; --nh-surface: #151D26; --nh-surface2: #1D2631;
  --nh-line: #26313D; --nh-line2: #3A4757;
  --nh-text: #E8EDF2; --nh-text2: #B7C1CC; --nh-muted: #93A0AE;
  --nh-accent: #2F6FD6; --nh-accent-hover: #4A84E0; --nh-link: #7FAEF8; --nh-accent-soft: #1A2B45;
  --nh-brand: #7FAEF8; --nh-photo: #2A3544; --nh-bigcode: #243040;
  --nh-band: #1B2531; --nh-tile: #2A3544; --nh-warn: #F0A060;
  --nh-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ---------- база поверх Bono ---------- */
body.nh-redesign { background: var(--nh-bg); color: var(--nh-text); font-family: var(--nh-font); }
body.nh-redesign h1, body.nh-redesign h2, body.nh-redesign h3,
body.nh-redesign .entry-title, body.nh-redesign .page-title, body.nh-redesign .product_title {
  font-family: var(--nh-display); color: var(--nh-text); letter-spacing: -.2px;
}
body.nh-redesign a { color: var(--nh-link); }
body.nh-redesign a:hover { color: var(--nh-accent-hover); }
body.nh-redesign :focus-visible { outline: 2px solid var(--nh-accent); outline-offset: 2px; }

/* шапка темы */
body.nh-redesign .site-header, body.nh-redesign .main-navigation, body.nh-redesign .site-footer { background: var(--nh-surface); border-color: var(--nh-line); color: var(--nh-text); }
body.nh-redesign .site-title, body.nh-redesign .site-title a, body.nh-redesign .site-branding__title, body.nh-redesign .site-branding__title a {
  color: var(--nh-brand) !important; font-family: var(--nh-display); font-weight: 700;
}
body.nh-redesign .site-description { color: var(--nh-muted); }
body.nh-redesign .main-navigation a, body.nh-redesign .menu a { color: var(--nh-text); }
.nh-bmw-logo { width: 40px; height: 40px; object-fit: contain; margin-right: 10px; vertical-align: middle; flex-shrink: 0; }

/* контентные поверхности темы */
body.nh-redesign .site-content, body.nh-redesign .content-area { background: transparent; color: var(--nh-text); }
body.nh-redesign .entry-content, body.nh-redesign article.page, body.nh-redesign article.post { color: var(--nh-text); }
body.nh-redesign .entry-content p, body.nh-redesign .entry-content li { color: var(--nh-text2); line-height: 1.65; }
body.nh-redesign table, body.nh-redesign th, body.nh-redesign td { border-color: var(--nh-line); }
body.nh-redesign input, body.nh-redesign select, body.nh-redesign textarea {
  background: var(--nh-surface); color: var(--nh-text); border: 1px solid var(--nh-line2); border-radius: 9px;
}

/* убрать сайдбар «Свежие записи / комментарии» */
body.nh-no-sidebar .widget-area, body.nh-no-sidebar #secondary, body.nh-no-sidebar .sidebar { display: none !important; }
body.nh-no-sidebar .content-area, body.nh-no-sidebar #primary { width: 100% !important; max-width: 100% !important; flex: 1 1 100% !important; }

.nh-wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }

/* ---------- полоса мессенджеров ---------- */
.nh-topbar { background: var(--nh-surface2); border-bottom: 1px solid var(--nh-line); font-family: var(--nh-font); }
.nh-topbar__in { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.nh-topbar__label { color: var(--nh-muted); font-size: 14px; margin-right: 6px; }
.nh-msg { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 17px;
  background: var(--nh-surface); color: var(--nh-text) !important; font-size: 13px; font-weight: 500; text-decoration: none !important; border: 1px solid var(--nh-line); }
.nh-msg:hover { border-color: var(--nh-line2); }
.nh-dot { width: 10px; height: 10px; border-radius: 5px; display: inline-block; flex-shrink: 0; }
.nh-msg--tg .nh-dot, .nh-fab__item.nh-msg--tg .nh-dot { background: #2AABEE; }
.nh-msg--max .nh-dot, .nh-fab__item.nh-msg--max .nh-dot { background: #7B5CFF; }
.nh-msg--wa .nh-dot, .nh-fab__item.nh-msg--wa .nh-dot { background: #25D366; }
.nh-topbar__phone { margin-left: auto; font-weight: 600; color: var(--nh-text) !important; text-decoration: none; white-space: nowrap; }
.nh-theme-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px;
  border: 1px solid var(--nh-line2); background: transparent; color: var(--nh-text); font: 500 13px var(--nh-font); cursor: pointer; }
@media (max-width: 767px) {
  .nh-topbar__in { gap: 6px; padding: 0 12px; }
  .nh-topbar__label, .nh-topbar__phone, .nh-theme-btn__txt { display: none; }
  .nh-msg { padding: 0 10px; }
  .nh-theme-btn { margin-left: auto; width: 34px; padding: 0; justify-content: center; }
}

/* ---------- плавающая кнопка ---------- */
.nh-fab { position: fixed; right: 16px; bottom: 20px; z-index: 9990; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; font-family: var(--nh-font); }
.nh-fab--raised { bottom: 100px; }
.nh-fab__btn { display: inline-flex; align-items: center; gap: 10px; height: 56px; min-width: 56px; padding: 0 16px; border-radius: 28px; border: 0;
  background: var(--nh-accent); color: #FFFFFF; font: 600 15px var(--nh-font); box-shadow: var(--nh-shadow); cursor: pointer; justify-content: center; }
.nh-fab__btn:hover { background: var(--nh-accent-hover); }
.nh-fab__menu { display: flex; flex-direction: column; gap: 8px; background: var(--nh-surface); border: 1px solid var(--nh-line); border-radius: 16px; padding: 10px; box-shadow: var(--nh-shadow); }
.nh-fab__menu[hidden] { display: none; }
.nh-fab__item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-radius: 10px; color: var(--nh-text) !important; text-decoration: none !important; font-weight: 500; }
.nh-fab__item:hover { background: var(--nh-surface2); }
@media (max-width: 767px) { .nh-fab__txt { display: none; } .nh-fab__btn { padding: 0; width: 56px; } }

/* ---------- кнопки ---------- */
.nh-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; border-radius: 10px;
  font: 600 16px var(--nh-font); text-decoration: none !important; border: 0; cursor: pointer; box-sizing: border-box; }
.nh-btn--primary { background: var(--nh-accent); color: #FFFFFF !important; }
.nh-btn--primary:hover { background: var(--nh-accent-hover); }
.nh-btn--light { background: #FFFFFF; color: #18212C !important; }
.nh-btn--dark { background: var(--nh-text); color: var(--nh-bg) !important; min-height: 46px; font-size: 14px; padding: 0 16px; }

/* ---------- главная: герой и подбор ---------- */
.nh-home { padding: 24px 0 0; }
.nh-hero { display: grid; grid-template-columns: 5fr 7fr; gap: 24px; }
.nh-hero__card { background: var(--nh-surface); border-radius: 20px; padding: 40px; display: flex; flex-direction: column; gap: 16px; }
.nh-hero__code { font: 700 120px/0.85 var(--nh-display); color: var(--nh-bigcode); letter-spacing: -3px; }
.nh-hero__title { margin: -52px 0 0 !important; font: 700 54px/1.02 var(--nh-display) !important; letter-spacing: -.8px; }
.nh-hero__lead { margin: 0; font-size: 17px; line-height: 1.55; color: var(--nh-text2); max-width: 460px; }
.nh-pick { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.nh-pick__q { font-weight: 600; font-size: 14px; }
.nh-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 12px; background: var(--nh-surface2); }
.nh-seg__btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 50px; border: 0; border-radius: 9px;
  background: transparent; color: var(--nh-muted); cursor: pointer; font-family: var(--nh-font); }
.nh-seg__btn b { font: 700 17px var(--nh-display); }
.nh-seg__btn small { font-size: 11px; opacity: .85; }
.nh-seg__btn.is-on { background: var(--nh-surface); color: var(--nh-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.nh-models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.nh-models[hidden] { display: none; }
.nh-model { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; border-radius: 10px;
  border: 1px solid var(--nh-line); background: var(--nh-surface2); color: var(--nh-text); cursor: pointer; font-family: var(--nh-font); }
.nh-model b { font: 700 21px/1 var(--nh-display); }
.nh-model small { font-size: 12px; opacity: .85; }
.nh-model.is-on { background: var(--nh-accent); border-color: var(--nh-accent); color: #FFFFFF; }
.nh-link-center { text-align: center; font-size: 14px; }
.nh-hero__photo { position: relative; border-radius: 20px; min-height: 560px; background-color: var(--nh-photo); background-size: cover; background-position: center; overflow: hidden; }
.nh-hero__bigcode { position: absolute; left: 32px; bottom: 100px; font: 700 160px/0.8 var(--nh-display); color: rgba(255, 255, 255, .9); letter-spacing: -4px; text-shadow: 0 2px 30px rgba(0, 0, 0, .25); }
.nh-hero__facts { position: absolute; left: 24px; right: 24px; bottom: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.nh-hero__facts div { background: var(--nh-surface); border-radius: 12px; padding: 12px 18px; display: flex; flex-direction: column; gap: 2px; }
.nh-hero__facts b { font-size: 15px; } .nh-hero__facts span { font-size: 13px; color: var(--nh-muted); }

/* секции */
.nh-sec { padding: 56px 0 0; }
.nh-sec__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.nh-sec__head h2 { margin: 0 !important; font: 600 34px/1.1 var(--nh-display) !important; }
.nh-sec__head a { font-weight: 500; }
.nh-cats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.nh-cat { background: var(--nh-surface); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 10px; min-height: 150px; color: var(--nh-text) !important; text-decoration: none !important; }
.nh-cat__img { width: 52px; height: 52px; border-radius: 12px; background: var(--nh-surface2); overflow: hidden; }
.nh-cat__img img { width: 100%; height: 100%; object-fit: cover; }
.nh-cat__txt { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.nh-cat__txt b { font-size: 17px; } .nh-cat__txt small { font-size: 14px; color: var(--nh-muted); line-height: 1.4; }

.nh-about { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--nh-surface); border-radius: 20px; overflow: hidden; margin-top: 56px; padding: 0; }
.nh-about__txt { padding: 40px; display: flex; flex-direction: column; gap: 18px; }
.nh-about__num { display: flex; align-items: flex-end; gap: 14px; }
.nh-about__num span { font: 700 96px/0.85 var(--nh-display); color: var(--nh-link); letter-spacing: -3px; }
.nh-about__num b { font-size: 16px; line-height: 1.35; padding-bottom: 6px; font-weight: 500; }
.nh-about__txt p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--nh-text2); }
.nh-about__facts { display: flex; gap: 10px; }
.nh-about__facts div { flex: 1; background: var(--nh-surface2); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.nh-about__facts b { font-size: 22px; } .nh-about__facts small { font-size: 13px; color: var(--nh-muted); }
.nh-about__photo { background-color: var(--nh-photo); background-size: cover; background-position: center; min-height: 360px; }

.nh-install { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.nh-install__row { background: var(--nh-surface); border-radius: 14px; padding: 20px; display: flex; gap: 16px; }
.nh-install__mark { width: 44px; height: 44px; border-radius: 11px; background: var(--nh-accent-soft); color: var(--nh-link); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font: 700 18px var(--nh-display); }
.nh-install__row b { display: block; font-size: 17px; margin-bottom: 4px; } .nh-install__row small { font-size: 15px; color: var(--nh-muted); line-height: 1.45; }

.nh-ugc { margin: 56px 0 0; background: var(--nh-band); color: #FFFFFF; padding: 48px max(20px, calc((100vw - 1240px) / 2)); display: grid; grid-template-columns: 5fr 7fr; gap: 24px; }
.nh-ugc__txt { display: flex; flex-direction: column; gap: 16px; justify-content: center; align-items: flex-start; }
.nh-ugc__txt h2 { margin: 0 !important; color: #FFFFFF !important; font: 600 40px/1.05 var(--nh-display) !important; }
.nh-ugc__txt p { margin: 0; color: #C8D0D9; font-size: 17px; line-height: 1.55; }
.nh-ugc__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nh-ugc__tile { height: 150px; border-radius: 12px; background-color: var(--nh-tile); background-size: cover; background-position: center; display: flex; align-items: flex-end; padding: 10px; }
.nh-ugc__tile span { font: 600 15px var(--nh-display); background: rgba(0, 0, 0, .45); padding: 2px 8px; border-radius: 6px; }

.nh-posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding-bottom: 56px; }
.nh-post { background: var(--nh-surface); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; color: var(--nh-text) !important; text-decoration: none !important; }
.nh-post__img { aspect-ratio: 16 / 9; background: var(--nh-photo); overflow: hidden; }
.nh-post__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nh-post__txt { padding: 16px 18px 18px; font-size: 17px; line-height: 1.35; }

/* ---------- сетка товаров WooCommerce (исправляет «наезды» на телефоне) ---------- */
body.nh-redesign ul.products { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0 !important; padding: 0 !important; }
body.nh-redesign ul.products::before, body.nh-redesign ul.products::after { display: none !important; }
body.nh-redesign ul.products li.product { width: auto !important; margin: 0 !important; float: none !important; height: auto !important;
  background: var(--nh-surface); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; padding: 0 0 16px !important; position: relative; }
body.nh-redesign ul.products li.product a img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: var(--nh-surface2); margin: 0 0 12px !important; position: static !important; }
body.nh-redesign ul.products li.product .woocommerce-loop-product__title { font: 500 15px/1.4 var(--nh-font) !important; color: var(--nh-text); padding: 0 16px !important; margin: 0 0 10px !important;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.9em; }
body.nh-redesign ul.products li.product .price { position: static !important; padding: 0 16px; margin: auto 0 12px !important; font: 600 18px var(--nh-font); color: var(--nh-text) !important; display: block; }
body.nh-redesign ul.products li.product .button, body.nh-redesign ul.products li.product .add_to_cart_button {
  position: static !important; transform: none !important; opacity: 1 !important; margin: 0 16px !important; width: auto !important;
  min-height: 44px; border-radius: 10px; background: var(--nh-accent-soft) !important; color: var(--nh-link) !important;
  font: 600 14px var(--nh-font) !important; display: flex !important; align-items: center; justify-content: center; border: 0 !important; box-shadow: none !important; }
body.nh-redesign ul.products li.product .button:hover { background: var(--nh-accent) !important; color: #FFFFFF !important; }
body.nh-redesign ul.products li.product .onsale, body.nh-redesign ul.products li.product .badge { top: 10px; left: 10px; right: auto; }
@media (max-width: 1023px) { body.nh-redesign ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  body.nh-redesign ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.nh-redesign ul.products li.product { border-radius: 12px; padding-bottom: 12px !important; }
  body.nh-redesign ul.products li.product .woocommerce-loop-product__title { font-size: 13px !important; padding: 0 12px !important; }
  body.nh-redesign ul.products li.product .price { padding: 0 12px; font-size: 15px; }
  body.nh-redesign ul.products li.product .button { margin: 0 12px !important; min-height: 40px; font-size: 13px !important; }
}

/* ---------- категория: чипсы кузова ---------- */
.nh-chips { margin: 0 0 20px; }
.nh-chips__label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.nh-chips__row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.nh-chips__row::-webkit-scrollbar { display: none; }
.nh-chip { flex-shrink: 0; display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 20px; background: var(--nh-surface);
  border: 1px solid var(--nh-line); color: var(--nh-text) !important; font: 600 15px var(--nh-display); text-decoration: none !important; }
.nh-chip.is-on { background: var(--nh-text); color: var(--nh-bg) !important; border-color: var(--nh-text); }

/* ---------- карточка товара ---------- */
.nh-fit { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.nh-fit__code { font: 600 14px var(--nh-display); padding: 4px 10px; border-radius: 6px; background: var(--nh-text); color: var(--nh-bg); }
.nh-fit__eng { font-size: 13px; padding: 4px 10px; border-radius: 6px; background: var(--nh-surface2); color: var(--nh-text2); }
.nh-vin { margin: 16px 0; border-radius: 12px; background: var(--nh-accent-soft); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.nh-vin > b { font-size: 15px; } .nh-vin > span { font-size: 14px; color: var(--nh-text2); }
.nh-vin__form label { display: block; font-size: 12px; color: var(--nh-muted); margin: 6px 0 4px; }
.nh-vin__row { display: flex; gap: 8px; }
.nh-vin__row input { flex: 1; min-width: 0; height: 46px; padding: 0 12px; font-size: 15px; text-transform: uppercase; }
.nh-vin__form small { display: block; margin-top: 6px; font-size: 12px; color: var(--nh-muted); }
.nh-vin__form.is-error input { border-color: #C0392B; }

.nh-buybar { display: none; }
@media (max-width: 767px) {
  .nh-buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9989; display: flex; gap: 8px; align-items: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--nh-surface); border-top: 1px solid var(--nh-line); transform: translateY(110%); transition: transform .2s ease; }
  .nh-buybar.is-shown { transform: none; }
  .nh-buybar__chat { width: 52px; height: 52px; border-radius: 10px; border: 1px solid var(--nh-line2); display: flex; align-items: center; justify-content: center; color: var(--nh-text) !important; flex-shrink: 0; }
  .nh-buybar__buy { flex: 1; height: 52px; border-radius: 10px; background: var(--nh-accent); color: #FFFFFF !important; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px; text-decoration: none !important; }
  body.single-product { padding-bottom: 80px; }
}

/* ---------- адаптив главной ---------- */
@media (max-width: 1023px) {
  .nh-hero { grid-template-columns: 1fr; }
  .nh-hero__photo { min-height: 320px; order: -1; }
  .nh-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nh-about, .nh-ugc { grid-template-columns: 1fr; }
  .nh-install, .nh-posts { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .nh-home { padding-top: 0; }
  .nh-home > .nh-wrap { padding: 0; }
  .nh-hero { gap: 0; }
  .nh-hero__photo { border-radius: 0; min-height: 260px; }
  .nh-hero__bigcode { font-size: 96px; bottom: 16px; left: 20px; }
  .nh-hero__facts { display: none; }
  .nh-hero__card { border-radius: 24px 24px 0 0; margin-top: -24px; position: relative; padding: 24px 20px; }
  .nh-hero__code { font-size: 64px; }
  .nh-hero__title { margin-top: -38px !important; font-size: 34px !important; }
  .nh-hero__lead { font-size: 15px; }
  .nh-model { min-height: 64px; }
  .nh-btn--primary { width: 100%; }
  .nh-sec { padding: 32px 20px 0; }
  .nh-sec__head h2 { font-size: 24px !important; }
  .nh-cats { grid-template-columns: 1fr; gap: 0; background: var(--nh-surface); border-radius: 12px; overflow: hidden; }
  .nh-cat { flex-direction: row; align-items: center; min-height: 64px; border-radius: 0; border-bottom: 1px solid var(--nh-bg); padding: 12px 16px; }
  .nh-cat__img { width: 44px; height: 44px; }
  .nh-cat__txt { margin: 0; }
  .nh-about { margin: 32px 0 0; border-radius: 0; }
  .nh-about__txt { padding: 28px 20px; }
  .nh-about__num span { font-size: 76px; }
  .nh-about__photo { min-height: 200px; }
  .nh-ugc { padding: 28px 20px; margin-top: 32px; }
  .nh-ugc__txt h2 { font-size: 26px !important; }
  .nh-ugc__tile { height: 92px; }
  .nh-ugc .nh-btn { width: 100%; }
  .nh-posts { padding-bottom: 32px; }
}

@media (prefers-reduced-motion: reduce) { .nh-buybar { transition: none; } }
