/* Belka kontaktowa w nagłówku + widżet tel/e-mail. Opis: assets/functions/contact_bar.php */

/* ===== BELKA - wspólne ===== */
.rw-bar__link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: "Archivo", sans-serif;
    font-size: 14px;
    letter-spacing: 0.5px;
    line-height: 1;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

/* bez podkreśleń i niebieskiego koloru z globalnych stylów linków */
.rw-bar__link,
.rw-bar__link:hover,
.rw-bar__link:focus,
.rw-bar__link:visited,
.rw-widget__btn,
.rw-widget__btn:hover,
.rw-widget__btn:focus,
.rw-widget__btn:visited,
.rw-widget__btn span {
    text-decoration: none !important;
    border-bottom: 0 !important;
    box-shadow: none;
}

.rw-bar__link:hover,
.rw-bar__link:focus,
.rw-bar__link:visited {
    color: #fff;
}

.rw-bar__link:hover span {
    opacity: 0.8;
}

.rw-bar__link svg {
    flex: 0 0 auto;
}

/* ===== DESKTOP (>= 992px) ===== */
.rw-bar--desktop {
    height: 32px;
}

.rw-bar--desktop .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 28px;
    height: 100%;
}

.rw-bar__link--phone {
    font-weight: 700;
    font-size: 15px;
}

/* belka zajmuje dotychczasowy odstęp 32px nad nagłówkiem - układ strony bez zmian */
body.rw-contact-header .naglowek {
    top: 0;
}

/* mieszkanie Brylantowej i wyszukiwarka: czarny nagłówek z padding 32px (laguna-new.css) -
   belka zajmuje górny odstęp zamiast dokładać pusty pas */
body.rw-contact-header.single-brylantowa .naglowek,
body.rw-contact-header.page-template-template-search .naglowek {
    padding-top: 0;
}

/* nagłówek przyklejony po przewinięciu - wszystkie strony (rw-sticky-header) */
body.rw-sticky-header .naglowek.naglowek--fixed {
    position: fixed;
    top: 0;
    background: #000;
    padding-bottom: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    animation: rw-slide-down 250ms ease;
}

body.rw-sticky-header .naglowek.naglowek--fixed .naglowek__logo,
body.rw-sticky-header .naglowek.naglowek--fixed .naglowek__logo svg {
    width: 160px;
    height: 43px;
}

body.admin-bar.rw-sticky-header .naglowek.naglowek--fixed {
    top: 32px;
}

/* strony inwestycji (bez belki) - przyklejony sam rząd z logo i menu */
body.rw-sticky-header:not(.rw-contact-header) .naglowek.naglowek--fixed {
    padding-top: 12px;
}

/* 992-1199: menu zajmuje dwa rzędy - przyklejamy tylko belkę z kontaktem */
@media (min-width: 992px) and (max-width: 1199px) {
    body.rw-contact-header .naglowek.naglowek--fixed {
        padding-bottom: 0;
    }

    body.rw-contact-header .naglowek.naglowek--fixed > .container {
        display: none;
    }

    /* strony inwestycji: menu w dwóch rzędach byłoby za wysokie - bez przyklejania */
    body.rw-sticky-header:not(.rw-contact-header) .naglowek.naglowek--fixed {
        position: absolute;
        top: 32px;
        padding: 0;
        background: transparent;
        box-shadow: none;
        animation: none;
    }

    body.rw-sticky-header:not(.rw-contact-header) .naglowek.naglowek--fixed .naglowek__logo,
    body.rw-sticky-header:not(.rw-contact-header) .naglowek.naglowek--fixed .naglowek__logo svg {
        width: 235px;
        height: 63px;
    }
}

@keyframes rw-slide-down {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* ===== MOBILE (< 992px) ===== */
.rw-bar--mobile {
    display: none;
}

@media only screen and (max-width: 991px) {
    body.rw-sticky-header .naglowek--mobile {
        position: fixed;
    }

    body.rw-contact-header .naglowek--mobile {
        padding: 0;
    }

    body.admin-bar.rw-sticky-header .naglowek--mobile {
        top: 46px;
    }

    .rw-bar--mobile {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 32px;
        background: #fff;
    }

    .rw-bar--mobile .rw-bar__link {
        color: #000;
        font-weight: 700;
        font-size: 15px;
    }

    .rw-bar--mobile .rw-bar__link:hover,
    .rw-bar--mobile .rw-bar__link:focus,
    .rw-bar--mobile .rw-bar__link:visited {
        color: #000;
    }

    /* wysokość jak dotychczas (~93px): belka 32 + rząd z logo 61 */
    body.rw-contact-header .naglowek--mobile .naglowek__logo {
        padding: 10px 20px;
        width: auto;
    }

    body.rw-contact-header .naglowek--mobile .naglowek__logo svg {
        width: 154px;
        height: 41px;
    }

    body.rw-contact-header .hamburger {
        top: 54px;
    }

    body.admin-bar.rw-contact-header .hamburger {
        top: 100px;
    }
}

/* ===== WIDŻET W PRAWYM DOLNYM ROGU ===== */
.rw-widget {
    position: fixed;
    right: 40px;
    bottom: 102px; /* nad przyciskiem "wróć do góry" (bottom 40 + 50 + 12) */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.rw-widget__btn,
.rw-widget__btn:hover,
.rw-widget__btn:focus,
.rw-widget__btn:visited {
    display: flex;
    align-items: center;
    color: #000;
}

.rw-widget__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    color: #000;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transition: background 200ms ease, color 200ms ease;
}

.rw-widget__icon svg {
    width: 22px;
    height: 22px;
}

.rw-widget__label {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    margin-right: 0;
    padding: 0;
    background: #000;
    color: #fff;
    font-family: "Archivo", sans-serif;
    font-size: 14px;
    line-height: 36px;
    border-radius: 18px;
    transition: max-width 250ms ease, opacity 200ms ease, margin 250ms ease, padding 250ms ease;
}

.rw-widget__btn:hover .rw-widget__icon,
.rw-widget__btn:focus-visible .rw-widget__icon {
    background: #000;
    color: #fff;
}

.rw-widget__btn:hover .rw-widget__label,
.rw-widget__btn:focus-visible .rw-widget__label {
    max-width: 280px;
    opacity: 1;
    margin-right: 10px;
    padding: 0 16px;
}

@media only screen and (min-width: 998px) and (max-width: 1600px) {
    .rw-widget {
        right: 10px;
        bottom: 70px; /* "wróć do góry" ma tu bottom 10 */
    }
}

@media only screen and (max-width: 991px) {
    .rw-widget {
        right: 14px;
        bottom: 14px;
    }

    .rw-widget__icon {
        width: 46px;
        height: 46px;
    }

    .rw-widget__label {
        display: none;
    }
}
