:root {
    --bnfs-primary-color: #da251d;
    --bnfs-secondary-color: #111111;
    --bnfs-background-color: #da251d;
    --bnfs-text-color: #ffffff;
    --bnfs-sale-price-color: #da251d;
    --bnfs-progress-color: #ffcc00;
    --bnfs-border-radius: 16px;
    --bnfs-card-gap: 14px;
    --bnfs-columns-desktop: 5;
    --bnfs-columns-tablet: 3;
    --bnfs-columns-mobile: 2;
}

.bnfs-section,
.bnfs-section * {
    box-sizing: border-box;
}

.bnfs-section {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 18px;
    border-radius: var(--bnfs-border-radius);
    background: var(--bnfs-background-color);
    background-size: cover;
    background-position: center;
    color: var(--bnfs-text-color);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.08);
}

.bnfs-section__shine {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.24), transparent 24%),
        radial-gradient(circle at 92% 0%, rgba(255, 255, 255, 0.16), transparent 28%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 44%);
}

.bnfs-template-red {
    --bnfs-primary-color: #ffffff;
    background: linear-gradient(135deg, #d81f18 0%, #a7100b 58%, #5f0704 100%);
}

.bnfs-template-light {
    --bnfs-primary-color: #da251d;
    --bnfs-background-color: #f5f7fb;
    --bnfs-text-color: #1d2327;
    background: linear-gradient(135deg, #ffffff 0%, #f5f7fb 100%);
    color: #1d2327;
    border: 1px solid #edf0f2;
}

.bnfs-template-minimal {
    --bnfs-primary-color: #ffffff;
    --bnfs-background-color: #111111;
    --bnfs-text-color: #ffffff;
    background: linear-gradient(135deg, #111111, #2a2a2a);
}

.bnfs-section__top-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}
.bnfs-section__top-tabs::-webkit-scrollbar { display: none; }

.bnfs-campaign-pill {
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.14);
    color: currentColor;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    cursor: default;
    opacity: .74;
}
.bnfs-template-light .bnfs-campaign-pill {
    border-color: #edf0f2;
    background: #fff;
}
.bnfs-campaign-pill.is-active {
    opacity: 1;
    background: #fff;
    color: #da251d;
}
.bnfs-campaign-pill:disabled {
    cursor: not-allowed;
}

.bnfs-section__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 2px 0 4px;
}

.bnfs-section__label {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: currentColor;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.bnfs-template-light .bnfs-section__label {
    background: rgba(218, 37, 29, 0.1);
    color: #da251d;
}

.bnfs-section__title {
    margin: 0;
    font-size: clamp(24px, 4vw, 42px);
    font-weight: 950;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: currentColor;
}

.bnfs-section__subtitle {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.84);
    font-weight: 500;
}
.bnfs-template-light .bnfs-section__subtitle {
    color: rgba(29, 35, 39, 0.72);
}

.bnfs-countdown {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.bnfs-countdown__label {
    align-self: center;
    padding-right: 4px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: .9;
}
.bnfs-countdown__items {
    display: flex;
    gap: 8px;
}
.bnfs-countdown__box {
    width: 54px;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}
.bnfs-countdown__num {
    color: #da251d;
    font-size: 19px;
    font-weight: 950;
    line-height: 1;
}
.bnfs-countdown__unit {
    margin-top: 4px;
    color: #667085;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.bnfs-nav-area {
    padding-top: 8px;
}
.bnfs-nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0 0;
    scrollbar-width: none;
}
.bnfs-nav-group::-webkit-scrollbar { display: none; }
.bnfs-tab-btn {
    border: 1px solid rgba(255,255,255,.28);
    background: rgba(255,255,255,.16);
    color: currentColor;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .2s ease;
}
.bnfs-tab-btn:hover {
    background: rgba(255,255,255,.25);
}
.bnfs-template-light .bnfs-tab-btn {
    color: #1d2327;
    border-color: #edf0f2;
    background: #fff;
}
.bnfs-tab-btn img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}
.bnfs-tab-btn small {
    font-size: 10px;
    opacity: .74;
    font-weight: 800;
}
.bnfs-tab-btn.is-active {
    color: #da251d;
    background: #fff;
    border-color: #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.bnfs-template-light .bnfs-tab-btn.is-active {
    color: #fff;
    background: #da251d;
    border-color: #da251d;
}
.bnfs-tab-btn.is-ended {
    opacity: .6;
}
.bnfs-time-tabs { display: none; }
.bnfs-time-tabs.is-visible { display: flex; }

