/* Современный слой поверх style2.css: те же цвета, блоки и разметка, только чище */
:root {
  --brand: #043897;
  --brand-2: #3D7DCA;
  --accent: #ff942f;
  --text: #1d2433;
  --muted: #5b6475;
  --line: #e3e8f0;
  --soft: #f4f7fc;
  --bg: #fff;
  --surface: #fff;
  --link: #043897;
  --header-bg: rgba(255, 255, 255, .92);
  --banner: #eef4ff;
  --banner-line: #d6e3fb;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-hover: 0 2px 4px rgba(16, 24, 40, .06), 0 12px 32px rgba(4, 56, 151, .14);
}

body {
  font-family: Manrope, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .card-title {
  font-family: Unbounded, sans-serif;
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--text);
}

a { color: var(--link); transition: color .2s; }
a:hover { color: var(--brand-2); text-decoration: none; }

/* Шапка: прилипает к верху, полосы остаются под ней */
header {
  position: sticky;
  top: 0;
  z-index: 1020;
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg) !important;
  backdrop-filter: saturate(180%) blur(10px);
}
header .container { background: transparent !important; }

.decorative-stripe { height: 6px; }
.decorative-stripe2 { height: 4px; }
.decorative-stripe3 { height: 32px; background: var(--bg); }

/* Кнопки */
.custom-button {
  display: inline-block;
  width: auto;
  min-width: 180px;
  padding: .7rem 1.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: .9rem;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(4, 56, 151, .25);
  transition: background-color .2s, transform .2s, box-shadow .2s;
}
.custom-button:hover,
.custom-button:focus-visible {
  background: var(--brand-2);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(4, 56, 151, .3);
}

/* Карусель */
.carousel { border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.carousel-inner img { border-radius: 0; }

/* Голубой и белый баннеры */
.custom-banner,
.custom-banner-white {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: 20px;
  margin-bottom: 1.5rem;
}
.custom-banner {
  background: var(--banner);
  border: 1px solid var(--banner-line);
}
.custom-banner h2 { color: var(--link); }
.custom-banner-white {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.custom-banner h2,
.custom-banner-white h2 {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  margin-bottom: 1rem;
}
.custom-banner p:last-child,
.custom-banner-white p:last-child { margin-bottom: 0; }

/* Заголовок «Отрасли применения» и т.п. */
.container > h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 1.5rem 0 0; }

/* Карточки отраслей */
.card {
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: transparent;
  border-top-color: var(--brand);
  box-shadow: var(--shadow-hover);
}
.card-body { padding: 1.5rem; }
.card-title { font-size: 1.1rem; line-height: 1.35; }
.card-title b { font-weight: 600; }
.card-text { color: var(--muted); font-size: .92rem; }
/* в карточке «Подробнее» — ссылка со стрелкой, а не девятая синяя кнопка */
.card .custom-button,
.card .custom-button:hover { min-width: 0; padding: 0; background: none; box-shadow: none; transform: none; color: var(--link); font-family: Manrope, sans-serif; font-weight: 600; font-size: .9rem; }
.card .custom-button::after { content: " →"; display: inline-block; transition: transform .2s; }
.card:hover .custom-button::after { transform: translateX(4px); }

/* Таблица продуктов в отрасли */
.table-container > .table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface) !important;
}
.table th,
.table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background-color: var(--surface);
  color: var(--text);
}
.table thead th {
  background: var(--soft);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--soft); }

/* Страница продукта: картинка и описание */
.first-pane {
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.second-pane {
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.second-pane h2 {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--link);
  margin-bottom: .25rem;
}
.second-pane p { margin-bottom: 1.25rem; }
.second-pane br { display: none; }

/* контейнер вмещает плавающие плашки, чтобы баннеры шли ниже */
.container:has(> .pane) { display: flow-root; }

@media (max-width: 768px) {
  .first-pane,
  .second-pane { float: none; width: 100%; margin-right: 0; }
}

/* Плашка «Скачать каталог» */
.custom-badge {
  display: inline-block;
  width: auto;
  padding: .4rem 2rem;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(255, 148, 47, .35);
  transition: transform .2s, box-shadow .2s;
}
.custom-badge:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(255, 148, 47, .45); }
.custom-badge a { color: var(--link); font-weight: 600; }

/* Форма заказа */
.modal-content { border: 0; border-radius: 20px; box-shadow: 0 24px 64px rgba(16, 24, 40, .2); }
.modal-header { border-bottom: 1px solid var(--line); padding: 1.25rem 1.5rem; }
.modal-body { padding: 1.5rem; }
.form-control { border-radius: 10px; border-color: var(--line); padding: .6rem .85rem; }
.form-control:focus { border-color: var(--brand-2); box-shadow: 0 0 0 .2rem rgba(61, 125, 202, .2); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* Подвал */
.footer {
  margin-top: 0 !important;
  padding: 3rem 0 2rem;
  background: var(--soft);
  font-size: .92rem;
}
.footer h5 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 1rem;
}
.footer li { margin-bottom: .35rem; }
.footer a { color: var(--text); }
.footer a:hover { color: var(--link); }

