/* HD Brand Flash Sale V1 — khối "⚡ ƯU ĐÃI TỪ {BRAND}" trên trang taxonomy brand.
   Mọi selector nằm dưới body.tax-brand .hd-bfs. Khai báo font tường minh (Roboto / Roboto Condensed — site đã nạp)
   cho MỌI phần tử chữ, để không kế thừa h2{font-family:"Helvetica Neue",Helvetica,Arial} của Bootstrap 3 (bài học Outlet V1.2).
   Biểu tượng là SVG nội tuyến, không dùng glyph (⚡ → ↓) để tránh rơi font. */

body.tax-brand .hd-bfs {
    --hd-bfs-navy: #0f1d3a;
    --hd-bfs-ink: #2a3650;
    --hd-bfs-muted: #7b8597;
    --hd-bfs-line: #e6eaf1;
    --hd-bfs-soft: #f5f7fa;
    --hd-bfs-deal: #e2412b;
    --hd-bfs-deal-soft: #fff1ec;
    --hd-bfs-gap: 16px;
    --hd-bfs-cols: 6;
    position: relative;
    margin: 24px 0 0;
    padding: 20px 20px 18px;
    background: #fff;
    border: 1px solid var(--hd-bfs-line);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15, 29, 58, .04), 0 10px 28px -20px rgba(15, 29, 58, .22);
    font-family: "Roboto", Arial, sans-serif;
    font-synthesis: none;
    color: var(--hd-bfs-ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-shadow: none;
}
body.tax-brand .hd-bfs *,
body.tax-brand .hd-bfs *::before,
body.tax-brand .hd-bfs *::after { box-sizing: border-box; }

/* ---- Đầu khối ---- */
body.tax-brand .hd-bfs__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin: 0 0 16px;
}
body.tax-brand .hd-bfs__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    font-family: "Roboto Condensed", "Roboto", Arial, sans-serif;
    font-size: 22px;
    font-weight: 700;
    font-style: normal;
    line-height: 1.2;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--hd-bfs-navy);
}
body.tax-brand .hd-bfs__icon--bolt { flex: none; color: var(--hd-bfs-deal); }
body.tax-brand .hd-bfs__countdown {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--hd-bfs-ink);
}
body.tax-brand .hd-bfs__countdown[hidden] { display: none; }
body.tax-brand .hd-bfs__countdown-time {
    font-family: "Roboto", Arial, sans-serif;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #fff;
    background: var(--hd-bfs-navy);
    border-radius: 6px;
    padding: 3px 8px;
}
body.tax-brand .hd-bfs__all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--hd-bfs-navy);
    text-decoration: none;
    white-space: nowrap;
}
body.tax-brand .hd-bfs__all:hover,
body.tax-brand .hd-bfs__all:focus { color: var(--hd-bfs-navy); text-decoration: underline; text-underline-offset: 3px; }
body.tax-brand .hd-bfs__all:focus-visible { outline: 2px solid var(--hd-bfs-navy); outline-offset: 3px; border-radius: 4px; }

/* ---- Băng cuộn ngang ---- */
body.tax-brand .hd-bfs__viewport { position: relative; }
body.tax-brand .hd-bfs__track {
    position: relative; /* khối chứa cho phần tử absolute bên trong → bị cắt theo vùng cuộn, không làm rộng trang */
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--hd-bfs-cols) - 1) * var(--hd-bfs-gap)) / var(--hd-bfs-cols));
    gap: var(--hd-bfs-gap);
    margin: 0;
    padding: 2px 0 6px;
    list-style: none;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
body.tax-brand .hd-bfs__track::-webkit-scrollbar { display: none; }
body.tax-brand .hd-bfs__item {
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    scroll-snap-align: start;
}
body.tax-brand .hd-bfs__item::before,
body.tax-brand .hd-bfs__item::marker { content: none; }

/* ---- Thẻ ---- */
body.tax-brand .hd-bfs__card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--hd-bfs-line);
    border-radius: 12px;
    overflow: hidden;
    color: var(--hd-bfs-ink);
    text-decoration: none;
    transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
