/**
 * Copyright © Caravel. All rights reserved.
 *
 * "Relâmpago da hora" widget (Block\Widget\HourlyOffers, templates/widget/hourly-offers.phtml), after the "flash"
 * section of the Black Cassol mockup: the big card of the offer of the hour and the locked list of the next hours.
 * Loaded by the cassol_blackfriday_active layout handle next to black-friday.css, whose tokens (--bf-*) it reuses,
 * and product-stage.css (the stage of the big card). Plain CSS with its own class names (bf-flash__*); fonts are
 * the theme's, so the sizes are about two thirds of the mockup's condensed display font.
 */
.bf-flash {
    --bf-flash-gutter: clamp(16px, 4vw, 48px);
    --bf-flash-ease: cubic-bezier(.2, .7, .2, 1);
    --bf-flash-row: 102px;
    --bf-flash-gap: 12px;
    color: var(--bf-text);
    background:
        radial-gradient(70% 80% at 25% 40%, rgba(232, 17, 45, .12), transparent 65%),
        var(--bf-bg);
    border-top: 1px solid var(--bf-line);
    padding: clamp(40px, 5.6vw, 77px) 0;
}

.bf-flash__wrap {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 var(--bf-flash-gutter);
}

/* ---------- heading ---------- */
.bf-flash__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.bf-flash__kick {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--bf-red);
    margin-bottom: 14px;
}

.bf-flash__kick::before {
    content: "";
    width: 28px;
    height: 2px;
    background: var(--bf-red);
}

.bf-flash__title {
    margin: 0;
    font-weight: 900;
    font-size: clamp(30px, 3.6vw, 54px);
    line-height: .95;
    text-transform: uppercase;
    color: var(--bf-text);
}

.bf-flash__lead {
    margin: 0;
    max-width: 560px;
    font-size: 15px;
    color: var(--bf-muted);
}

/* ---------- grid: big card + next hours ---------- */
.bf-flash__grid {
    display: grid;
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    gap: 20px;
    align-items: stretch;
}

.bf-flash__grid--single {
    grid-template-columns: minmax(0, 1fr);
}

.bf-flash__big {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    border: 1px solid var(--bf-line-2);
    border-radius: 22px;
    padding: clamp(18px, 3vw, 36px);
    background: var(--bf-surface);
    overflow: hidden;
}

/* the x-if roots: their children are the two columns of the card */
.bf-flash__offer {
    display: contents;
}

.bf-flash__offer .bf-stage {
    animation: bf-flash-in .5s var(--bf-flash-ease) both;
}

@keyframes bf-flash-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

.bf-flash__info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

/* the lamp badge and the countdown */
.bf-flash__time {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.bf-flash__bolt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bf-red);
    color: #fff;
    flex-shrink: 0;
}

.bf-flash__bolt svg {
    width: 20px;
    height: 20px;
}

.bf-flash__time small {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--bf-muted);
}

.bf-flash__time b {
    display: block;
    /* 40px of the condensed display font in the mockup */
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .02em;
    color: var(--bf-text);
    font-variant-numeric: tabular-nums;
}

.bf-flash__name {
    margin: 0 0 10px;
    font-size: clamp(18px, 1.8vw, 24px);
    font-weight: 800;
    line-height: 1.15;
    /* three lines at most: a long name must not push the price and the button down */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--bf-text);
}

.bf-flash__name a {
    color: inherit;
}

.bf-flash__name a:hover {
    text-decoration: underline;
}

.bf-flash__teaser {
    margin: 0;
    font-size: 15px;
    color: var(--bf-muted);
}

.bf-flash__de {
    font-size: 15px;
    color: var(--bf-muted);
    text-decoration: line-through;
    font-variant-numeric: tabular-nums;
}

/* the big price: "R$" + integer + ",cents", as the anchor offer */
.bf-flash__price {
    display: flex;
    align-items: baseline;
    gap: 2px;
    margin: 6px 0 2px;
    /* clamp(64px, 7vw, 104px) of the condensed display font in the mockup */
    font-size: clamp(44px, 4.6vw, 68px);
    font-weight: 900;
    line-height: .9;
    letter-spacing: -.04em;
    color: var(--bf-text);
    font-variant-numeric: tabular-nums;
}

.bf-flash__cur {
    font-size: .3em;
    letter-spacing: 0;
    margin-right: 6px;
    align-self: flex-start;
    margin-top: .45em;
}

.bf-flash__int {
    text-shadow: 0 0 60px rgba(255, 231, 184, .25);
}

.bf-flash__price small {
    font-size: .3em;
    font-weight: 800;
    letter-spacing: 0;
}

.bf-flash__pay {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    font-size: 15px;
    margin: 10px 0 18px;
    font-variant-numeric: tabular-nums;
}