/* Переключатель темы */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  transition: background-color .2s, border-color .2s;
}
.theme-toggle:hover { border-color: var(--brand-2); }
.theme-toggle .icon-sun,
[data-bs-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-bs-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* Тёмная тема: те же блоки, тёмные поверхности, фирменный синий светлее для контраста */
[data-bs-theme="dark"] {
  --text: #e6eaf2;
  --muted: #9aa4b8;
  --line: #263047;
  --soft: #151c2c;
  --bg: #0d1320;
  --surface: #121a2b;
  --link: #8db6ff;
  --header-bg: rgba(13, 19, 32, .9);
  --banner: #13213d;
  --banner-line: #22385f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .4), 0 12px 32px rgba(61, 125, 202, .25);
  --bs-body-bg: #0d1320;
  --bs-body-color: #e6eaf2;
}
[data-bs-theme="dark"] header img { filter: brightness(0) invert(1); }
[data-bs-theme="dark"] .custom-button:hover { background: #2f6fd0; }
[data-bs-theme="dark"] .card { background: var(--surface); }
[data-bs-theme="dark"] .modal-content { background: var(--surface); }
[data-bs-theme="dark"] .form-control { background: var(--bg); color: var(--text); }

/* Шаблоны задают Montserrat прямо в style="" — переводим текст на Manrope */
[style*="Montserrat"] { font-family: Manrope, sans-serif !important; }
:is(h1, h2, h3, h4, h5)[style*="Montserrat"] { font-family: Unbounded, sans-serif !important; font-weight: 500 !important; }
/* заголовки из базы обёрнуты в <b>: без этого браузер рисует Unbounded искусственно жирным */
:is(h1, h2, h3, h4, h5) :is(b, strong) { font-weight: inherit; }

/* Оранжевый — только главное действие «Заказать»; каталог — вторичная кнопка с обводкой */
header .custom-button { background: var(--accent); color: #3a1d00; box-shadow: 0 4px 14px rgba(255, 148, 47, .35); }
header .custom-button:hover, header .custom-button:focus-visible { background: #ff8410; color: #3a1d00; box-shadow: 0 8px 20px rgba(255, 148, 47, .45); }
.custom-badge { background: transparent; border: 1px solid var(--link); box-shadow: none; }
.custom-badge:hover { background: var(--soft); box-shadow: none; }
.custom-badge p { color: inherit !important; }

/* Unbounded широкий: длинные названия продуктов не должны вылезать за экран телефона */
h1 { font-size: clamp(1.4rem, 5vw, 2.5rem); overflow-wrap: anywhere; }

/* Страница продукта: хлебные крошки */
.crumbs { margin: 1rem 0 .5rem; font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--link); }
.crumbs span[aria-hidden] { margin: 0 .35rem; }

/* Кнопка заказа образца и ссылка на паспорт */
.product-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin-top: 1.25rem; }
.product-actions .custom-button { background: var(--accent); color: #3a1d00; box-shadow: 0 4px 14px rgba(255, 148, 47, .35); }
.product-actions .custom-button:hover { background: #ff8410; color: #3a1d00; }
.passport-link { font-weight: 600; }
.passport-link::before { content: "↓ "; }

/* Характеристики: название … значение */
.spec { margin: 0; }
.spec > div { display: flex; align-items: baseline; gap: .5rem; padding: .3rem 0; }
.spec > div::after { content: none; }
.spec dt { order: 1; font-weight: 400; }
.spec dd { order: 3; margin: 0; font-weight: 600; color: var(--link); white-space: nowrap; }
.spec > div::before { content: ""; order: 2; flex: 1; min-width: 1.5rem; border-bottom: 1px dotted var(--muted); opacity: .6; }
.spec-note { margin: .75rem 0 0; font-size: .85rem; color: var(--muted); }

/* Картинка и описание продукта — одна карточка одной высоты */
.product-hero {
  display: flex;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.product-hero .pane { float: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.product-hero .first-pane { flex: 0 0 32%; width: auto; }
.product-hero .first-pane img { width: 100%; height: 100%; min-height: 260px; object-fit: cover; }
.product-hero .second-pane { flex: 1; width: auto; align-self: center; }

@media (max-width: 768px) {
  .product-hero { flex-direction: column; }
  .product-hero .first-pane img { height: auto; min-height: 0; aspect-ratio: 1; }
}
