/* ========================================================
   MORFAY — КОНТАКТИ v3.0
   Хедер (телефон), модалка (Viber), CTA перед футером,
   нижня панель на мобільному.
   Файл: /wp-content/themes/<дочірня тема>/css/contacts.css
   Підключається з functions.php після style.css.
   ======================================================== */

:root {
    --mf-tg: #24a1de;
    --mf-vb: #7360f2;
    --mf-wa: #25d366;
    --mf-bar-h: 64px;
    --z-bar: 950; /* нижче хедера, меню і модалки */
}

/* ========================================================
   1. ХЕДЕР: кнопка месенджерів + телефон
   ======================================================== */

.header-left {
    align-items: center;
    gap: 12px;
}

/* іконки в кнопці тепер у span-обгортках */
span.contact-icon {
    display: block;
    width: 24px;
    height: 24px;
}
span.contact-icon svg { display: block; }

.contact-icon.viber-icon { color: var(--mf-vb); }

/* --- Телефон: ПК --- */
.hdr-phone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 50px;
    padding: 0 18px 0 14px;
    border-radius: 50px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--blur-amount);
    backdrop-filter: var(--blur-amount);
    border: 1.5px solid var(--glass-border);
    color: var(--text-primary) !important;
    text-decoration: none !important;
    font-family: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    white-space: nowrap;
    transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.hdr-phone:hover {
    border-color: var(--morfay-accent);
    background: var(--glass-bg-hover);
    box-shadow: 0 4px 12px rgba(79, 107, 99, 0.15);
}

.hdr-phone-icon {
    display: flex;
    color: var(--morfay-accent);
}

.hdr-phone-num {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .2px;
    font-variant-numeric: tabular-nums;
}

.hdr-phone-hint {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--morfay-accent);
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(79, 107, 99, 0.1);
}

/* після показу номера підказка зникає */
.hdr-phone.is-revealed .hdr-phone-hint,
.hdr-phone:not(.is-masked) .hdr-phone-hint { display: none; }

/* --- Телефон: мобільний (кругла кнопка дзвінка) --- */
@media (max-width: 900px) {
    .header-left { gap: 8px; }

    .hdr-phone {
        width: 45px;
        height: 45px;
        padding: 0;
        justify-content: center;
        background: var(--morfay-accent);
        border-color: var(--morfay-accent);
    }
    .hdr-phone-icon { color: #fff; }
    .hdr-phone-num,
    .hdr-phone-hint { display: none !important; }
}

/* вузький екран: номер на ПК не вміщається поруч з логотипом */
@media (min-width: 901px) and (max-width: 1080px) {
    .hdr-phone-hint { display: none; }
}

/* ========================================================
   2. МОДАЛКА: Viber, заголовок-div
   ======================================================== */

.contact-option-icon.viber {
    background: rgba(115, 96, 242, 0.1);
    color: var(--mf-vb);
}
.contact-option:hover .contact-option-icon.viber {
    background: rgba(115, 96, 242, 0.2);
}

.contact-option-action.js-phone-text {
    font-variant-numeric: tabular-nums;
}
.contact-option.is-revealed .contact-option-action,
.contact-option[href^="tel:"]:not(.is-masked) .contact-option-action.js-phone-text {
    font-weight: 700;
    color: var(--morfay-accent);
}

/* ========================================================
   3. CTA ПЕРЕД ФУТЕРОМ (універсальний, телефон + месенджери)
   ======================================================== */

.mf-cta {
    background: #EEF3F1;
    padding: 64px 24px 56px;
    text-align: center;
}

.mf-cta-inner {
    max-width: 640px;
    margin: 0 auto;
}

.mf-cta-title {
    font-family: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin: 0 0 12px;
}

.mf-cta-sub {
    font-size: 17px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 0 auto 28px;
    max-width: 520px;
}

/* --- Велика кнопка телефону --- */
.mf-cta-phone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 34px;
    border-radius: 50px;
    background: var(--morfay-accent);
    color: #fff !important;
    text-decoration: none !important;
    font-family: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 800;
    box-shadow: 0 6px 20px rgba(79, 107, 99, 0.3);
    transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
    animation: morfay-breathe 3s ease-in-out infinite;
}

.mf-cta-phone:hover {
    background: var(--morfay-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(79, 107, 99, 0.42);
    animation: none;
}

.mf-cta-phone-icon { display: flex; }

.mf-cta-phone-num {
    font-size: 24px;
    letter-spacing: .3px;
    font-variant-numeric: tabular-nums;
}

.mf-cta-phone-mob { display: none; font-size: 17px; text-transform: uppercase; letter-spacing: .5px; }

/* підказка «показати» на ПК, поки номер прихований */
.mf-cta-phone.is-masked::after {
    content: 'показати';
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 4px 9px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.18);
}

