/* =========================================================
   ZUNA SITE CORE — GLOBAL UX
   Enhances the existing Astra header. Does not replace it.
   ========================================================= */

:root {
    --zuna-global-header-transition: 420ms cubic-bezier(.22,.61,.36,1);
}

/* Existing Astra header becomes smart-sticky. */
#masthead {
    position: sticky !important;
    top: 0;
    z-index: 99990 !important;
    transform: translate3d(0, 0, 0);
    transition:
        transform var(--zuna-global-header-transition),
        box-shadow 260ms ease,
        backdrop-filter 260ms ease !important;
    will-change: transform;
}

body.admin-bar #masthead {
    top: 32px;
}

#masthead.zuna-smart-header--hidden {
    transform: translate3d(0, calc(-100% - 4px), 0) !important;
}

#masthead.zuna-smart-header--visible {
    transform: translate3d(0, 0, 0) !important;
}

#masthead.zuna-smart-header--scrolled {
    box-shadow: 0 12px 34px rgba(0, 0, 0, .18) !important;
}

/* Astra's native Back-to-Top button, plus plugin fallback if Astra's is off. */
#ast-scroll-top,
#zuna-back-to-top {
    right: 22px !important;
    bottom: 22px !important;
    width: 46px !important;
    height: 46px !important;
    border: 1px solid rgba(70, 209, 204, .34) !important;
    border-radius: 12px !important;
    background: #061B2D !important;
    color: #46D1CC !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .24) !important;
    transition:
        opacity 220ms ease,
        transform 220ms ease,
        background-color 220ms ease,
        color 220ms ease !important;
}

#ast-scroll-top:hover,
#zuna-back-to-top:hover {
    background: #46D1CC !important;
    color: #061B2D !important;
    transform: translateY(-3px) !important;
}

#zuna-back-to-top {
    position: fixed;
    z-index: 99980;
    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    pointer-events: none;
}

#zuna-back-to-top svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#zuna-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Keep Back-to-Top above Home V2's WhatsApp button. */
body.zuna-has-whatsapp #ast-scroll-top,
body.zuna-has-whatsapp #zuna-back-to-top {
    bottom: 84px !important;
}

/* Floating WhatsApp action shared by every public page. */
.zuna-whatsapp {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 800;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 16px;
    background: #25d366;
    box-shadow: 0 18px 38px rgba(0, 0, 0, .32);
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.zuna-whatsapp:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 22px 44px rgba(0, 0, 0, .36);
}

.zuna-whatsapp svg {
    width: 29px;
    height: 29px;
    fill: #fff;
}

/* Keep the expanded seven-item primary navigation on one line at laptop widths. */
@media (min-width: 922px) and (max-width: 1450px) {
    #masthead .main-header-menu > .menu-item > .menu-link {
        padding-inline: clamp(9px, .9vw, 14px) !important;
        font-size: clamp(.92rem, 1.35vw, 1.12rem) !important;
        white-space: nowrap;
    }

    #masthead .ast-builder-button-wrap .ast-custom-button {
        padding-inline: 15px !important;
    }
}

@media (max-width: 782px) {
    body.admin-bar #masthead {
        top: 46px;
    }
}

@media (max-width: 600px) {
    #ast-scroll-top,
    #zuna-back-to-top {
        right: 14px !important;
        bottom: 14px !important;
        width: 43px !important;
        height: 43px !important;
        border-radius: 11px !important;
    }

    body.zuna-has-whatsapp #ast-scroll-top,
    body.zuna-has-whatsapp #zuna-back-to-top {
        bottom: 74px !important;
    }

    .zuna-whatsapp {
        right: 14px;
        bottom: 14px;
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #masthead,
    #ast-scroll-top,
    #zuna-back-to-top,
    .zuna-whatsapp {
        transition-duration: 1ms !important;
    }
}
