/* ==========================================================================
   Fonts
========================================================================== */

@font-face {
  font-family: 'Druk Wide Cyr';
  src:
    url('/wp-content/themes/new/fonts/DrukWideCyr-Bold.woff2') format('woff2'),
    url('/wp-content/themes/new/fonts/DrukWideCyr-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src:
    url('/wp-content/themes/new/fonts/Gilroy-Regular.woff2') format('woff2'),
    url('/wp-content/themes/new/fonts/Gilroy-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src:
    url('/wp-content/themes/new/fonts/Gilroy-Medium.woff2') format('woff2'),
    url('/wp-content/themes/new/fonts/Gilroy-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src:
    url('/wp-content/themes/new/fonts/Gilroy-Semibold.woff2') format('woff2'),
    url('/wp-content/themes/new/fonts/Gilroy-Semibold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src:
    url('/wp-content/themes/new/fonts/Gilroy-Bold.woff2') format('woff2'),
    url('/wp-content/themes/new/fonts/Gilroy-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ==========================================
   КАРТА ПРИСУТСТВИЯ
   Desktop + mobile
   ========================================== */

.section_maps {
  --presence-green: #00df50;
  --presence-text: #ffffff;
  --presence-muted: #d0d6d2;

  --presence-font-main: 'Gilroy', Arial, sans-serif;
  --presence-font-title: 'Druk Wide Cyr', 'Arial Black', sans-serif;

  position: relative;
  color: var(--presence-text);

  font-family: var(--presence-font-main);
}

/* Не изменяем общий .container темы. */

.section_maps .block_maps,
.section_maps .block_maps * {
  box-sizing: border-box;
}

.section_maps .block_maps {
  position: relative;
  isolation: isolate;

  display: grid;
  grid-template-columns: minmax(0, 44%) minmax(0, 56%);
  align-items: center;
  gap: 0;

  width: 100%;
  min-height: clamp(390px, 40vw, 680px);
  margin: 0;
  padding: clamp(24px, 3vw, 44px) 0;
}

/* ==========================================
   ЛЕВАЯ КОЛОНКА
   ========================================== */

.section_maps .presence-copy {
  position: relative;
  z-index: 3;

  display: block;
  min-width: 0;
  margin: 0;
  padding: 0 clamp(14px, 2vw, 32px) 0 0;

  font-family: var(--presence-font-main);
}

.section_maps .presence-title {
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 0;

  color: var(--presence-text);

  font-family: var(--presence-font-title);
  font-size: clamp(23px, 2.5vw, 42px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-transform: uppercase;

  overflow-wrap: normal;
}

.section_maps .presence-title-main,
.section_maps .presence-title-accent {
  display: block;

  font-family: var(--presence-font-title);
  font-weight: 700;
}

.section_maps .presence-title-main {
  color: var(--presence-text);
}

.section_maps .presence-title-accent {
  color: var(--presence-green);
}

.section_maps .presence-description {
  display: block;
  max-width: 34ch;
  margin: 16px 0 0;
  padding: 0;

  color: var(--presence-muted);

  font-family: var(--presence-font-main);
  font-size: clamp(12px, 1.03vw, 17px);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.015em;
  text-transform: none;
}

/* Шрифт текста, если ACF выводит вложенные абзацы. */
.section_maps .presence-description p {
  font-family: var(--presence-font-main);
}

/* ==========================================
   ЗЕЛЁНАЯ КНОПКА
   ========================================== */

.section_maps .presence-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 104px;
  min-height: 42px;
  margin: 26px 0 0;
  padding: 12px 32px;
  border: 0;
  border-radius: 8px;
  background: var(--presence-green);
  color: #03230f;
  box-shadow: none;
  font-family: var(--presence-font-main);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

@media (hover: hover) {
  .section_maps .presence-button:hover {
    background: #35ed76;
    transform: translateY(-1px);
  }
}

.section_maps .presence-button:focus-visible,
.section_maps .universe button:focus-visible,
.section_maps .universe canvas:focus-visible {
  outline: 2px solid #98ffb9;
  outline-offset: 5px;
}

/* ==========================================
   ОБЛАСТЬ ГЛОБУСА
   ========================================== */

.section_maps .universe {
  /* Раньше было 83% — немного уменьшаем. */
  --diameter: 78%;

  position: relative;
  isolation: isolate;
  container-type: inline-size;

  display: block;
  width: 100%;
  height: clamp(340px, 36vw, 610px);
  min-width: 0;

  margin: 0;
  padding: 0;

  font-family: var(--presence-font-main);
}

.section_maps .universe [hidden] {
  display: none !important;
}

/* ==========================================
   КНОПКИ LATAM / MENA
   ========================================== */

.section_maps .region-word {
  position: absolute;

  /* Выше canvas: названия получают клики. */
  z-index: 6;

  display: block;
  width: auto;
  min-width: 0;
  min-height: 0;

  margin: 0;
  padding: 0;

  border: 0;
  border-radius: 0;

  background: transparent;
  color: transparent;
  box-shadow: none;

  font-family: var(--presence-font-title);
  font-size: 12.5cqw;
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.065em;
  text-transform: uppercase;

  -webkit-text-stroke: 1px #45534a;
  -webkit-text-fill-color: transparent;

  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  transition: -webkit-text-stroke-color 0.25s ease;
}

.section_maps .region-word-latam {
  top: 6%;
  left: 0;
}

.section_maps .region-word-mena {
  /* Сдвиг влево относительно правого края. */
  right: 5%;
  bottom: 6%;
}

.section_maps .region-word[aria-pressed="true"] {
  -webkit-text-stroke-color: #8c9e92;
}

@media (hover: hover) {
  .section_maps .region-word:hover {
    -webkit-text-stroke-color: #b3c5b9;
  }
}

.section_maps .region-word:focus-visible {
  outline: 2px solid var(--presence-green);
  outline-offset: 6px;
}

/* ==========================================
   CANVAS
   ========================================== */

.section_maps .globe-wrap {
  position: absolute;
  z-index: 2;

  top: 50%;
  left: 50%;

  display: block;
  width: var(--diameter);
  aspect-ratio: 1;

  margin: 0;
  padding: 0;

  transform: translate(-50%, -50%);
}

.section_maps #globe {
  display: block;
  width: 100%;
  height: 100%;

  margin: 0;
  padding: 0;

  border: 0;
  border-radius: 50%;

  background: transparent;

  clip-path: circle(48.5%);
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}

.section_maps #globe.is-dragging {
  cursor: grabbing;
}

/* ==========================================
   ПОДПИСИ СТРАН
   ========================================== */

.section_maps .country-orbit {
  position: absolute;
  z-index: 5;
  inset: 0;

  margin: 0;
  padding: 0;

  pointer-events: none;
}

.section_maps .country-label {
  position: absolute;
  top: 0;
  left: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;

  width: auto;
  min-width: 0;
  min-height: 23px;

  margin: 0;
  padding: 5px 8px;

  border: 1px solid #71807880;
  border-radius: 4px;

  background: #111a15f2;
  color: #dde5df;
  box-shadow: none;

  font-family: var(--presence-font-main);
  font-size: clamp(9px, 1.65cqw, 12px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-transform: none;

  transform: translate(-50%, -50%);

  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.section_maps .country-code {
  color: #99a99e;

  font-family: var(--presence-font-main);
  font-size: 0.7em;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.section_maps .country-label.is-active {
  border-color: #28e86c;
  background: #0c3018;
  color: #e2ffe9;
  box-shadow: 0 0 12px #00ed5826;
}

.section_maps .country-label.is-active .country-code {
  color: #84ffa6;
}

@media (hover: hover) {
  .section_maps .country-label:hover {
    border-color: #bccec1;
  }
}

/* ==========================================
   СОЕДИНИТЕЛЬНАЯ ЛИНИЯ
   ========================================== */

.section_maps .globe-connector {
  position: absolute;
  z-index: 4;
  inset: 0;

  display: block;
  width: 100%;
  height: 100%;

  margin: 0;
  padding: 0;

  overflow: visible;
  opacity: 0;
  pointer-events: none;
}

.section_maps .globe-connector.is-visible {
  opacity: 1;
}

.section_maps .globe-connector path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section_maps .globe-connector-line {
  stroke: #8affaa;
  stroke-width: 1.2;
}

.section_maps .globe-connector-glow {
  stroke: #00ed58;
  stroke-width: 4;
  opacity: 0.4;
  filter: blur(2px);
}

.section_maps .globe-connector-point {
  fill: #d9ffe3;
  stroke: #39f279;
  stroke-width: 1.5;
}

/* ==========================================
   ЗАГРУЗЧИК И FALLBACK
   ========================================== */

.section_maps .globe-loader {
  position: absolute;
  z-index: 7;

  top: 48%;
  left: 50%;

  margin: 0;
  padding: 7px 12px;

  border-radius: 5px;

  background: #102018ee;
  color: #cbd8cf;

  font-family: var(--presence-font-main);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;

  transform: translateX(-50%);
}

.section_maps .globe-fallback {
  position: absolute;
  z-index: 7;
  inset: 20% 8%;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;

  margin: 0;
  padding: 24px;

  border: 1px solid #ffffff20;
  border-radius: 16px;

  background: #102018;
  color: #c6fbd5;

  font-family: var(--presence-font-main);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.section_maps .globe-fallback strong {
  font-family: var(--presence-font-main);
  font-size: 24px;
  font-weight: 700;
}

.section_maps .globe-hint {
  /* В макете подсказки под глобусом нет. */
  display: none;

  font-family: var(--presence-font-main);
}

.section_maps .universe[data-ready="fallback"] .globe-wrap,
.section_maps .universe[data-ready="fallback"] .country-orbit,
.section_maps .universe[data-ready="fallback"] .globe-connector,
.section_maps .universe[data-ready="fallback"] .globe-hint {
  display: none;
}

/* ==========================================
   ПЛАНШЕТ / НЕБОЛЬШОЙ DESKTOP
   ========================================== */

@media (min-width: 761px) and (max-width: 1024px) {
  .section_maps .block_maps {
    grid-template-columns: minmax(0, 43%) minmax(0, 57%);
    min-height: 370px;
    padding-block: 26px;
  }

  .section_maps .presence-title {
    font-size: clamp(22px, 2.65vw, 29px);
  }

  .section_maps .presence-description {
    font-size: 12px;
  }

  .section_maps .presence-button {
    min-height: 38px;
    padding: 10px 20px;
    font-size: 12px;
  }

  .section_maps .universe {
    height: 330px;
  }
}

/* ==========================================
   МОБИЛЬНАЯ ВЕРСИЯ

   Порядок:
   заголовок → описание → глобус → кнопка.
   ========================================== */

@media (max-width: 760px) {
  .section_maps .block_maps {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    align-items: start;
    gap: 0;

    min-height: 0;
    margin: 0;
    padding: 38px 0 36px;
  }

  /*
   Убираем только визуальную обёртку текстовой колонки.
   Заголовок, описание и кнопка становятся grid-элементами.
   PHP и обработчик модалки остаются прежними.
  */
  .section_maps .presence-copy {
    display: contents;
  }

  .section_maps .presence-title {
    grid-column: 1;
    grid-row: 1;

    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;

    font-size: clamp(22px, 5.4vw, 34px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.04em;

    /* Регистр берётся из текста ACF. */
    text-transform: none;
  }

  .section_maps .presence-title-main,
  .section_maps .presence-title-accent {
    display: block;
  }

  /*
   На телефоне убираем принудительные переносы ACF.
   Текст переносится естественно по ширине экрана.
  */
  .section_maps .presence-title br,
  .section_maps .presence-description br {
    display: none;
  }

  .section_maps .presence-description {
    grid-column: 1;
    grid-row: 2;

    width: 100%;
    max-width: 43ch;

    margin: 17px 0 0;
    padding: 0;

    font-size: clamp(14px, 3.6vw, 17px);
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: -0.02em;
  }

  .section_maps .universe {
    /*
     На мобильном глобус крупнее относительно колонки,
     как на втором скриншоте.
    */
    --diameter: 94%;

    grid-column: 1;
    grid-row: 3;
    justify-self: center;

    width: 100%;
    max-width: 520px;
    height: auto;
    aspect-ratio: 1 / 1.08;
    min-width: 0;

    margin: 20px 0 0;
    padding: 0;
  }

  .section_maps .globe-wrap {
    top: 51%;
    left: 50%;
  }

  .section_maps .region-word {
    font-size: 15cqw;
    line-height: 0.88;
    letter-spacing: -0.065em;
    -webkit-text-stroke-width: 1px;
  }

  .section_maps .region-word-latam {
    top: 2%;
    left: 0;
  }

  .section_maps .region-word-mena {
    right: 2%;
    bottom: 1%;
  }

  .section_maps .country-label {
    min-height: 22px;
    gap: 4px;
    padding: 4px 6px;

    font-size: clamp(9px, 2.5cqw, 12px);
    border-radius: 3px;
  }

  .section_maps .country-code {
    font-size: 0.65em;
  }

  .section_maps .presence-button {
    grid-column: 1;
    grid-row: 4;
    justify-self: stretch;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-width: 0;
    min-height: 52px;

    margin: 22px 0 0;
    padding: 14px 22px;

    border-radius: 14px;

    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
  }

  .section_maps .globe-loader {
    font-size: 11px;
  }

  .section_maps .globe-fallback {
    inset: 19% 5%;
    padding: 18px;
    font-size: 13px;
  }
}

/* ==========================================
   УЗКИЕ ТЕЛЕФОНЫ
   ========================================== */

@media (max-width: 360px) {
  .section_maps .block_maps {
    padding-top: 30px;
    padding-bottom: 30px;
  }

  .section_maps .presence-title {
    font-size: 21px;
  }

  .section_maps .presence-description {
    font-size: 13px;
  }

  .section_maps .universe {
    margin-top: 18px;
  }

  .section_maps .country-label {
    gap: 3px;
    padding: 4px 5px;
    font-size: 9px;
  }

  .section_maps .presence-button {
    min-height: 48px;
    margin-top: 18px;
    font-size: 16px;
    border-radius: 12px;
  }
}

/* ==========================================
   ДОСТУПНОСТЬ
   ========================================== */

@media (prefers-reduced-motion: reduce) {
  .section_maps .presence-button,
  .section_maps .universe *,
  .section_maps .universe *::before,
  .section_maps .universe *::after {
    transition: none !important;
    animation: none !important;
  }
}