/* =====================================================================
   СТИЛИ САЙТА «АТА ЭНЕРГО»  (css/style.css)
   Содержание:
     1. Цвета, переменные и защита от копирования
     2. Основа и типографика (читаемые шрифты)
     3. Кнопки и общие элементы
     4. Шапка, язык (RU/KG), тема и эффект тока-змеи на логотипе
     5. Главный экран и автослайдер (надежный цикл)
     6. Схема распределения энергии
     7. Продукция и решения (реальные качественные фото)
     8. О компании
     8б. Специалисты (фото команды с надписью ПОД фото)
     8в. Как мы работаем (современные карточки)
     9. Баннер CTA
    10. Калькулятор мощности потребления и форма заявки (+996)
    11. Карта и контакты
    12. Подвал с вертикальным разделителем и соцсетями
    13. Модальное окно «Добавить свой прибор»
    14. Анимации появления
    15. Адаптив под мобильные устройства и планшеты
   ===================================================================== */


/* ===== 1. ЦВЕТА И ПЕРЕМЕННЫЕ ===== */
:root {
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --accent: #F59E0B;        /* солнечный янтарный */
  --accent-glow: #FBBF24;
  --electric: #0284C7;      /* электрический синий */
  --green: #10B981;         /* зеленый индикатор */
  --radius: 16px;           /* скругление карточек */
  --maxw: 1240px;           /* максимальная ширина */
}

/* ЗАПРЕТ ВЫДЕЛЕНИЯ И КОПИРОВАНИЯ КОНТЕНТА */
*, *::before, *::after {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}
/* Поля формы доступны для ввода текста */
input, textarea, select {
  -webkit-user-select: auto !important;
  -moz-user-select: auto !important;
  -ms-user-select: auto !important;
  user-select: auto !important;
}

/* СВЕТЛАЯ ТЕМА */
[data-theme="light"] {
  --bg: #F3F7FC;
  --bg2: #E3EEFA;
  --bg3: #FFF4DF;
  --card: #FFFFFF;
  --ink: #0D2036;
  --mut: #4B5E78;
  --line: #C7D9ED;
  --btn: #1D5FB8;
  --btn-ink: #FFFFFF;
  --hl: #1D5FB8;
  --hero1: #DCEBFC;
  --hero2: #FFF4DF;
  --header: rgba(255, 255, 255, 0.94);
  --foot-bg: #0E223D;
  --foot-ink: #FFFFFF;
  --foot-mut: #A3BAD8;
  --cta1: #1D5FB8;
  --cta2: #0E3B75;
  --card-shadow: 0 10px 30px rgba(13, 32, 54, 0.06);
}

