/* Контакты с картой (contacts_map) — tshop_3, оба варианта:
 *   stack (default)              карта во всю ширину, контакты рядом ячейками;
 *   split (text_left_map_right)  контакты и точки слева, карта справа (на узком — под ними).
 * Ручки дизайнера стилей на корне блока (.idblock-N):
 *   --title-size, --title-color   заголовок
 *   --map-height                  высота карты (настройка блока «высота» задаёт её прямо на карте)
 *   --map-radius                  скругление карты
 *   --ico-size, --ico-bg, --ico-color  плитки иконок контактов
 */
@layer modules {
  .t3-contacts { container: contacts / inline-size; --map-height: clamp(320px, 50vw, 520px); --map-radius: var(--radius-l); --ico-size: 44px; }

  .t3-contacts__edit { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }

  .t3-contacts__layout { display: grid; gap: var(--s-5); }

  /* контакты */
  .t3-facts { display: grid; gap: var(--s-3); margin: 0; }
  .t3-fact { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s-4); row-gap: 2px; align-items: center; }
  .t3-fact__ico { grid-row: span 2; }
  .t3-fact dt { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
  .t3-fact dd { margin: 0; font-size: var(--fs-m); font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
  .t3-fact dd a { color: inherit; }
  .t3-fact dd a:hover { color: var(--brand-text); }
  .t3-fact:not(:has(dd)) dt { grid-row: span 2; font-size: var(--fs-m); text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 600; }

  /* stack: ячейки контактов в ряд (на широком), карта сверху */
  .t3-contacts--stack .t3-contacts__info { order: 2; }
  .t3-contacts--stack .t3-map { order: 1; }
  .t3-contacts--stack .t3-contacts__route { order: 3; margin: 0; }
  .t3-contacts--stack .t3-facts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--s-3); }
  .t3-contacts--stack .t3-fact { padding: var(--s-4) var(--s-5); border-radius: var(--radius-l); background: var(--surface); }
  [data-style="bento"] .t3-contacts--stack .t3-fact { box-shadow: var(--shadow-1); }
  [data-style="quiet"] .t3-contacts--stack .t3-fact, [data-style="editorial"] .t3-contacts--stack .t3-fact { border: var(--line-w) solid var(--line); }
  [data-style="editorial"] .t3-contacts--stack .t3-fact { border-radius: 0; }
  .t3-contacts--stack .t3-points { order: 2; }

  /* split: колонка контактов + карта */
  .t3-contacts--split .t3-contacts__info { display: grid; gap: var(--s-5); align-content: start; }
  .t3-contacts__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
  .t3-contacts__actions .btn .i { margin-left: 2px; }
  @container contacts (min-width: 900px) {
    .t3-contacts--split .t3-contacts__layout { grid-template-columns: minmax(300px, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); align-items: stretch; }
    .t3-contacts--split .t3-map { min-height: var(--map-height); height: 100%; }
  }

  /* точки */
  .t3-points { display: grid; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
  .t3-contacts--stack .t3-points { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
  .t3-point {
    display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--s-3); align-items: start; width: 100%;
    padding: var(--s-3) var(--s-4); border-radius: var(--radius-m); text-align: left; background: var(--surface-2);
    transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  }
  .t3-point:hover { background: var(--line); }
  .t3-point[aria-current="true"] { background: var(--surface); box-shadow: inset 0 0 0 2px var(--brand); }
  [data-style="editorial"] .t3-point { border-radius: 0; }
  .t3-point__num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: var(--fs-xs); font-weight: 700; }
  .t3-point__body { display: grid; gap: 2px; font-size: var(--fs-s); color: var(--text-2); }
  .t3-point__body b { color: var(--text); font-weight: 600; }

  /* карта */
  .t3-map { position: relative; height: var(--map-height); border-radius: var(--map-radius); overflow: hidden; background: var(--surface-2); isolation: isolate; }
  [data-style="editorial"] .t3-map { border: var(--line-w) solid var(--line); }
  .t3-map__canvas { position: absolute; inset: 0; }
  .t3-map__stub { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--s-2); margin: 0; color: var(--text-3); font-size: var(--fs-s); }
  .t3-map.is-ready .t3-map__stub { display: none; }
  .t3-map__open {
    position: absolute; z-index: 2; left: var(--s-3); bottom: var(--s-3); display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; padding: 0 var(--s-4); border-radius: var(--radius-pill); font-size: var(--fs-s); font-weight: 600;
    background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--text); box-shadow: var(--shadow-1); backdrop-filter: blur(8px);
  }
  .t3-map__open:hover { background: var(--surface); }
  [data-style="editorial"] .t3-map__open { border-radius: 0; }
  /* тёмная схема: «ночная» подложка карты */
  [data-scheme="dark"] .t3-map [class*="ground-pane"] { filter: invert(.92) hue-rotate(180deg) saturate(.6) brightness(.95); }
  .t3-map [class*="copyrights-pane"] { opacity: .8; }
}
