/*
 * Homepage sale hero (inc/home-sale-hero.php; switch pep_home_sale_hero_enabled).
 *
 * Loaded on the front page only, after home-redesign.css, and only while the band prints. This file declares no token
 * of its own: colours are the --pep-* tokens from home-redesign.css :root or white, except the button's hover pink
 * (the literal home-redesign.css uses for its own button hover) and the vial shadow (the --pep-shadow tint at a
 * higher alpha); the headline font is --secondary-font from style.css. Classes are home-sale*; the band adds no body
 * class.
 *
 * The header is position:fixed, so the first block on the page supplies its clearance (home-redesign.css gives the
 * purity hero 78 / 92 / 106 px). The band is first while it prints, so its stage carries that clearance as top
 * padding (the wash runs up under the header, no white strip) and the purity hero below it drops to a plain gap.
 *
 * .main-wrapper pads the page 20px (12px to 479). The stage alone takes that padding back with negative margins so
 * the wash reaches the window's edges; the copy stays inside the wrapper, in the same .container box as the purity
 * hero below, so their edges line up at every width. Measured header heights the stage's top padding clears: 88 on
 * a phone, 99 at 800, 95 at 1000, 107 from 1200. The sale's own bar inside the header (body.pep-nc-bar, signed-in
 * customers) pushes .main-wrapper down by its own height, so the same padding clears the header with or without it.
 *
 * Below 992 the copy wrapper is display:contents and the button is ordered right after the mechanic sentence, so the
 * button is on a phone's first screen even with the header's sale bar (budget: button bottom <= 660 of 844).
 */

.home-sale {
    margin-top: 0;
    background: #fff;
}

.home-sale + .home-hero {
    margin-top: 8px;
}

/* ---------- stage: the lineup on the homepage's own wash ---------- */
.home-sale__stage {
    margin: -12px -12px 0;
    padding: 100px 0 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 62%, #fff 100%), var(--pep-grad);
}

.home-sale__lineup {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2vw;
}

.home-sale__vial {
    flex: none;
    display: block;
    width: 13.4vw;
    max-width: 52px;
    filter: drop-shadow(0 10px 12px rgba(90, 20, 60, .16));
}

.home-sale__vial--2 {
    width: 15.6vw;
    max-width: 61px;
}

.home-sale__vial--1 {
    width: 17.7vw;
    max-width: 69px;
}

/* The pictures are the site's own product photos on white; the outline of the vial is cut here. */
.home-sale__vial img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 304 / 661;
    -webkit-clip-path: polygon(5.5% .92%, 94.5% .92%, 96.5% 1.84%, 96.5% 7.13%, 95% 8.05%, 95% 14.71%, 93% 15.63%, 83% 15.86%, 83% 24.37%, 88% 25.75%, 94% 28.05%, 98% 30.8%, 99.5% 34.02%, 99.5% 96.32%, 98% 98.39%, 94% 99.54%, 6% 99.54%, 2% 98.39%, .5% 96.32%, .5% 34.02%, 2% 30.8%, 6% 28.05%, 12% 25.75%, 17% 24.37%, 17% 15.86%, 7% 15.63%, 5% 14.71%, 5% 8.05%, 3.5% 7.13%, 3.5% 1.84%);
    clip-path: polygon(5.5% .92%, 94.5% .92%, 96.5% 1.84%, 96.5% 7.13%, 95% 8.05%, 95% 14.71%, 93% 15.63%, 83% 15.86%, 83% 24.37%, 88% 25.75%, 94% 28.05%, 98% 30.8%, 99.5% 34.02%, 99.5% 96.32%, 98% 98.39%, 94% 99.54%, 6% 99.54%, 2% 98.39%, .5% 96.32%, .5% 34.02%, 2% 30.8%, 6% 28.05%, 12% 25.75%, 17% 24.37%, 17% 15.86%, 7% 15.63%, 5% 14.71%, 5% 8.05%, 3.5% 7.13%, 3.5% 1.84%);
}

.home-sale__plinth {
    width: calc(100% - 40px);
    max-width: 350px;
    height: 12px;
    margin: 0 auto;
    border-radius: 3px;
    background: #fff;
    border: 1px solid var(--pep-line);
    box-shadow: var(--pep-shadow);
}

/* ---------- copy ---------- */
.home-sale__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 4px;
    padding-bottom: 6px;
}

.home-sale__copy {
    display: contents;
}

.home-sale__act {
    order: 1;
}

.home-sale .home-sale__offers {
    order: 2;
}

.home-sale .home-sale__fine {
    order: 3;
}

.home-sale .home-sale__eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--pep-ink);
}

.home-sale__dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pep-primary);
}