/* ТЁМНАЯ ТЕМА (МЯГКИЙ ГЛУБОКИЙ СИНИЙ ПОДВАЛ, НЕ СЛИШКОМ ТЁМНЫЙ) */
[data-theme="dark"] {
  --bg: #0B1322;
  --bg2: #101C32;
  --bg3: #14213D;
  --card: #131F36;
  --ink: #EDF2F8;
  --mut: #9FB0C7;
  --line: #223450;
  --btn: #F59E0B;
  --btn-ink: #140D00;
  --hl: #F59E0B;
  --hero1: #0F1C36;
  --hero2: #0B1322;
  --header: rgba(11, 19, 34, 0.94);
  --foot-bg: #111C2E;
  --foot-ink: #EDF2F8;
  --foot-mut: #96A8C2;
  --cta1: #15325E;
  --cta2: #0C1E3C;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}


/* ===== 2. ОСНОВА И ТИПОГРАФИКА ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.62;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.wrap { width: min(var(--maxw), 100% - 44px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ic { width: 20px; height: 20px; flex: none; }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.02em; line-height: 1.18; }
h2 { font-size: clamp(1.85rem, 3.8vw, 2.75rem); }
h3 { font-size: 1.28rem; letter-spacing: -.01em; }

.eyebrow {
  display: inline-block;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.sub {
  color: var(--mut);
  max-width: 64ch;
  margin-top: 14px;
  font-size: 1.12rem;
  line-height: 1.55;
}
.sec { padding: clamp(68px, 9vw, 120px) 0; }
.alt { background: var(--bg2); }
.warm { background: var(--bg3); }
.sec-head { margin-bottom: clamp(34px, 5vw, 56px); }


/* ===== 3. КНОПКИ И ОБЩИЕ ЭЛЕМЕНТЫ ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1.5px solid var(--btn);
  background: var(--btn);
  color: var(--btn-ink);
  font-weight: 600;
  font-size: 1.02rem;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .2s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
}
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--ink);
  background: var(--bg2);
  box-shadow: none;
}
.btn-sm {
  padding: 10px 20px;
  font-size: 0.95rem;
}
.btn-light {
  background: #FFFFFF;
  color: #0C2545;
  border-color: #FFFFFF;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 16px 36px;
}
.btn-light:hover {
  background: #FFF8E7;
  border-color: #FFF8E7;
  color: #0C2545;
}
.more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--btn);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  transition: color .2s, border-color .2s;
}
.more:hover { color: var(--accent); }


/* ===== 4. ШАПКА, ЛОГОТИП С ТОКОМ-ЗМЕЙКОЙ, ЯЗЫК И ТЕМА ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background .3s;
}
.header-in {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 76px;
}

/* ЛОГОТИП И ЭФФЕКТ ТОКА-ЗМЕЙКИ (РАБОТАЕТ НА ВСЕХ ПК И ТЕЛЕФОНАХ) */
.logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.28rem;
  letter-spacing: -.02em;
  padding: 6px 12px;
  border-radius: 12px;
  transition: transform .2s ease;
  flex-shrink: 0;
  animation: logoSparkGlow 15s ease infinite;
}
.logo-svg {
  width: 40px;
  height: 40px;
  flex: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.logo-text b { color: var(--hl); font-weight: 800; }

/* Логотип-картинка (замена старого значка и текста) */
.logo-img {
  display: block;
  height: 54px;
  width: auto;
  flex: none;
  transition: transform .25s ease, filter .25s ease;
}
/* Новый значок рядом с надписью (внутри .logo, поэтому анимация змейки обходит оба элемента) */
.logo-app {
  display: block;
  height: 46px;
  width: 46px;
  flex: none;
  border-radius: 12px;
  transition: transform .25s ease;
}
.logo:hover .logo-app { transform: scale(1.04); }
[data-theme="dark"] .logo-app { box-shadow: 0 0 0 1.5px rgba(255,255,255,.28); }   /* тонкая светлая обводка, чтобы значок не сливался с тёмным фоном */
.logo-img.on-dark { display: none; }                      /* белая версия — только в тёмной теме */
[data-theme="dark"] .logo-img.on-light { display: none; }
[data-theme="dark"] .logo-img.on-dark { display: block; }
.logo:hover .logo-img { transform: scale(1.04); }
.foot-logo .logo-img { height: 58px; }
.foot-logo:hover .logo-img { filter: drop-shadow(0 0 10px rgba(245, 158, 11, .45)); }

/* Контейнер бегущего электрического тока */
.logo-electric-box {
  position: absolute;
  inset: -2px;
  pointer-events: none;
  border-radius: 14px;
  overflow: visible;
  z-index: 2;
}
.snake-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}
.snake-rect {
  fill: none;
  stroke: url(#electricSnakeGrad);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 75 420;
  filter: drop-shadow(0 0 6px #00f0ff) drop-shadow(0 0 12px #f59e0b);
  animation: electricSnakeCycle 15s linear infinite;
}

@keyframes electricSnakeCycle {
  /* 0% - 80% (первые 12 сек) — логотип спокоен */
  0%, 80% {
    stroke-dashoffset: 495;
    opacity: 0;
  }
  81% {
    opacity: 1;
  }
  /* 81% - 96% (2.5 сек) — электрическая змейка огибает логотип */
  96% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  /* 97% - 100% — мягкое затухание */
  98%, 100% {
    stroke-dashoffset: -35;
    opacity: 0;
  }
}

@keyframes logoSparkGlow {
  0%, 80% { filter: none; }
  88% { filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.8)); }
  96% { filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.7)); }
  100% { filter: none; }
}

/* МЕНЮ НАВИГАЦИИ (4 ПУНКТА) */
.nav { margin-left: auto; }
.nav > ul { display: flex; align-items: center; gap: 8px; }
.nav a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--mut);
  transition: color .2s, background .2s;
}
.nav a:hover {
  color: var(--ink);
  background: var(--bg2);
}
.nav-mobile-extra { display: none; }

/* ПРАВЫЙ БЛОК ДЕЙСТВИЙ */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКА (RU / KG) */
.lang-switch {
  display: inline-flex;
  align-items: center;
  background: var(--bg2);
  border: 1.5px solid var(--line);
  border-radius: 24px;
  padding: 3px 5px;
  gap: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.lang-btn {
  border: none;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--mut);
  padding: 4px 9px;
  border-radius: 16px;
  cursor: pointer;
  transition: all .2s ease;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.active {
  background: var(--btn);
  color: var(--btn-ink);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.lang-divider {
  color: var(--line);
  font-size: 12px;
  font-weight: 600;
}

/* КНОПКА ТЕМЫ */
.theme {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--bg2);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color .2s, color .2s, transform .15s;
}
.theme:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(15deg);
}
[data-theme="light"] .ic-sun,
[data-theme="dark"] .ic-moon { display: none; }

