/*
 * The promotion bar and the pricing pages' sale prices (public/site/assets/js/promo.js), on the public site and on
 * the app's signed-in pages. Nothing here applies until promo.js shows the bar (.zub-promo, html.zub-promo-on) or a
 * sale price (.zub-promo-deal).
 *
 * The bar carries its own colours, the same in the light and the dark theme: white on a violet that is at least
 * 9.9:1 against it at both ends of its gradient (tests/Frontend/promo-bar.test.cjs computes them).
 * It sits under every header, menu, overlay and dialog of the pages it is on: in the page's flow (a slot, or the
 * top of the page) it is under anything positioned after it; over the public site's pages at 990, above their
 * content (#smooth-wrapper: 1) and under their mobile-menu overlay (1000), their dialogs (1042 and up) and their
 * header (9999), whose top moves down by the bar's height, as does the content; at the bottom of the Desktop at 45,
 * in the height the Desktop keeps free for it (desktop.css keeps the cookie line's the same way), under its welcome
 * card (60) and the app's toasts (50). It never makes the page wider: it wraps, from 320px up.
 */
.zub-promo {
    box-sizing: border-box;
    position: relative;
    width: 100%;
    margin: 0;
    padding: 8px 16px;
    background-color: #4c1d95;
    background-image: linear-gradient(90deg, #4c1d95, #3730a3);
    color: #fff;
    font-family: var(--body-font, var(--font-family-primary, system-ui)), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: normal;
    text-align: center;
    -webkit-text-size-adjust: 100%;
}

.zub-promo *,
.zub-promo *::before,
.zub-promo *::after {
    box-sizing: border-box;
}

.zub-promo-in {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.zub-promo .zub-promo-text {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: #fff;
    font: inherit;
    overflow-wrap: anywhere;
}

/* the public site makes every a and span inline-block, and colours its links on hover */
.zub-promo .zub-promo-link,
.zub-promo .zub-promo-link:visited,
.zub-promo .zub-promo-link:hover,
.zub-promo .zub-promo-link:focus {
    display: inline;
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.zub-promo .zub-promo-link:hover {
    text-decoration-thickness: 2px;
}

.zub-promo .zub-promo-close {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font: 400 22px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
}

.zub-promo .zub-promo-close:hover {
    background: rgba(255, 255, 255, .16);
}

.zub-promo .zub-promo-close span {
    display: inline;
}

.zub-promo .zub-promo-link:focus-visible,
.zub-promo .zub-promo-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* over the top of a public site page: its header and its content move down by the bar's height */
.zub-promo.zub-promo--over {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 990;
}

html.zub-promo-over .header-area {
    margin-top: var(--zub-promo-h, 0px);
}

html.zub-promo-over #smooth-content {
    padding-top: var(--zub-promo-h, 0px);
}

/* the not-found page: its brand is fixed at the top, and its content is centred in the window */
html.zub-promo-over #brand-link {
    margin-top: var(--zub-promo-h, 0px);
}

html.zub-promo-over body.zub-promo-pad {
    padding-top: var(--zub-promo-h, 0px);
}

/* the Desktop and its email verification page: above the cookie line, in a height they keep free */
.zub-promo.zub-promo--foot {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--cookie-notice-height, 0px);
    z-index: 45;
}

html.zub-promo-foot #zd,
html.zub-promo-foot #zd-verify {
    bottom: calc(var(--cookie-notice-height, 0px) + var(--zub-promo-h, 0px));
}

html.zub-promo-foot #zd ~ #concierge,
html.zub-promo-foot #zd-verify ~ #concierge {
    bottom: calc(1rem + var(--zd-guide-lift, 0px) + var(--cookie-notice-height, 0px) + var(--zub-promo-h, 0px));
}

html.zub-promo-foot #zd ~ #concierge > #concierge-panel,
html.zub-promo-foot #zd-verify ~ #concierge > #concierge-panel {
    max-height: calc(100dvh - 7rem - var(--zd-guide-lift, 0px) - var(--cookie-notice-height, 0px) - var(--zub-promo-h, 0px));
}

/* ------------------------------------------------- the pricing pages: a sale price, over the regular one */

.zub-promo-deal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: -8px 0 8px;
    font-family: var(--body-font, inherit);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
}

.zub-promo-deal[hidden] {
    display: none;
}

.zub-promo-deal .zub-promo-was {
    display: inline;
    color: #4b5563;
    font-size: 18px;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

.zub-promo-deal .zub-promo-mark {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: #6d30fb;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.zub-promo-deal .zub-promo-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
