/* Epil: карточка контактов студии (виджет epil_listing_contacts). Цвета — глобальные цвета Listivo. */
.epil-contacts {
    --epil-text: var(--e-global-color-lcolor1, #374b5c);
    --epil-muted: var(--e-global-color-lcolor2, #73818c);
    --epil-border: var(--e-global-color-lcolor3, #d5e3ee);
    --epil-bg: var(--e-global-color-lcolor4, #f2f4f8);
    --epil-accent: var(--e-global-color-lprimary1, #e898f7);
    --epil-accent-soft: color-mix(in srgb, var(--epil-accent) 16%, #fff);

    margin: 20px 0 0;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--epil-border);
    border-radius: 10px;
    color: var(--epil-text);
    font-size: 14px;
    line-height: 1.4;
}

.epil-contacts__title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
}

.epil-contacts__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.epil-contacts__item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 0;
}

.epil-contacts__item + .epil-contacts__item {
    border-top: 1px solid var(--epil-bg);
}

.epil-contacts__icon {
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--epil-accent-soft);
    color: var(--epil-text);
}

.epil-contacts__icon svg {
    width: 20px;
    height: 20px;
}

.epil-contacts__emoji {
    font-size: 20px;
    line-height: 1;
}

.epil-contacts__body {
    min-width: 0;
    flex: 1;
}

.epil-contacts__label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    color: var(--epil-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}

.epil-contacts__value {
    display: block;
    color: var(--epil-text);
    font-weight: 600;
    overflow-wrap: anywhere;
    text-decoration: none;
}

a.epil-contacts__value:hover,
a.epil-contacts__value:focus-visible {
    color: var(--epil-text);
    text-decoration: underline;
}

.epil-contacts__phone {
    font-size: 16px;
    letter-spacing: .01em;
}

/*
 * Единый блок контактов: блок владельца Listivo (lst_listing_user_v2: сеть, телефон с раскрытием, «Чат»,
 * «Отправить заявку») + «Контакты» сразу под ним (wp epil contacts merge-card) — одна карточка.
 * Работает только при таком соседстве; иначе оба блока выглядят как раньше.
 */
html body .elementor-widget-lst_listing_user_v2:has(+ .elementor-widget-epil_listing_contacts) .listivo-listing-user-v2 {
    overflow: hidden;
    border: 1px solid var(--e-global-color-lcolor3, #d5e3ee);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    background: #fff;
}

html body .elementor-widget-lst_listing_user_v2:has(+ .elementor-widget-epil_listing_contacts) .listivo-listing-user-v2__content {
    padding: 20px 20px 16px;
}

/* Телефон владельца — строка в стиле наших пунктов, а не голубая полоса во всю ширину */
html body .elementor-widget-lst_listing_user_v2:has(+ .elementor-widget-epil_listing_contacts) .listivo-listing-user-v2__phone {
    padding: 0 20px;
}

html body .elementor-widget-lst_listing_user_v2:has(+ .elementor-widget-epil_listing_contacts) .listivo-listing-user-v2__phone .listivo-contact-button {
    height: 56px !important;
    padding: 0 8px 0 10px !important;
    border-radius: 14px !important;
    background: var(--e-global-color-lcolor4, #f2f4f8) !important;
    font-size: 16px;
}

html body .elementor-widget-lst_listing_user_v2:has(+ .elementor-widget-epil_listing_contacts) .listivo-listing-user-v2__phone .listivo-contact-button__icon {
    width: 40px !important;
    height: 40px !important;
    margin-right: 12px;
}

html body .elementor-widget-lst_listing_user_v2:has(+ .elementor-widget-epil_listing_contacts) .listivo-listing-user-v2__phone .listivo-contact-button__icon--additional {
    width: 40px !important;
    height: 40px !important;
    margin: 0 0 0 auto;
}

/* «Чат» / «Отправить заявку» — как наши кнопки */
html body .elementor-widget-lst_listing_user_v2:has(+ .elementor-widget-epil_listing_contacts) .listivo-listing-user-v2__bottom {
    gap: 10px;
    padding: 12px 20px 4px;
}

html body .elementor-widget-lst_listing_user_v2:has(+ .elementor-widget-epil_listing_contacts) .listivo-listing-user-v2__bottom .listivo-simple-button {
    height: 46px !important;
    padding: 0 14px !important;
    border-radius: 12px !important;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* Контурные кнопки: фиолетовая рамка без заливки — на странице и так много фиолетового */
html body .elementor-widget-lst_listing_user_v2:has(+ .elementor-widget-epil_listing_contacts) .listivo-listing-user-v2__bottom .listivo-simple-button {
    border: 1.5px solid #d86eec !important;
    background: transparent !important;
    color: #b44fc9 !important;
    transition: background-color .15s ease;
}

html body .elementor-widget-lst_listing_user_v2:has(+ .elementor-widget-epil_listing_contacts) .listivo-listing-user-v2__bottom .listivo-simple-button path {
    fill: currentColor !important;
    stroke: currentColor !important;
}

html body .elementor-widget-lst_listing_user_v2:has(+ .elementor-widget-epil_listing_contacts) .listivo-listing-user-v2__bottom .listivo-simple-button:hover,
html body .elementor-widget-lst_listing_user_v2:has(+ .elementor-widget-epil_listing_contacts) .listivo-listing-user-v2__bottom .listivo-simple-button:focus-visible {
    background: #fbeefe !important;
    color: #b44fc9 !important;
}

/* Адрес из профиля владельца — дубль: в карточке остаётся адрес самой студии (с картой) */
html body .elementor-widget-lst_listing_user_v2:has(+ .elementor-widget-epil_listing_contacts) .listivo-listing-user-v2__address {
    display: none;
}

/* «Позвонить» — тем же цветом, что «Чат» и «Отправить заявку» */
html body .elementor-widget-lst_listing_user_v2 + .elementor-widget-epil_listing_contacts .epil-contacts__button--call {
    background: #d86eec;
}

/* Номер владельца совпал с номером студии — его показывает список телефонов ниже */
body.epil-contacts-hide-owner-phone .elementor-widget-lst_listing_user_v2:has(+ .elementor-widget-epil_listing_contacts) .listivo-listing-user-v2__phone {
    display: none;
}

html body .elementor-widget-lst_listing_user_v2 + .elementor-widget-epil_listing_contacts .epil-contacts {
    margin-top: 0;
    padding-top: 6px;
    border-top: 0;
    border-radius: 0 0 16px 16px;
}

/* Тонкий разделитель между частями карточки */
html body .elementor-widget-lst_listing_user_v2 + .elementor-widget-epil_listing_contacts .epil-contacts::before {
    content: "";
    display: block;
    margin: 6px 0 4px;
    border-top: 1px solid var(--epil-bg);
}

/* Адрес — ссылка «Показать на карте» (окно assets/js/contacts-map.js) */
a.epil-contacts__map-link {
    display: block;
    color: var(--epil-text);
    text-decoration: none;
}

.epil-contacts__map-hint {
    display: flex;
    width: max-content;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    color: #c86ad9;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--epil-accent) 60%, transparent);
    text-underline-offset: 3px;
}

.epil-contacts__map-hint::before {
    content: "";
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4 3 6v14l6-2 6 2 6-2V4l-6 2z'/%3E%3Cpath d='M9 4v14M15 6v14'/%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' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4 3 6v14l6-2 6 2 6-2V4l-6 2z'/%3E%3Cpath d='M9 4v14M15 6v14'/%3E%3C/svg%3E") center / contain no-repeat;
}

a.epil-contacts__map-link:hover .epil-contacts__map-hint,
a.epil-contacts__map-link:focus-visible .epil-contacts__map-hint {
    text-decoration-color: currentColor;
}

/* Окно с картой */
html.epil-map-modal-open {
    overflow: hidden;
}

.epil-map-modal {
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .55);
}

.epil-map-modal[hidden] {
    display: none;
}

.epil-map-modal__dialog {
    display: flex;
    flex-direction: column;
    width: min(880px, 100%);
    max-height: calc(100vh - 48px);
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .35);
    color: #374b5c;
    font-family: var(--epil-font-text, inherit);
}

.epil-map-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
}

.epil-map-modal__title {
    margin: 0;
    font-family: var(--epil-font-heading, inherit);
    font-size: 18px;
    font-weight: 700;
}

.epil-map-modal__address {
    margin: 4px 0 0;
    color: #73818c;
    font-size: 14px;
}

html body .epil-map-modal__close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f2f4f8;
    color: #374b5c;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.epil-map-modal__map {
    flex: 1 1 auto;
    min-height: 420px;
    height: 60vh;
}

.epil-map-modal__pin {
    display: block;
    width: 36px;
    height: 36px;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    background: #e898f7;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .3);
    transform: rotate(-45deg);
}

.epil-map-modal__routes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 20px 18px;
}