/* БУРГЕР */
.burger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--bg2);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.burger span {
  width: 22px;
  height: 2.2px;
  background: var(--ink);
  border-radius: 2px;
  transition: .25s;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ===== 5. ГЛАВНЫЙ ЭКРАН И АВТОСЛАЙДЕР ===== */
.hero {
  padding: clamp(48px, 7vw, 100px) 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--hero1), var(--hero2));
}
.hero::before {
  content: "";
  position: absolute;
  width: 760px;
  height: 760px;
  right: -160px;
  top: -240px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 68%);
  pointer-events: none;
}
.hero-in {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(32px, 5vw, 76px);
  align-items: center;
  position: relative;
}
.slides { display: grid; }
.slide {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity .8s cubic-bezier(.4,0,.2,1), transform .8s cubic-bezier(.4,0,.2,1), visibility .8s;
}
.slide.on {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.slide h2 {
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  letter-spacing: -.03em;
  max-width: 17ch;
  line-height: 1.15;
}
.lead {
  margin: 22px 0 32px;
  max-width: 50ch;
  color: var(--mut);
  font-size: clamp(1.08rem, 1.8vw, 1.25rem);
  line-height: 1.55;
}
.cta { display: flex; flex-wrap: wrap; gap: 14px; }
.slider-ctrl {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 38px;
}
.dots { display: flex; gap: 10px; }
.dots button {
  width: 10px;
  height: 10px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all .4s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.dots button.on {
  background: var(--accent);
  width: 36px;
  border-radius: 12px;
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.55), 0 0 4px rgba(245, 158, 11, 0.3);
}


/* ===== 6. СХЕМА РАСПРЕДЕЛЕНИЯ ЭНЕРГИИ ===== */
.hero-art { min-width: 0; }
.diagram { display: block; width: 100%; height: auto; overflow: visible; }
.d-sun { fill: var(--accent); }
.d-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: .5;
  animation: ring 3.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.d-pulse {
  animation: pulse 3.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.d-box { fill: var(--bg); stroke: var(--ink); stroke-width: 1.6; }
.d-thin { fill: none; stroke: var(--ink); stroke-width: 1; opacity: .35; }
.d-line { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.d-window { fill: var(--accent); opacity: .85; }
.d-term { fill: var(--ink); }
.d-sine { fill: none; stroke: var(--green); stroke-width: 2.2; stroke-linecap: round; }
.d-batfill {
  fill: var(--green);
  opacity: .85;
  transform-box: fill-box;
  transform-origin: bottom;
  animation: charge 6s ease-in-out infinite;
}
.d-beam {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 2 9;
  animation: dash 1s linear infinite;
}
.d-beam.b2 { animation-duration: 1.3s; }
.d-beam.b3 { animation-duration: .8s; }
.d-beam.b4 { animation-duration: 1.6s; }
.d-beam.b5 { animation-duration: 1.1s; }
.d-flow {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 2 9;
  animation: dash .8s linear infinite;
}
@keyframes dash   { to { stroke-dashoffset: -22; } }
@keyframes pulse  { 50% { transform: scale(1.12); opacity: .75; } }
@keyframes ring   { 50% { transform: scale(1.12); opacity: .2; } }
@keyframes charge { 0% { transform: scaleY(.15); } 85%, 100% { transform: scaleY(1); } }
.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 24px;
  margin-top: 12px;
  font-size: .95rem;
  font-weight: 500;
  color: var(--mut);
}
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.l-sun { background: var(--accent); }
.l-pan { background: #2B5593; }
.l-inv { background: var(--ink); }
.l-bat { background: var(--green); }


/* ===== 7. ПРОДУКЦИЯ И РЕШЕНИЯ (РЕАЛЬНЫЕ ФОТО) ===== */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }

.item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 22px;
  box-shadow: var(--card-shadow);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.item:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .1);
}
/* карточка — колонка: ссылка «Узнать подробнее» всегда прижата к низу и стоит на одной линии у соседних карточек */
.item { display: flex; flex-direction: column; }
.item .more { margin-top: auto; align-self: flex-start; }
.item p { margin-bottom: 14px; }
.item h3 { margin: 18px 4px 8px; font-size: 1.18rem; }
.item p { color: var(--mut); font-size: 1rem; line-height: 1.5; margin: 0 4px 10px; }
.media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  background: var(--bg2);
  overflow: hidden;
  display: block;
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.item:hover .media img {
  transform: scale(1.05);
}

/* Подзаголовок «Освещение на солнечной энергии» под основными карточками продукции */
.sub-head { margin: clamp(46px, 6vw, 72px) 0 clamp(22px, 3vw, 32px); }
.sub-head h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0 0 8px; }
.sub-head .sub { margin: 0; }
/* Карточка без фото: нарисованный значок на цветном фоне */
.icon-media {
  display: grid;
  place-items: center;
  color: var(--btn);
  background: linear-gradient(145deg, var(--bg2), rgba(245, 158, 11, .14));
}
.icon-media svg { width: 78%; height: auto; }
.icon-media .li-s { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.icon-media .li-a { fill: var(--accent); fill-opacity: .35; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; }
.icon-media .li-r { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }

/* РЕШЕНИЯ (ДЛЯ ДОМА И БИЗНЕСА) */
.sol {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--card-shadow);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.sol:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .12);
}
.sol-media.has-real-img {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg2);
}
.sol-media.has-real-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
.sol:hover .sol-media.has-real-img img {
  transform: scale(1.04);
}
.sol-body { padding: 30px 28px; }
.sol-body h3 { font-size: 1.35rem; }
.sol-body p {
  color: var(--mut);
  margin-top: 10px;
  font-size: 1.05rem;
  line-height: 1.55;
}


