/* Контакты: список, карта, таблица филиалов */

/* Блок 2 × 2: контакты слева, карта справа */
.contacts { display: flex; align-items: stretch; gap: 1.25rem; padding: 0 3.75rem; }
.contacts__info {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .625rem;                  /* 10 между элементами */
  padding: 1.25rem;              /* 20 */
  border: 1px solid var(--orange);
  border-radius: var(--radius);
  background-color: #fff;
}
.contact-item {
  display: flex;
  align-items: stretch;
  border-radius: .375rem;        /* 6 */
  background-color: #edf1f7;
}
/* Полоса с иконкой слева — тянется на всю высоту элемента */
.contact-item__icon {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.0625rem .9375rem;   /* 17 / 15 */
  border-radius: .375rem 0 0 .375rem;
  background-color: #dce6f0;
}
.contact-item__icon img { width: 1.5rem; height: 1.5rem; }
.contact-item__body {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;                  /* 20 */
  padding: 1.25rem;
}
.contact-item__label {
  margin: 0;
  font-size: 1rem;               /* 16 Regular uppercase */
  line-height: 1.2;
  font-weight: 400;
  text-transform: uppercase;
  color: rgba(10, 18, 38, .5);
}
.contact-item__row {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;                  /* 20 */
  margin: 0;
  font-size: 1.25rem;            /* 20 Regular */
  line-height: 1.2;
  color: #0a1226;
}
.contact-item__mark { flex: none; width: 1.5rem; height: 1.5rem; }
.contact-item__row a { color: inherit; }
.contact-item__row a:hover { color: var(--orange); }
.contact-item__mail { color: var(--orange); }
.contact-item__mail:hover { text-decoration: underline; }

