/* ======== THEME (светлая) ======== */
:root {
  --primary: #FFE9BF;           /* бежевый фон кнопок/элементов */
  --secondary: #000000;         /* чёрный текст/бордюр */
  --secondary-70: rgba(0,0,0,0.7);
  --secondary-40: rgba(0,0,0,0.4);
  --text: #000;
  --bg-light: #f8f8f8;
}

/* ========== BASE ========== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
img { max-width: 100%; }

.root {
  margin: 0;
  min-width: 320px;
  font-family: Montserrat, sans-serif;
  color: var(--text);
}

.root__container {
  margin: 0 auto;
  padding: 0 15px;
  max-width: 1110px;
}

/* ========== HEADER ========== */
.header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100vh;
  background-position: center;
  background-size: cover;
  color: #fff;
  text-align: center;
  overflow: hidden;
}

.header__title {
  margin: 0 0 25px;
  font-weight: 700;
  font-size: 56px;
  line-height: 130%;
  text-align: center;
  color: #fff;
}

.header__subtitle {
  margin: 0;
  font-weight: 700;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  color: #fff;
}

.header__arrow {
  position: absolute;
  left: 50%;
  bottom: 30px;
  display: block;
  width: 48px;
  height: 48px;
  transform: translate(-50%, 0);
}

/* ========== PORTFOLIO ========== */
.portfolio { padding: 80px 0 115px; }

.portfolio__title {
  margin: 0 0 70px;
  font-weight: 700;
  font-size: 46px;
  line-height: 130%;
  text-align: center;
  color: var(--text);
}

/* ========== CARDS ========== */
.card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.card__link {
  display: block;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: color 0.2s ease-in;
}
.card__link:hover { color: var(--secondary); }

.card__item {
  margin-bottom: 30px;
  width: 100%;
  max-width: 530px;
  box-shadow: 0 10px 40px rgb(126 155 189 / 35%);
  background-color: #fff;
  transition: transform 0.2s ease-in;
}
.card__item:hover { transform: translateY(-15px); }

.card__item:last-child,
.card__item:nth-last-child(2) { margin-bottom: 0; }

.card__image { margin-bottom: 20px; }

.card__image--mini {
  width: 200px;
  height: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto 15px;
}

.card__title { margin: 0 0 13px; font-weight: 600; font-size: 24px; line-height: 130%; }
.card__subtitle { margin: 0; font-size: 16px; line-height: 130%; }

/* ========== FOOTER (светлая) ========== */
.footer { padding: 45px 0 130px; background: var(--primary); }
.footer__row { display: flex; justify-content: space-between; list-style-type: none; margin: 0; padding: 0; color: var(--secondary); }
.footer__copyright { flex-grow: 1; max-width: 350px; line-height: 1.3; color: var(--secondary); }
.footer__copyright-name { margin: 0 0 15px; font-weight: 700; font-size: 28px; }
.footer__copyright-description { margin: 0 0 15px; font-weight: 600; font-size: 16px; }
.footer__icons { flex-grow: 1; max-width: 350px; }
.footer__icons-title { font-weight: 600; font-size: 16px; line-height: 1.3; }
.footer__icon-list { display: flex; align-items: center; }
.footer__icon-list > * + * { margin-left: 35px; }
.footer__contacts { flex-grow: 1; max-width: 350px; }
.footer__contacts-description { margin: 15px 0; font-size: 15px; line-height: 1.3; color: var(--secondary); }

/* ========== PROJECT / PAGES ========== */
.project { padding: 80px 0 120px; text-align: center; }
.project__header { margin: 0 0 40px; font-weight: 700; font-size: 46px; line-height: 1.3; }
.project__img { margin-bottom: 70px; box-shadow: 0 10px 40px rgb(126 155 189 / 35%); }
.project__content { display: block; border-radius: 10px; }

.projects__description { margin: 0 auto 60px; max-width: 730px; text-align: center; }
.projects__description p { margin: 0 0 15px; font-size: 16px; line-height: 1.5; }