/* ===== 8. О КОМПАНИИ ===== */
.about {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(36px, 6vw, 88px);
  align-items: start;
}
.about-text h2 { margin-bottom: 20px; }
.about-text p {
  color: var(--mut);
  margin-bottom: 28px;
  font-size: 1.12rem;
  line-height: 1.6;
}
.feats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--card-shadow);
}
.feats li {
  display: flex;
  gap: 16px;
  padding: 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.feats li:nth-child(2n) { border-right: 0; }
.feats li:nth-last-child(-n+2) { border-bottom: 0; }
.feats .ic {
  width: 28px;
  height: 28px;
  color: var(--accent);
  margin-top: 2px;
}
.feats b { display: block; font-weight: 700; font-size: 1.06rem; }
.feats span { display: block; color: var(--mut); font-size: 0.96rem; margin-top: 4px; }


/* ===== 8б. СПЕЦИАЛИСТЫ (НАДПИСЬ АККУРАТНО ПОД ФОТО) ===== */
.team-showcase {
  max-width: 960px;
  margin: 0 auto;
}
.team-photo-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.1);
  transition: transform .25s ease, box-shadow .25s ease;
}
.team-photo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.16);
}
.team-photo-wrap {
  width: 100%;
  max-height: 520px;
  overflow: hidden;
  background: var(--bg2);
}
.team-photo-wrap img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}
.team-card-caption {
  padding: 18px 24px;
  background: var(--card);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  align-items: center;
}
.team-cert-badge {
  background: rgba(29, 95, 184, 0.94);
  color: #FFFFFF;
  padding: 10px 24px;
  font-size: 1.02rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.team-cert-badge .ic {
  color: #FFC53D;
  width: 20px;
  height: 20px;
}


/* ===== 8в. КАК МЫ РАБОТАЕМ ===== */
.steps-container { margin-top: 20px; }
.steps-modern {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.step-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--card-shadow);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.step-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .1);
}
.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.step-num {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, var(--btn), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.step-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg2);
  display: grid;
  place-items: center;
  color: var(--accent);
}
.step-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}
.step-card p {
  color: var(--mut);
  font-size: 1.02rem;
  line-height: 1.5;
}


/* ===== ПРОЕКТЫ ===== */
.proj {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 24px;
  box-shadow: var(--card-shadow);
  transition: transform .25s ease, border-color .25s ease;
}
.proj:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
}
.proj-media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 1.5px dashed var(--line);
  background: var(--bg2);
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
  padding: 16px;
  color: var(--mut);
  font-size: .95rem;
}
.proj-media.has-img { border-style: solid; }
.proj h3 { margin: 18px 0 6px; font-size: 1.22rem; }
.proj .place { font-size: .95rem; color: var(--accent); font-weight: 700; }
.proj p { color: var(--mut); font-size: 1.02rem; margin-top: 8px; line-height: 1.5; }


/* ===== 9. БАННЕР CTA ===== */
.cta-band {
  background: linear-gradient(135deg, var(--cta1), var(--cta2));
  color: #FFFFFF;
  padding: clamp(56px, 8vw, 96px) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(245, 158, 11, 0.18), transparent 70%);
  pointer-events: none;
}
.cta-in { position: relative; z-index: 1; }
.cta-in h2 { font-size: clamp(2rem, 4vw, 3rem); }
.cta-in p {
  margin: 14px auto 32px;
  opacity: .88;
  font-size: 1.2rem;
  max-width: 58ch;
  line-height: 1.5;
}
.cta-action-btn { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }


/* ===== 10. КАЛЬКУЛЯТОР ПОТРЕБЛЕНИЯ (СЛЕВА) И ФОРМА ЗАЯВКИ (СПРАВА) ===== */
.calc-contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);   /* minmax(0,…) — колонки не растягиваются от длинных слов */
  gap: 32px;
  align-items: stretch;
}
.calc-contact-grid > * { min-width: 0; }

/* 1. КАРТОЧКА КАЛЬКУЛЯТОРА (СЛЕВА) */
.calculator-card {
  background: var(--card);
  padding: 28px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* ПЕРЕКЛЮЧАТЕЛЬ ФАЗ */
.calc-phase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.calc-step-lbl {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
}
.phase-pills {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
}
.phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--mut);
  transition: all .2s ease;
  min-width: 0;
  white-space: normal;       /* длинный текст (кыргызский) переносится */
}
.phase-pill input { display: none; }
.phase-pill:hover { border-color: var(--accent); color: var(--ink); }
.phase-pill.active {
  background: var(--btn);
  border-color: var(--btn);
  color: var(--btn-ink);
  box-shadow: 0 4px 12px rgba(29, 95, 184, 0.18);
}