/* --- Месенджери --- */
.mf-cta-msg {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.mf-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 50px;
    background: #fff;
    border: 1px solid rgba(79, 107, 99, 0.18);
    color: var(--text-primary) !important;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 600;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.mf-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.mf-cta-btn.tg svg { color: var(--mf-tg); }
.mf-cta-btn.vb svg { color: var(--mf-vb); }
.mf-cta-btn.wa svg { color: var(--mf-wa); }
.mf-cta-btn.tg:hover { border-color: var(--mf-tg); }
.mf-cta-btn.vb:hover { border-color: var(--mf-vb); }
.mf-cta-btn.wa:hover { border-color: var(--mf-wa); }

.mf-cta-form {
    display: inline-block;
    margin-top: 22px;
    font-size: 14px;
    color: var(--text-secondary) !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.mf-cta-form:hover { color: var(--morfay-accent) !important; }

@media (max-width: 900px) {
    .mf-cta { padding: 48px 16px 44px; }
    .mf-cta-sub { font-size: 16px; }

    .mf-cta-phone {
        width: 100%;
        max-width: 360px;
        padding: 18px 24px;
    }
    .mf-cta-phone-num { display: none; }
    .mf-cta-phone-mob { display: inline; }
    .mf-cta-phone.is-masked::after { display: none; }

    .mf-cta-msg { max-width: 360px; margin-left: auto; margin-right: auto; }
    .mf-cta-btn { flex: 1 1 0; justify-content: center; padding: 12px 10px; font-size: 14px; }
}

/* ========================================================
   4. ФУТЕР: телефон у колонці контактів
   ======================================================== */

.morfay-footer-contact-item .js-phone-text {
    font-variant-numeric: tabular-nums;
}
.morfay-footer-contact-item.is-masked .js-phone-text::after {
    content: ' · показати';
    color: var(--morfay-accent-light);
    font-size: 12px;
}

/* ========================================================
   5. НИЖНЯ ПАНЕЛЬ КОНТАКТІВ (тільки мобільний)
   ======================================================== */

.mf-bar { display: none; }

@media (max-width: 900px) {
    .mf-bar {
        display: flex;
        gap: 8px;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: var(--z-bar);
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.92);
        -webkit-backdrop-filter: blur(12px) saturate(180%);
        backdrop-filter: blur(12px) saturate(180%);
        border-top: 1px solid var(--glass-border);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
        transform: translateY(110%);
        transition: transform .3s ease;
    }

    .mf-bar.is-visible { transform: translateY(0); }

    /* щоб панель не перекривала низ сторінки */
    body.mf-bar-on { padding-bottom: var(--mf-bar-h); }

    .mf-bar-btn {
        flex: 1 1 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 46px;
        border-radius: 12px;
        background: #F6F8F7;
        border: 1px solid rgba(79, 107, 99, 0.12);
        color: var(--text-primary) !important;
        text-decoration: none !important;
        font-size: 13px;
        font-weight: 700;
    }

    .mf-bar-call {
        flex: 1.4 1 0;
        background: var(--morfay-accent);
        border-color: var(--morfay-accent);
        color: #fff !important;
    }

    .mf-bar-btn.tg svg { color: var(--mf-tg); }
    .mf-bar-btn.vb svg { color: var(--mf-vb); }
}

/* ========================================================
   6. ВИПРАВЛЕНІ АНІМАЦІЇ FREEPIK
   Були у style.css всередині тегу <style>, через що браузер
   відкидав і їх, і сусідні правила. Тут уже без тегів.
   ======================================================== */

#freepik--background-complete--inject-64 {
    opacity: 0;
    animation: svgFadeIn 0.8s ease forwards;
    animation-delay: 0.2s;
}

#freepik--Shadow--inject-64,
#freepik--Table--inject-64 {
    opacity: 0;
    animation: svgFadeIn 0.6s ease forwards;
    animation-delay: 0.6s;
}

#freepik--Houses--inject-64 {
    opacity: 0;
    animation: svgSlideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.8s;
}

#freepik--Character--inject-64 {
    opacity: 0;
    animation: svgSlideRight 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 1.2s;
}

@keyframes svgSlideRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes svgFadeIn {
    to { opacity: 1; }
}

@keyframes svgSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .mf-cta-phone { animation: none; }
    .mf-bar { transition: none; }
}