.project__link { display: inline-block; line-height: 1; text-decoration: none; color: #2f73b6; }
.project__link::after { content: ""; display: block; width: 0%; height: 2px; background-color: #225384; transition: width 0.4s ease-in-out; }
.project__link:hover::after, .project__link:focus::after { width: 100%; }

/* логотип и изображения */
.logo { width: 300px; height: auto; display: block; margin: 0 auto; }
.monitor-img {
  display: block; margin: 0 auto; max-width: 600px; width: 100%; height: auto;
  border: none; box-shadow: none; object-fit: contain; border-radius: 0;
}
.project__img .monitor-img { box-shadow: none !important; border-radius: 0 !important; }

/* ==============================
   КНОПКИ — ЕДИНЫЙ ВИД (СВЕТЛАЯ)
============================== */
.project__btn-manual,
.top-menu__link,
.file__btn-download,
.file__btn-back,
.project__btn-back,
.footer__contacts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--secondary);
  border-radius: 40px;
  padding: 0 20px;
  min-height: 40px;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--secondary);           /* чёрный текст */
  background-color: var(--primary);  /* бежевый фон */
  transition: all 0.3s ease-in-out;
}
.project__btn-manual:hover,
.top-menu__link:hover,
.file__btn-download:hover,
.file__btn-back:hover,
.project__btn-back:hover,
.footer__contacts-btn:hover {
  background-color: var(--secondary); /* чёрный фон */
  color: var(--primary);              /* бежевый текст */
}

/* Локальные вариации без изменения размеров */
.file__btn-download,
.file__btn-back {
  border-radius: 10px;
  text-transform: none;
}

/* ======= TOP MENU (полоса) ======= */
.top-menu {
  position: fixed; top: 0; left: 0; width: 100%;
  background-color: var(--secondary-40);
  z-index: 999; padding: 10px 20px; box-shadow: none;
}
.menu-container { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.top-menu__list { display: flex; gap: 15px; list-style: none; margin: 0; padding: 0; }

/* ======= LANGUAGE SELECTOR ======= */
.language-selector select {
  padding: 5px 10px; border-radius: 5px; border: 1px solid #ccc; background-color: rgba(255,255,255,0.8);
}
.language-switcher { position: relative; display: inline-block; }
#languageSelect {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: 40px;
  padding: 0 40px 0 16px;   /* место под стрелку справа */
  min-height: 40px;
  line-height: 20px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  border-width: 2px;
  border-style: solid;
  position: relative;
}
/* СВЕТЛАЯ ТЕМА — как у остальных кнопок */
body:not(.dark-theme) #languageSelect {
  background-color: var(--primary);
  color: var(--secondary);
  border-color: var(--secondary);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12"><polygon points="0,0 12,0 6,6" fill="%23000000"/></svg>');
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
}
body:not(.dark-theme) #languageSelect:hover {
  background-color: var(--secondary);
  color: var(--primary);
  border-color: var(--secondary);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12"><polygon points="0,0 12,0 6,6" fill="%23FFE9BF"/></svg>');
}

/* ТЁМНАЯ ТЕМА — под твою палитру (фон тёмный, текст бежевый) */
body.dark-theme #languageSelect {
  background-color: var(--primary) !important;
  color: var(--secondary) !important;
  border-color: var(--secondary) !important;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12"><polygon points="0,0 12,0 6,6" fill="%23FFE9BF"/></svg>');
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
}
body.dark-theme #languageSelect:hover {
  background-color: var(--secondary) !important; /* беж */
  color: #000 !important;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12"><polygon points="0,0 12,0 6,6" fill="%23000000"/></svg>');
}

#languageSelect:hover { background-color: var(--primary); color: var(--secondary); border-color: var(--secondary); }
#languageSelect:focus { outline: none; box-shadow: 0 0 5px var(--primary); }

/* ======= TEAM / WHY-US / REVIEWS ======= */
.team__card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 20px; border-radius: 15px; box-shadow: 0 5px 20px rgba(0,0,0,0.1); transition: transform 0.3s;
}
.team__photo {
  width: 150px; height: 150px; object-fit: cover; border-radius: 50%; margin-bottom: 15px; border: 3px solid var(--primary);
}
.team__name, .team__role, .team__phrase { margin: 5px 0; }
.why-us {
  padding: 20px 0; background-color: var(--bg-light);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.why-us__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; align-items: center; }
.why-us__item { position: relative; margin-bottom: 40px; }
.why-us__number {
  width: 50px; height: 50px; background-color: var(--secondary); color: var(--primary);
  font-weight: 700; font-size: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 15px;
}
.why-us__text { font-size: 16px; color: var(--text); line-height: 1.5; max-width: 400px; margin: 0 auto; }
.why-us__arrow { font-size: 30px; color: var(--secondary); margin: 20px 0; }