/* ШАПКА КАТАЛОГА */
.calc-catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.calc-cat-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.btn-custom-add {
  border: 1.5px dashed var(--btn);
  background: var(--bg2);
  color: var(--btn);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  line-height: 1.2;
  transition: all .18s;
}
.btn-custom-add:hover {
  background: var(--btn);
  color: var(--btn-ink);
  border-style: solid;
}

/* СЕТКА БЫСТРОЙ ТЕХНИКИ */
.quick-app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  /* На компьютере список занимает всё свободное место карточки (нет пустоты внизу).
     flex-basis: 0 — высота карточки задаётся формой справа, а список подстраивается и при нехватке места прокручивается. */
  flex: 1 1 0;
  min-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
  align-content: stretch;
  grid-auto-rows: minmax(auto, 1fr);   /* строка не может быть ниже своего содержимого — карточки не налезают друг на друга */
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.q-app-card {
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "icon name name" "power power step";
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
  transition: all .2s ease;
}
.q-app-left, .q-app-details { display: contents; }   /* на компьютере раскладываем по областям сетки */
.q-app-icon { grid-area: icon; }
.q-app-name { grid-area: name; }
.q-app-power-edit { grid-area: power; }
.q-app-right { grid-area: step; }
.q-app-card:hover {
  border-color: var(--accent);
}
.q-app-card.has-qty {
  border-color: var(--btn);
  background: linear-gradient(135deg, var(--bg2), var(--card));
  box-shadow: 0 4px 12px rgba(29, 95, 184, 0.1);
}
.q-app-left {
  display: contents;   /* на компьютере элементы раскладываются сеткой карточки (см. .q-app-card) */
}
.q-app-icon {
  font-size: 1.45rem;
  line-height: 1;
  flex: none;
}
.q-app-details {
  display: contents;
}
.q-app-name {
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.25;
  overflow-wrap: break-word;     /* длинные названия переносятся, а не обрезаются */
  color: var(--ink);
}
.app-3ph-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  background: #E11D48;
  color: #fff;
  margin-left: 4px;
  vertical-align: middle;
}
.q-app-power-edit {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
}
.q-power-input {
  width: 62px;
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--card);
  color: var(--mut);
  text-align: right;
}
.q-unit {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mut);
}

/* СТЕППЕР (+/-) */
.q-stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  overflow: hidden;
  flex: none;
}
.q-step-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  display: grid;
  place-items: center;
  transition: background .15s;
}
.q-step-btn:hover {
  background: var(--bg2);
}
.q-step-val {
  width: 28px;
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--ink);
}

/* ПАНЕЛЬ ИТОГОВОГО РАСХОДА (ТОЛЬКО РАСХОД, БЕЗ ИНВЕРТОРОВ И БАТАРЕЙ) */
.calc-total-bar {
  background: linear-gradient(135deg, var(--bg2), color-mix(in srgb, var(--accent) 14%, var(--bg2)));
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 14px;
  flex-wrap: wrap;
  min-width: 0;
}
.calc-total-info { min-width: 0; flex: 1 1 180px; }
.total-lbl {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 2px;
}
.total-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--btn);
  letter-spacing: -.02em;
  line-height: 1.1;
}
.total-val .unit {
  font-size: 1.35rem;
  color: var(--ink);
  font-weight: 700;
}
.total-val .sub-w {
  font-size: 0.95rem;
  color: var(--mut);
  font-weight: 600;
  margin-left: 6px;
}
.total-count-text {
  font-size: 0.92rem;
  color: var(--mut);
  margin-top: 2px;
}
.total-count-text b { color: var(--ink); }
.btn-reset-calc {
  max-width: 100%;
  line-height: 1.2;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--mut);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
}
.btn-reset-calc:hover {
  border-color: #E5484D;
  color: #E5484D;
}


/* 2. КАРТОЧКА ЗАЯВКИ (СПРАВА, КРУПНАЯ И ВЫРАЗИТЕЛЬНАЯ) */
.contact-card {
  background: var(--card);
  padding: 34px 30px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  box-shadow: 0 14px 40px rgba(13, 32, 54, 0.08);
}
.form-header-box { margin-bottom: 20px; }
.card-head-title {
  font-size: 1.65rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--ink);
}
.card-head-desc {
  color: var(--mut);
  font-size: 1.02rem;
  line-height: 1.5;
}

/* БЕЙДЖ ПРИКРЕПЛЁННОГО РАСЧЁТА В ФОРМЕ */
.calc-attached-badge {
  background: linear-gradient(135deg, var(--bg2), color-mix(in srgb, var(--accent) 16%, var(--bg2)));
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}
.calc-attached-badge .badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: #140D00;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.calc-attached-badge .badge-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--mut);
}
.calc-attached-badge > div:last-child { min-width: 0; }
.calc-attached-badge .badge-values {
  overflow-wrap: anywhere;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
  margin-top: 2px;
}
.badge-preview-list {
  font-size: 0.88rem;
  color: var(--mut);
  margin-top: 4px;
  line-height: 1.4;
  max-height: 60px;
  overflow-y: auto;
  overflow-wrap: anywhere;
}