.home-sale .home-sale__title {
    margin: 0;
    font-family: var(--secondary-font);
    font-size: clamp(36px, 11.3vw, 44px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.04em;
    text-transform: none;
    text-wrap: balance;
    color: var(--pep-ink);
    max-width: 6em;
}

.home-sale__num {
    color: var(--pep-primary);
}

.home-sale .home-sale__sub {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--pep-body);
    max-width: 60ch;
}

.home-sale .home-sale__offers {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-sale .home-sale__offers li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-sale__chip {
    flex: none;
    min-width: 76px;
    box-sizing: border-box;
    padding: 5px 10px;
    border-radius: 100px;
    background: var(--pep-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .06em;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
}

.home-sale__offer {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--pep-body);
    padding-top: 1px;
    max-width: 62ch;
}

.home-sale__offer b {
    font-weight: 600;
    color: var(--pep-ink);
}

/* ---------- button and end date ---------- */
.home-sale__act {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 2px;
}

.home-sale a.home-sale__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 0 30px;
    box-sizing: border-box;
    border-radius: 50px;
    background: var(--pep-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background .16s ease;
}

/* Two rules, not one list: a browser that does not know :focus-visible drops a whole selector list (review N9). */
.home-sale a.home-sale__btn:hover {
    background: #c30068;
    color: #fff;
}

.home-sale a.home-sale__btn:focus-visible {
    background: #c30068;
    color: #fff;
}

.home-sale .home-sale__ends {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--pep-ink);
}

.home-sale .home-sale__fine {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--pep-muted);
}

@media (min-width: 480px) {
    .home-sale__stage {
        margin: -20px -20px 0;
    }
}

/* ---------- tablet ---------- */
@media (min-width: 768px) {
    .home-sale + .home-hero {
        margin-top: 20px;
    }

    .home-sale__stage {
        padding: 126px 0 34px;
    }

    .home-sale__lineup {
        gap: 14px;
    }

    .home-sale__vial {
        width: 86px;
        max-width: none;
    }

    .home-sale__vial--2 {
        width: 100px;
        max-width: none;
    }

    .home-sale__vial--1 {
        width: 114px;
        max-width: none;
    }

    .home-sale__plinth {
        max-width: 640px;
        height: 16px;
        border-radius: 4px;
    }

    .home-sale .home-sale__title {
        font-size: 64px;
        max-width: none;
    }

    .home-sale .home-sale__sub {
        font-size: 17px;
    }

    .home-sale__offer {
        font-size: 15px;
        padding-top: 0;
    }

    .home-sale__act {
        flex-direction: row;
        align-items: center;
        gap: 18px;
    }

    .home-sale a.home-sale__btn {
        width: auto;
        min-height: 56px;
    }

    .home-sale .home-sale__ends {
        font-size: 15px;
    }

    .home-sale .home-sale__fine {
        font-size: 13px;
    }
}

/* ---------- desktop: copy left, button and end date bottom right ---------- */
@media (min-width: 992px) {
    .home-sale + .home-hero {
        margin-top: 28px;
    }

    .home-sale__stage {
        padding: 140px 0 26px;
    }

    .home-sale__lineup {
        gap: 18px;
    }

    /* Vials keep the tablet size: taller ones pushed the button to 702px down a 1280-wide page for a signed-in
       customer (the header carries the sale bar there), past a 1366x768 laptop's first screen. */
    .home-sale__plinth {
        max-width: 760px;
        height: 20px;
    }

    .home-sale__body {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 56px;
        row-gap: 16px;
        align-items: start;
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 12px;
    }

    .home-sale__copy {
        display: flex;
        flex-direction: column;
        gap: 16px;
        min-width: 0;
        grid-column: 1;
        grid-row: 1;
    }

    .home-sale .home-sale__eyebrow {
        font-size: 12px;
    }

    .home-sale .home-sale__title {
        font-size: clamp(64px, 6.1vw, 88px);
    }

    .home-sale .home-sale__sub {
        font-size: 18px;
    }

    /* The button sits level with the headline, not under the copy, so it is on the first screen of a laptop
       (measured: under the copy it ended 860px down a 1440-wide page). */
    .home-sale__act {
        grid-column: 2;
        grid-row: 1;
        flex-direction: column;
        align-items: flex-end;
        gap: 14px;
        margin-top: 44px;
    }

    .home-sale .home-sale__fine {
        grid-column: 1;
        grid-row: 2;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-sale a.home-sale__btn {
        transition: none;
    }
}

/* The purity hero's own width from 1200 (home-redesign.css, the width ramp): the band's copy takes the same box. */
@media (min-width: 1200px) {
    .home-sale__body.container {
        max-width: min(1260px, 79%);
    }
}
