/*
 * Seasonal sales: the bar above the header and the band above the plans (promo/). Same build as on
 * xplodedthemes.com, in WPIDE's colors: the ground is the site's indigo with its primary (#6576ff) glowing
 * through; each event brings only its accent (--sale-accent, from the site's palette) and its motif.
 */

.wp-sale-bar,
.wp-sale {
    --sale-bg: #141c3d;
    --sale-glow: #6576ff;
    --sale-ease: cubic-bezier(.16, 1, .3, 1);
}

.wp-sale-num {
    font-variant-numeric: tabular-nums;
}

/* The bar ---------------------------------------------------------------------------------------------- */

.wp-sale-bar {
    position: relative;
    z-index: 1001;
    display: block;
    overflow: hidden;
    border-bottom: 1px solid rgba(101, 118, 255, .35);
    background:
        radial-gradient(60% 220% at 50% 0%, rgba(101, 118, 255, .45), transparent 70%),
        radial-gradient(30% 300% at 0% 50%, color-mix(in srgb, var(--sale-accent) 22%, transparent), transparent 70%),
        var(--sale-bg);
    color: rgba(255, 255, 255, .78);
    font-size: 14px;
    text-decoration: none;
}

.wp-sale-bar:hover {
    color: rgba(255, 255, 255, .78);
}

/* The landing page's header floats over the hero from the top of the page: with the bar, from below it. */
.wp-sale-bar ~ .nk-app-root .header {
    position: relative;
}

.wp-sale-bar__sky {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.wp-sale-bar__p {
    position: absolute;
    top: 50%;
    left: var(--x);
    width: var(--s);
    height: var(--s);
    margin-top: calc(var(--s) / -2);
    color: var(--sale-accent);
    opacity: .3;
    animation: wp-sale-drift var(--d) ease-in-out var(--delay) infinite alternate;
}

.wp-sale-bar__p svg {
    display: block;
    width: 100%;
    height: 100%;
}

@keyframes wp-sale-drift {
    from { transform: translate(-18px, -6px) rotate(-12deg); }
    to { transform: translate(18px, 6px) rotate(12deg); }
}

.wp-sale-bar__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 44px;
    padding: 6px 16px;
}

.wp-sale-bar__mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--sale-accent);
    color: var(--sale-bg);
    box-shadow: 0 0 18px color-mix(in srgb, var(--sale-accent) 55%, transparent);
    animation: wp-sale-pop 2.4s ease-in-out infinite;
}

.wp-sale-bar__mark svg {
    width: 15px;
    height: 15px;
}

@keyframes wp-sale-pop {
    50% { transform: scale(1.12) rotate(-6deg); }
}

.wp-sale-bar__name {
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
}

.wp-sale-bar__offer b {
    color: var(--sale-accent);
    font-weight: 700;
}

.wp-sale-bar__offer,
.wp-sale-bar__when {
    white-space: nowrap;
}

.wp-sale-bar__offer::before,
.wp-sale-bar__when::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 3px;
    margin-right: 12px;
    vertical-align: middle;
    border-radius: 50%;
    background: color-mix(in srgb, var(--sale-accent) 70%, #fff);
}

.wp-sale-bar__when .wp-sale-num {
    color: #fff;
    font-weight: 500;
}

.wp-sale-bar__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 6px;
    padding: 4px 10px 4px 12px;
    border: 1px solid rgba(101, 118, 255, .7);
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color .25s, border-color .25s;
}

.wp-sale-bar__arrow {
    font-size: 14px;
    color: #b3bbff;
    transition: transform .3s var(--sale-ease);
}

.wp-sale-bar:hover .wp-sale-bar__cta {
    border-color: #6576ff;
    background: #6576ff;
}

.wp-sale-bar:hover .wp-sale-bar__arrow {
    color: #fff;
    transform: translateX(3px);
}

/* The band --------------------------------------------------------------------------------------------- */

.wp-sale {
    padding: clamp(48px, 7vw, 88px) 0 0;
    /* The bar's link lands here below the sticky header. */
    scroll-margin-top: 40px;
}

.wp-sale__defs {
    position: absolute;
}

.wp-sale__card {
    --sale-pad: clamp(28px, 5vw, 64px);
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 32px clamp(32px, 5vw, 72px);
    overflow: hidden;
    isolation: isolate;
    padding: var(--sale-pad);
    border: 1px solid rgba(101, 118, 255, .35);
    border-radius: 24px;
    background:
        radial-gradient(60% 90% at 100% 0%, rgba(101, 118, 255, .55), transparent 70%),
        radial-gradient(50% 80% at 0% 110%, color-mix(in srgb, var(--sale-accent) 20%, transparent), transparent 70%),
        var(--sale-bg);
    box-shadow: 0 40px 100px rgba(101, 118, 255, .22);
    color: #fff;
}

