/* «Хиты продаж» on the home page «Лента» (partials/home/bestsellers, cards partials/home/bs-card): the title with its gold
   line and round arrows, one row of cards that scrolls with the arrows, a swipe or a mouse drag */

.lfbs {
    --ink: #111; --muted: #6f6f6f; --line: #e9e6e1; --gold: #b08d57; --red: #a3141f;
    max-width: 1100px; margin: 64px auto; padding: 0 16px; color: var(--ink);
    font-family: 'CenturyGothic', Arial, Helvetica, sans-serif;
}
.lfbs * { font-size: inherit; box-sizing: border-box; }   /* the theme sets «* { font-size: 20px }» */
.lfbs a { color: inherit; text-decoration: none; }
.lfbs a:hover { color: inherit; text-decoration: none; }
.lfbs a:focus-visible, .lfbs button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* the title with its gold line, the arrows on the right */
.lfbs-head { display: grid; grid-template-columns: 1fr auto; align-items: end; row-gap: 10px; margin-bottom: 28px; }
.lfbs-title { margin: 0; font-size: 34px; font-weight: normal; letter-spacing: .02em; line-height: 1.15; }
.lfbs-line { grid-row: 2; display: block; width: 40px; height: 1px; margin-top: 6px; background: var(--gold); }
.lfbs-arrows { grid-row: 1 / 3; grid-column: 2; align-self: center; display: flex; gap: 8px; }
.lfbs-arrow {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
    border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}
.lfbs-arrow svg { width: 18px; height: 18px; }
.lfbs-arrow:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* the row: five cards on a computer, three on a tablet, two and the next one's edge on a phone */
.lfbs-track {
    display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 4 * 16px) / 5); gap: 16px;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px 2px 10px; margin: -4px -2px 0;
}
.lfbs-track::-webkit-scrollbar { display: none; }
.lfbs-track.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }   /* dragged with a mouse */
.lfbs-track.is-dragging .lfbs-card { pointer-events: none; }

/* the card */
.lfbs-card {
    position: relative; display: grid; align-content: start; justify-items: center; gap: 6px; padding: 18px 16px 20px;
    border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: center; scroll-snap-align: start;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.lfbs-card:hover { border-color: #d8d2c8; box-shadow: 0 12px 32px rgba(0, 0, 0, .07); transform: translateY(-2px); }
.lfbs-card__img { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; margin-bottom: 8px; }
.lfbs-card__img img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .4s ease; }
.lfbs-card:hover .lfbs-card__img img { transform: scale(1.04); }
.lfbs-card__brand { font-size: 12px; line-height: 1.5; letter-spacing: .1em; text-transform: uppercase; color: #6b6b6b; } /* brand and name as the catalog's cards (catalog-variants.css .lfc-c2), 2026-12-02 */
.lfbs-card__name { margin-top: -2px; font-size: 15px; line-height: 1.5; } /* -2px: 4px from the brand, the card's gap is 6px */
.lfbs-card__price { display: block; margin-top: 2px; font-size: 16px; } /* prices as the catalog's cards (catalog-variants.css, desktop.css), 2026-12-02 */
.lfbs-card .price { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 10px; }
.lfbs-card .price__old { color: #6f6f6f; text-decoration: line-through; text-decoration-color: rgba(111, 111, 111, .8); font-size: 13px; }
.lfbs-card .price__new { color: var(--red); font-weight: 700; }
.lfbs-card .card-discount {
    position: absolute; top: 14px; left: 14px; z-index: 1; display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; font-size: 11px;
}

/* tablets */
@media (max-width: 991px) {
    .lfbs-track { grid-auto-columns: calc((100% - 2 * 16px) / 3); }
}
/* phones */
@media (max-width: 767px) {
    .lfbs { margin: 48px auto; }
    .lfbs-title { font-size: 26px; }
    .lfbs-arrow { width: 38px; height: 38px; }   /* kept on phones: the row also scrolls with them, not only with a swipe */
    .lfbs-track { grid-auto-columns: 44%; gap: 10px; }
    .lfbs-card { padding: 12px 10px 14px; }
    .lfbs-card .card-discount { top: 8px; left: 8px; width: 34px; height: 34px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .lfbs * { transition: none !important; }
}

/* «Хиты продаж» of the home page (.lfbs--home, partials/home/bestsellers) on a white card, as «Для неё», «Для него» and
   «Журнал» under it (home-for-her.css, home-magazine.css), 2026-12-02. Not the product page's rows (product-more.css) */
.lfbs--home { position: relative; z-index: 0; margin-top: 100px; margin-bottom: 132px; }   /* 68px from the card to «Для неё» */
.lfbs--home::before {
    content: ''; position: absolute; z-index: -1; top: -32px; right: -24px; bottom: -32px; left: -24px;
    border: 1px solid #e9e6e1; border-radius: 12px; background: #fff; pointer-events: none;
}
@media (max-width: 1147px) { .lfbs--home { padding: 0 28px; } .lfbs--home::before { right: 8px; left: 8px; } }
@media (max-width: 767px) {
    .lfbs--home { margin-top: 64px; margin-bottom: 88px; padding: 0 16px; }
    .lfbs--home::before { top: -24px; right: 8px; bottom: -24px; left: 8px; }   /* the title at the top: room above it */
}

/* The photo starts no higher than the middle of the «−N%» badge at any width (2026-12-02): the badge sits in the card's top left corner over the
   photo's square, so the square's top gets the room down to the badge's middle. The sizes are the badge's own
   (--bs-badge-*), so the room follows them; every card of the row gets it, so the photos stay level */
.lfbs-card { --bs-pad-top: 18px; --bs-badge-top: 14px; --bs-badge-size: 40px; }
.lfbs-card__img { box-sizing: border-box; padding-top: calc(var(--bs-badge-top) + var(--bs-badge-size) / 2 - var(--bs-pad-top)); }   /* the photo's top at the badge's middle */
@media (max-width: 767px) {
    .lfbs-card { --bs-pad-top: 12px; --bs-badge-top: 8px; --bs-badge-size: 34px; }
}
