/* Universal Contact Top Bar: all styles scoped to this plugin. */
#uctb-topbar {
    --uctb-active-text: var(--uctb-text, #657545);
    --uctb-active-background: var(--uctb-background, #F7F5F0);
    --uctb-active-hover: var(--uctb-hover, #35472B);
    width: 100%;
    background: var(--uctb-active-background);
    color: var(--uctb-active-text);
    font-family: inherit;
    font-size: var(--uctb-font-size, 15px);
    font-weight: 400;
    line-height: 1.5;
    box-sizing: border-box;
}

#uctb-topbar *, #uctb-topbar *::before, #uctb-topbar *::after {
    box-sizing: border-box;
}

#uctb-topbar .uctb-inner {
    display: grid;
    grid-template-columns: repeat(var(--uctb-items, 3), minmax(0, 1fr));
    align-items: center;
    column-gap: 22px;
    row-gap: 8px;
    min-height: 38px;
    padding: 8px 18px;
    margin-inline: auto;
}

/* Other block-based themes can provide their global wide-size variable. */
#uctb-topbar .uctb-inner:not(.zak-container) {
    max-width: var(--wp--style--global--wide-size, none);
}

/* Optional fourth slot: safe HTML such as opening hours. */
#uctb-topbar .uctb-additional {
    min-width: 0;
    max-width: 100%;
    font: inherit;
    line-height: inherit;
    overflow-wrap: anywhere;
    color: inherit;
    text-align: left;
}

#uctb-topbar .uctb-additional p {
    font: inherit;
    line-height: inherit;
    color: inherit;
    margin: 0;
    padding: 0;
}

#uctb-topbar .uctb-additional p + p { margin-top: .4em; }
#uctb-topbar .uctb-additional a,
#uctb-topbar .uctb-additional a:visited {
    color: var(--uctb-active-text) !important;
    text-decoration: none;
}
#uctb-topbar .uctb-additional a:hover,
#uctb-topbar .uctb-additional a:focus-visible {
    color: var(--uctb-active-hover) !important;
}

/* Optional WhatsApp link shares the phone's existing desktop column. */
#uctb-topbar .uctb-phone-group {
    display: inline-flex;
    align-items: center;
    justify-self: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}
#uctb-topbar .uctb-phone-group:first-child { justify-self: start; }
#uctb-topbar .uctb-phone-group:last-child { justify-self: end; }
#uctb-topbar .uctb-link.uctb-whatsapp,
#uctb-topbar .uctb-link.uctb-whatsapp:visited,
#uctb-topbar .uctb-link.uctb-whatsapp:hover,
#uctb-topbar .uctb-link.uctb-whatsapp:focus-visible {
    color: #25D366 !important;
}

#uctb-topbar .uctb-whatsapp .uctb-icon {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
}

#uctb-topbar .uctb-link { justify-self: center; }
#uctb-topbar .uctb-link:first-child { justify-self: start; }
#uctb-topbar .uctb-link:last-child,
#uctb-topbar .uctb-additional:last-child { justify-self: end; }

#uctb-topbar .uctb-link,
#uctb-topbar .uctb-link:visited {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--uctb-active-text) !important;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-decoration: none !important;
    transition: color .18s ease;
}

#uctb-topbar .uctb-link:hover,
#uctb-topbar .uctb-link:focus-visible {
    color: var(--uctb-active-hover) !important;
}

#uctb-topbar .uctb-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

#uctb-topbar .uctb-link span {
    overflow-wrap: anywhere;
}

#uctb-topbar .uctb-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    display: block;
    color: inherit;
}

@media (max-width: 768px) {
    #uctb-topbar {
        --uctb-active-text: var(--uctb-mobile-text, #E0E0E0);
        --uctb-active-background: var(--uctb-mobile-background, #252528);
        --uctb-active-hover: var(--uctb-mobile-hover, #A8B77A);
        font-size: var(--uctb-mobile-font-size, 16px);
    }

    #uctb-topbar .uctb-inner {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        gap: 10px;
        padding: 12px 18px;
    }

    #uctb-topbar .uctb-inner > * {
        justify-self: center !important;
    }

    #uctb-topbar .uctb-phone-group {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        justify-self: center !important;
    }

    #uctb-topbar .uctb-additional {
        text-align: center;
    }

    #uctb-topbar .uctb-link {
        justify-content: center;
        text-align: center;
    }

    /* Applied only when a supported mobile navigation container is found. */
    #uctb-topbar.uctb-in-mobile-menu {
        width: 100%;
        max-width: none;
        flex: 0 0 auto;
        position: relative;
        border-top: 1px solid var(--uctb-mobile-divider, #49494D);
        margin: 14px 0 0;
    }

    #uctb-topbar.uctb-in-mobile-menu .uctb-inner,
    #uctb-topbar.uctb-in-mobile-menu .uctb-inner.zak-container {
        width: 100%;
        max-width: none;
        min-height: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 26px 24px;
        margin: 0;
        gap: 15px;
    }

    #uctb-topbar.uctb-in-mobile-menu .uctb-phone-group {
        width: 100%;
        align-items: flex-start;
        gap: 15px;
    }

    #uctb-topbar.uctb-in-mobile-menu .uctb-additional {
        align-self: stretch;
        text-align: left;
    }

    #uctb-topbar.uctb-in-mobile-menu .uctb-link {
        justify-content: flex-start;
        align-items: flex-start;
        text-align: left;
        width: 100%;
        line-height: 1.5;
    }
}