/* The motif, drifting: up by default; each event sets its own way below. */
.wp-sale__sky {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.wp-sale__p {
    position: absolute;
    bottom: -40px;
    left: var(--x);
    width: var(--s);
    height: var(--s);
    color: var(--sale-accent);
    opacity: var(--o);
    animation: wp-sale-rise var(--d) linear var(--delay) infinite;
}

@keyframes wp-sale-rise {
    from { transform: translateY(0) rotate(-10deg); }
    50% { transform: translate(14px, -260px) rotate(8deg); }
    to { transform: translate(-6px, -560px) rotate(-6deg); }
}

/* The emblem: the motif, large and lit, behind the clock. */
.wp-sale__emblem {
    position: absolute;
    top: 50%;
    right: clamp(-60px, -2vw, -20px);
    z-index: -1;
    width: clamp(220px, 26vw, 340px);
    height: clamp(220px, 26vw, 340px);
    color: var(--sale-accent);
    opacity: .2;
    filter: drop-shadow(0 0 40px var(--sale-glow));
    transform: translateY(-50%) rotate(-12deg);
}

.wp-sale__emblem svg {
    width: 100%;
    height: 100%;
}

.wp-sale__copy {
    position: relative;
    min-width: 0;
}

.wp-sale__label {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
}

.wp-sale__label > span:last-child {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
    font-weight: 400;
}

.wp-sale__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sale-accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--sale-accent) 30%, transparent);
}

.wp-sale--live .wp-sale__dot {
    animation: wp-sale-live 1.6s ease-in-out infinite;
}

@keyframes wp-sale-live {
    50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--sale-accent) 0%, transparent); }
}

.wp-sale__offer {
    margin: 14px 0 0;
    color: #fff;
    font-size: clamp(40px, 5vw, 64px);
    font-weight: 500;
    letter-spacing: -.03em;
    line-height: 1;
}

.wp-sale__offer b {
    font-size: 1.8em;
    font-weight: 700;
    letter-spacing: -.04em;
    background: linear-gradient(180deg, #fff 10%, #9aa6ff 75%, var(--sale-accent) 130%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.wp-sale__line {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, .8);
    font-size: clamp(16px, 1.4vw, 19px);
}

.wp-sale__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-top: 28px;
}

.btn.wp-sale__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    border-color: #6576ff;
    background: #6576ff;
    color: #fff;
    box-shadow: 0 10px 30px rgba(101, 118, 255, .45);
}

.btn.wp-sale__cta:hover {
    border-color: #798bff;
    background: #798bff;
    color: #fff;
}

.btn.wp-sale__cta .icon {
    transition: transform .3s var(--sale-ease);
}

.btn.wp-sale__cta:hover .ni-arrow-right {
    transform: translateX(3px);
}

/* The code, as a ticket you can copy. */
.wp-sale__code {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 16px 0 18px;
    border: 1.5px dashed color-mix(in srgb, var(--sale-accent) 75%, transparent);
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    color: rgba(255, 255, 255, .72);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background-color .2s, border-color .2s;
}

.wp-sale__code:hover {
    border-color: var(--sale-accent);
    background: rgba(255, 255, 255, .09);
}

.wp-sale__code b {
    color: #fff;
    font-size: 17px;
    letter-spacing: .08em;
}

.wp-sale__copyicon,
.wp-sale__doneicon {
    font-size: 17px;
    transition: opacity .2s, transform .3s var(--sale-ease);
}

.wp-sale__doneicon {
    position: absolute;
    right: 16px;
    color: #1ee0ac;
    opacity: 0;
    transform: scale(.5);
}

.wp-sale__code.is-done .wp-sale__copyicon {
    opacity: 0;
    transform: scale(.5);
}

.wp-sale__code.is-done .wp-sale__doneicon {
    opacity: 1;
    transform: none;
}

.wp-sale__ics {
    color: rgba(255, 255, 255, .78);
    font-size: 14px;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, .3);
    text-underline-offset: 3px;
}

.wp-sale__ics:hover {
    color: #fff;
}

.wp-sale__note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 16px 0 0;
    color: rgba(255, 255, 255, .75);
    font-size: 14px;
}

.wp-sale__note .icon {
    margin-top: 2px;
    color: var(--sale-accent);
    font-size: 16px;
}

/* The clock: four glass tiles; a digit that changes drops in. */
.wp-sale__clock {
    position: relative;
}

.wp-sale__clocklabel {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.wp-sale__cells {
    display: grid;
    grid-template-columns: repeat(4, 84px);
    gap: 10px;
}

.wp-sale__cell {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 16px 0 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .03));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.wp-sale__cell b {
    display: block;
    color: #fff;
    font-size: 38px;
    font-weight: 500;
    letter-spacing: -.02em;
    line-height: 1;
}

.wp-sale__cell b.is-tick {
    animation: wp-sale-tick .45s var(--sale-ease);
}

@keyframes wp-sale-tick {
    from { opacity: 0; transform: translateY(-40%); filter: blur(3px); }
}