body.tax-brand .hd-bfs__card:hover,
body.tax-brand .hd-bfs__card:focus { color: var(--hd-bfs-ink); text-decoration: none; }
body.tax-brand .hd-bfs__card:hover {
    border-color: #d5dbe6;
    box-shadow: 0 12px 24px -18px rgba(15, 29, 58, .45);
    transform: translateY(-2px);
}
body.tax-brand .hd-bfs__card:focus-visible { outline: 2px solid var(--hd-bfs-navy); outline-offset: 2px; }
body.tax-brand .hd-bfs__media {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    background: var(--hd-bfs-soft);
}
body.tax-brand .hd-bfs__img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    margin: 0;
}
body.tax-brand .hd-bfs__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--hd-bfs-deal);
    color: #fff;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: .01em;
}
body.tax-brand .hd-bfs__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    padding: 10px 12px 12px;
}
body.tax-brand .hd-bfs__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    min-height: calc(2 * 1.38em);
    margin: 0 0 2px;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.38;
    color: var(--hd-bfs-navy);
    text-transform: none;
}
body.tax-brand .hd-bfs__price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: auto;
    font-family: "Roboto", Arial, sans-serif;
    line-height: 1.25;
}
body.tax-brand .hd-bfs__prefix { font-size: 12px; font-weight: 500; color: var(--hd-bfs-muted); }
body.tax-brand .hd-bfs__now,
body.tax-brand .hd-bfs__now .amount,
body.tax-brand .hd-bfs__now bdi {
    font-family: "Roboto", Arial, sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--hd-bfs-deal);
}
body.tax-brand .hd-bfs__was,
body.tax-brand .hd-bfs__was del,
body.tax-brand .hd-bfs__was .amount,
body.tax-brand .hd-bfs__was bdi {
    font-family: "Roboto", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.25;
    color: var(--hd-bfs-muted);
}
body.tax-brand .hd-bfs__was del { text-decoration: line-through; }
body.tax-brand .hd-bfs__note {
    font-family: "Roboto", Arial, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: var(--hd-bfs-muted);
}
body.tax-brand .hd-bfs__stock {
    align-self: flex-start;
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--hd-bfs-deal-soft);
    color: #b2381f;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}
body.tax-brand .hd-bfs .screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Nút trái/phải (desktop/tablet) ---- */
body.tax-brand .hd-bfs__nav {
    position: absolute;
    top: calc(50% - 40px);
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--hd-bfs-line);
    border-radius: 50%;
    background: #fff;
    color: var(--hd-bfs-navy);
    box-shadow: 0 6px 16px -8px rgba(15, 29, 58, .35);
    cursor: pointer;
    transition: opacity .2s ease, background-color .2s ease;
}
body.tax-brand .hd-bfs__nav--prev { left: -12px; }
body.tax-brand .hd-bfs__nav--next { right: -12px; }
body.tax-brand .hd-bfs__nav:hover { background: var(--hd-bfs-soft); }
body.tax-brand .hd-bfs__nav:focus-visible { outline: 2px solid var(--hd-bfs-navy); outline-offset: 2px; }
body.tax-brand .hd-bfs__nav[disabled] { opacity: .35; cursor: default; background: #fff; }
body.tax-brand .hd-bfs.is-scrollable .hd-bfs__nav { display: inline-flex; }

/* ---- Breakpoint (số thẻ nhìn thấy) ---- */
@media (max-width: 1199.98px) { body.tax-brand .hd-bfs { --hd-bfs-cols: 5; } }
@media (max-width: 991.98px)  { body.tax-brand .hd-bfs { --hd-bfs-cols: 4; } }
@media (max-width: 767.98px) {
    body.tax-brand .hd-bfs { --hd-bfs-cols: 3; --hd-bfs-gap: 12px; padding: 16px 14px 14px; margin-top: 16px; border-radius: 14px; }
    body.tax-brand .hd-bfs.is-scrollable .hd-bfs__nav { display: none; } /* mobile: vuốt */
    body.tax-brand .hd-bfs__title { font-size: 19px; }
}
@media (max-width: 575.98px) {
    body.tax-brand .hd-bfs { --hd-bfs-cols: 2.3; --hd-bfs-gap: 10px; }
    body.tax-brand .hd-bfs__head { margin-bottom: 12px; }
    body.tax-brand .hd-bfs__title { font-size: 17px; }
    body.tax-brand .hd-bfs__all { font-size: 13px; }
    body.tax-brand .hd-bfs__body { padding: 8px 10px 10px; }
    body.tax-brand .hd-bfs__name { font-size: 13px; }
    body.tax-brand .hd-bfs__now,
    body.tax-brand .hd-bfs__now .amount,
    body.tax-brand .hd-bfs__now bdi { font-size: 15px; }
    body.tax-brand .hd-bfs__was,
    body.tax-brand .hd-bfs__was del,
    body.tax-brand .hd-bfs__was .amount,
    body.tax-brand .hd-bfs__was bdi { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    body.tax-brand .hd-bfs__track { scroll-behavior: auto; }
    body.tax-brand .hd-bfs__card,
    body.tax-brand .hd-bfs__nav { transition: none; }
    body.tax-brand .hd-bfs__card:hover { transform: none; }
}
