/* ПСН-Сервис — дизайн-система (светлая, строгая) */

:root {
  --c-accent: #f26522;
  --c-accent-dark: #d9531a;
  --c-accent-soft: #fdeee5;
  --c-ink: #2b2d31;
  --c-text: #3d3f45;
  --c-muted: #6b7078;
  --c-line: #e3e6ea;
  --c-bg: #ffffff;
  --c-bg-alt: #f4f5f7;
  --c-dark: #25272b;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 6px 24px rgba(30, 34, 40, .08);
  --shadow-lg: 0 16px 48px rgba(30, 34, 40, .16);
  --container: 1240px;
  --font: "Manrope", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, select { font: inherit; color: inherit; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.section--alt { background: var(--c-bg-alt); }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.section__title { font-size: 34px; line-height: 1.2; font-weight: 800; color: var(--c-ink); }
.section__sub { margin-top: 8px; color: var(--c-muted); max-width: 640px; }
.link-more { color: var(--c-accent); font-weight: 700; white-space: nowrap; }
.link-more:hover { color: var(--c-accent-dark); }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 26px; border: 0; border-radius: var(--radius);
  font-weight: 700; cursor: pointer; transition: .2s; white-space: nowrap;
}
.btn--primary { background: var(--c-accent); color: #fff; }
.btn--primary:hover { background: var(--c-accent-dark); }
.btn--outline { background: transparent; color: var(--c-ink); box-shadow: inset 0 0 0 2px var(--c-line); }
.btn--outline:hover { box-shadow: inset 0 0 0 2px var(--c-accent); color: var(--c-accent); }
.btn--sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn--block { width: 100%; }

/* Шапка */
.header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--c-line); }
.header__row { display: flex; align-items: center; gap: 32px; height: 76px; }
.logo { display: inline-flex; align-items: baseline; gap: .16em; font-family: "Rubik", var(--font); font-size: 22px; font-weight: 700; line-height: 1; white-space: nowrap; }
.logo b { font-weight: 700; color: var(--c-accent); }
.logo span { font-weight: 500; letter-spacing: .16em; color: #4a4d52; }
.logo--light span { color: rgba(255,255,255,.8); }
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { white-space: nowrap; font-weight: 600; font-size: 15px; color: var(--c-ink); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.is-active { color: var(--c-accent); border-color: var(--c-accent); }
.header__phone { font-weight: 800; color: var(--c-ink); white-space: nowrap; }
.header__phone small { display: block; font-weight: 500; font-size: 12px; color: var(--c-muted); }
.burger { display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; }
.burger span, .burger span::before, .burger span::after { display: block; width: 20px; height: 2px; background: var(--c-ink); margin: 0 auto; position: relative; }
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; }
.burger span::before { top: -6px; } .burger span::after { top: 6px; }
.burger span, .burger span::before, .burger span::after { transition: .2s; }
.burger.is-open span { background: transparent; }
.burger.is-open span::before { top: 0; transform: rotate(45deg); }
.burger.is-open span::after { top: 0; transform: rotate(-45deg); }
.header__phone-ico, .nav__cabinet { display: none; }

/* Hero */
.hero { position: relative; overflow: hidden; color: #fff; padding: 110px 0 150px; background: var(--c-dark); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(25,27,31,.85) 0%, rgba(25,27,31,.5) 55%, rgba(25,27,31,.15) 100%); }
.hero__slides, .hero__slide { position: absolute; inset: 0; }
.hero__slide { background-size: cover; background-position: center; opacity: 0; transition: opacity 1s ease; }
.hero__slide.is-active { opacity: 1; }
.hero__content { position: relative; z-index: 2; }
.hero__title { font-size: 54px; line-height: 1.1; font-weight: 800; max-width: 760px; }
.hero__title em { font-style: normal; color: var(--c-accent); }
.hero__text { margin-top: 20px; font-size: 19px; max-width: 600px; color: rgba(255,255,255,.85); }

/* Фильтр */
.filter {
  position: relative; z-index: 5; margin-top: -78px;
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 22px 24px 24px;
}
.filter__tabs { display: inline-flex; background: var(--c-bg-alt); border-radius: var(--radius); padding: 4px; margin-bottom: 18px; }
.filter__tabs input { position: absolute; opacity: 0; pointer-events: none; }
.filter__tabs label { padding: 9px 26px; border-radius: 8px; font-weight: 700; font-size: 15px; cursor: pointer; color: var(--c-muted); }
.filter__tabs input:checked + label { background: var(--c-accent); color: #fff; }
.filter__grid { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr 1fr 1.2fr auto; gap: 14px; align-items: end; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--c-muted); margin-bottom: 6px; }
.field select, .field input[type=text], .field input[type=tel], .field input[type=number] {
  width: 100%; height: 48px; padding: 0 14px; background: #fff;
  border: 1.5px solid var(--c-line); border-radius: var(--radius); outline: none; transition: .2s;
}
.field select:focus, .field input:focus { border-color: var(--c-accent); }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.filter__more { margin-top: 14px; font-size: 14px; }
.filter__more a { color: var(--c-accent); font-weight: 700; }

/* Преимущества */

/* Категории */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.cat {
  position: relative; min-height: 230px; padding: 24px; border-radius: var(--radius-lg); overflow: hidden;
  color: #fff; display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(180deg, rgba(30,32,36,.05) 20%, rgba(30,32,36,.85)), var(--img, none) center / cover no-repeat, #5a5f67;
  transition: .25s;
}
.cat--all { background: var(--c-accent); }
.cat--all:hover { background: var(--c-accent-dark); }
.cat:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat__name { font-size: 22px; font-weight: 800; }
.cat__count { font-size: 14px; color: rgba(255,255,255,.75); }

/* Карточки объектов */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-lg); overflow: hidden; transition: .25s; display: flex; flex-direction: column; }
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.card__img { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #cfd3d9, #aeb3bb); }
.card__tag { position: absolute; top: 14px; left: 14px; background: var(--c-accent); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 6px; }
.card__quick { position: absolute; right: 14px; bottom: 14px; background: #fff; color: var(--c-ink); font-size: 13px; font-weight: 700; border: 0; padding: 7px 14px; border-radius: 8px; cursor: pointer; opacity: 0; transition: .2s; }
.card:hover .card__quick { opacity: 1; }
.card__body { padding: 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card__price { font-size: 24px; font-weight: 800; color: var(--c-ink); }
.card__price small { font-size: 14px; font-weight: 500; color: var(--c-muted); }
.card__title { font-weight: 700; color: var(--c-ink); }
.card__addr { font-size: 14px; color: var(--c-muted); }
.card__params { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.chip { font-size: 13px; background: var(--c-bg-alt); border-radius: 6px; padding: 4px 10px; }

/* Сервисы */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service { padding: 28px; background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-lg); transition: .25s; }
.service:hover { border-color: var(--c-accent); box-shadow: var(--shadow); }
.service__ico { width: 52px; height: 52px; border-radius: 12px; background: var(--c-accent-soft); color: var(--c-accent); display: grid; place-items: center; font-size: 24px; margin-bottom: 18px; }
.service h3 { color: var(--c-ink); font-size: 19px; margin-bottom: 8px; }
.service p { color: var(--c-muted); font-size: 15px; }

/* ИИ-помощник */
.ai { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; background: var(--c-dark); color: #fff; border-radius: 24px; padding: 56px; }
.ai h2 { font-size: 34px; line-height: 1.2; font-weight: 800; }
.ai p { margin: 16px 0 28px; color: rgba(255,255,255,.75); }
.chat { background: #fff; color: var(--c-text); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 85%; padding: 12px 16px; border-radius: 14px; font-size: 15px; }
.msg--bot { background: var(--c-bg-alt); border-bottom-left-radius: 4px; }
.msg--user { background: var(--c-accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat__input { display: flex; gap: 8px; margin-top: 4px; }
.chat__input input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1.5px solid var(--c-line); border-radius: var(--radius); }
.ai > *, .cta > * { min-width: 0; }
.chat__input .btn { flex: 0 0 auto; }

.ai-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 60; width: 64px; height: 64px; border-radius: 50%;
  background: var(--c-accent); color: #fff; border: 0; font-size: 28px; cursor: pointer; box-shadow: var(--shadow-lg);
}

/* Публикации */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post__img { aspect-ratio: 16 / 10; border-radius: var(--radius-lg); background: linear-gradient(135deg, #d6d9de, #b7bcc4); margin-bottom: 14px; }
.post__date { font-size: 13px; color: var(--c-muted); }
.post h3 { color: var(--c-ink); font-size: 18px; margin-top: 4px; }
.post:hover h3 { color: var(--c-accent); }

/* Заявка */
.cta { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; background: var(--c-accent); color: #fff; border-radius: 24px; padding: 56px; }
.cta h2 { font-size: 34px; line-height: 1.2; font-weight: 800; }
.cta p { margin-top: 14px; opacity: .9; }
.cta__form { background: #fff; color: var(--c-text); padding: 28px; border-radius: var(--radius-lg); display: grid; gap: 14px; }
.cta__note { font-size: 12px; color: var(--c-muted); }

/* Подвал */
.footer { background: var(--c-dark); color: rgba(255,255,255,.7); padding: 64px 0 28px; margin-top: 80px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
.footer h4 { color: #fff; margin-bottom: 16px; }
.footer li { margin-bottom: 10px; font-size: 15px; }
.footer a:hover { color: var(--c-accent); }
.footer .logo { margin-bottom: 16px; }
.footer__bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Адаптив */
@media (max-width: 1100px) {
  .filter__grid { grid-template-columns: 1fr 1fr 1fr; }
  .filter__grid .btn { grid-column: 1 / -1; }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .nav { gap: 18px; }
}
/* Шапка: компактное меню на ширине до 1100px (иначе элементы шапки не помещаются) */
@media (max-width: 1100px) {
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; gap: 0; background: #fff; padding: 8px 20px 20px;
    border-bottom: 1px solid var(--c-line); box-shadow: var(--shadow);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--c-line); }
  .nav a:hover, .nav a.is-active { border-color: var(--c-line); }
  .nav .nav__cabinet { display: block; margin-top: 16px; border: 0; text-align: center; padding: 0 26px; line-height: 48px; border-radius: var(--radius); background: var(--c-accent); color: #fff; }
  .nav .nav__cabinet:hover { color: #fff; background: var(--c-accent-dark); }
  .header__cabinet { display: none; }
  .header__phone { margin-left: auto; color: var(--c-accent); display: grid; place-items: center; width: 44px; height: 44px; }
  .header__phone-text { display: none; }
  .header__phone-ico { display: block; }
  .burger { display: block; }
}
@media (max-width: 900px) {
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; gap: 0; background: #fff; padding: 8px 20px 20px;
    border-bottom: 1px solid var(--c-line); box-shadow: var(--shadow);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--c-line); }
  .nav a:hover, .nav a.is-active { border-color: var(--c-line); }
  .nav .nav__cabinet { display: block; margin-top: 16px; border: 0; text-align: center; padding: 0 26px; line-height: 48px; border-radius: var(--radius); background: var(--c-accent); color: #fff; }
  .nav .nav__cabinet:hover { color: #fff; background: var(--c-accent-dark); }
  .header__cabinet { display: none; }
  .header__phone { margin-left: auto; color: var(--c-accent); display: grid; place-items: center; width: 44px; height: 44px; }
  .header__phone-text { display: none; }
  .header__phone-ico { display: block; }
  .burger { display: block; }
  .cards, .services, .posts { grid-template-columns: repeat(2, 1fr); }
  .ai, .cta { grid-template-columns: 1fr; padding: 36px 28px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .section { padding: 56px 0; }
  .section__head { flex-direction: column; align-items: start; }
  .section__title, .ai h2, .cta h2 { font-size: 26px; }
  .ai { padding: 28px 20px; gap: 28px; }
  .chat { padding: 14px; }
  .msg { max-width: 92%; font-size: 14px; }
  .chat__input { flex-wrap: wrap; }
  .chat__input input { flex: 1 1 140px; }
  .hero { padding: 64px 0 120px; }
  .hero__title { font-size: 34px; }
  .hero__text { font-size: 16px; }
  .header__phone small { display: none; }
  .header__row { gap: 12px; }
  .logo { font-size: 18px; }
  .filter { padding: 16px; }
  .filter__grid { grid-template-columns: 1fr 1fr; }
  .filter__grid .field--wide { grid-column: 1 / -1; }
  .cards, .services, .posts, .cats { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
}

/* Баннер cookie */
.cookie { position: fixed; left: 20px; bottom: 20px; z-index: 90; max-width: 520px; background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 20px 22px; font-size: 14px; line-height: 1.5; color: var(--c-text); }
.cookie[hidden] { display: none; }
.cookie a:not(.btn) { color: var(--c-accent); text-decoration: underline; }
.cookie__btns { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
@media (max-width: 640px) { .cookie { left: 12px; right: 12px; bottom: 12px; max-width: none; } }

/* Блок «Почему ПСН-Сервис» (анимированный) */
.why { background: var(--c-dark); color: rgba(255,255,255,.75); padding: 80px 0; position: relative; overflow: hidden; }
.why::before { content: ""; position: absolute; right: -160px; top: -160px; width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(circle, rgba(242,101,34,.28), transparent 70%); animation: why-float 9s ease-in-out infinite; }
.why .container { position: relative; }
.why__head { max-width: 720px; }
.why__title { font-size: 36px; line-height: 1.15; font-weight: 800; color: #fff; }
.why__sub { margin-top: 12px; font-size: 18px; }
.why__nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 44px; }
.why__num { border-left: 3px solid var(--c-accent); padding: 4px 0 4px 22px; }
.why__val { font-size: 64px; line-height: 1; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.why__val span { color: var(--c-accent); }
.why__lbl { margin-top: 10px; font-size: 16px; }
.why__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 44px; }
.why__card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius-lg); padding: 28px; transition: transform .25s, background .25s, border-color .25s; }
.why__card:hover { transform: translateY(-4px); background: rgba(255,255,255,.1); border-color: var(--c-accent); }
.why__ico { width: 46px; height: 46px; border-radius: 12px; background: var(--c-accent); color: #fff; display: grid; place-items: center; font-size: 22px; margin-bottom: 16px; }
.why__card h3 { color: #fff; font-size: 20px; margin-bottom: 8px; }
.why__flow { margin-top: 44px; }
.why__flow h3 { color: #fff; font-size: 22px; margin-bottom: 22px; }
.why__steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; position: relative; padding: 0;  z-index: 501; }
.why__steps::before { content: ""; position: absolute; left: 20px; right: 20px; top: 19px; height: 2px; background: rgba(255,255,255,.15); }
.why__steps::after { content: ""; position: absolute; left: 20px; top: 19px; height: 2px; width: 0; background: var(--c-accent); }
.why__flow.is-in .why__steps::after { width: calc(100% - 40px); transition: width 2.4s ease .3s; z-index: 500; }
.why__steps li { position: relative; font-size: 15px; color: #fff; padding-top: 52px; font-weight: 600; }
.why__steps li span { position: absolute; top: 0; left: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--c-dark); border: 2px solid rgba(255,255,255,.25); display: grid; place-items: center; font-weight: 800; transition: background .4s, border-color .4s; }
.why__flow.is-in .why__steps li span { background: var(--c-accent); border-color: var(--c-accent); }
.why__flow.is-in .why__steps li:nth-child(1) span { transition-delay: .3s; } .why__flow.is-in .why__steps li:nth-child(2) span { transition-delay: .8s; }
.why__flow.is-in .why__steps li:nth-child(3) span { transition-delay: 1.3s; } .why__flow.is-in .why__steps li:nth-child(4) span { transition-delay: 1.8s; }
.why__flow.is-in .why__steps li:nth-child(5) span { transition-delay: 2.3s; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease var(--d, 0s), transform .7s ease var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }
@keyframes why-float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-40px, 40px); } }
@media (max-width: 900px) { .why__nums { grid-template-columns: 1fr; gap: 20px; } .why__cards { grid-template-columns: 1fr; } .why__val { font-size: 52px; } }
@media (max-width: 640px) {
  .why { padding: 56px 0; } .why__title { font-size: 28px; }
  .why__steps { grid-template-columns: 1fr; gap: 18px; } .why__steps::before, .why__steps::after { display: none; }
  .why__steps li { padding: 8px 0 0 54px; min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } .why::before { animation: none; } .why__flow.is-in .why__steps::after, .why__steps li span { transition: none !important; } }

/* Полоса под фильтром главной — серая, как следующий блок */
.filter-wrap { display: flow-root; background: var(--c-bg-alt); }

/* Кнопка «Написать в MAX» и QR-код (includes/max.php): QR только на компьютере, на телефоне достаточно кнопки */
.max-contact { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.max-btn { display: inline-block; padding: 8px 18px; border-radius: 999px; background: var(--c-accent); color: #fff !important; font-weight: 700; font-size: 14px; text-decoration: none; }
.max-btn:hover { background: var(--c-accent-dark); }
.max-qr { display: none; margin: 0; text-align: center; font-size: 11px; line-height: 1.3; max-width: 140px; }
.max-qr__img { width: 120px; margin: 0 auto 4px; border-radius: 8px; overflow: hidden; background: #fff; }
.max-qr__img svg { display: block; width: 100%; height: auto; }
.max-contact--footer .max-qr { color: rgba(255, 255, 255, .7); }
.max-contact--footer .max-qr__img { width: 96px; }
@media (min-width: 900px) and (hover: hover) and (pointer: fine) { .max-qr { display: block; } }
