/**
 * Copyright © Caravel. All rights reserved.
 *
 * "Os mais desejados da Black" widget (Block\Widget\MostWanted, templates/widget/most-wanted.phtml), after the
 * "desejados" section of the Black Cassol mockup: category tabs, the "Ordenar por" select, a grid of product cards
 * and "Ver mais ofertas", then the price bands of "Quanto você quer gastar?" (bf-bands__*). Loaded by the cassol_blackfriday_active layout handle next to black-friday.css, whose
 * tokens (--bf-*) it reuses. Plain CSS with its own class names (bf-wanted__*); fonts are the theme's. The card
 * stage is the shared .bf-stage of product-stage.css, on white.
 */

.bf-wanted-root {
    --bf-wanted-gutter: clamp(16px, 4vw, 48px);
    --bf-wanted-ease: cubic-bezier(.2, .7, .2, 1);
    background: var(--bf-bg);
}

.bf-wanted {
    color: var(--bf-text);
    background: var(--bf-bg);
    border-top: 1px solid var(--bf-line);
    padding: clamp(40px, 5.6vw, 77px) 0;
}

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

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

.bf-wanted__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-wanted__kick::before {
    content: "";
    width: 28px;
    height: 2px;
    background: var(--bf-red);
}

.bf-wanted__title {
    margin: 0;
    font-weight: 900;
    /* the condensed display font of the mockup (84px) at about two thirds with the theme font */
    font-size: clamp(30px, 3.6vw, 54px);
    line-height: .95;
    text-transform: uppercase;
    color: var(--bf-text);
}

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

/* ---------- tabs and sort ---------- */
/* tabs and sort on one line: tabs that do not fit scroll sideways instead of pushing the select down */
.bf-wanted__bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px 24px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.bf-wanted__tabs {
    display: flex;
    flex: 0 1 auto;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.bf-wanted__tabs::-webkit-scrollbar {
    display: none;
}

.bf-wanted__tabs--more {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
}

.bf-wanted__tabs button {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--bf-line-2);
    border-radius: 999px;
    background: transparent;
    font-weight: 700;
    font-size: 14px;
    color: var(--bf-muted);
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    transition: color .2s, border-color .2s, background-color .2s;
}

.bf-wanted__tabs button:hover {
    color: var(--bf-text);
    border-color: var(--bf-muted);
}

.bf-wanted__tabs button[aria-pressed="true"] {
    background: var(--bf-text);
    color: #050505;
    border-color: var(--bf-text);
}

.bf-wanted__sort {
    display: flex;
    flex-shrink: 0;
    white-space: nowrap;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 14px;
    color: var(--bf-muted);
}

.bf-wanted__sort select {
    min-height: 44px;
    padding: 0 38px 0 16px;
    border: 1px solid var(--bf-line-2);
    border-radius: 999px;
    background-color: var(--bf-surface);
    /* chevron in --bf-text */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23F4F1EA' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    color: var(--bf-text);
    font-size: 14px;
    font-weight: 500;
    appearance: none;
    cursor: pointer;
}

.bf-wanted__sort select:focus-visible {
    outline: 2px solid var(--bf-outline);
    outline-offset: 2px;
}

/* a band click scrolls here: room for the sticky header */
.bf-wanted {
    scroll-margin-top: 80px;
}

.bf-wanted__status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 0 18px;
}

.bf-wanted__count {
    font-size: 13px;
    color: var(--bf-muted);
}

/* "Faixa: Até R$ 99 ×", the price band filtering the grid */
.bf-wanted__band {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 6px 0 14px;
    border: 1px solid var(--bf-red);
    border-radius: 999px;
    background: #241216;
    color: var(--bf-text);
    font-size: 13px;
    font-weight: 700;
}

.bf-wanted__band button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--bf-text);
    cursor: pointer;
}

.bf-wanted__band button:hover {
    background: var(--bf-red);
}

/* ---------- grid ---------- */
.bf-wanted__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.bf-wanted__card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--bf-line);
    border-radius: 16px;
    overflow: hidden;
    background: var(--bf-surface);
    animation: bf-wanted-in .5s var(--bf-wanted-ease) both;
    transition: border-color .3s, transform .3s var(--bf-wanted-ease);
}