/* Карта */
.contacts__map {
  position: relative;
  flex: none;
  width: 58.125rem;              /* 930 */
  align-self: stretch;
  overflow: hidden;
  border: 1px solid var(--orange);
  border-radius: var(--radius);
  background-color: #dce6f0;     /* фон, пока виджет грузится */
}
.contacts__map-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Метка на карте */
.map-pin { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.map-pin__btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-1.375rem, -3.09375rem);   /* -22 / -49.5 */
  width: 2.75rem;                                 /* 44 */
  height: 3.3125rem;                              /* 53 */
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
}
.map-pin__btn img { display: block; width: 100%; height: 100%; }
.map-pin__btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; border-radius: .25rem; }
.map-pin__card {
  position: absolute;
  top: 50%;
  left: calc(50% + 2rem);                         /* 22 (пол-метки) + 10 зазор */
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: .625rem;
  width: 17.6875rem;                              /* 283 */
  max-width: calc(100% - 1.25rem);
  padding: .625rem;
  border-radius: .625rem;
  background-color: #fff;
  box-shadow: 0 0 .625rem rgba(10, 18, 38, .2);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.map-pin.is-open .map-pin__card { opacity: 1; visibility: visible; pointer-events: auto; }
.map-pin__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 605 / 454;
  object-fit: cover;
  border-radius: .375rem;
}
.map-pin__text {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  line-height: 1.2;
  word-break: break-word;
}
.map-pin__name { font-size: .75rem; font-weight: 600; color: #0a1226; }
.map-pin__addr { font-size: .625rem; color: #0a1226; }
.map-pin__tel { font-size: .625rem; color: rgba(10, 18, 38, .5); }
.map-pin__site { font-size: .625rem; color: var(--orange); }
. .contacts__map.is-tiles { cursor: grab; }
.contacts__map.is-tiles.is-drag { cursor: grabbing; }
.tile-map__viewport {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  touch-action: pan-y;
}
.tile-map__viewport:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.tile-map__layer { position: absolute; top: 0; left: 0; will-change: transform; }
.tile-map__tile {
  position: absolute;
  width: 256px;
  height: 256px;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}
.tile-map__ctrl {
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  border-radius: .5rem;
  box-shadow: 0 0 .625rem rgba(10, 18, 38, .2);
}
.tile-map__btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background-color: #fff;
  color: #0a1226;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}
.tile-map__btn:hover { background-color: #f2f5fa; }
.tile-map__btn:disabled { color: rgba(10, 18, 38, .3); cursor: default; }
.tile-map__logo { position: absolute; left: 0; bottom: 0; z-index: 3; display: block; }
.tile-map__logo img { display: block; width: 5.5rem; height: 3rem; }
.tile-map__open {
  position: absolute;
  right: .75rem;
  bottom: .75rem;
  z-index: 3;
  padding: .375rem .75rem;
  border-radius: .375rem;
  background-color: #fff;
  box-shadow: 0 0 .625rem rgba(10, 18, 38, .2);
  font-size: .75rem;
  color: #0a1226;
}
.tile-map__open:hover { color: var(--orange); }
.tile-map__hint {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1.25rem;
  background-color: rgba(10, 18, 38, .5);
  color: #fff;
  font-size: 1rem;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}
.tile-map__hint.is-on { opacity: 1; visibility: visible; }
.contacts__map.is-tiles .contacts__pin-btn {
  top: 0;
  left: 0;
  transform: translate(calc(var(--pin-x) - 1.375rem), calc(var(--pin-y) - 3.09375rem));
}
.contacts__map.is-tiles .contacts__pin-card {
  top: var(--pin-y);
  left: calc(var(--pin-x) + 2rem);
}

/* Таблица филиалов */
.branch-table-wrap { padding: 0 3.75rem; }
.branch-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  color: #0a1226;
  text-align: left;
}
.branch-table__th,
.branch-table__cell {
  border-bottom: .375rem solid transparent;
  background-clip: padding-box;
  vertical-align: middle;
}
.branch-table__row:last-child > * { border-bottom: 0; }
.branch-table__row[hidden] { display: none; }
.branch-table__th {
  padding: 2.5rem 0;             /* строка заголовка 104 = 40 + 24 + 40 */
  background-color: #dce6f0;
  font-size: 1.25rem;            /* 20 Semibold uppercase */
  line-height: 1.2;
  font-weight: 600;
  text-transform: uppercase;
}
.branch-table__cell { padding: 1.875rem 0; background-color: #fdfffe; }
/* Колонки макета: 630 | 540 | 270 | остаток, поля строки 30, зазор 30 */
.branch-table__col--name { width: 41.25rem; }
/* 630 + 30 зазора */
.branch-table__col--addr { width: 35.625rem; }
/* 540 + 30 */
.branch-table__col--tel { width: 18.75rem; }
/* 270 + 30 */
.branch-table__th:first-child,
.branch-table__cell:first-child { padding-left: 1.875rem; }
.branch-table__th:last-child,
.branch-table__cell:last-child { padding-right: 1.875rem; }
.branch-table__th:not(:last-child),
.branch-table__cell:not(:last-child) { padding-right: 1.875rem; }
.branch-table__name { display: flex; align-items: center; gap: 1.25rem; }
.branch-table__photo {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 10rem;                  /* 160 × 110 */
  height: 6.875rem;
  border-radius: var(--radius);
  background-color: #dce6f0;
}
.branch-table__photo img { width: 3.125rem; height: 3.125rem; }
.branch-table__title { min-width: 0; font-size: 1.625rem; line-height: 1.2; font-weight: 600; }
.branch-table__title,
.branch-table__addr,
.branch-table__tel,
.branch-table__mail { overflow-wrap: anywhere; }
.branch-table__addr { font-size: 1.5rem; line-height: 1.2; }
.branch-table__tel { font-size: 1.5rem; line-height: 1.2; color: rgba(10, 18, 38, .5); }
.branch-table__tel a { color: inherit; }
.branch-table__tel a:hover { color: var(--orange); }
.branch-table__mail { font-size: 1.5rem; line-height: 1.2; font-weight: 600; }
.branch-table__mail a { color: var(--orange); }
.branch-table__mail a:hover { text-decoration: underline; }
@media (max-width: 1279px) {
  .contacts { gap: 1rem; padding: 0 1rem; }
  .contacts__info { padding: 1rem; gap: .5rem; }
  .contact-item__icon { padding: .875rem .75rem; }
  .contact-item__icon img { width: 1.25rem; height: 1.25rem; }
  .contact-item__body { gap: .75rem; padding: 1rem; }
  .contact-item__label { font-size: .8125rem; }
  .contact-item__row { gap: .75rem; font-size: .9375rem; }
  .contact-item__mark { width: 1.25rem; height: 1.25rem; }
  .contacts__map { width: 38%; }
  /* карточка встаёт по центру метки — мостик не нужен */
  .map-pin__card { top: 50%; left: 50%; transform: translate(-50%, -50%); }
  .contacts__map.is-tiles .contacts__pin-card { top: 50%; left: 50%; transform: translate(-50%, -50%); }
  .branch-table-wrap { padding: 0 1rem; }
  .branch-table__th,
  .branch-table__cell { border-bottom: 6px solid transparent; }
  .branch-table__th { padding: 1.25rem 0; font-size: .875rem; }
  .branch-table__cell { padding: 1rem 0; }
  .branch-table__th:first-child,
  .branch-table__cell:first-child { padding-left: 1.25rem; }
  .branch-table__th:last-child,
  .branch-table__cell:last-child { padding-right: 1.25rem; }
  .branch-table__th:not(:last-child),
  .branch-table__cell:not(:last-child) { padding-right: 1.25rem; }
  .branch-table__col--name { width: 34%; }
  .branch-table__col--addr { width: 29%; }
  .branch-table__col--tel { width: 17%; }
  .branch-table__name { gap: .75rem; }
  .branch-table__photo { width: 6rem; height: 4.25rem; }
  .branch-table__photo img { width: 2rem; height: 2rem; }
  .branch-table__title { font-size: 1.0625rem; }
  .branch-table__addr,
  .branch-table__tel,
  .branch-table__mail { font-size: .9375rem; }
}
@media (max-width: 1024px) {
  .map-pin__card {
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    gap: 10px;
    width: 150px;
    max-width: calc(100% - 20px);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(10, 18, 38, .2);
  }
  /* правило режима тайлов специфичнее одиночного класса — гасим и его */
  .contacts__map.is-tiles .contacts__pin-card { top: 50%; left: 10px; transform: translateY(-50%); }
  .map-pin__photo { border-radius: 6px; }
  .map-pin__text { gap: 4px; }
  .map-pin__name { font-size: 12px; }
  .map-pin__addr { font-size: 10px; }
  .map-pin__tel { font-size: 10px; }
  .map-pin__site { font-size: 10px; }
}
@media (max-width: 767px) {
  .contacts { flex-direction: column; align-items: stretch; gap: 20px; padding: 0 20px; }
  .contacts__info { padding: 20px; gap: 10px; }
  .contact-item__icon { padding: 17px 15px; }
  .contact-item__icon img { width: 20px; height: 20px; }
  .contact-item__body { gap: 15px; padding: 20px; }
  .contact-item__label { font-size: 12px; }
  .contact-item__row { gap: 20px; font-size: 14px; }
  .contact-item__mark { width: 20px; height: 20px; }
  .contacts__map { width: 100%; height: 320px; align-self: auto; }
  .branch-table-wrap { padding: 0 20px; }
  .branch-table,
  .branch-table tbody,
  .branch-table__row,
  .branch-table__cell { display: block; }
  .branch-table colgroup { display: none; }
  .branch-table__row--head { display: none; }
  .branch-table__th,
  .branch-table__cell { border-bottom: 0; }
  .branch-table__row {
    padding: 30px;
    background-color: #fdfffe;
    border-radius: var(--radius);
  }
  .branch-table__row + .branch-table__row { margin-top: 6px; }
  .branch-table__cell,
  .branch-table__cell:first-child,
  .branch-table__cell:last-child,
  .branch-table__cell:not(:last-child) { padding: 0; background: none; }
  .branch-table__cell + .branch-table__cell { margin-top: 10px; }
  .branch-table__name { display: flex; flex-direction: column; align-items: stretch; gap: 20px; }
  .branch-table__photo { width: 100%; height: 110px; }
  .branch-table__photo img { width: 50px; height: 50px; }
  .branch-table__title { font-size: 16px; }
  .branch-table__addr,
  .branch-table__tel,
  .branch-table__mail { font-size: 14px; }
}

/* Карточка «Контактная информация» */
.contact-item--job .contact-item__body { gap: .625rem; }
.contact-item__pair { display: flex; flex-wrap: wrap; column-gap: 5.625rem; row-gap: .625rem; }
@media (max-width: 768px) {
  .contact-item__pair { flex-direction: column; gap: .625rem; }
}
.contact-item__value { font-size: 1.25rem; line-height: 1.2; color: #0a1226; }
.contact-item__value a { color: inherit; }
.contact-item__value a:hover { color: var(--orange); }
.contact-item__value .contact-item__mail { color: var(--orange); }

/* Мобильная (< 768): макет 591:11676 и 641:14865 */
@media (max-width: 767px) {
  .contact-item--job .contact-item__body { gap: 10px; }
  .contact-item__value { font-size: 14px; }
  .contact-item__pair { gap: 10px; }
}

/* Страница «Руководство» (management.html) */
.contact-item--lead .contact-item__body { gap: 1.0625rem; }
