/* ============================================
   Школа Матрица — стили (mobile first)
   Цвета: синий #1e3a5f, белый, серый, акцент #e8a735
   ============================================ */

:root {
  --color-primary: #1e3a5f;
  --color-primary-light: #2d4a6f;
  --color-accent: #e8a735;
  --color-accent-hover: #d49428;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f7fa;
  --color-text: #2c3e50;
  --color-text-muted: #6b7c8f;
  --color-border: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(30, 58, 95, 0.08);
  --shadow-md: 0 4px 20px rgba(30, 58, 95, 0.12);
  --shadow-lg: 0 8px 32px rgba(30, 58, 95, 0.15);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.25s ease;
  --header-height: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 48px 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

.about--after-news {
  border-top: 1px solid var(--color-border);
  padding-top: 52px;
}

/* Страница услуги (внутренняя) */
.service-page {
  padding: 32px 0 64px;
}

.breadcrumb {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 24px;
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.service-page__title {
  margin: 0 0 24px;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
}

.service-page__content {
  max-width: 720px;
  margin: 0 0 32px;
}

.service-page__content p {
  margin: 0 0 16px;
}

.service-page__content p:last-child {
  margin-bottom: 0;
}

.service-page__content ul {
  margin: 0 0 16px;
  padding-left: 1.5em;
}

.service-page__cta {
  margin-top: 32px;
}

.section__title {
  margin: 0 0 32px;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
  min-height: 48px;
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-md);
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn--outline:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn--large {
  padding: 16px 32px;
  font-size: 1.125rem;
}

.btn--full {
  width: 100%;
}

.btn--whatsapp {
  background: #25d366;
  color: #fff;
}

.btn--whatsapp:hover {
  background: #20bd5a;
}

.btn--telegram {
  background: #0088cc;
  color: #fff;
}

.btn--telegram:hover {
  background: #006699;
}

.btn--vk {
  background: #0077ff;
  color: #fff;
}

.btn--vk:hover {
  background: #0066dd;
}

/* ========== Хедер ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
}


.nav__list {
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.logo:hover {
  color: var(--color-primary);
}

.logo__place {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(30, 58, 95, 0.08);
  overflow: hidden;
}

.logo__img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.logo__text {
  display: inline-block;
}

.nav__link {
  padding: 8px 12px;
  color: var(--color-text);
}

.nav__link:hover {
  color: var(--color-accent);
}

.header__cta {
  display: none;
}

.burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 48px;
  height: 48px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity var(--transition);
}

.burger:hover {
  opacity: 0.8;
}

.burger__line {
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.burger.is-open .burger__line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.burger.is-open .burger__line:nth-child(2) {
  opacity: 0;
}

.burger.is-open .burger__line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
}

.nav-overlay.is-visible {
  display: block;
}

/* Мобильное меню открыто (только до 768px) */
@media (max-width: 767px) {
  body.menu-open .nav__list {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--color-bg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    gap: 8px;
  }

  body.menu-open .nav__link {
    display: block;
    padding: 16px;
    font-size: 1.125rem;
    border-radius: var(--radius);
  }

  .nav__cta-mobile {
    display: none;
  }

  body.menu-open .nav__cta-mobile {
    display: block;
    margin-top: 8px;
  }
}

.nav__cta-btn {
  width: 100%;
  margin: 0;
}

@media (min-width: 768px) {
  .nav__cta-mobile {
    display: none !important;
  }
}

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-height) + 32px) 0 48px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 50%, #3d5a80 100%);
  background-image: url("images/hero-school.jpg");
  background-size: cover;
  background-position: center;
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
}

