/* Глобальные настройки */
* {
  box-sizing: border-box;
}

:root {
  --main-font: 'Inter', Arial, sans-serif;
  --base-font-size: 1rem;
  --main-line-height: 1.5;
  --red: #ed3a36;
  --link-color: #1976d2;
  --link-hover: #155b9a;
  --bg-color: #f5f5f5;
  --box-bg: #fff;
  --text-color: #111;
  --border-color: #ddd;
  --toggle-bg: #ddd;
  --toggle-dot: #fff;
  --transition: 0.3s ease;
  --animation-duration: 0.5s;

  /* Кнопки скачивания */
  --download-btn-bg: #f5f5f5;
  --download-btn-border: #ccc;
  --download-btn-text: #111;
  --download-btn-hover-bg: #e0e0e0;
  --download-btn-hover-border: #aaa;
}

[data-theme="dark"] {
  --bg-color: #121212;
  --box-bg: #1e1e1e;
  --text-color: #f0f0f0;
  --link-color: #1976d2;
  --link-hover: #155b9a;
  --border-color: #333;
  --toggle-bg: #444;
  --toggle-dot: #111;
  --download-btn-bg: #2d2d2d;
  --download-btn-border: #444;
  --download-btn-text: #f0f0f0;
  --download-btn-hover-bg: #3d3d3d;
  --download-btn-hover-border: #555;
}

/* Базовые стили */
html, body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Плавная прокрутка */
html {
  scroll-behavior: smooth;
}

/* Пустая строка перед заголовком */
.services-spacer {
  height: 0;
  margin: 0;
  padding: 0;
}

/* Для якоря — ничего не добавляем, он невидим */
.services-anchor {
  scroll-margin-top: 5px;
}

body {
  margin: 0;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: var(--main-font);
  line-height: var(--main-line-height);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

/* Типографика */
.content-text {
  margin: 0;
  padding: 0;
  white-space: normal;
  overflow-wrap: break-word;
  color: var(--text-color);
  transition: color var(--transition);
}

.content-text p {
  margin: 0 0 1em 0;
  line-height: 1.5;
}

.bold {
  font-weight: 600;
}

/* Ссылки */
.text-link,
.download-link {
  font-weight: 600;
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
  overflow-wrap: break-word;
}

.text-link:hover,
.download-link:hover {
  color: var(--link-color);
  text-decoration: underline;
}

/* Логотип */
.logo-link {
  text-decoration: none;
  font-size: 1rem;
  color: #fff;
  background: var(--red);
  font-weight: 700;
  line-height: 1em;
  padding: 0.17em 0.35em;
  border-radius: 0;
  white-space: nowrap;
  display: inline-block;
}

.logo-text {
  font-size: 1rem;
  line-height: 1;
}

.logo-link:hover,
.logo-link:focus {
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

/* Основной контейнер */
.box {
  background: var(--box-bg);
  max-width: 670px;
  width: 100%;
  margin: clamp(12px, 3vw, 40px) auto;
  box-shadow: 0 3px 16px 0 rgba(160, 40, 40, 0.1);
  padding: 1.5em;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  position: relative;
  outline: 2px solid transparent;
  outline-offset: -2px;
  overflow: hidden;
}

/* Общий контейнер аккордеона */
.expandable-section {
  margin: 1em 0;
  width: 100%;
}

/* Картинки для аккордеона */
.qr-image-container img {
  display: block;
  margin: 10px auto;
  width: 294px;
  height: 294px;
  max-width: 100%;
  object-fit: contain;
}

/* Кнопка аккордеона */
.expand-toggle {
  background: none;
  border: none;
  padding: 0.5em 0;
  font: inherit;
  color: var(--link-color);
  cursor: pointer;
  text-align: left;
  width: 100%;
  display: block;
  line-height: 1.4;
  transition: color 0.2s ease;
  position: relative;
}

.expand-toggle:hover .bold {
  text-decoration: underline;
}

/* Стрелка-индикатор */
.toggle-icon {
  font-size: 1rem;
  margin-left: 0.5em;
  transition: transform 0.3s ease;
  display: inline-block;
  transform: rotate(0deg);
}

.expand-toggle[aria-expanded="true"] .toggle-icon {
  transform: rotate(-180deg);
}

/* Содержимое аккордеона */
.expandable-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding-top: 0;
  padding-bottom: 0;
}

.expandable-content[aria-hidden="false"] {
  max-height: 500px;
  padding-top: 1em;
  padding-bottom: 1em;
}

/* Контейнер для линии и текста */
.accordion-content-wrapper {
  display: flex;
  align-items: stretch;
  gap: 1em;
  min-height: 1px;
}

/* Линия */
.accordion-line {
  width: 2px;
  min-height: 100%;
  background-color: var(--border-color);
  flex-shrink: 0;
  border-radius: 2px;
}

[data-theme="dark"] .accordion-line {
  background-color: #555;
}

/* Текст внутри аккордеона */
.accordion-content-wrapper p {
  margin: 0;
  line-height: 1.4;
  flex: 1;
}

/* Карта */
#yandex-map {
  margin: 0.1875em 0 0.1em 0;
  border-radius: 12px;
  height: 300px;
  width: 100%;
  max-width: 100%;
  background: #f0f0f0;
  overflow: hidden;
  position: relative;
}