.bf-flash__pay b {
    color: var(--bf-text);
    font-weight: 700;
}

.bf-flash__pay span {
    color: var(--bf-muted);
}

.bf-flash__ctas {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.bf-flash__ctas form {
    margin: 0;
}

.bf-flash__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 26px;
    border: 0;
    border-radius: 999px;
    background: var(--bf-red);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 8px 28px -8px rgba(189, 40, 33, .7);
    transition: filter .2s, opacity .2s;
}

.bf-flash__btn:hover:not(:disabled) {
    color: #fff;
    filter: brightness(1.12);
}

.bf-flash__btn:disabled {
    opacity: .75;
    cursor: not-allowed;
}

/* sold out: the offer stays on screen, without a way to buy it */
.bf-flash__btn--soldout,
.bf-flash__btn--soldout:disabled {
    background: var(--bf-surface-3);
    color: var(--bf-muted);
    box-shadow: none;
    opacity: 1;
}

.bf-flash__soldout {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    padding: 6px 10px 5px;
    border-radius: 6px;
    background: rgba(5, 5, 5, .8);
    border: 1px solid var(--bf-line-2);
    color: var(--bf-text);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* the "Ver opções de retirada" link in place of the mockup's delivery line */
.bf-flash__pickup {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    color: var(--bf-ok);
    cursor: pointer;
}

.bf-flash__pickup:hover {
    text-decoration: underline;
}

.bf-flash__icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* waiting state: no offer this hour */
.bf-flash__lockstage {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bf-muted);
}

.bf-flash__lockstage svg {
    position: relative;
    z-index: 2;
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 18px 20px rgba(0, 0, 0, .6));
}

/* on the white background the lock has no stage to cast a shadow on */
.bf-stage--white.bf-flash__lockstage svg {
    filter: none;
}

/* skeleton while the offer loads */
.bf-flash__ph {
    display: block;
    border-radius: 8px;
    background: var(--bf-surface-3);
    opacity: .6;
}

.bf-flash__ph--stage {
    aspect-ratio: 1 / 1;
    border-radius: 14px;
}

.bf-flash__ph--line {
    height: 14px;
    width: 80%;
    margin-bottom: 12px;
}

.bf-flash__ph--short {
    width: 45%;
}

.bf-flash__ph--price {
    height: 48px;
    width: 60%;
    margin: 8px 0 20px;
}

.bf-flash__ph--btn {
    height: 48px;
    width: 180px;
    border-radius: 999px;
}

.bf-flash__note {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 14px;
    color: var(--bf-muted);
}

.bf-flash__note--error {
    color: var(--bf-red);
}

/* ---------- next hours ---------- */
.bf-flash__next {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.bf-flash__next h3 {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--bf-muted);
}

/* the list is clipped to the height of the big card: the wrapper follows the grid row, the list is taken out of
   the flow (so it never stretches the row) and the script shows as many rows as fit */
.bf-flash__list-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
}

.bf-flash__list {
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--bf-flash-gap);
}

.bf-flash__nx {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    box-sizing: border-box;
    height: var(--bf-flash-row);
    flex: 0 0 auto;
    padding: 12px 14px;
    border: 1px solid var(--bf-line);
    border-radius: 14px;
    background: var(--bf-surface);
}

.bf-flash__sil {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 10px;
    background: radial-gradient(circle at 50% 30%, #222, #0a0a0a);
    color: var(--bf-muted);
}

.bf-flash__sil svg {
    width: 22px;
    height: 22px;
}

.bf-flash__h {
    /* 30px of the condensed display font in the mockup */
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    color: var(--bf-text);
    font-variant-numeric: tabular-nums;
}

.bf-flash__hint {
    margin: 3px 0 0;
    font-size: 13px;
    line-height: 1.3;
    color: var(--bf-muted);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
    .bf-flash__grid,
    .bf-flash__big {
        grid-template-columns: minmax(0, 1fr);
    }

    .bf-flash__big .bf-stage,
    .bf-flash__ph--stage {
        max-width: 420px;
    }

    /* the list goes back into the flow; the script shows three rows */
    .bf-flash__list-wrap {
        position: static;
        flex: none;
    }

    .bf-flash__list {
        position: static;
    }
}

@media (max-width: 640px) {
    .bf-flash {
        --bf-flash-row: 86px;
    }

    .bf-flash__head {
        margin-bottom: 18px;
    }

    .bf-flash__nx {
        grid-template-columns: 60px minmax(0, 1fr);
    }

    .bf-flash__sil {
        width: 60px;
        height: 60px;
    }

    .bf-flash__time b {
        font-size: 28px;
    }

    .bf-flash__price {
        font-size: 40px;
    }
}
