/* Адаптив: отдельная композиция для tablet (768–1199) и mobile (<768), а не «сжатый» desktop */

/* ---------- ≤1280: чуть плотнее ---------- */
@media (max-width: 1280px) {
  .nav__list { gap: 24px; }
  .nav__link { white-space: nowrap; }
  .hero__shape--main { width: 160px; right: 19%; }
}

/* ---------- TABLET ≤1199 ---------- */
@media (max-width: 1199px) {
  :root { --header-h: 76px; }
  .nav { gap: 24px; }
  .nav__list { gap: 18px; }
  .nav__link { font-size: 14px; }
  .hero { min-height: 0; padding-block: 56px 48px; }
  .hero__inner { grid-template-columns: minmax(0, 620px); }
  .hero__visual { display: none; }
  .hero__photo { width: 70%; opacity: 0.35; }
  .hero__shape--main { width: 120px; right: 10%; opacity: 0.85; }
  .hero__shape--thin { width: 14px; right: 22%; }
  .hero__shape--line { right: 34%; }
  .process__mark { right: -8%; width: 46vw; margin-top: calc(46vw * -0.425); }

  .section-head { grid-template-columns: 1fr 1fr; }
  .section-head__link { grid-column: 1 / -1; justify-self: start; padding-bottom: 0; }

  .services__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .service-card { min-height: 168px; padding: 24px 24px 22px; }
  .service-card--wide { grid-column: span 2; }
  .service-card--cta { grid-column: span 2; }

  .steps { grid-template-columns: repeat(2, 1fr); gap: 40px 32px; }
  .step { padding-right: 0; }
  .step__arrow { display: none; }

  .trust__grid { grid-template-columns: repeat(2, 1fr); }

  .callback__grid { grid-template-columns: 1fr; gap: 48px; }

  .footer__grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- ≤900: услуги в 2 колонки, чтобы заголовки не ломались ---------- */
@media (max-width: 900px) {
  .services__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-card--wide, .service-card--cta { grid-column: span 2; }
  .service-card__title { font-size: 17px; }
  .section-head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 40px; }
  .section-head__text { max-width: 480px; padding-bottom: 0; }
  .section-head__text--right { text-align: left; }
  .section-head__title br, .section-head__text br { display: none; }
}

/* ---------- ≤1023: burger-меню ---------- */
@media (max-width: 1023px) {
  .burger { display: flex; }
  .header__cta { display: none; }
  .nav {
    position: fixed;
    top: calc(var(--header-h) + var(--topbar-h)); left: 0; right: 0; bottom: 0;
    z-index: 49;
    flex-direction: column;
    align-items: stretch;
    gap: 32px;
    padding: 32px var(--gutter) 40px;
    background: var(--black);
    border-top: 1px solid var(--border-dark);
    overflow-y: auto;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--t-base), opacity var(--t-base), visibility 0s var(--t-base);
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; transition: transform var(--t-base), opacity var(--t-base); }
  .nav__list { flex-direction: column; gap: 4px; }
  .nav__link { display: block; padding: 16px 0; font-size: 22px; font-weight: 700; border-bottom: 1px solid var(--border-dark); }
  .nav__link::after { display: none; }
  .nav__cta { display: inline-flex; height: var(--btn-h); font-size: 15px; }

  .audiences__grid { grid-template-columns: 1fr; }
}