/* Ката в темной теме */

[data-theme="dark"] #yandex-map {
  filter: invert(1) hue-rotate(180deg) brightness(1.05) contrast(1.05);
}


[data-theme="dark"] #yandex-map .ymaps-2-1-79-placemark__icon {
  filter: invert(1) hue-rotate(180deg);
}

[data-theme="dark"] .ymaps-2-1-79-balloon__content {
  filter: none !important;
  background: #1e1e1e !important;
  color: #f0f0f0 !important;
}

[data-theme="dark"] .standart-image {
  filter: brightness(0.80) contrast(0.95);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Стандартная картинка */
.standart-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 15px auto;
  border-radius: 8px !important; /* !important для приоритета */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .standart-image {
  filter: brightness(0.80) contrast(0.95);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  /* Явно сохраняем border-radius */
  border-radius: 8px !important;
}

/* Стили для подписи (без теней и границ, но с круглыми углами) */
.sign-image {
  border-radius: 8px !important; /* !important для гарантии */
  box-shadow: none !important;
  border: none !important;
  margin: 15px auto !important;
  max-width: 100%;
  width: 100%;
}

/* Ограничиваем изображение внутри .sign-image */
.sign-image img {
  max-width: 100%;
  height: auto;
  display: block;
  width: 100%;
  border-radius: 8px !important; /* Явно задаём углы для img */
}

/* Тёмная тема для подписи */
[data-theme="dark"] .sign-image {
  filter: brightness(0.90) contrast(1.0) !important;
  border-radius: 8px !important; /* Принудительно сохраняем углы */
}

/* Дополнительно: гарантируем углы для img в тёмной теме */
[data-theme="dark"] .sign-image img {
  border-radius: 8px !important;
}

/* Видео */
.video-container {
  margin: 1.5em 0;
}

.video-container video {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: block;
}

/* Кнопка меню (три полоски) */
.menu-button {
  position: absolute;
  top: calc(1.5em + 7px);
  right: 24px;
  z-index: 10;
  width: 28px;
  height: 18px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.menu-button::before,
.menu-button::after,
.menu-button span {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: #000;
  border-radius: 1px;
  transition: 0.3s ease;
}

.menu-button::before { top: 0; }
.menu-button::after { top: 8px; }
.menu-button span { bottom: 0; }

.menu-button:hover::before,
.menu-button:hover span {
  transform: translateX(-2px);
}

.menu-button:hover::after {
  opacity: 0.9;
}

[data-theme="dark"] .menu-button::before,
[data-theme="dark"] .menu-button::after,
[data-theme="dark"] .menu-button span {
  background: #fff;
}

/* Состояние: меню закрыто (бургер) */
.menu-button.is-closed::before,
.menu-button.is-closed::after,
.menu-button.is-closed span {
  transform: none;
  opacity: 1;
}

/* Состояние: меню открыто (крестик) */
.menu-button.is-open::before {
  transform: rotate(45deg) translate(3px, 3px);
}
.menu-button.is-open::after {
  opacity: 0;
}
.menu-button.is-open span {
  transform: rotate(-45deg) translate(3px, -3px);
}

/* Скрытые элементы */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* CSS для компактного аудиоплеера (дополняет основной стилистический набор) */
.audio-player {
  display: flex;
  align-items: center;
  gap: 15px; /* Отступ между кнопкой и панелью управления */
  width: 100%;
  max-width: 100%;
  margin: 20px 0; /* Вертикальные отступы */
}

.play-btn {
  flex-shrink: 0;
  padding: 10px;
  background: red;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.controls-container {
  flex-grow: 1; /* Растягивается на оставшееся пространство */
  width: 100%;
}

.player-title {
  font-size: 14px;
  color: #555;
  margin-bottom: 8px;
}

.progress-container {
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: red;
  width: 0%;
  transition: width 0.1s ease;
}


.time-and-volume {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #777;
}

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

.volume-slider {
  width: 80px;
}

svg {
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.play-btn svg {
  margin-left: 3px;
}

/* CSS для скачивания .pdf */
.pdf-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  width: 100%;
  max-width: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
}

.pdf-text {
  flex-grow: 1;
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  text-align: left;
}

.pdf-icon-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px; /* Отступ между иконкой и надписью */
}

.pdf-icon-wrapper a {
  text-decoration: none;
}

.pdf-label {
  color: red;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.pdf-icon-wrapper svg {
  fill: white !important;
  stroke: red !important;
  stroke-width: 2.5 !important;
}

.pdf-icon-wrapper svg path,
.pdf-icon-wrapper svg polyline,
.pdf-icon-wrapper svg line {
  stroke: red !important;
  fill: white !important;
}

p + .pdf-card {
  margin-top: 0.5em; /* Вместо стандартного 1em–1.2em */
}

/* Блок скачивания */
.download-section {
  margin: 1.5em 0 0 0;
  line-height: var(--main-line-height);
  font-family: var(--main-font);
}

.download-section span {
  color: var(--text-color);
}

.download-section .download-link {
  display: block;
  margin: 0.4em 0;
  padding: 0.2em 0.4em;
  max-width: max-content;
  width: fit-content;
  line-height: 1.4;
  text-decoration: none;
  color: var(--link-color);
  font-weight: 600;
  border-radius: 6px;
  background: transparent;
  transition: background 0.2s ease;
}

.download-section .download-link:hover {
  text-decoration: underline;
  background: rgba(25, 118, 210, 0.08);
}

.download-section span + .download-link,
.download-section .download-link + .download-link {
  margin-top: 1em;
}

/* Контейнер с двумя блоками */
.dual-block-container {
  display: flex;
  gap: 1em;
  margin: 1.5em 0;
  align-items: stretch;
  justify-content: space-between;
  padding: 0;
  width: 100%;
}

.photo-container {
  flex: 0 0 294px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  padding: 0;
  border-radius: 8px;
  height: 294px;
  background: transparent;
  overflow: hidden;
}

.photo-container .video-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.download-container {
  flex: 0 0 294px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.8em;
  border: none;
  padding: 0;
  background: transparent;
}

.download-container p {
  margin: 0;
  text-align: center;
  font-weight: 400;
  color: var(--text-color);
  padding: 0.8em;
  background: var(--box-bg);
  width: 100%;
}

.download-container .download-link {
  width: 100%;
  text-align: center;
  padding: 1em 1.2em;
  border: 1px solid var(--download-btn-border);
  background: var(--download-btn-bg);
  color: var(--download-btn-text);
  font-weight: 500;
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s ease;
  display: block;
}

.download-container .download-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(150, 150, 150, 0.2);
  background: var(--download-btn-hover-bg);
  border-color: var(--download-btn-hover-border);
}

.download-container .download-link + .download-link {
  border-top: none;
}

.download-container .download-link:first-child {
  border-radius: 12px;
}

.cookie-info-text {
  text-align: center;
  font-size: 0.6rem;
}

/* Переключатель темы */
.theme-toggle-wrapper {
  margin: 1.5em auto 0;
  text-align: center;
}

#theme-toggle {
  position: relative;
  width: 60px;
  height: 30px;
  background: var(--toggle-bg);
  border: none;
  border-radius: 30px;
  cursor: pointer;
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: background var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  box-sizing: border-box;
  user-select: none;
}

#theme-toggle .icon-sun,
#theme-toggle .icon-moon {
  position: relative;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

#theme-toggle .icon-sun svg {
  stroke: #fff;
  stroke-width: 2;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

#theme-toggle .icon-moon svg {
  stroke: #fff;
  stroke-width: 2;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

#theme-toggle .toggle-dot {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  background: var(--toggle-dot);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition) cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  pointer-events: none;
}