/* ПОЛЯ ВВОДА В ФОРМЕ */
form { display: grid; gap: 16px; }
label { display: grid; gap: 7px; font-weight: 600; font-size: 1rem; color: var(--ink); }
.input-lg {
  padding: 15px 18px !important;
  font-size: 1.05rem !important;
  border-radius: 12px !important;
  border: 1.5px solid var(--line) !important;
  background: var(--bg) !important;
}
input, select, textarea {
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  width: 100%;
  font-size: 1.02rem;
  transition: border-color .2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; }
.status { min-height: 1.4em; font-weight: 700; font-size: 1rem; }
.status.ok { color: var(--green); }
.status.err { color: #E5484D; }
.formnote {
  font-size: 0.94rem;
  color: var(--mut);
  line-height: 1.5;
  margin-top: -2px;
}
.btn-lead-submit {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 13px 22px;
  box-shadow: 0 6px 18px rgba(29, 95, 184, 0.2);
  margin-top: 6px;
}


/* ===== 11. КАРТА И АДРЕС ПОД КАЛЬКУЛЯТОРОМ ===== */
.map-section-below {
  margin-top: 40px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.map-info-bar {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.map-address-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}
.map-address-item .ic { color: var(--accent); }
.map-actions-group { display: flex; gap: 10px; flex-wrap: wrap; }
.map-box-compact {
  height: 320px;
  width: 100%;
  background: var(--bg2);
}
.map-box-compact iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
[data-theme="dark"] .map-box-compact iframe {
  filter: invert(.92) hue-rotate(180deg) saturate(.85);
}


/* ===== 12. ПОДВАЛ С ВЕРТИКАЛЬНОЙ ПОЛОСКОЙ ===== */
.footer {
  background: var(--foot-bg);
  color: var(--foot-ink);
  padding-top: 60px;
  transition: background .3s;
}
.foot-in {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 44px;
}
.foot-col { flex: 1; }
.foot-about { flex: 1.4; }
.foot-logo {
  padding: 0;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
}
.foot-in h4 {
  font-size: .88rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--foot-mut);
  margin-bottom: 16px;
  font-weight: 700;
}
.foot-in a, .foot-in .addr {
  display: block;
  padding: 5px 0;
  font-size: 1.02rem;
  color: var(--foot-mut);
  transition: color .2s;
}
.foot-in a:hover { color: var(--accent); }
.footer .logo-text b { color: var(--accent); }
.foot-note {
  color: var(--foot-mut);
  margin-top: 8px;
  max-width: 32ch;
  font-size: 0.98rem;
}
/* ВЕРТИКАЛЬНЫЙ РАЗДЕЛИТЕЛЬ МЕЖДУ РАЗДЕЛАМИ И КОНТАКТАМИ */
.foot-divider {
  width: 1px;
  background: rgba(255, 255, 255, 0.16);
  height: 120px;
  align-self: center;
  flex: none;
}
.foot-bottom {
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding: 24px 0;
  color: var(--foot-mut);
  font-size: .95rem;
}
.fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent);
  color: #140D00;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  z-index: 50;
  transition: transform .2s ease;
}
.fab:hover { transform: scale(1.1); }
.fab .ic { width: 28px; height: 28px; }
.social { display: flex; gap: 12px; }
.foot-in .soc {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .3);
  color: var(--foot-ink);
  transition: .2s;
}
.foot-in .soc:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #140D00;
}
.foot-in .soc .ic { width: 22px; height: 22px; }
.totop {
  position: fixed;
  right: 28px;
  bottom: 90px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: .25s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.totop.show { opacity: 1; visibility: visible; }


/* ===== 13. МОДАЛЬНОЕ ОКНО «ДОБАВИТЬ СВОЙ ПРИБОР» ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.modal.open {
  opacity: 1;
  visibility: visible;
}
.modal-dialog {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: min(480px, 100%);
  padding: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  transform: translateY(16px);
  transition: transform .25s ease;
}
.modal.open .modal-dialog {
  transform: none;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 { font-size: 1.25rem; }
.modal-close {
  border: none;
  background: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--mut);
  line-height: 1;
}
.modal-close:hover { color: var(--ink); }
.modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}


/* ===== 13б. ОКНО «УЗНАТЬ ПОДРОБНЕЕ» (раздел «Продукция») ===== */
body.modal-lock { overflow: hidden; }          /* пока окно открыто, страница за ним не прокручивается */
.detail-dialog {
  width: min(640px, 100%);
  max-height: min(86vh, 760px);                 /* всегда по центру и не выше экрана */
  display: flex;
  flex-direction: column;
  padding: 26px 26px 22px;
}
.detail-dialog .modal-header { margin-bottom: 14px; flex: none; }
.detail-dialog .modal-header h3 { font-size: 1.45rem; padding-right: 12px; }
.detail-dialog .modal-close {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg2);
  font-size: 1.1rem;
}
.detail-dialog .modal-close:hover { background: var(--line); }
.detail-body {
  overflow-y: auto;                              /* длинный текст прокручивается внутри окна */
  min-height: 0;
  flex: 1 1 auto;
  padding-right: 6px;
  line-height: 1.6;
  color: var(--mut);
  font-size: 1.02rem;
  overflow-wrap: break-word;
}
.detail-body h4 {
  margin: 18px 0 6px;
  font-size: 1.05rem;
  color: var(--ink);
}
.detail-body h4:first-child { margin-top: 0; }
.detail-body p { margin: 0 0 8px; }
.detail-body ul { margin: 0 0 8px; padding-left: 22px; list-style: disc; }
.detail-body li::marker { color: var(--accent); }
.detail-body li { margin-bottom: 6px; }
.detail-actions { flex: none; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }


/* ===== 14. АНИМАЦИИ ПОЯВЛЕНИЯ ===== */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s ease;
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}


/* ===== 15. АДАПТИВНОСТЬ ===== */
@media (max-width: 1080px) {
  /* Планшеты и узкие ноутбуки: компактная шапка, чтобы меню и кнопка не переносились на вторую строку */
  .logo-img { height: 38px; }
  .logo-app { height: 38px; width: 38px; }
  .header-in { gap: 10px; }
  .nav a { padding: 10px 8px; font-size: .95rem; white-space: nowrap; }
  .header-actions { gap: 8px; }
  .header-actions .btn { white-space: nowrap; padding: 10px 14px; font-size: .92rem; }
  .hero-in, .about { grid-template-columns: 1fr; }
  .calc-contact-grid { grid-template-columns: 1fr; }
  .contact-card { position: static; }
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .steps-modern { grid-template-columns: repeat(2, 1fr); }
  .hero-art { max-width: 580px; margin: 0 auto; width: 100%; }
  .foot-in { flex-wrap: wrap; }
  .foot-divider { display: none; }
  .foot-col { min-width: 200px; }
}

/* Самые узкие планшеты (861–900 px): ещё компактнее шапка */
@media (min-width: 861px) and (max-width: 900px) {
  .nav a { padding: 10px 5px; font-size: .9rem; }
  .header-actions .btn { padding: 10px 10px; font-size: .88rem; }
  .logo-img { height: 34px; }
}

