.promo-widget {
    position: fixed;
    right: max(24px, env(safe-area-inset-right));
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 28;
    display: grid;
    justify-items: end;
    gap: 12px;
    width: min(390px, calc(100vw - 32px));
    font-family: var(--ds-font-body);
}

.promo-trigger,
.promo-close {
    border: 0;
    cursor: pointer;
    font: inherit;
}

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

.promo-trigger {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 50px;
    padding: 10px 20px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-color-accent);
    box-shadow: 0 12px 30px rgba(23, 36, 61, 0.24);
    color: var(--ds-color-white);
    font-weight: 750;
    letter-spacing: 0.01em;
}

.promo-widget.should-attract .promo-trigger {
    animation: promo-gentle-lift 700ms ease-in-out 2;
}

.promo-trigger:hover {
    transform: translateY(-2px);
}

.promo-trigger:focus-visible,
.promo-close:focus-visible,
.promo-action:focus-visible {
    outline: 3px solid var(--ds-color-brand);
    outline-offset: 3px;
}

.promo-card {
    position: relative;
    width: 100%;
    padding: 24px;
    border: 1px solid var(--ds-color-line);
    border-radius: var(--ds-radius-card);
    background: var(--ds-color-white);
    box-shadow: var(--ds-shadow-lifted);
    color: var(--ds-color-ink);
}

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

.promo-label {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--ds-color-accent);
    font-size: var(--ds-text-xs);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.promo-card h2 {
    max-width: calc(100% - 30px);
    margin: 0 0 10px;
    font-family: var(--ds-font-display);
    font-size: 1.35rem;
    line-height: 1.2;
}

.promo-card > p {
    margin: 0 0 14px;
    color: var(--ds-color-muted);
    line-height: 1.55;
}

.promo-card .promo-date {
    color: var(--ds-color-ink);
    font-size: var(--ds-text-sm);
    font-weight: 700;
}

.promo-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    background: transparent;
    color: var(--ds-color-muted);
    font-size: 1.7rem;
    line-height: 1;
}

.promo-close:hover {
    background: var(--ds-color-paper-blue);
    color: var(--ds-color-ink);
}

.redesign-page .promo-action {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-color-brand);
    color: var(--ds-color-white);
    font-weight: 750;
    text-decoration: none;
}

@keyframes promo-gentle-lift {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-7px);
    }
}

@media screen and (max-width: 700px) {
    .promo-widget {
        right: 16px;
        bottom: max(16px, env(safe-area-inset-bottom));
        width: calc(100vw - 32px);
    }

    /* While the quiet cookie notice is visible it owns the bottom of a narrow
       screen, so the promotion widget moves above it and keeps its safe-area
       clearance. The lift also has to clear the hero appointment call to
       action, because expanding the widget replaces the trigger with a much
       taller card that grows upwards from this offset; once the notice is
       hidden the rule stops applying. */
    body:has(.rd-consent:not([hidden])) .promo-widget {
        bottom: calc(max(14px, env(safe-area-inset-bottom)) + 270px);
    }

    .promo-card {
        max-height: min(420px, calc(100vh - 104px));
        overflow-y: auto;
        padding: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .promo-widget.should-attract .promo-trigger {
        animation: none;
    }

    .promo-trigger:hover {
        transform: none;
    }
}