.hero__text-wrap {
  display: inline-block;
  max-width: 100%;
  padding: 28px 24px 32px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.hero__title {
  margin: 0 0 20px;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.hero__subtitle {
  margin: 0;
  font-size: 1.125rem;
  opacity: 0.95;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero__cta {
  box-shadow: var(--shadow-lg);
}

/* ========== О школе ========== */
.about__grid {
  display: grid;
  gap: 32px;
  margin-bottom: 40px;
}

.about__text {
  font-size: 1rem;
  color: var(--color-text);
}

.about__lead {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 16px;
}

.about__license-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #fff;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.about__license-img a {
  display: block;
  line-height: 0;
}

.about__license-img img {
  width: 100%;
  height: auto;
  object-fit: contain;
  vertical-align: top;
}

.about__features {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.about__feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  color: var(--color-primary);
}

.about__feature-icon {
  font-size: 1.5rem;
  color: var(--color-accent);
}

/* ========== Новости ========== */
.news__carousel {
  position: relative;
  overflow: hidden;
}

.news__track-wrap {
  width: 100%;
  overflow: hidden;
}

.news__track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.news__track::-webkit-scrollbar {
  height: 8px;
}

.news__track::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.news__item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.news__item--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--color-text-muted);
}

.news__item--no-photo .news__body {
  flex: 1 1 100%;
}

.news__item--no-photo .news__img {
  display: none;
}

.news__body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  order: 2;
}

.news__img {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 400 / 280;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  order: 1;
}

.news__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news__img-placeholder {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.news__date {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  display: block;
}

.news__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.3;
}

.news__text {
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.5;
  margin: 0;
}

.news__text p {
  margin: 0 0 0.5em;
}

.news__text p:last-child {
  margin-bottom: 0;
}

