/* ==========================================================================
   Спільний модуль карти (BRANCH-D / CONT-D)
   Використовується віджетами «BRANCH — Філії» та «CONT-D — Як нас знайти».
   iframe підставляє js/nd-map.js — лише після скролу до карти або кліку.
   ========================================================================== */

.nd-map {
  --nd-map-h: 420px;
  --nd-map-card: #faf4e8;
  --nd-map-terra: #c57858;
  --nd-map-terra-d: #8e5740;
  --nd-map-line: rgba(46, 37, 32, 0.12);

  position: relative;
  height: var(--nd-map-h);
  border: 1px solid var(--nd-map-line);
  border-radius: 20px;
  overflow: hidden;
  background: #e8e0d2 repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.5) 0 12px,
    rgba(255, 255, 255, 0) 12px 24px
  );
}

.nd-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Кнопка-заглушка до завантаження карти */
.nd-map__load {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--nd-map-terra-d);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.nd-map__load::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 260px;
  max-width: 80%;
  height: 56px;
  border-radius: 999px;
  background: var(--nd-map-card);
  box-shadow: 0 10px 30px -12px rgba(46, 37, 32, 0.4);
  transition: background 0.2s ease;
}
.nd-map__load:hover::before { background: #fff; }
.nd-map__load > * { position: relative; }
.nd-map__load:focus-visible {
  outline: 2px solid var(--nd-map-terra-d);
  outline-offset: -6px;
}
.nd-map__icon { display: inline-flex; }
.nd-map.is-loaded .nd-map__load { display: none; }

/* Кнопка «Прокласти маршрут» */
.nd-map__route {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 13px 28px;
  border: 1px solid var(--nd-map-terra, #c57858);
  border-radius: 999px;
  color: var(--nd-map-terra-d, #8e5740);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.nd-map__route:hover {
  background: var(--nd-map-terra, #c57858);
  color: #fff;
}
.nd-map__route:focus-visible {
  outline: 2px solid var(--nd-map-terra-d, #8e5740);
  outline-offset: 3px;
}

@media (max-width: 767px) {
  .nd-map {
    --nd-map-h: 300px;
    border-radius: 16px;
  }
  .nd-map__route {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nd-map__load::before,
  .nd-map__route { transition: none; }
}