.bf-wanted__card:hover {
    border-color: var(--bf-line-2);
    transform: translateY(-3px);
}

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

/* the square white stage of product-stage.css, without the rounded corners: the card clips it */
.bf-wanted__stage {
    border-radius: 0;
}

.bf-wanted__card:hover .bf-stage--white img {
    transform: scale(1.04);
}

/* Two blocks, so the cards of a row line up whatever the product has: the chip and the name (three lines kept, so
   the names of a row take the same room) against the image, the prices, the pickup link and the button against the
   bottom edge. A price line the product does not have ("De", Pix, installments) leaves the flow (x-show), so the
   prices of such a card sit lower, against the pickup link and the button; the row of the grid stretches every card
   to the tallest, and the spare room opens between the two blocks. */
.bf-wanted__body {
    display: flex;
    flex-direction: column;
    padding: 14px 16px 16px;
    flex: 1;
}

.bf-wanted__top,
.bf-wanted__offer {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bf-wanted__offer {
    margin-top: auto;
    padding-top: 10px;
}

/* the line of the green "Economize R$ X" chip, kept at the height of the chip when there is no discount */
.bf-wanted__eco-row {
    display: flex;
    align-items: center;
    min-height: 22px;
}

.bf-wanted__eco {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(95, 211, 154, .1);
    color: var(--bf-ok);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.bf-wanted__name {
    margin: 0;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.3;
    min-height: 3.9em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bf-wanted__name a {
    color: var(--bf-text);
}

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

/* one line each (x-show removes the line the product does not have) */
.bf-wanted__de,
.bf-wanted__pix,
.bf-wanted__par {
    line-height: 1.3;
}

.bf-wanted__de {
    font-size: 13px;
    color: var(--bf-muted);
    font-variant-numeric: tabular-nums;
}

.bf-wanted__de span {
    text-decoration: line-through;
}

/* the price of the card: the Pix price when the product has one, the final price otherwise */
.bf-wanted__price {
    /* 36px of the condensed display font in the mockup */
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
    color: var(--bf-text);
    font-variant-numeric: tabular-nums;
}

/* "7% à vista no PIX" under the Pix price, bold and small as on the product page */
.bf-wanted__pix {
    font-size: 13px;
    font-weight: 700;
    color: var(--bf-text);
    font-variant-numeric: tabular-nums;
}

.bf-wanted__par {
    font-size: 13px;
    color: var(--bf-muted);
    font-variant-numeric: tabular-nums;
}

/* the mockup's green "Retire hoje" line, as the button that opens the pickup drawer */
.bf-wanted__pickup {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    margin: 4px 0 10px;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    color: var(--bf-ok);
    cursor: pointer;
}

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

.bf-wanted__icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

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

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

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

.bf-wanted__empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 60px 0;
    text-align: center;
    color: var(--bf-muted);
}

/* the error note ("Tentar novamente" is a "Ver mais" button) */
.bf-wanted__note {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 60px 0;
    text-align: center;
    color: var(--bf-muted);
}

/* ---------- skeleton cards while a page loads ---------- */
.bf-wanted__card--empty {
    animation: none;
    pointer-events: none;
}

.bf-wanted__ph {
    display: block;
    border-radius: 6px;
    background: var(--bf-surface-3);
    opacity: .6;
    animation: bf-wanted-pulse 1.4s ease-in-out infinite;
}

.bf-wanted__ph--stage {
    aspect-ratio: 1 / 1;
    border-radius: 0;
}

/* the chip line of the real card (22px); the three lines after it are the name */
.bf-wanted__ph--chip {
    height: 20px;
    width: 40%;
    margin: 1px 0;
    border-radius: 999px;
}

.bf-wanted__ph--line {
    height: 13px;
    width: 80%;
}

.bf-wanted__ph--short {
    width: 50%;
}

/* the "Ver opções de retirada" line, with its margins */
.bf-wanted__ph--pickup {
    width: 50%;
    margin: 4px 0 10px;
}

.bf-wanted__ph--price {
    height: 30px;
    width: 60%;
    margin-top: 8px;
}

.bf-wanted__ph--btn {
    height: 44px;
    width: 100%;
    margin-top: 8px;
    border-radius: 999px;
}

@keyframes bf-wanted-pulse {
    50% {
        opacity: .3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bf-wanted__ph {
        animation: none;
    }
}

/* ---------- "Ver mais ofertas" ---------- */
.bf-wanted__more {
    display: flex;
    justify-content: center;
    margin-top: 34px;
}

.bf-wanted__more-btn {
    min-height: 48px;
    padding: 0 26px;
    border: 1px solid var(--bf-line-2);
    border-radius: 999px;
    background: transparent;
    color: var(--bf-text);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: border-color .2s, background-color .2s, color .2s;
}

.bf-wanted__more-btn:hover {
    border-color: var(--bf-text);
    background: var(--bf-text);
    color: #050505;
}

/* ---------- price bands ("Quanto você quer gastar?") ---------- */
.bf-bands {
    color: var(--bf-text);
    padding: 0 0 clamp(40px, 5.6vw, 77px);
}

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

.bf-bands__head {
    margin-bottom: 26px;
}

.bf-bands__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.bf-bands__card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    min-height: 340px;
    padding: 22px;
    overflow: hidden;
    border: 1px solid var(--bf-line);
    border-radius: 20px;
    background:
        radial-gradient(70% 55% at 50% 0, rgba(255, 231, 184, .14), transparent 70%),
        var(--bf-surface);
    color: var(--bf-text);
    text-align: left;
    cursor: pointer;
    transition: border-color .3s, transform .3s var(--bf-wanted-ease);
}

.bf-bands__card:hover,
.bf-bands__card[aria-pressed="true"] {
    border-color: var(--bf-text);
}

.bf-bands__card:hover {
    transform: translateY(-4px);
}

.bf-bands__card:focus-visible {
    outline: 2px solid var(--bf-outline);
    outline-offset: 2px;
}

/* the photos of the band (catalog photos on white), one at a time, crossfading */
.bf-bands__ims {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 62%;
}

.bf-bands__im {
    position: absolute;
    top: 54%;
    left: 50%;
    width: 52%;
    aspect-ratio: 1 / 1;
    max-height: 82%;
    padding: 6%;
    border-radius: 14px;
    background: #fff;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.92);
    transition: opacity .8s, transform .8s var(--bf-wanted-ease);
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .6));
}