/* В ТЁМНОЙ теме — бегунок справа */
[data-theme="dark"] #theme-toggle .toggle-dot {
  transform: translateX(30px);
}

/* В СВЕТЛОЙ теме — бегунок слева */
[data-theme="light"] #theme-toggle .toggle-dot,
:root:not([data-theme="dark"]) #theme-toggle .toggle-dot {
  transform: translateX(0);
}

/* Медиа-запросы для адаптивности */
@media (min-width: 671px) {
  .content-block > :first-child {
    margin-top: 0;
  }
}

/* Выпадающее меню внутри .box */
.dropdown-menu {
  position: absolute;
  top: 60px;
  right: 23px;
  width: 150px;
  background: var(--box-bg);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 16px 0;
  transition: opacity var(--transition), transform var(--transition);
  transform: translateX(20px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--border-color);
  font-family: var(--main-font);
  font-size: 1rem;
  line-height: var(--main-line-height);
  color: var(--text-color);
}

.dropdown-menu[aria-hidden="false"] {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* Пункты списка меню */
.dropdown-list {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-top: 8px;
}

.dropdown-list li {
  margin-bottom: 8px;
}

.dropdown-list a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  display: block;
  padding: 8px 16px;
  font-size: 1rem;
  line-height: var(--main-line-height);
  transition: text-decoration var(--transition);
}

