/*
 * Bot CTA labels — auto-attach a small "→ Telegram" chip after every Telegram-bot
 * link so users see clearly where the button leads BEFORE clicking. Prevents the
 * "I expected a form, got redirected to Telegram" surprise.
 *
 * Applies via attribute selector — no per-page markup edits needed.
 *
 * Opt-out: add `data-no-telegram-label` on the <a> if needed (e.g. footer
 * social-icon row where the icon alone already signals Telegram).
 *
 * @since 16.05.2026
 */

/* Telegram circular logo — standalone vector marker after every bot CTA.
   No text label — logo is universally recognized. 16.05.2026.
   Sits inside a soft white circle for contrast on any-color CTAs (orange/navy/cream). */
a[href*="t.me/egoistrealestate_bot"]:not([data-no-telegram-label])::after {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 10px;
    vertical-align: middle;
    background-color: #fff;
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23229ED9'%3E%3Cpath d='M12 0C5.37 0 0 5.37 0 12s5.37 12 12 12 12-5.37 12-12S18.63 0 12 0zm5.56 8.19l-1.86 8.77c-.14.62-.5.77-1.02.48l-2.82-2.08-1.36 1.31c-.15.15-.28.28-.56.28l.2-2.82 5.14-4.64c.22-.2-.05-.31-.35-.11L8.57 12.7l-2.73-.85c-.59-.19-.6-.59.13-.88L16.77 7.5c.49-.18.92.12.79.69z'/%3E%3C/svg%3E");
    background-size: 18px 18px;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(20, 52, 91, .18);
    transform: translateY(-1px);
}

/* Hide both ::before and ::after when label not needed */
a[href*="t.me/egoistrealestate_bot"][data-no-telegram-label]::after,
a[href*="t.me/egoistrealestate_bot"][data-no-telegram-label]::before,
a[href*="t.me/egoistrealestate_bot"][aria-label*="Telegram"]::after,
a[href*="t.me/egoistrealestate_bot"][aria-label*="Telegram"]::before,
a[href*="t.me/egoistrealestate_bot"][aria-label*="telegram"]::after,
a[href*="t.me/egoistrealestate_bot"][aria-label*="telegram"]::before,
a[href*="t.me/egoistrealestate_bot"][aria-label*="бот"]::after,
a[href*="t.me/egoistrealestate_bot"][aria-label*="бот"]::before,
a[href*="t.me/egoistrealestate_bot"][aria-label*="Bot"]::after,
a[href*="t.me/egoistrealestate_bot"][aria-label*="Bot"]::before {
    content: none;
}

/* Hide pseudo-elements on social-icon rows (footer/header/about/contacts)
   AND on footer phone line — there the Telegram glyph is already part of the markup. */
.footer__social a[href*="t.me/egoistrealestate_bot"]::after,
.footer__social a[href*="t.me/egoistrealestate_bot"]::before,
.header-mobile-social a[href*="t.me/egoistrealestate_bot"]::after,
.header-mobile-social a[href*="t.me/egoistrealestate_bot"]::before,
.about-vikki__socials a[href*="t.me/egoistrealestate_bot"]::after,
.about-vikki__socials a[href*="t.me/egoistrealestate_bot"]::before,
.kontakty-messenger a[href*="t.me/egoistrealestate_bot"]::after,
.kontakty-messenger a[href*="t.me/egoistrealestate_bot"]::before,
.footer__lead-alt a[href*="t.me/egoistrealestate_bot"]::after,
.footer__lead-alt a[href*="t.me/egoistrealestate_bot"]::before {
    content: none;
}

/* On the floating "ПОДОБРАТЬ КВАРТИРУ" CTA, sticky object PDP bars, and about
   sticky CTA: KEEP the blue Telegram circle (added via ::after) and HIDE the
   existing white paper-plane SVG inside the TELEGRAM button markup.
   16.05.2026 — fix: scoped svg hide to t.me anchors only, інакше WhatsApp icon теж зникав. */
.tg-float-btn .tg-float-btn__icon,
.obj-v2-sticky .obj-v2-sticky__icon,
.obj-v3-sticky .obj-v3-sticky__icon,
.about-sticky-cta .about-sticky-cta__icon,
.about-sticky-cta a[href*="t.me/egoistrealestate_bot"] svg[width="22"] {
    display: none !important;
}

/* About-scenarios cards: TG chip INLINE with CTA text — same line as
   "Find for scenario →", not below. The card root IS the <a> (no descendant
   anchor), so the global ::after was rendering at the very end of card content
   (below description). Kill ::after/::before on the card itself, then put the
   chip as ::before of the CTA <p>.
   16.05.2026 — per Anastasiia's feedback. */
