/* epusk contacts — QUALITY REDESIGN (test-only)
   Scoped to .contacts-v1.contacts-detail.
   Content, phones, email, address, map (#contacts-site-map), feedback form (jqm/data-event),
   schema microdata, socials, QR NOT changed. Epusk brand only — no VSE copy. */

.contacts-v1.contacts-detail,
.contacts-v1.contacts-detail *,
.contacts-v1.contacts-detail *::before,
.contacts-v1.contacts-detail *::after {
    box-sizing: border-box;
}

/* ===== Токены (epusk) ===== */
.contacts-v1.contacts-detail {
    --ep-ink: #0f172a;
    --ep-text: #334155;
    --ep-muted: #64748b;
    --ep-line: #e2e8f0;
    --ep-surface: #f8fafc;
    --ep-accent: #f2722c;
    --ep-accent-hover: #d9601a;
    --ep-white: #ffffff;
    --ep-radius: 14px;
    --ep-radius-sm: 10px;

    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(36px, 5vw, 64px) 0 clamp(24px, 4vw, 48px);
    background: var(--ep-white);
    color: var(--ep-text);
    font-size: 16px;
    line-height: 1.6;
    font-family: inherit;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

.contacts-v1.contacts-detail > .hidden { display: none; }

/* ===== Раскладка: 2 колонки → 1 ===== */
.ep-contacts__inner { max-width: 100%; }

.ep-contacts__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
}

.ep-contacts__content {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2.5vw, 24px);
    min-width: 0;
}

@media (max-width: 1000px) {
    .ep-contacts__layout { grid-template-columns: minmax(0, 1fr); }
}

/* ===== Фото ===== */
.ep-contacts__photo {
    margin: 0;
    overflow: hidden;
    border-radius: var(--ep-radius);
    background: var(--ep-surface);
    border: 1px solid var(--ep-line);
    min-height: 380px;
}
.ep-contacts__photo .swiper { min-height: 380px; border-radius: inherit; }
.ep-contacts__photo .swiper-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== Карточки ===== */
.ep-contacts__card {
    min-width: 0;
    padding: clamp(22px, 3vw, 32px);
    border: 1px solid var(--ep-line);
    border-radius: var(--ep-radius);
    background: var(--ep-white);
}
.ep-contacts__card + .ep-contacts__card { margin-top: 0; }

/* ===== Иерархия заголовков: h2 секций, h3 подсекций ===== */
.ep-contacts__card-title {
    margin: 0 0 20px;
    color: var(--ep-ink);
    font-size: clamp(20px, 2.4vw, 24px);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.ep-contacts__group { margin: 0 0 22px; }
.ep-contacts__group:last-child { margin-bottom: 0; }

.ep-contacts__group-title {
    margin: 0 0 10px;
    color: var(--ep-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.4;
}

/* ===== Значения контактов (Bitrix-разметка) ===== */
.contacts-v1.contacts-detail .contact-property__label { display: none; }
.contacts-v1.contacts-detail .contact-property__value { overflow-wrap: break-word; }

.contacts-v1.contacts-detail .title,
.contacts-v1.contacts-detail .title.font_upper { text-transform: none !important; }

.contacts-v1.contacts-detail .title.font_upper.muted,
.contacts-v1.contacts-detail .title.font_upper {
    color: var(--ep-ink);
    font-size: 14px;
    margin: 14px 0 6px;
    font-weight: 500;
}

/* ===== Ссылки ===== */
.contacts-v1.contacts-detail a { color: inherit; text-decoration: none; }
.contacts-v1.contacts-detail a:hover { color: var(--ep-accent); text-decoration: underline; }

.contacts-v1.contacts-detail a[href^="tel:"],
.contacts-v1.contacts-detail a[href^="mailto:"] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--ep-accent);
    font-weight: 500;
}
.contacts-v1.contacts-detail .contact-property__value a { font-size: 17px; }

/* ===== Соцсети ===== */
.ep-contacts__socials {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--ep-line);
}
.ep-contacts__socials .social__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--ep-radius-sm);
}
.ep-contacts__socials .social__link:hover { background: var(--ep-surface); }

/* ===== QR ===== */
.ep-contacts__qr {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--ep-line);
}
.ep-contacts__qr a { display: inline-block; }
.ep-contacts__qr img {
    border-radius: var(--ep-radius-sm);
    border: 1px solid var(--ep-line);
    padding: 6px;
    background: var(--ep-white);
}

/* ===== Кнопка CTA — основное действие ===== */
.ep-contacts__cta {
    position: relative;
    width: 100%;
    min-height: 60px;
    padding: 16px 24px;
    cursor: pointer;
    appearance: none;
    font: inherit;
    border: 0;
    border-radius: var(--ep-radius);
    background: var(--ep-accent);
    color: var(--ep-white) !important;
    box-shadow: 0 4px 12px rgb(242 114 44 / 0.22);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
    transition: background-color .2s ease, box-shadow .2s ease, transform .12s ease;
}
.ep-contacts__cta *,
.ep-contacts__cta svg { color: var(--ep-white) !important; stroke: var(--ep-white); }
.ep-contacts__cta-label { font-size: 17px; font-weight: 700; line-height: 1.3; }
.ep-contacts__cta-hint { font-size: 13px; font-weight: 400; opacity: .92; line-height: 1.3; }
.ep-contacts__cta svg { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); }
.ep-contacts__cta:hover {
    background: var(--ep-accent-hover);
    box-shadow: 0 8px 20px rgb(242 114 44 / 0.30);
}
.ep-contacts__cta:active { transform: translateY(1px); }