.news__arrow {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  background: var(--color-bg);
  color: var(--color-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.news__arrow:hover {
  background: var(--color-primary);
  color: #fff;
}

.news__bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.news__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.news__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: var(--color-border);
  cursor: pointer;
  padding: 0;
  transition: background var(--transition), transform var(--transition);
}

.news__dot:hover {
  background: var(--color-text-muted);
}

.news__dot--active {
  background: var(--color-accent);
  transform: scale(1.2);
}

@media (min-width: 768px) {
  .news__item {
    flex-direction: row;
  }
  .news__item .news__body {
    flex: 1 1 50%;
    padding: 20px;
    order: 1;
  }
  .news__item .news__img {
    flex: 0 0 50%;
    width: 50%;
    max-width: 540px;
    aspect-ratio: 400 / 280;
    height: auto;
    min-height: 0;
    order: 2;
  }
  .news__item .news__img img {
    min-height: 0;
  }
}

/* ========== Карточки (преимущества, услуги) ========== */
.card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: rgba(232, 167, 53, 0.15);
  color: var(--color-accent);
  font-size: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.card__title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.card__title--small {
  font-size: 1.125rem;
}

.card__meta {
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.card__text {
  margin: 0;
  color: var(--color-text);
  font-size: 0.9375rem;
}

.card__btn {
  margin-top: 20px;
}

.card__avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  flex-shrink: 0;
}

.card__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.card__avatar-fallback {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

.card__avatar-fallback--show {
  display: flex;
}

.card__review-meta {
  margin-bottom: 8px;
}

.card__rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 4px 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.card__stars {
  color: var(--color-accent);
  letter-spacing: 2px;
}

.card__rating-num {
  font-weight: 600;
  color: var(--color-text);
}

/* Преимущества — сетка */
.advantages__grid {
  display: grid;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.advantages__card {
  text-align: center;
}

/* ========== Фотогалерея ========== */
.gallery__intro {
  text-align: center;
  color: var(--color-text-muted);
  margin: 0 0 32px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.gallery__subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 48px 0 12px;
  text-align: center;
}

.gallery__intro--narrow {
  margin-bottom: 24px;
}

.gallery__slider {
  position: relative;
  overflow: hidden;
}

.gallery__track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  list-style: none;
  margin: 0;
  padding: 0 0 16px;
  -webkit-overflow-scrolling: touch;
}

.gallery__track::-webkit-scrollbar {
  height: 8px;
}

.gallery__track::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.gallery__item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-width: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.gallery__item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.gallery__item img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.gallery__item--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.gallery__nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.gallery__arrow {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-primary);
  background: var(--color-bg);
  color: var(--color-primary);
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.gallery__arrow:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Услуги — сетка */
.services__grid {
  display: grid;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.card--service {
  display: flex;
  flex-direction: column;
}

.card--service .card__text {
  flex-grow: 1;
}

/* Карусель фото в карточке услуги */
.service__slider {
  position: relative;
  overflow: hidden;
  margin: 0 0 16px;
  border-radius: var(--radius);
}

.service__track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
  -webkit-overflow-scrolling: touch;
}

.service__track::-webkit-scrollbar {
  height: 6px;
}

.service__track::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.service__item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-width: 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.service__item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.service__item--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.service__nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.service__arrow {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-primary);
  background: var(--color-bg);
  color: var(--color-primary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background var(--transition), color var(--transition);
}

.service__arrow:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Карусель на странице услуги (крупнее) */
.service-page__slider.service__slider {
  margin-bottom: 32px;
}

.service-page__slider .service__item img {
  height: 240px;
}

.service-page__slider .service__nav {
  margin-top: 16px;
}

.service-page__slider .service__arrow {
  width: 44px;
  height: 44px;
  font-size: 0.875rem;
}

/* ========== Отзывы (источник: Яндекс.Карты) ========== */
.reviews__source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 24px;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.reviews__rating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 6px 12px;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  border-radius: var(--radius);
}

.reviews__source-text a {
  color: var(--color-primary);
  font-weight: 500;
}

.reviews__source-text a:hover {
  color: var(--color-accent);
}

.reviews__source-footer {
  text-align: center;
  margin: 24px 0 0;
  font-size: 0.9375rem;
}

.reviews__source-footer a {
  color: var(--color-primary);
  font-weight: 500;
}

.reviews__source-footer a:hover {
  color: var(--color-accent);
}

.reviews__slider {
  position: relative;
  overflow: hidden;
}

.reviews__track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

.reviews__track::-webkit-scrollbar {
  height: 8px;
}

.reviews__track::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.card--review {
  flex: 0 0 100%;
  scroll-snap-align: start;
  text-align: center;
}

.reviews__nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.reviews__arrow {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-primary);
  background: var(--color-bg);
  color: var(--color-primary);
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.reviews__arrow:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ========== Контакты ========== */
.contacts__grid {
  display: grid;
  gap: 32px;
}

.contacts__info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contacts__item {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
}

.contacts__item i {
  width: 24px;
  color: var(--color-accent);
}

.contacts__item a {
  color: var(--color-text);
}

.contacts__item a:hover {
  color: var(--color-accent);
}

.contacts__item:has(.contacts__phones) {
  align-items: flex-start;
}

.contacts__phones {
  line-height: 1.6;
}

.contacts__phones a {
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.contacts__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.contacts__actions .btn:hover {
  transform: scale(1.06);
  color: #fff;
}

.contacts__actions .btn--primary:hover {
  background: var(--color-accent);
  box-shadow: var(--shadow-md);
  color: #fff;
}

.contacts__actions .btn--whatsapp:hover {
  background: #25d366;
  color: #fff;
}

.contacts__actions .btn--telegram:hover {
  background: #0088cc;
  color: #fff;
}

.contacts__actions .btn--vk:hover {
  background: #0077ff;
  color: #fff;
}

.contacts__map {
  min-height: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--color-bg-alt);
}

.contacts__map iframe {
  display: block;
  width: 100%;
  max-width: 560px;
  height: 400px;
  margin-left: auto;
  margin-right: auto;
  border: 0;
}

/* ========== Футер ========== */
.footer {
  background: var(--color-primary);
  color: #fff;
  padding: 32px 0;
}

.footer a {
  color: rgba(255, 255, 255, 0.9);
}

.footer a:hover {
  color: #a5d8f3;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 24px;
}

.footer__social {
  display: flex;
  gap: 16px;
}

.footer__social-link {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  font-size: 1.25rem;
  transition: background var(--transition);
}

.footer__social-link:hover {
  background: #a5d8f3;
  color: var(--color-primary);
}

/* ========== Модальное окно ========== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.modal__box {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}

.modal__close:hover {
  color: var(--color-primary);
  background: var(--color-bg-alt);
}

.modal__title {
  margin: 0 0 24px;
  font-size: 1.5rem;
  color: var(--color-primary);
}

/* Модалка с виджетом Яндекс.Форм — шире, чтобы форма помещалась */
.modal__box:has(.form--ya-widget) {
  max-width: min(680px, 100vw - 40px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.form--ya-widget {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.form--ya-widget iframe {
  width: 100%;
  max-width: 650px;
  height: 520px;
  min-height: 320px;
  border: 0;
  border-radius: var(--radius);
}

@media (max-width: 767px) {
  /* На мобильных даём прокрутку всему оверлею, чтобы форма всегда была доступна */
  .modal {
    align-items: flex-start;
    padding: 8px 0;
    overflow-y: auto;
  }

  .modal__box {
    max-height: none;
    height: auto;
    border-radius: 0;
  }

  .modal__box:has(.form--ya-widget) {
    padding: 12px;
    max-height: none;
  }

  .form--ya-widget iframe {
    height: 60vh;
    min-height: 320px;
  }
}

/* Форма */
.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form__label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
}

.form__label em {
  font-weight: 400;
  color: var(--color-text-muted);
}

.form__input,
.form__select {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  transition: border-color var(--transition);
}

.form__input:focus,
.form__select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form__select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7c8f' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* ========== Планшеты (768px+) ========== */
@media (min-width: 768px) {
  .section {
    padding: 64px 0;
  }

  .section__title {
    font-size: 2rem;
    margin-bottom: 40px;
  }

  .burger {
    display: none;
  }

  .nav__list {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .header__cta {
    display: inline-flex;
  }

  body.menu-open .nav__list,
  body.menu-open .header__cta {
    position: static;
    flex-direction: row;
    background: transparent;
    padding: 0;
    box-shadow: none;
    margin: 0;
    width: auto;
  }

  .hero__title {
    font-size: 2.25rem;
  }

  .hero__subtitle {
    font-size: 1.25rem;
  }

  .about__grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

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

  .gallery__item {
    flex: 0 0 calc(50% - 12px);
  }

  .gallery__item img {
    height: 260px;
  }

  .service-page__slider .service__item {
    flex: 0 0 calc(50% - 6px);
  }

  .service-page__slider .service__item img {
    height: 260px;
  }

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

  .card--wide {
    grid-column: 1 / -1;
  }

  .card--review {
    flex: 0 0 calc(50% - 12px);
  }

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

  .contacts__map {
    min-height: 400px;
  }

  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ========== Десктоп (1024px+) ========== */
@media (min-width: 1024px) {
  .section__title {
    font-size: 2.25rem;
  }

  .hero__title {
    font-size: 2.75rem;
  }

  .about__features {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 32px;
  }

  .advantages__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }

  .advantages__card:hover {
    transform: translateY(-4px);
  }

  .gallery__item {
    flex: 0 0 calc(33.333% - 16px);
  }

  .gallery__item img {
    height: 280px;
  }

  .service-page__slider .service__item {
    flex: 0 0 calc(33.333% - 8px);
  }

  .service-page__slider .service__item img {
    height: 280px;
  }

  .services__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }

  .card--wide {
    grid-column: span 1;
  }

  .card--review {
    flex: 0 0 calc(33.333% - 16px);
  }

  .contacts__map {
    min-height: 400px;
  }
}