a.about-scenarios__card[href*="t.me/egoistrealestate_bot"]::after,
a.about-scenarios__card[href*="t.me/egoistrealestate_bot"]::before {
    content: none;
}
a.about-scenarios__card[href*="t.me/egoistrealestate_bot"] .about-scenarios__card-cta::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
    background-color: #fff;
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23229ED9'%3E%3Cpath d='M12 0C5.37 0 0 5.37 0 12s5.37 12 12 12 12-5.37 12-12S18.63 0 12 0zm5.56 8.19l-1.86 8.77c-.14.62-.5.77-1.02.48l-2.82-2.08-1.36 1.31c-.15.15-.28.28-.56.28l.2-2.82 5.14-4.64c.22-.2-.05-.31-.35-.11L8.57 12.7l-2.73-.85c-.59-.19-.6-.59.13-.88L16.77 7.5c.49-.18.92.12.79.69z'/%3E%3C/svg%3E");
    background-size: 16px 16px;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(20, 52, 91, .18);
    transform: translateY(-1px);
}

/* Save-search CTA also opens VSB popup (intercepted by save-search.js).
   Don't show TG chip — confuses users into thinking it's a bot CTA.
   16.05.2026 — Anastasiia: row stayed in 3 lines on mobile due to chip width. */
a.catalog-v2__save-search[href*="t.me/egoistrealestate_bot"]::after,
a.catalog-v2__save-search[href*="t.me/egoistrealestate_bot"]::before {
    content: none !important;
}

/* Hide auto Telegram chip on catalog cards — card already has its own design,
   the chip looks redundant next to "Спросить Vikki об этом объекте →".
   16.05.2026 — per Anastasiia's feedback. */
.catalog-v2__card a[href*="t.me/egoistrealestate_bot"]::after,
.catalog-v2__map-card a[href*="t.me/egoistrealestate_bot"]::after,
.m-sheet-card a[href*="t.me/egoistrealestate_bot"]::after,
.product-card a[href*="t.me/egoistrealestate_bot"]::after,
.catalog-card a[href*="t.me/egoistrealestate_bot"]::after,
.obj-v3-similar a[href*="t.me/egoistrealestate_bot"]::after,
.catalog-empty-state a[href*="t.me/egoistrealestate_bot"]::after {
    content: none;
}

/* =============================================================
   "Без Telegram? Напишите в форме →" fallback link styles
   (injected by assets/scripts/bot-fallback.js) — adapts color to parent context.
   16.05.2026 — single instance per page, centered, below last bot CTA.
   ============================================================= */

.egoist-bot-fallback-wrap {
    margin-top: 12px;
    width: 100%;
    /* 16.05.2026 — default centered під inline CTA pairs (service pages Hero/Final CTA).
       Left-align scoped до stacked-column contexts нижче. */
    text-align: center;
    /* Take full width of parent so flex/grid siblings don't squeeze it */
    flex-basis: 100%;
    grid-column: 1 / -1;
}

/* Left-align fallback коли кнопки stacked column (e.g. about-hero-desktop на ≤900px,
   де buttons мають flex-direction: column). 16.05.2026 */
@media (max-width: 900px) {
    .about-hero-desktop__buttons .egoist-bot-fallback-wrap,
    .about-hero-desktop .egoist-bot-fallback-wrap {
        text-align: left;
    }
}

/* 16.05.2026 — На single-CTA blocks (Hero + Pricing + інші де single left-aligned button):
   fallback повинен left-align під кнопкою, не центрований. Final CTA / Locations з 2
   inline buttons залишаються centered (default). */
.r-hero .egoist-bot-fallback-wrap,
.upravlenie-hero .egoist-bot-fallback-wrap,
.upr-hero .egoist-bot-fallback-wrap,
.sellers-hero .egoist-bot-fallback-wrap,
.about-hero-desktop .egoist-bot-fallback-wrap,
.kontakty-hero .egoist-bot-fallback-wrap,
.upravlenie-pricing__right .egoist-bot-fallback-wrap,
.upravlenie-pricing .egoist-bot-fallback-wrap,
.sellers-pricing .egoist-bot-fallback-wrap,
.catalog-v2__hero .egoist-bot-fallback-wrap,
.catalog-hero .egoist-bot-fallback-wrap {
    text-align: left;
}

.egoist-bot-fallback {
    display: inline-block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: .01em;
    line-height: 1.4;
    color: rgba(20, 52, 91, .65);
    text-decoration: underline;
    text-decoration-color: rgba(20, 52, 91, .3);
    text-underline-offset: 3px;
    transition: color .15s ease, text-decoration-color .15s ease;
    cursor: pointer;
}