html body .epil-map-modal__route {
    padding: 10px 16px;
    border: 1px solid #d5e3ee;
    border-radius: 999px;
    color: #374b5c;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

html body .epil-map-modal__route:hover {
    border-color: #e898f7;
    background: #fbeefe;
    color: #374b5c;
}

@media (max-width: 600px) {
    .epil-map-modal {
        padding: 0;
    }

    .epil-map-modal__dialog {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }

    .epil-map-modal__map {
        height: auto;
        min-height: 0;
    }
}

.epil-contacts__badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
}

.epil-contacts__badge--open {
    background: #e3f7ea;
    color: #1d7a3d;
}

.epil-contacts__badge--closed {
    background: #fdeaea;
    color: #b42318;
}

.epil-contacts__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.epil-contacts__chip {
    padding: 4px 10px;
    border: 1px solid var(--epil-border);
    border-radius: 999px;
    color: var(--epil-text);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease;
}

.epil-contacts__chip:hover,
.epil-contacts__chip:focus-visible {
    background: var(--epil-accent-soft);
    border-color: var(--epil-accent);
    color: var(--epil-text);
}

/* Кнопки — как фиолетовые «Чат» / «E-mail» в блоке выше */
.epil-contacts__actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.epil-contacts__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: filter .15s ease, transform .15s ease;
}

.epil-contacts__button svg {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
}

.epil-contacts__button:hover,
.epil-contacts__button:focus-visible {
    color: #fff;
    filter: brightness(.95);
    transform: translateY(-1px);
}

.epil-contacts__button--call {
    grid-column: 1 / -1;
    background: var(--epil-accent);
}

.epil-contacts__button--whatsapp {
    background: #25d366;
}

.epil-contacts__button--telegram {
    background: #229ed9;
}

.epil-contacts__socials {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--epil-bg);
}

.epil-contacts__social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--epil-border);
    border-radius: 50%;
    color: var(--epil-text);
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.epil-contacts__social svg {
    width: 18px;
    height: 18px;
}

.epil-contacts__social:hover,
.epil-contacts__social:focus-visible {
    background: var(--epil-accent);
    border-color: var(--epil-accent);
    color: #fff;
}

/* VIP-студия — ярко-жёлтый пин, как на картах каталога */
.epil-map-modal__pin.is-vip {
    background: #facc15;
}