.wp-sale__cell em {
    color: rgba(255, 255, 255, .62);
    font-size: 11.5px;
    font-style: normal;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* Each event's own motion ------------------------------------------------------------------------------ */

.wp-sale--valentine .wp-sale__emblem { animation: wp-sale-beat 1.4s ease-in-out infinite; }

@keyframes wp-sale-beat {
    0%, 40%, 100% { transform: translateY(-50%) rotate(-12deg) scale(1); }
    15% { transform: translateY(-50%) rotate(-12deg) scale(1.08); }
    28% { transform: translateY(-50%) rotate(-12deg) scale(1.02); }
}

.wp-sale--mothers .wp-sale__emblem,
.wp-sale--xmas .wp-sale__emblem { animation: wp-sale-turn 40s linear infinite; }

@keyframes wp-sale-turn {
    to { transform: translateY(-50%) rotate(348deg); }
}

.wp-sale--fathers .wp-sale__p,
.wp-sale--bfcm .wp-sale__p {
    top: calc(var(--x) * .8);
    bottom: auto;
    animation: wp-sale-twinkle calc(var(--d) / 3) ease-in-out var(--delay) infinite;
}

@keyframes wp-sale-twinkle {
    0%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); }
    50% { opacity: var(--o); transform: scale(1) rotate(20deg); }
}

.wp-sale--bfcm .wp-sale__emblem { animation: wp-sale-flash 3.2s steps(1) infinite; }

@keyframes wp-sale-flash {
    0%, 100% { opacity: .2; }
    4% { opacity: .6; }
    7% { opacity: .2; }
    10% { opacity: .5; }
}

.wp-sale--fathers .wp-sale__emblem { animation: wp-sale-glow 4s ease-in-out infinite; }

@keyframes wp-sale-glow {
    50% { opacity: .34; transform: translateY(-50%) rotate(0deg) scale(1.05); }
}

/* Halloween: bats flap across from the left; the emblem sways. */
.wp-sale--halloween .wp-sale__p {
    top: var(--x);
    bottom: auto;
    left: -40px;
    animation: wp-sale-fly var(--d) linear var(--delay) infinite;
}

@keyframes wp-sale-fly {
    0% { transform: translate(0, 0) scaleY(1); }
    10% { transform: translate(10vw, -10px) scaleY(.5); }
    20% { transform: translate(20vw, 0) scaleY(1); }
    30% { transform: translate(30vw, -12px) scaleY(.5); }
    40% { transform: translate(40vw, 0) scaleY(1); }
    50% { transform: translate(50vw, -10px) scaleY(.5); }
    60% { transform: translate(60vw, 0) scaleY(1); }
    70% { transform: translate(70vw, -12px) scaleY(.5); }
    80% { transform: translate(80vw, 0) scaleY(1); }
    90% { transform: translate(90vw, -10px) scaleY(.5); }
    100% { transform: translate(105vw, 0) scaleY(1); }
}

.wp-sale--halloween .wp-sale__emblem { animation: wp-sale-sway 5s ease-in-out infinite alternate; }

@keyframes wp-sale-sway {
    from { transform: translateY(-50%) rotate(-18deg); }
    to { transform: translateY(-46%) rotate(-4deg); }
}

/* Christmas: snow falls. */
.wp-sale--xmas .wp-sale__p {
    top: -40px;
    bottom: auto;
    color: #fff;
    animation: wp-sale-fall var(--d) linear var(--delay) infinite;
}

@keyframes wp-sale-fall {
    from { transform: translateY(0) rotate(0deg); }
    50% { transform: translate(-16px, 260px) rotate(90deg); }
    to { transform: translate(10px, 560px) rotate(180deg); }
}

.wp-sale--xmas .wp-sale__emblem {
    color: #fff;
    opacity: .12;
}

/* Smaller screens -------------------------------------------------------------------------------------- */

@media (max-width: 991px) {
    .wp-sale__card {
        grid-template-columns: minmax(0, 1fr);
    }

    .wp-sale__emblem {
        right: -50px;
        width: 220px;
        height: 220px;
    }
}

@media (max-width: 767px) {
    .wp-sale-bar__when,
    .wp-sale-bar__cta > span {
        display: none;
    }

    .wp-sale-bar__cta,
    .wp-sale-bar:hover .wp-sale-bar__cta {
        margin: 0;
        padding: 0;
        border: 0;
        background: none;
    }
}

@media (max-width: 575px) {
    .wp-sale__cells {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .wp-sale__cell b {
        font-size: 28px;
    }

    .wp-sale__actions > * {
        flex: 1 1 100%;
        justify-content: center;
    }
}

@media (max-width: 340px) {
    .wp-sale-bar__offer {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wp-sale-bar :is(.wp-sale-bar__p, .wp-sale-bar__mark),
    .wp-sale :is(.wp-sale__p, .wp-sale__emblem, .wp-sale__dot, .wp-sale__cell b) {
        animation: none !important;
    }
}