@media (max-width: 860px) {
  .hide-m { display: none; }
  .burger { display: flex; }
  .nav {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1.5px solid var(--line);
    padding: 16px 24px 28px;
    max-height: calc(100vh - 76px);
    overflow: auto;
    transform: translateY(-120%);
    transition: transform .3s ease;
    z-index: 55;
    margin: 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  }
  .nav.open { transform: none; }
  .nav > ul { flex-direction: column; gap: 0; }
  .nav a {
    padding: 16px 8px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    font-size: 1.15rem;
  }
  .nav-mobile-extra { display: block; margin-top: 20px; }
  .nav-mobile-extra .btn { width: 100%; }
  .phase-selector { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .grid3, .grid2, .grid4 { grid-template-columns: 1fr; }
  .steps-modern { grid-template-columns: 1fr; }
  .feats { grid-template-columns: 1fr; }
  .feats li {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }
  .feats li:last-child { border-bottom: 0 !important; }
  .cta .btn { width: 100%; }
  .header-in { height: 70px; gap: 12px; }
  .logo { font-size: 1.15rem; padding: 4px 8px; }
  .logo-svg { width: 34px; height: 34px; }
  .logo-img { height: 42px; }
  .logo-app { height: 38px; width: 38px; }
  .foot-logo .logo-img { height: 46px; }
  .lang-btn { padding: 3px 7px; font-size: 0.82rem; }
  .theme { width: 34px; height: 34px; }

  /* Calculator and form — full width, compact padding */
  .calculator-card,
  .contact-card {
    padding: 16px 12px;
    border-radius: 12px;
  }
  .card-head-title { font-size: 1.25rem; }
  .card-head-desc { font-size: 0.9rem; }

  /* Appliance grid — single column, taller scroll */
  .quick-app-grid {
    grid-template-columns: minmax(0, 1fr);
    flex: none;               /* на телефоне высота фиксированная, список прокручивается */
    min-height: 0;
    height: 360px;
    grid-auto-rows: auto;
    align-content: start;
    gap: 6px;
  }
  .q-app-card { padding: 10px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .q-app-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
  .q-app-details { display: block; min-width: 0; flex: 1; }
  .q-app-name { font-size: 0.85rem; }
  .q-app-icon { font-size: 1.2rem; }
  .q-power-input { width: 64px; font-size: 0.82rem; }

  /* Stepper — bigger touch targets */
  .q-step-btn { width: 36px; height: 36px; font-size: 1.2rem; }
  .q-step-val { width: 28px; font-size: 1rem; }

  /* Phase selector */
  .calc-phase-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .phase-pills { width: 100%; display: flex; flex-wrap: nowrap; }
  .phase-pill { flex: 1 1 0; min-width: 0; justify-content: center; text-align: center; padding: 10px 6px; font-size: 0.82rem; }

  /* Catalog header */
  .calc-catalog-header { flex-direction: column; align-items: stretch; gap: 8px; }
  .btn-custom-add { justify-content: center; width: 100%; padding: 8px 14px; }

  /* Total bar */
  .calc-total-bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; margin-top: 0; }
  .calc-total-info { flex: none; }   /* иначе блок растягивается по высоте и появляется пустота */
  .total-val { font-size: 1.5rem; }
  .total-val .unit { font-size: 1.1rem; }
  .total-val .sub-w { font-size: 0.82rem; }
  .btn-reset-calc { width: 100%; text-align: center; padding: 10px; }

  /* WhatsApp button — smaller on mobile */
  .btn-lead-submit {
    width: 100%;
    justify-content: center;
    font-size: 0.88rem;
    padding: 12px 16px;
  }
  .btn-lead-submit .ic { width: 18px; height: 18px; }

  /* Badge */
  .calc-attached-badge { padding: 10px 12px; gap: 10px; }
  .calc-attached-badge .badge-icon { width: 32px; height: 32px; }
  .calc-attached-badge .badge-values { font-size: 0.92rem; }
  .badge-preview-list { font-size: 0.8rem; }

  /* Form inputs */
  .input-lg {
    padding: 12px 14px !important;
    font-size: 0.95rem !important;
  }

  .totop { right: 20px; }
  .foot-in { flex-direction: column; gap: 24px; }
  .foot-col { width: 100%; }

  /* Section header text */
  .sec-head .sub { font-size: 0.95rem; }

  /* Map */
  .map-box-compact { height: 240px; }
  .map-info-bar { flex-direction: column; align-items: flex-start; padding: 14px 16px; gap: 10px; }
}

@media (max-width: 400px) {
  .wrap { width: calc(100% - 20px); }
  /* Узкие телефоны: шапка не должна быть шире экрана */
  .header-in { gap: 6px; }
  .header-actions { gap: 6px; flex-shrink: 0; }
  .logo { min-width: 0; font-size: 1.02rem; padding: 4px 6px; }
  .logo-svg { width: 30px; height: 30px; }
  .logo-img { height: 35px; }
  .logo-app { height: 32px; width: 32px; }
  .hero { padding: clamp(32px, 5vw, 60px) 0; }
  .slide h2 { font-size: 1.6rem; }
  .lead { font-size: 0.95rem; margin: 14px 0 20px; }
  .btn { padding: 11px 18px; font-size: 0.9rem; }
  .btn-sm { padding: 8px 14px; font-size: 0.85rem; }
  .calculator-card, .contact-card { padding: 12px 10px; }
  .phase-pill { font-size: 0.76rem; padding: 8px 4px; }
  .q-app-card { padding: 8px; gap: 6px; }
  .q-app-name { font-size: 0.8rem; }
  .q-power-input { width: 60px; font-size: 0.78rem; }
  .q-step-btn { width: 32px; height: 32px; }
  .calc-total-bar { padding: 10px 10px; }
  .total-val { font-size: 1.3rem; }
  .btn-lead-submit { font-size: 0.82rem; padding: 10px 12px; }
  .card-head-title { font-size: 1.1rem; }
  .modal-dialog { padding: 16px; }
  .detail-dialog { padding: 18px 16px 16px; max-height: 88vh; }
  .detail-dialog .modal-header h3 { font-size: 1.2rem; }
  .detail-body { font-size: 0.96rem; }
}

/* Совсем узкие телефоны (до 340 px) */
@media (max-width: 340px) {
  .logo-img { height: 28px; }
  .logo-app { height: 26px; width: 26px; }
  .header-in { gap: 4px; }
}


/* =====================================================================
   ПРОДВИЖЕНИЕ: соцсети, кнопки «Поделиться», всплывающее сообщение
   ===================================================================== */
.social { flex-wrap: wrap; }
.share-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 0; border: 0; background: none;
  color: var(--foot-ink); opacity: .85; font: inherit; font-size: .92rem; cursor: pointer;
}
.share-link:hover { opacity: 1; text-decoration: underline; }
.share-link .ic { width: 18px; height: 18px; }

.calc-bar-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-share-calc { display: inline-flex; align-items: center; gap: 6px; }
.btn-share-calc .ic { width: 16px; height: 16px; }
.btn-share-calc:hover { border-color: var(--accent); color: var(--ink); }

.detail-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.detail-actions .btn .ic { width: 16px; height: 16px; vertical-align: -3px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #0E223D; color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: .95rem; box-shadow: 0 10px 30px rgba(0,0,0,.3);
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .calc-bar-btns { display: grid; grid-template-columns: 1fr 1fr; }
  .calc-bar-btns .btn-reset-calc { width: 100%; justify-content: center; }
}