.bf-bands__im--on {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.bf-bands__im img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bf-bands__sub {
    position: relative;
    font-size: 13px;
    font-weight: 500;
    color: var(--bf-muted);
}

.bf-bands__label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    /* 48px of the condensed display font in the mockup */
    font-size: clamp(26px, 2.4vw, 34px);
    font-weight: 900;
    line-height: .95;
    text-transform: uppercase;
}

.bf-bands__arrow {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    transition: transform .25s var(--bf-wanted-ease);
}

.bf-bands__card:hover .bf-bands__arrow {
    transform: translateX(4px);
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .bf-wanted__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .bf-bands__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .bf-wanted__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* no room for both: the select goes under the tabs */
    .bf-wanted__bar {
        flex-wrap: wrap;
    }

    .bf-wanted__tabs {
        flex-basis: 100%;
    }
}

@media (max-width: 640px) {
    .bf-wanted__grid {
        gap: 10px;
    }

    .bf-wanted__tabs {
        margin: 0 calc(var(--bf-wanted-gutter) * -1);
        padding: 0 var(--bf-wanted-gutter) 4px;
    }

    .bf-wanted__tabs button {
        min-height: 40px;
        font-size: 13px;
    }

    .bf-wanted__body {
        padding: 12px;
    }

    .bf-wanted__price {
        font-size: 22px;
    }

    .bf-wanted__name {
        font-size: 14px;
    }

    .bf-wanted__btn {
        min-height: 42px;
        padding: 0 10px;
        font-size: 14px;
    }

    .bf-bands__grid {
        gap: 10px;
    }

    .bf-bands__card {
        min-height: 290px;
        padding: 16px;
    }

    .bf-bands__label {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bf-wanted__card {
        animation: none;
        transition: none;
    }

    .bf-wanted__card:hover {
        transform: none;
    }

    .bf-wanted__card:hover .bf-stage--white img {
        transform: none;
    }

    .bf-bands__card,
    .bf-bands__im,
    .bf-bands__arrow {
        transition: none;
    }

    .bf-bands__card:hover {
        transform: none;
    }
}