.dropdown-list a:hover {
  text-decoration: underline;
}

.dropdown-close {
  display: block;
  width: 100%;
  text-align: right;
  background: none;
  border: none;
  color: var(--link-color);
  cursor: pointer;
  font-size: 1rem;
  font-family: Arial, sans-serif;
  font-weight: 400;
  padding: 0 16px 8px 0;
  margin: 0;
  line-height: 1;
  transition: text-decoration var(--transition);
  text-decoration: none;
}

.dropdown-close:hover {
  text-decoration: underline;
  color: var(--link-color);
}


@media (max-width: 670px) {
  /* Стили для .box на мобильных */
  .box {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 1.12em 0.75em;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }

  /* Размер шрифта на мобильных */
  :root {
    --main-font-size: 1rem;
  }

  /* Визуальный отступ между якорем и заголовком */
  .services-spacer {
    height: 0.8em;
  }

  /* Позиционирование кнопки меню на мобильных */
  .menu-button {
    top: 21px;
    right: 15px;
  }

  /* Позиционирование блока выпадающего меню */
  .dropdown-menu {
    right: 12px;
  }

  /* Стили логотипа на мобильных */
  .logo-link {
    padding: 0.12em 0.25em;
  }
  
  /* Адаптация dual-block-container для мобильных */
  .dual-block-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0; /* нулевое расстояние между блоками на мобильных */
  }

  .photo-container,
  .download-container {
    width: 100%;
    max-width: 294px;
    margin: 0 auto;
    padding: 0; /* нулевые отступы */
  }

  .photo-container {
    order: 1;
    height: 294px; /* сохраняем фиксированную высоту на мобильных */
  }

  .download-container {
    order: 2;
    justify-content: center; /* выравнивание по вертикали */
    align-items: center; /* выравнивание по горизонтали */
  }

  .download-container .download-link {
    width: 100%;
    padding: 0.6em 1em;
  }
  
  /* Картинки для аккордеона */
  .qr-image-container img {
    width: 200px;
    height: 200px;
  }

  /* Универсальные стили для кнопок скачивания на мобильных */
  .download-link {
    display: block;
    width: 85%;
    margin: 0.5em auto;
    padding: 0.6em 0.8em;
    line-height: 1.4;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    transition: all 0.2s ease;
    text-align: center;
  }

  /* Ховер-эффект для кнопок на мобильных */
  .download-link:hover {
    color: var(--link-color);
    border-color: var(--link-color);
    box-shadow: 0 1px 4px rgba(25, 118, 210, 0.2);
  }

  /* Дополнительные адаптации для элементов внутри .download-section */
  .download-section .download-link {
    margin: 0.3em 0;
  }

  /* Плавающие кнопки */
  .floating-telegram-button,
  .floating-max-button,
  .floating-call-button {
    position: fixed;
    width: 56px;
    height: 56px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    pointer-events: none;
  }

  /* Класс видимости */
  .floating-button-visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
  }

  /* Анимация покачивания */
  .wiggle-animation {
    animation: wiggle 0.5s ease-in-out;
  }

  @keyframes wiggle {
    0%, 100% {
      transform: rotate(0deg);
    }
    25% {
      transform: rotate(-3deg);
    }
    75% {
      transform: rotate(3deg);
    }
  }

  /* Позиционирование кнопок — относительное к правому краю */
  .floating-telegram-button {
    right: 12px;
    bottom: 20px;
    background-image: url('https://mocrush.in/static/telegram-button.png');
  }

  .floating-max-button {
    right: 12px;
    bottom: calc(20px + 56px + 1em);
    background-image: url('https://mocrush.in/static/max-button.png');
  }

  .floating-call-button {
    right: 12px;
    bottom: calc(20px + 2 * (56px + 1em));
    background-image: url('https://mocrush.in/static/telephone-button.png');
  }