.review__card { text-align: center; padding: 15px; border: 1px solid #e0e0e0; border-radius: 10px; }
.card__title { margin-bottom: 10px; }

/* ======= FILES LIST ======= */
.files__list {
  display: flex; flex-direction: column; gap: 40px; max-width: 800px; margin: 0 auto; padding: 0; list-style: none;
}
.file__card {
  padding: 20px; border-radius: 15px; box-shadow: 0 5px 20px rgba(0,0,0,0.1); text-align: center; transition: transform 0.3s;
}
.file__card:hover { transform: translateY(-5px); }
.file__title { font-size: 20px; font-weight: 700; margin-bottom: 15px; color: var(--secondary); }
.file__sizes { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.file__size-btn {
  background-color: #f0f0f0; padding: 5px 10px; border-radius: 8px; font-size: 14px; text-decoration: none; color: var(--text); transition: background-color 0.3s;
}
.file__size-btn:hover { background-color: #e0e0e0; }

/* ======= BACK BUTTON (в проектах) ======= */
.project__btn-back {
  border-radius: 40px;        /* как у manual */
  text-transform: uppercase;  /* как у manual */
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  min-height: 40px;
  padding: 0 20px;
}

/* ======= SPECS BOX ======= */
.project__specs {
  margin-top: 30px; padding: 20px; background: var(--bg-light); border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.specs__title { font-size: 1.5rem; margin-bottom: 15px; font-weight: 700; }
.specs__list { list-style: none; padding: 0; margin: 0; }
.specs__list li { padding: 5px 0; border-bottom: 1px solid rgba(0,0,0,0.1); }

/* ======= RESPONSIVE ======= */
@media (max-width: 768px) {
  .why-us__text { max-width: 90%; }
  .why-us__number { width: 40px; height: 40px; font-size: 20px; }
  .why-us__arrow { font-size: 24px; }
}

/* ==============================
   ТЁМНАЯ ТЕМА (под палитру #FFE9BF / #000000)
============================== */
body.dark-theme {
  --primary: rgba(0,0,0,0.7);   /* беж */
  --secondary: #FFE9BF; /* чёрный */
  --text: #f5f5f5;
  --bg-light: #1e1e1e;
  --secondary-70: rgba(0,0,0,0.7);
  --secondary-40: rgba(0,0,0,0.6);

  background-color: #121212 !important;
  color: var(--text) !important;
}



/* Ссылки (в тёмной — бежевые) */
body.dark-theme a { color: var(--secondary) !important; text-decoration: none; }
body.dark-theme a:hover { color: #ffffff !important; }

/* Топ-меню (полоса/фон) */
body.dark-theme .top-menu { background-color: var(--secondary-40) !important; box-shadow: none !important; }

/* Кнопки меню — тот же размер; фон тёмный, текст бежевый */
body.dark-theme .top-menu__link {
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--secondary) !important;     /* беж бордер */
  border-radius: 40px !important;
  padding: 0 20px !important;
  min-height: 40px !important;
  font-weight: 600 !important; font-size: 14px !important; line-height: 20px !important;
  text-transform: uppercase;
  color: var(--secondary) !important;                 /* беж текст */
  background-color: var(--primary) !important;        /* тёмная заливка */
  transition: all 0.3s ease-in-out;
}
body.dark-theme .top-menu__link:hover {
  background-color: var(--secondary) !important;      /* беж заливка */
  color: #000 !important;                             /* чёрный текст */
}

/* Хэдер */
body.dark-theme .header,
body.dark-theme .header p,
body.dark-theme .header__title,
body.dark-theme .header__subtitle { background-color: transparent !important; color: #f5f5f5 !important; }

/* Карточки/блоки */
body.dark-theme .card,
body.dark-theme .card__item,
body.dark-theme .project__card,
body.dark-theme .team__card,
body.dark-theme .contacts__card,
body.dark-theme .review__card,
body.dark-theme .file__card,
body.dark-theme .project__specs {
  background-color: #1e1e1e !important;
  color: var(--text) !important;
  box-shadow: 0 5px 20px rgba(0,0,0,0.5) !important;
  border-color: rgba(255,255,255,0.06) !important;
}

/* Заголовки */
body.dark-theme .card__title,
body.dark-theme .card__subtitle,
body.dark-theme .team__name,
body.dark-theme .team__role,
body.dark-theme .team__phrase,
body.dark-theme .contacts__title,
body.dark-theme .contacts__subtitle,
body.dark-theme .file__title,
body.dark-theme .project__header,
body.dark-theme .project__subtitle,
body.dark-theme .portfolio__title { color: var(--text) !important; }

/* Кнопки в тёмной теме — такой же размер: фон тёмный, текст бежевый */
body.dark-theme .project__btn-manual,
body.dark-theme .file__btn-download,
body.dark-theme .file__btn-back,
body.dark-theme .project__btn-back,
body.dark-theme .footer__contacts-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--secondary) !important;      /* беж бордер */
  border-radius: 40px !important;
  padding: 0 20px !important;
  min-height: 40px !important;
  font-weight: 600 !important; font-size: 14px !important; line-height: 20px !important;
  text-decoration: none; text-transform: uppercase;
  color: var(--secondary) !important;                 /* беж текст */
  background-color: var(--primary) !important;        /* тёмная заливка */
  transition: all 0.3s ease-in-out;
}
body.dark-theme .project__btn-manual:hover,
body.dark-theme .file__btn-download:hover,
body.dark-theme .file__btn-back:hover,
body.dark-theme .project__btn-back:hover,
body.dark-theme .footer__contacts-btn:hover {
  background-color: var(--secondary) !important;      /* беж заливка */
  color: #000 !important;                             /* чёрный текст */
}

/* Футер — чёрный */
body.dark-theme .footer { background-color: #000000 !important; color: var(--text) !important; }
/* обычные ссылки в футере — бежевые (кнопку не трогаем) */
body.dark-theme .footer a:not(.footer__contacts-btn) { color: var(--secondary) !important; }
/* текстовые блоки в футере — светлые */
body.dark-theme .footer__row,
body.dark-theme .footer__copyright,
body.dark-theme .footer__contacts-description { color: var(--text) !important; }

/* Иконки/картинки в тёмной */
body.dark-theme .footer__icon-list img,
body.dark-theme .team__photo,
body.dark-theme .card__image,
body.dark-theme .project__img img { filter: brightness(0.9) !important; }

/* ======= Theme Toggle (переключатель темы) ======= */
/* Светлая */
.theme-toggle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #000;
  border-radius: 40px;
  padding: 6px 14px;
  min-height: 34px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  background-color: #FFE9BF;
  color: #000;
  transition: all 0.3s ease-in-out;
}
.theme-toggle-btn:hover { background-color: #000; color: #FFE9BF; }

/* Тёмная — под новую палитру (тёмная заливка + беж текст) */
body.dark-theme .theme-toggle-btn {
  border-color: var(--secondary);
  background-color: var(--primary);
  color: var(--secondary);
}
body.dark-theme .theme-toggle-btn:hover {
  background-color: var(--secondary);
  color: #000;
}

/* ====== Главная: новые секции ====== */
.section-title{ margin:0 0 24px; text-align:center; font-size:36px; font-weight:800; color:var(--secondary); }

/* Преимущества */
.benefits{ padding:40px 0; background: var(--bg-light); }
.benefits__list{ margin:0; padding:0; list-style:none; display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.benefits__item{ background:#fff; border-radius:16px; padding:20px; text-align:center; box-shadow:0 6px 20px rgba(0,0,0,.08); }
.benefits__icon{ font-size:28px; margin-bottom:8px; }
.benefits__item h3{ margin:6px 0 8px; font-size:18px; color:var(--secondary); }
.benefits__item p{ margin:0; color:var(--text); }
@media (max-width: 900px){ .benefits__list{grid-template-columns:1fr;} }

/* Популярные модели */
.featured{ padding:40px 0 20px; }
.featured__grid{ list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.featured__card{ background:#fff; border-radius:16px; padding:18px; text-align:center; box-shadow:0 8px 24px rgba(0,0,0,.08); }
.featured__card h3{ margin:10px 0 6px; font-size:20px; }
.featured__card p{ margin:0 0 12px; color:var(--text); }
.featured__actions{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
@media (max-width: 900px){ .featured__grid{ grid-template-columns:1fr; } }

/* Гайд */
.guide-teaser{ padding:40px 0; background:var(--bg-light); }
.guide-teaser__inner{ display:flex; align-items:center; justify-content:center; text-align:center; }
.guide-teaser p{ max-width:760px; margin:0 auto 16px; }

/* Отзывы */
.reviews{ padding:40px 0; }
.reviews__list{ list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(2,1fr); gap:20px; }
.reviews__item{ background:#fff; border-radius:16px; padding:20px; box-shadow:0 8px 24px rgba(0,0,0,.08); }
.reviews blockquote{ margin:0 0 10px; font-size:16px; line-height:1.6; }
.reviews__author{ color:var(--secondary); font-weight:600; }
@media (max-width: 900px){ .reviews__list{ grid-template-columns:1fr; } }

/* CTA */
.cta{ padding:48px 0; }
.cta__inner{ text-align:center; background:var(--primary); color:var(--secondary); border-radius:20px; padding:28px; }
.cta__inner h2{ margin:0 0 8px; font-size:28px; }
.cta__inner p{ margin:0 0 14px; }
/* =========================
   НОВЫЕ СЕКЦИИ — ТЁМНАЯ ТЕМА
   ========================= */

/* Фоны секций на тёмной */
body.dark-theme .benefits,
body.dark-theme .featured,
body.dark-theme .reviews,
body.dark-theme .guide-teaser,
body.dark-theme .cta {
  background: transparent !important;
}

/* Карточки секций */
body.dark-theme .benefits__item,
body.dark-theme .featured__card,
body.dark-theme .reviews__item,
body.dark-theme .guide-teaser__inner,
body.dark-theme .cta__inner {
  background: #1e1e1e !important;
  color: var(--text) !important;                    /* БЕЛЫЙ текст */
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 6px 20px rgba(0,0,0,.45) !important;
}

/* Заголовки — бежевым акцентом */
body.dark-theme .section-title

/* Обычные тексты внутри карточек — белым */
body.dark-theme .benefits__item p,
body.dark-theme .featured__card p,
body.dark-theme .reviews__item blockquote,
body.dark-theme .guide-teaser__inner p,
body.dark-theme .cta__inner p {
  color: var(--text) !important;                    /* #f5f5f5 */
}

/* Ничего не трогаем для кнопок — они уже под тёмную тему оформлены в твоих общих стилях */
/* карточки в каталоге */
.card__item {
  margin: 15px;
  padding: 20px;
  border-radius: 12px;
  background: #fff;
  /* тонкая рамка в светлой теме */
  border: 1px solid rgba(0,0,0,0.08);
  /* мягкая тень (можно твою) */
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  flex: 1 1 calc(33.333% - 30px);
  box-sizing: border-box;
  transition: transform .2s ease-in;
}

/* чтобы элементы красиво переносились */
.card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.catalog__toolbar {
  display: flex;
  gap: 18px;   /* например, сделать 18–20px */
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}


.catalog__filter.is-active {
  outline: 2px solid var(--secondary);
}

.catalog__search {
  flex: 1 1 260px;
  min-height: 40px;
  padding: 0 14px;
  border: 2px solid var(--secondary);
  border-radius: 40px;
  background: var(--primary);
  color: var(--secondary);
  font-weight: 600;
}
/* ====== КАТАЛОГ — тёмная тема ====== */
body.dark-theme .card__item {
  background: #1e1e1e !important;
  color: var(--text) !important;   /* белый текст */
  border: 1px solid rgba(255,255,255,0.08);
}
body.dark-theme .card__title,
body.dark-theme .card__subtitle {
  color: var(--text) !important;
}

/* ====== СТРАНИЦА ПРОДУКТА — тёмная тема ====== */
body.dark-theme #prodShort {
  color: var(--text) !important;
}
body.dark-theme #specList li {
  color: var(--text) !important;
  border-color: rgba(255,255,255,0.1) !important;
}
body.dark-theme .specs__title,
body.dark-theme #prodTitle {
  color: var(--secondary) !important; /* бежевым акцентом */
}
/* --- Fix: не растягивать изображения карточек на главной --- */

.certificate {
  padding: 40px 0;
  text-align: center;
}
.certificate__box {
  display: flex;
  justify-content: center;
}
.certificate__box img {
  max-width: 400px;
  width: 100%;
  height: auto;
  border: 3px solid var(--secondary);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
/* --- Fix: не растягивать изображения карточек на главной --- */
#featuredList img {
  display: block;
  width: 100%;
  height: 240px;          /* единая высота сетки */
  object-fit: contain;    /* не искажать, вписывать целиком */
  background: #fff;       /* подложка вокруг изображения */
  border-radius: 16px;    /* по желанию, под стиль сайта */
}
@media (max-width: 768px) {
  .header__title {
    font-size: 32px;
  }
  .header__subtitle {
    font-size: 14px;
    letter-spacing: 0.1em;
  }

  .featured__grid {
    grid-template-columns: 1fr; /* карточки в один столбец */
  }

  .card__item {
    flex: 1 1 100%;
    max-width: 100%;
  }

  #featuredList img {
    height: 180px; /* поменьше для телефонов */
  }
}
.top-menu__list {
  display: flex;
  flex-wrap: wrap;   /* кнопки переносятся */
  gap: 8px;          /* расстояние между ними */
  justify-content: center;
}
@media (max-width: 768px) {
  .top-menu__list {
    flex-direction: column;   /* на телефоне в колонку */
    align-items: center;
  }
}

/* === ПАНЕЛЬ КАТАЛОГА: Категории | Поиск (сверху) + Диагонали (снизу) === */
.catalog__toolbar{
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;   /* слева гибкие категории, справа фикс-узаемый поиск */
  grid-template-areas:
    "filters search"
    "diags   diags";
  align-items: center;
  gap: 12px 16px;
}

/* — Категории: одна строка со горизонтальным скроллом, кнопки не съедаются — */
#filters{
  grid-area: filters;
  display: flex;
  flex-wrap: nowrap;         /* без переноса */
  gap: 2px;
  overflow-x: auto;          /* если не влезли — прокрутка */
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  padding-right: 12px;       /* небольшой зазор справа, рядом с полем поиска */
  scrollbar-width: none;     /* Firefox: скрыть полоску */
  -ms-overflow-style: none;
}
#filters::-webkit-scrollbar{ display: none; }
#filters .catalog__filter{
  flex: 0 0 auto;
  white-space: nowrap;
}

/* — Поиск: уменьшенный, не растягивается слишком широко — */
.catalog__search{
  grid-area: search;
  width: clamp(240px, 26vw, 420px);  /* min 240, обычно ~26vw, max 420 */
  max-width: 420px;
  justify-self: end;                 /* прижать к правому краю */
  min-height: 44px;
}

/* — Диагонали: всегда второй ряд, место зарезервировано — */
#diagFilters{
  grid-area: diags;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  min-height: 48px;                  /* чтобы верхний ряд не прыгал */
}
#diagFilters.is-hidden{
  visibility: hidden;                /* место остаётся, кликов нет */
  pointer-events: none;
}
#diagFilters .diag__filter{
  flex: 0 0 auto;
  white-space: nowrap;
}

/* страховка от переполнений внутри grid */
.catalog__toolbar > * { min-width: 0; }

/* — Мобилки: складываем столбиком — */
@media (max-width: 900px){
  .catalog__toolbar{
    grid-template-columns: 1fr;
    grid-template-areas:
      "filters"
      "search"
      "diags";
  }
  #filters{
    flex-wrap: wrap;     /* на узких — переносим, скролл не нужен */
    overflow: visible;
    padding-right: 0;
  }
  .catalog__search{
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }
}
/* ====== МОБИЛЬНЫЙ ВИД ====== */
@media (max-width: 900px){

  /* Шапка: превращаем меню в горизонтальную ленту со скроллом */
  nav.top-menu{
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;          /* без переноса */
    overflow-x: auto;           /* прокрутка по горизонтали */
    -webkit-overflow-scrolling: touch;
    padding: 8px 12px;
    background: var(--bg, #f6e5c4);  /* тот же тон, что и кнопки */
    position: sticky;            /* фиксируем у верхнего края */
    top: 0;
    z-index: 1000;
    border-radius: 0 0 12px 12px; /* опционально — скругление снизу */
  }
  nav.top-menu > *{
    flex: 0 0 auto;             /* элементы не сжимаются, едут в ленту */
    white-space: nowrap;
  }
  nav.top-menu::-webkit-scrollbar{ display:none; } /* прячем полоску */

  /* Панель каталога: вертикальная колонка */
  .catalog__toolbar{
    grid-template-columns: 1fr;
    grid-template-areas:
      "filters"
      "search"
      "diags";
    gap: 10px;
  }
  #filters{
    flex-wrap: wrap;            /* можно переносить */
    overflow: visible;          /* скролл не нужен в мобильном виде */
    padding-right: 0;
  }
  .catalog__search{
    width: 100%;
    max-width: none;
    justify-self: stretch;
    min-height: 42px;
  }

  /* Сетка карточек каталога: по 1 в ряд */
  #catalogList,
  .card__list{
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .card__item .card__image{
    height: auto;
    max-height: 48vw;           /* чтобы картинка не вылазила по высоте */
    object-fit: contain;
  }

  /* Лёгкий отступ у главного контейнера, чтобы не липло к краям */
  .root__container, .container, main{
    padding-left: 12px;
    padding-right: 12px;
  }
}