/* ===== Карта ===== */
.ep-contacts__map {
    min-width: 0;
    min-height: 520px;
    overflow: hidden;
    border: 1px solid var(--ep-line);
    border-radius: var(--ep-radius);
    background: var(--ep-surface);
    contain: paint;
    position: sticky;
    top: 24px;
}
.ep-contacts__map .bx-yandex-view-map,
.ep-contacts__map .bx-yandex-map {
    width: 100%;
    height: 520px !important;
    min-height: 520px !important;
    display: block;
}
.ep-contacts__map iframe { max-width: 100% !important; }

@media (max-width: 1000px) {
    .ep-contacts__map { position: static; min-height: 420px; }
    .ep-contacts__map .bx-yandex-view-map,
    .ep-contacts__map .bx-yandex-map { height: 420px !important; min-height: 420px !important; }
}
@media (max-width: 640px) {
    .contacts-v1.contacts-detail { padding: 16px 0; }
    .ep-contacts__photo,
    .ep-contacts__photo .swiper { min-height: 260px; }
    .ep-contacts__map { min-height: 360px; }
    .ep-contacts__map .bx-yandex-view-map,
    .ep-contacts__map .bx-yandex-map { height: 360px !important; min-height: 360px !important; }
}

/* ===== Описание ===== */
.ep-contacts__desc {
    margin-top: clamp(40px, 6vw, 64px);
    padding-top: clamp(24px, 4vw, 40px);
    border-top: 1px solid var(--ep-line);
    color: var(--ep-muted);
    font-size: 15px;
    line-height: 1.7;
}

/* ===== Доступность ===== */
.contacts-v1.contacts-detail :is(a, button, [tabindex]):focus-visible {
    outline: 3px solid var(--ep-accent);
    outline-offset: 3px;
    border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
    .contacts-v1.contacts-detail *,
    .contacts-v1.contacts-detail *::before,
    .contacts-v1.contacts-detail *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

body { overflow-x: clip; }
html { overflow-x: clip; }
/* ===== Карточка «Связаться с нами» — улучшение качества ===== */
.ep-contacts__card--contact .ep-contacts__group-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ep-contacts__card--contact .ep-contacts__group-title::before {
    content: "";
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ep-accent);
}

/* Телефоны — крупные строки с иконкой телефона */
.ep-contacts__card--contact .ep-contacts__phone {
    display: flex;
    align-items: center;
    min-height: 48px;
    margin-bottom: 6px;
    padding: 10px 14px;
    border: 1px solid var(--ep-line);
    border-radius: var(--ep-radius-sm);
    background: var(--ep-surface);
    transition: border-color .2s ease, background-color .2s ease;
}
.ep-contacts__card--contact .ep-contacts__phone:hover {
    border-color: var(--ep-accent);
    background: var(--ep-white);
}
.ep-contacts__card--contact .ep-contacts__phone a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-size: 18px;
    font-weight: 600;
}
.ep-contacts__card--contact .ep-contacts__phone a::before {
    content: "";
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.5 15.5 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25c1.2.4 2.5.6 3.8.6a1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.3.2 2.6.6 3.8a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.5 15.5 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25c1.2.4 2.5.6 3.8.6a1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.3.2 2.6.6 3.8a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* E-mail — крупная строка с иконкой конверта */
.ep-contacts__card--contact .ep-contacts__email a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-size: 18px;
    font-weight: 600;
}
.ep-contacts__card--contact .ep-contacts__email a::before {
    content: "";
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 4-8 5-8-5V6l8 5 8-5z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 4-8 5-8-5V6l8 5 8-5z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Соцсети — ровный ряд, без пустых дыр */
.ep-contacts__socials .social__items {
    gap: 10px !important;
    margin: 0 !important;
}
.ep-contacts__socials .social__item {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
}
.ep-contacts__socials .social__link {
    width: 44px;
    height: 44px;
    border: 1px solid var(--ep-line);
    border-radius: var(--ep-radius-sm);
    background: var(--ep-white);
    transition: border-color .2s ease, background-color .2s ease;
}
.ep-contacts__socials .social__link:hover {
    border-color: var(--ep-accent);
    background: var(--ep-surface);
}

/* QR — аккуратно по центру */
.ep-contacts__qr { text-align: center; }
.ep-contacts__qr .ep-contacts__group-title { justify-content: center; }
.ep-contacts__qr img {
    box-shadow: 0 1px 4px rgb(0 0 0 / 0.06);
    transition: transform .2s ease, box-shadow .2s ease;
}
.ep-contacts__qr a:hover img {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.12);
}
    transition: transform .2s ease, box-shadow .2s ease;
}
.ep-contacts__qr a:hover img {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.12);
}

/* E-mail (резервный стиль по селектору, если обёртка Bitrix другая) */
.ep-contacts__card--contact .ep-contacts__group a[href^="mailto:"] {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-size: 18px;
    font-weight: 600;
}
.ep-contacts__card--contact .ep-contacts__group a[href^="mailto:"]::before {
    content: "";
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 4-8 5-8-5V6l8 5 8-5z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 4-8 5-8-5V6l8 5 8-5z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ===== Кнопки «Карта входа/въезда» и «Запустить навигатор» — в ряд ===== */
.contacts-v1.contacts-detail .video_file_dub {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center !important;
    margin: 12px 0 !important;
}
.contacts-v1.contacts-detail .video_file_dub br { display: none !important; }
.contacts-v1.contacts-detail .video_file_dub > a { display: inline-flex; }
.contacts-v1.contacts-detail .video_file_dub .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    white-space: nowrap;
}