.egoist-bot-fallback:hover {
    color: var(--orange, #E8953A);
    text-decoration-color: rgba(229, 138, 58, .6);
}

/* On dark-hero / dark-section parents: switch to white text + soft blue underline.
   16.05.2026 — extended to cover catalog finale + all service-page finale sections. */
.about-hero-desktop .egoist-bot-fallback,
.about-cta .egoist-bot-fallback,
.about-process .egoist-bot-fallback,
.about-safety .egoist-bot-fallback,
.catalog-v2__hero .egoist-bot-fallback,
.catalog-v2__finale .egoist-bot-fallback,
.kontakty-hero .egoist-bot-fallback,
.upravlenie-hero .egoist-bot-fallback,
.upravlenie-cta .egoist-bot-fallback,
.upr-cta .egoist-bot-fallback,
.upravlenie-page section[class*="cta"] .egoist-bot-fallback,
.rental-hero .egoist-bot-fallback,
.r-hero .egoist-bot-fallback,
.r-finale .egoist-bot-fallback,
/* 16.05.2026 — removed .r-process, .r-locations, .upravlenie-process з white-text rule
   bo вони мають inner white cards → white text was invisible on white inner bg.
   Fallback inside white card падає на default dark color — OK. */
.rental-cta .egoist-bot-fallback,
.rental-finale .egoist-bot-fallback,
.sellers-hero .egoist-bot-fallback,
.sellers-cta .egoist-bot-fallback,
.sellers-page section[class*="cta"] .egoist-bot-fallback,
.obj-v3-hero .egoist-bot-fallback,
.obj-v3-cta .egoist-bot-fallback,
.object-data .egoist-bot-fallback {
    color: rgba(255, 255, 255, .85);
    text-decoration-color: rgba(255, 255, 255, .4);
}

.about-hero-desktop .egoist-bot-fallback:hover,
.about-cta .egoist-bot-fallback:hover,
.about-process .egoist-bot-fallback:hover,
.about-safety .egoist-bot-fallback:hover,
.catalog-v2__hero .egoist-bot-fallback:hover,
.catalog-v2__finale .egoist-bot-fallback:hover,
.kontakty-hero .egoist-bot-fallback:hover,
.upravlenie-hero .egoist-bot-fallback:hover,
.upravlenie-cta .egoist-bot-fallback:hover,
.upr-cta .egoist-bot-fallback:hover,
.upravlenie-page section[class*="cta"] .egoist-bot-fallback:hover,
.rental-hero .egoist-bot-fallback:hover,
.rental-cta .egoist-bot-fallback:hover,
.rental-finale .egoist-bot-fallback:hover,
.sellers-hero .egoist-bot-fallback:hover,
.sellers-cta .egoist-bot-fallback:hover,
.sellers-page section[class*="cta"] .egoist-bot-fallback:hover,
.obj-v3-hero .egoist-bot-fallback:hover,
.obj-v3-cta .egoist-bot-fallback:hover,
.object-data .egoist-bot-fallback:hover {
    color: #fff;
    text-decoration-color: rgba(255, 255, 255, .8);
}

@media (max-width: 640px) {
    a[href*="t.me/egoistrealestate_bot"]:not([data-no-telegram-label])::after {
        width: 16px;
        height: 16px;
        margin-left: 7px;
        background-size: 16px 16px;
    }
}

/* ─────────────────────────────────────────────────────────
   16.05.2026 — На прозорих кнопках (ghost/outline) auto-injected
   Telegram ::after icon має бути теж transparent (no white circle bg + no shadow).
   GLOBAL — застосовується скрізь де є .btn-ghost / .btn-outline-* з t.me link.
   ───────────────────────────────────────────────────────── */
.btn-ghost::after,
.btn-outline-white::after,
.btn-outline-dark::after,
.btn-outline-navy::after,
.btn-outline::after,
.btn[class*="ghost"]::after,
.btn[class*="outline"]::after {
    background-color: transparent !important;
    box-shadow: none !important;
}

/* ─────────────────────────────────────────────────────────
   16.05.2026 — Dedup fallback wraps inside same section.
   На sellers-benefits + sellers-valuation + інших мульти-CTA sections JS
   injects 1 wrap per button-row → 2+ wraps visible. CSS sibling rule
   hides all but first.
   ───────────────────────────────────────────────────────── */
.sellers-benefits .egoist-bot-fallback-wrap ~ .egoist-bot-fallback-wrap,
.sellers-valuation .egoist-bot-fallback-wrap ~ .egoist-bot-fallback-wrap,
.sellers-process .egoist-bot-fallback-wrap ~ .egoist-bot-fallback-wrap,
.upravlenie-pricing .egoist-bot-fallback-wrap ~ .egoist-bot-fallback-wrap,
.r-process .egoist-bot-fallback-wrap ~ .egoist-bot-fallback-wrap,
.r-locations .egoist-bot-fallback-wrap ~ .egoist-bot-fallback-wrap,
section .egoist-bot-fallback-wrap ~ .egoist-bot-fallback-wrap {
    display: none !important;
}

/* На sellers-benefits / sellers-valuation Button position = right column,
   fallback повинен align right під ним. 16.05.2026 */
.sellers-benefits .egoist-bot-fallback-wrap,
.sellers-valuation .egoist-bot-fallback-wrap {
    text-align: right;
}