.bnfs-products-wrap {
    position: relative;
}
.bnfs-products-wrap.is-loading::before {
    content: attr(data-loading-text);
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .72);
    border-radius: calc(var(--bnfs-border-radius) - 4px);
    color: #1d2327;
    font-weight: 800;
}

.bnfs-products {
    position: relative;
    margin-top: 16px;
}
.bnfs-product-viewport {
    overflow: hidden;
    width: 100%;
}
.bnfs-product-track {
    display: grid;
    grid-template-columns: repeat(var(--bnfs-columns-desktop, 5), minmax(0, 1fr));
    gap: var(--bnfs-card-gap, 14px);
}
.bnfs-products--slider .bnfs-product-viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.bnfs-products--slider .bnfs-product-viewport::-webkit-scrollbar { display: none; }
.bnfs-products--slider .bnfs-product-track {
    display: flex;
    gap: var(--bnfs-card-gap, 14px);
}
.bnfs-products--slider .bnfs-product-card {
    flex: 0 0 calc((100% - (var(--bnfs-card-gap, 14px) * (var(--bnfs-columns-desktop, 5) - 1))) / var(--bnfs-columns-desktop, 5));
    scroll-snap-align: start;
}

.bnfs-slider-arrow {
    position: absolute;
    top: 42%;
    z-index: 3;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #da251d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.bnfs-slider-arrow--prev { left: -8px; }
.bnfs-slider-arrow--next { right: -8px; }
.bnfs-slider-arrow:hover {
    background: #da251d;
    color: #fff;
}
.bnfs-slider-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}
.bnfs-slider-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.45);
}
.bnfs-template-light .bnfs-slider-dots span { background: #d0d5dd; }

.bnfs-product-card {
    position: relative;
    background: #fff;
    border-radius: calc(var(--bnfs-border-radius, 16px) - 2px);
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(0,0,0,.10);
    border: 1px solid rgba(0,0,0,.05);
    min-width: 0;
    color: #1d2327;
}
.bnfs-product-card__image {
    position: relative;
    display: block;
    padding: 10px;
    background: linear-gradient(180deg, #f8f9fb, #fff);
    text-decoration: none;
}
.bnfs-product-card__image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    display: block;
    transition: transform .25s ease;
}
.bnfs-product-card:hover .bnfs-product-card__image img {
    transform: scale(1.035);
}
.bnfs-product-card__badge,
.bnfs-product-card__soldout,
.bnfs-product-card__lowstock {
    position: absolute;
    left: 8px;
    top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
    color: #fff;
    background: var(--bnfs-sale-price-color, #da251d);
}
.bnfs-product-card__soldout,
.bnfs-product-card__lowstock {
    left: auto;
    right: 8px;
    background: #111;
}
.bnfs-product-card__lowstock { background: #f58220; }
.bnfs-product-card__body { padding: 10px 12px 12px; }
.bnfs-product-card__title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.35;
    min-height: 38px;
}
.bnfs-product-card__title a { color: #1d2327; text-decoration: none; }
.bnfs-product-card__prices {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.bnfs-product-card__sale-price {
    color: var(--bnfs-sale-price-color, #da251d);
    font-weight: 950;
    font-size: 16px;
}
.bnfs-product-card__prices del { color: #98a2b3; font-size: 12px; }
.bnfs-product-card__progress {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: #edf0f2;
}
.bnfs-product-card__progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--bnfs-progress-color, #da251d), #ff7a45);
}
.bnfs-product-card__sold {
    margin-top: 5px;
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}
.bnfs-product-card__actions {
    display: flex;
    gap: 7px;
    margin-top: 10px;
}
.bnfs-product-card__cart,
.bnfs-product-card__detail,
.bnfs-product-card__disabled {
    min-height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    padding: 8px 9px;
}
.bnfs-product-card__cart {
    flex: 1;
    background: #da251d;
    color: #fff !important;
}
.bnfs-product-card__detail {
    background: #f2f4f7;
    color: #1d2327 !important;
}
.bnfs-product-card__disabled {
    flex: 1;
    background: #f2f4f7;
    color: #98a2b3;
}
.bnfs-empty-products {
    margin-top: 14px;
    padding: 16px;
    border-radius: calc(var(--bnfs-border-radius) - 4px);
    background: rgba(255,255,255,.92);
    color: rgba(34,34,34,.72);
    font-size: 14px;
    font-weight: 700;
}
.bnfs-product-card.is-sold-out { opacity: .72; }
.bnfs-section__note {
    margin-top: 12px;
    font-size: 13px;
    color: rgba(255,255,255,.82);
}
.bnfs-template-light .bnfs-section__note { color: rgba(29, 35, 39, .72); }
.bnfs-stage-one-notice {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.75);
    color: #555;
    font-size: 13px;
}

@media (max-width: 1024px) {
    .bnfs-product-track {
        grid-template-columns: repeat(var(--bnfs-columns-tablet, 3), minmax(0, 1fr));
    }
    .bnfs-products--slider .bnfs-product-card {
        flex-basis: calc((100% - (var(--bnfs-card-gap, 14px) * (var(--bnfs-columns-tablet, 3) - 1))) / var(--bnfs-columns-tablet, 3));
    }
}

@media (max-width: 767px) {
    .bnfs-section {
        margin: 14px auto;
        padding: 14px;
        border-radius: calc(var(--bnfs-border-radius) - 4px);
    }
    .bnfs-section__inner {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .bnfs-countdown {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }
    .bnfs-countdown__items { gap: 6px; }
    .bnfs-countdown__box { width: 48px; height: 48px; border-radius: 10px; }
    .bnfs-countdown__num { font-size: 17px; }
    .bnfs-nav-group { padding-top: 7px; }
    .bnfs-tab-btn { padding: 7px 11px; font-size: 12px; }
    .bnfs-product-track {
        display: flex;
        gap: 10px;
    }
    .bnfs-products--grid .bnfs-product-viewport {
        overflow-x: auto;
        scrollbar-width: none;
    }
    .bnfs-products--grid .bnfs-product-viewport::-webkit-scrollbar { display: none; }
    .bnfs-products--slider .bnfs-product-card,
    .bnfs-products--grid .bnfs-product-card {
        flex: 0 0 calc(100% / var(--bnfs-columns-mobile, 2) - 7px);
        min-width: calc(100% / var(--bnfs-columns-mobile, 2) - 7px);
        scroll-snap-align: start;
    }
    .bnfs-slider-arrow { display: none; }
    .bnfs-product-card__body { padding: 8px 9px 10px; }
    .bnfs-product-card__title { font-size: 12.5px; min-height: 34px; }
    .bnfs-product-card__sale-price { font-size: 14px; }
    .bnfs-product-card__actions { gap: 5px; }
    .bnfs-product-card__cart,
    .bnfs-product-card__detail,
    .bnfs-product-card__disabled { font-size: 11.5px; padding: 7px 7px; }
}

/* ===============================
 * Phase 5: Product grid & single product Flash Sale info
 * =============================== */
.bnfs-product-flash-info,
.bnfs-product-flash-info * {
    box-sizing: border-box;
}

.bnfs-product-flash-info {
    --bnfs-loop-primary: var(--bnfs-sale-price-color, #da251d);
    --bnfs-loop-progress: var(--bnfs-progress-color, #da251d);
    font-family: inherit;
}

.bnfs-product-flash-info--loop {
    margin: 7px 0 6px;
    padding: 8px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fff7f6 0%, #ffffff 100%);
    border: 1px solid rgba(218, 37, 29, 0.12);
    color: #1d2327;
    clear: both;
}

.bnfs-loop-flash__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 5px;
}

.bnfs-loop-flash__badge,
.bnfs-loop-flash__discount {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.bnfs-loop-flash__badge {
    color: #fff;
    background: linear-gradient(135deg, #da251d, #ff5b35);
}

.bnfs-loop-flash__discount {
    color: #da251d;
    background: #fff;
    border: 1px solid rgba(218, 37, 29, 0.18);
}

.bnfs-loop-flash__price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.15;
}

.bnfs-loop-flash__price strong {
    color: var(--bnfs-sale-price-color, #da251d);
    font-size: 14px;
    font-weight: 950;
}

.bnfs-loop-flash__price del {
    color: #98a2b3;
    font-size: 11px;
    opacity: 1;
}

.bnfs-loop-flash__countdown,
.bnfs-loop-flash__state {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 3px;
    color: #344054;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
}

.bnfs-loop-flash__countdown span,
.bnfs-loop-flash__state {
    color: #667085;
    font-weight: 700;
}

.bnfs-loop-flash__countdown b {
    color: #111827;
    font-size: 11.5px;
    font-weight: 950;
}

.bnfs-loop-flash__progress {
    width: 100%;
    height: 5px;
    margin-top: 7px;
    border-radius: 999px;
    overflow: hidden;
    background: #f1f1f1;
}

.bnfs-loop-flash__progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff9f1c, var(--bnfs-progress-color, #da251d));
}

.bnfs-loop-flash__sold {
    margin-top: 4px;
    color: #667085;
    font-size: 10.8px;
    font-weight: 700;
    line-height: 1.2;
}

.bnfs-product-flash-info--loop.is-ended,
.bnfs-product-flash-info--loop.is-sold-out {
    background: #f8f8f8;
    border-color: #eeeeee;
}

.bnfs-product-flash-info--loop.is-ended .bnfs-loop-flash__badge,
.bnfs-product-flash-info--loop.is-sold-out .bnfs-loop-flash__badge {
    background: #667085;
}

.bnfs-product-flash-info--single {
    margin: 14px 0;
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff7f6 0%, #ffffff 60%, #fff 100%);
    border: 1px solid rgba(218, 37, 29, 0.15);
    box-shadow: 0 10px 26px rgba(218, 37, 29, 0.07);
    color: #1d2327;
    clear: both;
}

.bnfs-single-flash__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(218, 37, 29, 0.1);
}

.bnfs-single-flash__badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: linear-gradient(135deg, #da251d, #ff5b35);
    color: #fff;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.bnfs-single-flash__head h3 {
    margin: 7px 0 0;
    color: #111827;
    font-size: 19px;
    line-height: 1.18;
    font-weight: 950;
}

.bnfs-single-flash__head p {
    margin: 5px 0 0;
    color: #667085;
    font-size: 13px;
    font-weight: 700;
}

.bnfs-single-flash__discount {
    flex: 0 0 auto;
    min-width: 54px;
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    font-size: 16px;
    font-weight: 950;
}

.bnfs-single-flash__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 13px 0;
}

.bnfs-single-flash__price span,
.bnfs-single-flash__countdown-label {
    display: block;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.bnfs-single-flash__price strong {
    display: block;
    margin-top: 4px;
    color: var(--bnfs-sale-price-color, #da251d);
    font-size: 26px;
    line-height: 1.08;
    font-weight: 950;
}

.bnfs-single-flash__price del {
    display: inline-block;
    margin-top: 4px;
    color: #98a2b3;
    font-size: 14px;
}

.bnfs-single-flash__countdown {
    text-align: right;
}

.bnfs-single-flash__time {
    display: flex;
    gap: 6px;
    margin-top: 5px;
}

.bnfs-single-flash__time span {
    min-width: 44px;
    min-height: 44px;
    padding: 5px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.bnfs-single-flash__time b {
    font-size: 16px;
    line-height: 1;
    font-weight: 950;
}

.bnfs-single-flash__time em {
    margin-top: 3px;
    color: rgba(255,255,255,.72);
    font-size: 9px;
    line-height: 1;
    font-style: normal;
    font-weight: 800;
    text-transform: uppercase;
}

.bnfs-single-flash__progress-wrap {
    padding-top: 2px;
}

.bnfs-single-flash__progress {
    height: 8px;
    border-radius: 999px;
    background: #f1f1f1;
    overflow: hidden;
}

.bnfs-single-flash__progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff9f1c, var(--bnfs-progress-color, #da251d));
}

.bnfs-single-flash__sold,
.bnfs-single-flash__meta {
    margin-top: 7px;
    color: #667085;
    font-size: 13px;
    font-weight: 700;
}

.bnfs-single-flash__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px dashed rgba(218, 37, 29, 0.16);
}

.bnfs-single-flash__meta span {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #f0f0f0;
}

.bnfs-single-flash__soldout {
    color: #da251d;
    font-weight: 900;
}

.bnfs-product-flash-info--single.is-ended,
.bnfs-product-flash-info--single.is-sold-out {
    background: #fafafa;
    border-color: #eeeeee;
    box-shadow: none;
}

.bnfs-product-flash-info--single.is-ended .bnfs-single-flash__badge,
.bnfs-product-flash-info--single.is-sold-out .bnfs-single-flash__badge {
    background: #667085;
}

@media (max-width: 767px) {
    .bnfs-product-flash-info--loop {
        padding: 7px;
        border-radius: 9px;
    }
    .bnfs-loop-flash__badge,
    .bnfs-loop-flash__discount {
        font-size: 9.5px;
        padding: 3px 6px;
    }
    .bnfs-loop-flash__price strong {
        font-size: 13px;
    }
    .bnfs-loop-flash__countdown {
        font-size: 10px;
        flex-wrap: wrap;
    }
    .bnfs-product-flash-info--single {
        padding: 12px;
    }
    .bnfs-single-flash__body {
        grid-template-columns: 1fr;
    }
    .bnfs-single-flash__countdown {
        text-align: left;
    }
    .bnfs-single-flash__time {
        flex-wrap: wrap;
    }
    .bnfs-single-flash__price strong {
        font-size: 23px;
    }
}
