/* ============================================================
   КАРТОЧКИ КОНТАКТОВ (contacts-cards)
   Изолированный слой: правила действуют только при body.contacts-cards.
   Основную contacts.html не затрагивает.
   ============================================================ */

/* Верхний блок: факты-доверие */
.contacts-cards .contacts-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 24px;
  border: 1px solid rgba(6, 8, 10, 0.10);
  border-radius: 0;
  background: rgba(6, 8, 10, 0.10);
  overflow: hidden;
}
.contacts-cards .contacts-fact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 15px 20px;
  background: var(--paper-2, #fff);
}
.contacts-cards .contacts-fact b {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.contacts-cards .contacts-fact span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.contacts-cards .contacts-addresses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-block: 12px 24px;
  scroll-margin-top: 80px;
}
.contacts-addresses article {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  background: var(--paper-2, #fff);
}
.contacts-addresses article > span {
  color: var(--muted);
  font: 750 10px/1.2 var(--mono);
  letter-spacing: .07em;
}
.contacts-addresses article :is(h2, p) { margin: 0; }
.contacts-addresses article h2 { font-size: clamp(20px, 3vw, 30px); }
.contacts-addresses article p { color: var(--muted); }
.contacts-addresses article a {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-top: 2px;
  border-top: 1px solid var(--line);
  font-weight: 750;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (max-width: 620px) {
  .contacts-cards .contacts-addresses { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .contacts-addresses article { padding: 12px 14px 2px; }
}

/* Сетка во всю ширину, легче и просторнее */
.contacts-cards .contacts-places {
  max-width: none;
  gap: 14px;
  padding-left: 28px;
  padding-right: 28px;
  padding-top: 10px;
}
.contacts-cards .place-card {
  min-height: 268px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  box-shadow: none;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.contacts-cards .place-card:hover {
  transform: none;
  border-color: var(--ink);
  box-shadow: 0 12px 30px -24px rgba(6, 8, 10, 0.5);
}

/* Крупное прямоугольное фото слева */
.contacts-cards .place-card__photo {
  width: clamp(230px, 40%, 400px);
}

/* Тело — просторнее */
.contacts-cards .place-card__body {
  gap: 12px;
  padding: 26px 28px;
  justify-content: flex-start;
}
.contacts-cards .place-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.contacts-cards .place-card__label { margin: 0; }
.contacts-cards .place-card__body h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

/* Плашка «5.0 · Яндекс» */
.contacts-cards .pc-rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 5px 10px 5px 8px;
  border: 1px solid rgba(6, 8, 10, 0.12);
  border-radius: 0;
  background: #fff;
  font: 800 12.5px/1 var(--sans);
  white-space: nowrap;
}
.contacts-cards .pc-rating svg { width: 13px; height: 13px; fill: #f5a623; }
.contacts-cards .pc-rating span {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* Инфо-строки с иконками */
.contacts-cards .pc-info {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
}
.contacts-cards .pc-info li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--ink);
}
.contacts-cards .pc-info svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contacts-cards .pc-info circle { fill: none; }
.contacts-cards .pc-info a { color: var(--ink); font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; }
.contacts-cards .pc-info a:hover { color: var(--cas); }

/* Действия: маршрут + соцсети */
.contacts-cards .pc-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
}
.contacts-cards .pc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 0;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}
.contacts-cards .pc-btn svg {
  width: 17px; height: 17px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.contacts-cards .pc-btn--route { background: var(--ink); color: #fff; }
.contacts-cards .pc-btn--route:hover { background: #000; }

/* Соцсети — квадратные иконки, бренд-цвет на hover */
.contacts-cards .pc-soc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: none;
  border: 1px solid rgba(6, 8, 10, 0.16);
  border-radius: 0;
  color: var(--ink);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.contacts-cards .pc-soc svg { width: 20px; height: 20px; }
.contacts-cards .pc-soc--wa svg,
.contacts-cards .pc-soc--tg svg { fill: currentColor; stroke: none; }
.contacts-cards .pc-soc--ig svg { fill: none; stroke: currentColor; stroke-width: 2; }
.contacts-cards .pc-soc--ig .ig-dot { fill: currentColor; stroke: none; }
.contacts-cards .pc-soc--wa:hover { color: #25d366; border-color: #25d366; background: rgba(37, 211, 102, 0.08); }
.contacts-cards .pc-soc--tg:hover { color: #2aabee; border-color: #2aabee; background: rgba(42, 171, 238, 0.08); }
.contacts-cards .pc-soc--ig:hover { color: #e1306c; border-color: #e1306c; background: rgba(225, 48, 108, 0.08); }
.contacts-cards .pc-soc:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Десктоп-дефолты для новых элементов аккордеона (на десктопе не видны/раскрыты) */
.contacts-cards .pc-toggle { display: none; }
.contacts-cards .pc-chev { display: none; }
.contacts-cards .pc-fold { display: flex; flex-direction: column; flex: 1; }
.contacts-cards .pc-fold-inner { display: flex; flex-direction: column; gap: 12px; flex: 1; }

/* Десктоп: показываем только «Будем рады видеть вас», без скролла */
@media (min-width: 541px) {
  .contacts-cards .contacts-hero__sub {
    display: block; margin-top: 12px; max-width: 44ch;
    color: var(--muted); font-size: 16px; line-height: 1.45;
  }
  .contacts-cards .contacts-hero { padding-top: 4px; padding-bottom: 14px; }
  .contacts-cards .place-card { min-height: 256px; }
  .contacts-cards .place-card__photo img { object-position: center 42%; }
}

/* Планшет / мобильный */
@media (max-width: 760px) {
  .contacts-cards .place-card { min-height: 220px; }
}
@media (max-width: 640px) {
  .contacts-cards .contacts-facts { grid-template-columns: 1fr; }
  .contacts-cards .contacts-fact { flex-direction: row; align-items: baseline; gap: 10px; }
  .contacts-cards .contacts-fact b { flex: none; min-width: 96px; }
}

/* ── Мобильный аккордеон: плитки-баннеры, тап разворачивает ── */
@media (max-width: 540px) {
  .contacts-cards .contacts-facts { display: none; }      /* короче ради «одного экрана» */
  body.contacts-cards .contacts-places { gap: 8px; padding: 12px 14px 14px; }
  body.contacts-cards .contacts-hero { padding-top: 8px; padding-bottom: 6px; }
  .contacts-cards .contacts-hero__sub { margin-top: 8px; font-size: 14px; }

  .contacts-cards .place-card {
    position: relative;
    flex-direction: column;
    min-height: 0;
    border-radius: 0;
    overflow: hidden;
  }
  /* фото — прямоугольный баннер с затемнением */
  .contacts-cards .place-card__photo { position: relative; width: 100%; height: 108px; align-self: auto; }
  .contacts-cards .place-card__photo::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(6,8,10,0) 28%, rgba(6,8,10,.42) 62%, rgba(6,8,10,.82) 100%);
  }

  /* тап-кнопка поверх фото */
  .contacts-cards .pc-toggle {
    display: block;
    position: absolute; top: 0; left: 0; right: 0; height: 108px;
    z-index: 4; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer;
  }
  .contacts-cards .pc-chev {
    display: flex; align-items: center; justify-content: center;
    position: absolute; right: 12px; bottom: 12px;
    width: 30px; height: 30px; background: transparent;
    transition: transform .3s ease;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.5));
  }
  .contacts-cards .pc-chev::before {
    content: ""; display: block;
    width: 13px; height: 13px; margin-top: -4px;
    border-right: 2.5px solid #fff; border-bottom: 2.5px solid #fff;
    transform: rotate(45deg);
  }
  .contacts-cards .place-card.is-open .pc-chev { transform: rotate(180deg); }

  /* подписи поверх фото */
  .contacts-cards .place-card__top {
    position: absolute; top: 12px; left: 14px; right: 14px; z-index: 5;
    align-items: flex-start; pointer-events: none;
  }
  .contacts-cards .place-card__label { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.55); }
  .contacts-cards .place-card__body h2 {
    position: absolute; left: 14px; right: 52px; top: 66px; z-index: 5;
    color: #fff; font-size: 18px; line-height: 1.1; pointer-events: none;
    text-shadow: 0 1px 6px rgba(0,0,0,.6);
  }
  .contacts-cards .pc-rating { background: rgba(255,255,255,.94); }

  /* тело: сворачиваемая часть под фото */
  .contacts-cards .place-card__body { padding: 0; gap: 0; display: block; }
  .contacts-cards .pc-fold {
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows .32s ease;
  }
  .contacts-cards .pc-fold-inner {
    overflow: hidden; min-height: 0;
    display: flex; flex-direction: column; gap: 12px;
    padding: 0 16px;
  }
  .contacts-cards .place-card.is-open .pc-fold { grid-template-rows: 1fr; }
  .contacts-cards .place-card.is-open .pc-fold-inner { padding: 14px 16px 16px; }

  /* кнопки действий прямоугольниками */
  .contacts-cards .pc-actions { flex-wrap: wrap; gap: 8px; margin-top: 0; padding-top: 2px; }
  .contacts-cards .pc-btn { flex: 1 1 100%; }
  .contacts-cards .pc-soc { flex: 1 1 0; width: auto; height: 50px; border-radius: 0; }
}

/* ── Футер в стиле «минимал-техно» (десктоп): без телефонов, с живым статусом ── */
.contacts-cards .lab-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin: 28px 0 0;
  padding: 16px clamp(18px, 3vw, 40px);
  background: var(--rail, #0c1114);
  color: rgba(255, 255, 255, 0.82);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  position: relative;
  overflow: hidden;
}
.contacts-cards .lab-footer::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 64px);
  pointer-events: none;
}
.contacts-cards .lab-footer__cell { position: relative; z-index: 1; display: flex; align-items: center; }
.contacts-cards .lab-footer__brand { gap: 12px; }
.contacts-cards .lab-footer__mark {
  font: 800 18px/1 var(--sans);
  letter-spacing: 0.04em;
  color: #fff;
}
.contacts-cards .lab-footer__tag {
  font: 700 9.5px/1.3 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
/* статус по центру */
.contacts-cards .lab-footer__status { justify-content: center; gap: 9px; }
.contacts-cards .lab-footer__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
}
.contacts-cards .lab-footer__status.is-open .lab-footer__dot {
  background: #23c56a;
  animation: labPulse 2.4s ease-out infinite;
}
@keyframes labPulse {
  0% { box-shadow: 0 0 0 0 rgba(35, 197, 106, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(35, 197, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(35, 197, 106, 0); }
}
.contacts-cards .lab-footer__state {
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}
/* координаты + часы справа */
.contacts-cards .lab-footer__geo { justify-content: flex-end; gap: 14px; }
.contacts-cards .lab-footer__coords {
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
}
.contacts-cards .lab-footer__clock {
  font: 800 15px/1 var(--mono);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.contacts-cards .lab-footer__tz {
  font: 700 9.5px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
/* На мобильном футер прячем — там док и правило «один экран» */
@media (max-width: 540px) {
  .contacts-cards .lab-footer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .contacts-cards .lab-footer__status.is-open .lab-footer__dot { animation: none; }
}

/* ── Мета-строка в hero (заполняет верх, острая, mono) ── */
.contacts-cards .contacts-hero__meta {
  list-style: none;
  margin: 20px 0 0;
  padding: 15px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 9px 26px;
  border-top: 1px solid var(--line-strong);
}
.contacts-cards .contacts-hero__meta li {
  position: relative;
  font: 700 11.5px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.contacts-cards .contacts-hero__meta li + li::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 1px;
  height: 11px;
  margin-top: -5px;
  background: var(--line-strong);
}

/* Иконка WhatsApp в доке вместо «WA» */
body.contacts-cards .home-dock__route--wa span {
  display: flex;
  align-items: center;
  justify-content: center;
}
body.contacts-cards .home-dock__route--wa span svg {
  width: 17px;
  height: 17px;
  fill: #fff;
  display: block;
}
@media (max-width: 400px) {
  .contacts-cards .contacts-hero__meta { gap: 8px 18px; }
  .contacts-cards .contacts-hero__meta li { font-size: 10.5px; }
}

/* Мобильный: компактнее — уместить всё в один экран */
@media (max-width: 540px) {
  .contacts-cards .contacts-hero__meta { margin-top: 11px; padding-top: 10px; gap: 6px 16px; }
  .contacts-cards .contacts-hero__meta li { font-size: 10px; letter-spacing: 0.05em; }
  body.contacts-cards .contacts-places { gap: 6px; padding-top: 10px; }
  body.contacts-cards .contacts-hero { padding-top: 6px; padding-bottom: 4px; }
}

/* ============================================================
   НИЖНЕЕ МЕНЮ КОНТАКТОВ: два действия + листы выбора
   ============================================================ */
.c-dock { display: none; }
.c-sheet { display: none; }

@media (max-width: 980px) {
  body.contacts-cards .c-dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    display: flex; gap: 8px;
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(244, 245, 244, 0.94);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-top: 1px solid var(--line-strong);
  }
  .c-dock__btn {
    flex: 1; height: 50px; border: 1px solid var(--line-strong); border-radius: 0;
    background: #fff; color: var(--ink); font: 800 15px/1 var(--sans);
    font-family: inherit; cursor: pointer;
  }
  .c-dock__btn--primary { flex: 1.5; background: var(--red); border-color: var(--red); color: #fff; }

  body.contacts-cards .c-sheet { position: fixed; inset: 0; z-index: 400; display: flex; align-items: flex-end; }
  body.contacts-cards .c-sheet[hidden] { display: none; }
  .c-sheet__backdrop { position: absolute; inset: 0; background: rgba(6, 8, 10, 0.55); }
  .c-sheet__panel {
    position: relative; width: 100%; background: var(--paper-2, #fff);
    padding: 18px 18px calc(20px + env(safe-area-inset-bottom, 0px));
    border-top: 3px solid var(--ink); animation: cSheetUp 0.28s ease;
  }
  @keyframes cSheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .c-sheet__head { display: flex; align-items: center; justify-content: space-between; }
  .c-sheet__head b { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
  .c-sheet__close {
    width: 38px; height: 38px; border: 1px solid var(--line-strong); background: transparent;
    font-size: 22px; line-height: 1; color: var(--ink); cursor: pointer;
  }
  .c-sheet__hint { margin: 4px 0 14px; color: var(--muted); font-size: 13px; }
  .c-sheet__list { border-top: 1px solid var(--line); }
  .c-sheet__row { display: flex; align-items: center; gap: 8px; padding: 13px 0; border-bottom: 1px solid var(--line); }
  .c-sheet__dir { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
  .c-sheet__dot { width: 8px; height: 8px; flex: none; }
  .c-sheet__dot--green { background: var(--green); }
  .c-sheet__dot--blue { background: var(--blue); }
  .c-sheet__dot--red { background: var(--red); }
  .c-sheet__call {
    display: inline-flex; align-items: center; height: 42px; padding: 0 14px;
    border: 1px solid var(--line-strong); font-size: 13px; font-weight: 700;
    color: var(--ink); text-decoration: none;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
  }
  .c-sheet__call:hover,
  .c-sheet__call:active { background: var(--ink); border-color: var(--ink); color: #fff; }
  .c-sheet__ch { display: flex; gap: 8px; flex: none; }
  .c-sheet__ic {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; flex: none; border: 1px solid var(--line-strong);
    color: var(--ink); text-decoration: none;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
  }
  .c-sheet__ic svg { width: 20px; height: 20px; fill: currentColor; }
  .c-sheet__ic--tg:hover,
  .c-sheet__ic--tg:active { background: #2aabee; border-color: #2aabee; color: #fff; }
  .c-sheet__ic--wa:hover,
  .c-sheet__ic--wa:active { background: #25d366; border-color: #25d366; color: #fff; }
  .c-sheet__place {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 15px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink);
  }
  .c-sheet__place b { display: block; font-size: 16px; }
  .c-sheet__place em { font-style: normal; color: var(--muted); font-size: 13px; }
  .c-sheet__place i { font-style: normal; color: var(--muted); font-size: 18px; }

  /* Логотип: через вертикальную черту — Northern Performance System */
  body.contacts-cards .brand { display: flex; align-items: center; }
  body.contacts-cards .brand__logo { width: 118px; }
  body.contacts-cards .brand span {
    display: block; margin-left: 11px; padding-left: 11px;
    border-left: 1px solid var(--line-strong);
    font: 700 7.5px/1.35 var(--mono); letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--muted);
  }
}