/* ---------- MOBILE ≤767 ---------- */
@media (max-width: 767px) {
  :root { --header-h: 68px; --section-y: 64px; --btn-h: 54px; }
  :root { --topbar-h: 44px; }
  .topbar { font-size: 12px; line-height: 1.3; }
  .topbar__phone { display: none; }
  .topbar__address span { white-space: normal; }
  .header__actions { gap: 10px; }
  .header__call {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    color: var(--white); background: var(--red);
    border-radius: var(--radius-btn);
  }
  .header__call .icon { width: 20px; height: 20px; }
  .logo__mark { height: 38px; }
  .logo--lg .logo__mark { height: 52px; }
  .logo__name { font-size: 15px; }
  .logo__sub { font-size: 9px; }

  .hero { padding-block: 48px 40px; }
  .hero__content { gap: 22px; }
  .hero__title { max-width: none; }
  .hero__lead { font-size: 16px; }
  .hero__lead br { display: none; }
  .hero__photo { width: 100%; opacity: 0.22; object-position: 70% 50%;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 40%, #000 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 40%, #000 100%); }
  .hero__shape--line { display: none; }
  .hero__shape--main { width: 56px; right: -10%; opacity: 0.55; }
  .hero__shape--thin { width: 8px; right: 4%; opacity: 0.55; }
  .process__mark { display: none; }

  .section-head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 32px; }
  .section-head__text { padding-bottom: 0; }
  .section-head__text--right { text-align: left; }
  .section-head__title br { display: none; }

  .services__grid { grid-template-columns: 1fr; gap: 12px; }
  .service-card { min-height: 0; padding: 22px 20px 20px; grid-template-columns: 26px minmax(0, 1fr); column-gap: 12px; }
  .service-card--wide, .service-card--cta { grid-column: auto; }
  .service-card--wide .service-card__title { font-size: 18px; max-width: none; }
  .service-card__icon { width: 26px; height: 26px; margin-top: -2px; }
  .service-card__title { font-size: 17px; }
  .service-card__text { padding-top: 12px; padding-right: 28px; }
  .service-card__arrow { right: 20px; bottom: 22px; }
  .service-card--cta { flex-direction: column; align-items: flex-start; gap: 12px; }
  .service-card--cta .service-card__text { flex: 0 0 auto; }
  .service-card--cta .btn { margin-left: 0; width: 100%; }

  /* Процесс — вертикальный timeline */
  .steps { grid-template-columns: 1fr; gap: 0; }
  .step { position: relative; padding: 0 0 36px 64px; }
  .step::before {
    content: ""; position: absolute; left: 23px; top: 48px; bottom: 0;
    width: 1px; background: var(--border-light);
  }
  .step:last-child::before { display: none; }
  .step__head { position: static; margin-bottom: 12px; gap: 12px; }
  .step__num {
    position: absolute; left: 0; top: 0;
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px;
    font-size: 16px; letter-spacing: 0;
    color: var(--white); background: var(--red); border-radius: 50%;
  }
  .step__icon { width: 26px; height: 26px; }
  .step__title { max-width: none; }

  .audiences { padding-block: 16px 40px; }
  .audience { grid-template-columns: 1fr; grid-template-areas: "body" "note"; min-height: 0; padding: 32px 24px 28px; gap: 24px; }
  .audience__bg { object-position: 60% 50%; }
  .audience--dark::before { background: linear-gradient(180deg, rgba(16, 18, 20, 0.92) 55%, rgba(16, 18, 20, 0.55) 100%); }
  .audience--red::before { background: linear-gradient(180deg, rgba(169, 15, 21, 0.92) 55%, rgba(169, 15, 21, 0.55) 100%); }
  .audience__note { text-align: left; }
  .audience__btn { width: 100%; }

  .trust { padding-block: 24px 64px; }
  .trust__grid { grid-template-columns: 1fr; gap: 12px; }
  .trust__item { padding: 24px 22px; }

  .callback__grid { gap: 36px; }
  .callback__title br { display: none; }
  .callback__perks { gap: 16px; margin-top: 28px; }
  .perk { width: 100%; }
  .perk br { display: none; }
  .form__row { grid-template-columns: 1fr; }

  .footer { padding-block: 40px 20px; }
  .footer__grid { grid-template-columns: 1fr; gap: 28px; padding-bottom: 28px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 14px; }
  .footer__slogan { display: block; padding-left: 12px; border-left: 2px solid var(--red); line-height: 1.6; }
  .footer__slogan::after { display: none; }
  .label { font-size: 11px; letter-spacing: 0.12em; gap: 12px; }
  .label::before { width: 24px; }
  .trust__title { min-height: 0; }

  /* Modal — bottom sheet */
  .modal { align-items: flex-end; padding: 0; }
  .modal__panel { max-width: none; max-height: 92vh; overflow-y: auto; padding: 32px 22px 28px; border-radius: 16px 16px 0 0; border-bottom: 0; }
  .modal__title { font-size: 22px; }
  @keyframes modal-in { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
}

/* ---------- ≥480 на телефоне: 2 колонки услуг ---------- */
@media (min-width: 480px) and (max-width: 767px) {
  .services__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-card { min-height: 150px; }
  .service-card--wide, .service-card--cta { grid-column: span 2; }
  .trust__grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- ≤390: очень узкие экраны ---------- */
@media (max-width: 390px) {
  :root { --gutter: 18px; }
  .hero__title { font-size: 42px; }
  .stat__value { font-size: 26px; }
}

/* Оплата по QR */
@media (max-width: 900px) {
  .pay__grid { grid-template-columns: 1fr; margin-top: 32px; }
  .pay__placeholder, .pay__done { min-height: 220px; }
}
@media (max-width: 767px) {
  .pay .form__row { grid-template-columns: 1fr; }
  .pay__panel { padding: 20px; }
  .pay__req, .pay__summary div { grid-template-columns: 1fr; gap: 2px; }
}
