/*
 * Pływający przycisk „Zadzwoń” w lewym dolnym rogu.
 * Paleta z motywu Astra: akcent #bf6277 / #cb7287, ciemny #454F5E, krem #efe4dc.
 * Prawy dolny róg zostaje wolny — zajmuje go przycisk „do góry” i baner zgody.
 */

.itper-tel-widget {
    position: fixed;
    left: 20px;
    bottom: calc(20px + var(--itper-tel-przesuniecie, 0px));
    z-index: 9990;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    transition: bottom .25s ease;
}

/* ---------- przycisk ---------- */

.itper-tel-przycisk {
    display: inline-flex;
    align-items: center;
    gap: 0;
    height: 58px;
    padding: 0;
    border-radius: 999px;
    background: #bf6277;
    color: #ffffff !important;
    text-decoration: none !important;
    box-shadow: 0 10px 26px rgba(69, 79, 94, .32);
    overflow: hidden;
    transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.itper-tel-przycisk:hover,
.itper-tel-przycisk:focus-visible {
    background: #cb7287;
    color: #ffffff !important;
    box-shadow: 0 14px 32px rgba(69, 79, 94, .4);
    transform: translateY(-2px);
}

.itper-tel-przycisk:focus-visible {
    outline: 3px solid #efe4dc;
    outline-offset: 3px;
}

.itper-tel-ikona {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
}

.itper-tel-etykieta {
    font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
    white-space: nowrap;

    /* Domyślnie schowana — rozwija się przy najechaniu na urządzeniach z myszą. */
    max-width: 0;
    opacity: 0;
    padding-right: 0;
    transition: max-width .22s ease, opacity .18s ease, padding-right .22s ease;
}

@media (hover: hover) and (pointer: fine) {
    .itper-tel-przycisk:hover .itper-tel-etykieta,
    .itper-tel-przycisk:focus-visible .itper-tel-etykieta {
        max-width: 160px;
        opacity: 1;
        padding-right: 22px;
    }
}

/* Lekkie pulsowanie, żeby przycisk dał się zauważyć — raz na 6 sekund. */
@media (prefers-reduced-motion: no-preference) {
    .itper-tel-przycisk::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 999px;
        box-shadow: 0 0 0 0 rgba(191, 98, 119, .55);
        animation: itper-tel-puls 6s ease-out infinite;
        pointer-events: none;
    }

    .itper-tel-przycisk {
        position: relative;
    }

    .itper-tel-przycisk:hover::after {
        animation: none;
    }
}

@keyframes itper-tel-puls {
    0%   { box-shadow: 0 0 0 0 rgba(191, 98, 119, .5); }
    12%  { box-shadow: 0 0 0 14px rgba(191, 98, 119, 0); }
    100% { box-shadow: 0 0 0 0 rgba(191, 98, 119, 0); }
}

/* ---------- komunikat „numer skopiowany” ---------- */

.itper-tel-komunikat {
    order: -1;                       /* nad przyciskiem */
    max-width: min(300px, calc(100vw - 48px));
    padding: 10px 16px;
    border-radius: 12px;
    background: #454f5e;
    color: #ffffff;
    font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
    font-size: 13.5px;
    line-height: 1.4;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .32);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease;
}

.itper-tel-komunikat[hidden] {
    display: none;
}

.itper-tel-komunikat.itper-widoczny {
    opacity: 1;
    transform: translateY(0);
}

.itper-tel-komunikat strong {
    display: block;
    font-weight: 700;
    color: #efe4dc;
    letter-spacing: .01em;
}

/* ---------- telefon ---------- */

@media (max-width: 640px) {
    .itper-tel-widget {
        left: 14px;
        bottom: calc(14px + var(--itper-tel-przesuniecie, 0px));
    }

    .itper-tel-przycisk,
    .itper-tel-ikona {
        height: 54px;
    }

    .itper-tel-ikona {
        width: 54px;
        flex-basis: 54px;
    }
}

/* ---------- odnośniki tel:/mailto: w treści ---------- */

.itper-tel,
.itper-mail {
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* W nagłówkach (np. „Zadzwoń do nas +48 668 760 338”) odnośnik nie może
   rozbijać typografii — dziedziczy kolor nagłówka, podkreślenie na hover. */
h1 a.itper-tel, h2 a.itper-tel, h3 a.itper-tel, h4 a.itper-tel,
h1 a.itper-mail, h2 a.itper-mail, h3 a.itper-mail, h4 a.itper-mail,
.uagb-icon-list__label a.itper-tel,
.uagb-icon-list__label a.itper-mail,
.uagb-ifb-title a.itper-tel,
.uagb-ifb-title a.itper-mail {
    color: inherit !important;
    text-decoration: none !important;
}

h1 a.itper-tel:hover, h2 a.itper-tel:hover, h3 a.itper-tel:hover, h4 a.itper-tel:hover,
h1 a.itper-mail:hover, h2 a.itper-mail:hover, h3 a.itper-mail:hover, h4 a.itper-mail:hover,
.uagb-icon-list__label a.itper-tel:hover,
.uagb-icon-list__label a.itper-mail:hover,
.uagb-ifb-title a.itper-tel:hover,
.uagb-ifb-title a.itper-mail:hover {
    text-decoration: underline !important;
}
