.mfs-flash-wrapper {
    /* Main wrapper styles matching the image */
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative; /* để arrow định vị theo box */
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Header */
.mfs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.mfs-header.style-orange {
    background: #fff;
    border-bottom: 1px solid #f1f1f1;
}

.mfs-header.style-blue {
    background: #00bfa5; /* Shopee-like teal/blue or use user color */
    color: #fff;
}

.mfs-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #ee4d2d; /* Orange red */
    text-transform: uppercase;
    font-style: italic;
    padding: 5px;
}

.mfs-header.style-blue .mfs-title {
    color: #fff;
}

.mfs-timer-block {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    color: #333;
}

.mfs-time-box {
    background: #000;
    color: #fff;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 14px;
}

.mfs-view-all {
    margin-left: auto;
    font-size: 14px;
    color: #ee4d2d;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.mfs-header.style-blue .mfs-view-all {
    color: #fff;
}

/* Product List / Grid / Slider */
.mfs-products {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto; /* dùng scroll để slide bằng JS */
    overflow-y: hidden;
    gap: var(--mfs-gap, 10px);
    padding: 10px;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.mfs-products::-webkit-scrollbar {
    display: none;  /* Hide scrollbar Chrome */
}

.mfs-product-card {
    /* Width được set inline từ PHP, fallback cho trường hợp không có inline style */
    flex: 0 0 calc((100% / 5) - 8px);
    border: 1px solid transparent;
    transition: transform 0.2s;
    background: #fff;
    position: relative;
    padding-bottom: 10px;
    list-style: none; /* Remove bullet */
    min-width: 0; /* Prevent flex item from overflowing */
}

/* Responsive breakpoints */
@media (max-width: 768px) {
    .mfs-products[data-items-per-view] .mfs-product-card {
        flex: 0 0 calc(50% - var(--mfs-gap, 10px) / 2) !important; /* 2 items on tablet */
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .mfs-products[data-items-per-view] .mfs-product-card {
        flex: 0 0 calc(100% - var(--mfs-gap, 10px)) !important; /* 1 item on mobile */
        min-width: 0;
    }
}

.mfs-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1;
}

/* Discount Badge */
.mfs-badge-box {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 212, 36, 0.9);
    color: #ee4d2d;
    padding: 4px 6px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 85%, 0 100%);
    z-index: 3; /* cao hơn frame overlay */
}

.mfs-badge-percent {
    display: block;
    font-size: 14px;
    color: #ee4d2d;
}

.mfs-badge-text {
    font-size: 10px;
    text-transform: uppercase;
    color: #fff;
}

/* Image + Frame */
.mfs-image-wrap {
    position: relative;
    width: 100%;
}

.mfs-card-img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    display: block;
}

.mfs-image-frame {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    pointer-events: none;
    z-index: 2;
}

/* Content */
.mfs-card-content {
    padding: 8px;
}

.mfs-product-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 6px 0 2px 0;
    height: 40px;
    max-height: 36px;
    overflow: hidden;
    line-height: 1.2;
}

.mfs-card-price {
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.mfs-price-sale {
    color: #ee4d2d;
    font-size: 16px;
    font-weight: bold;
}

.mfs-price-regular {
    color: #999;
    font-size: 12px;
    text-decoration: line-through;
}

/* Sold Progress Bar */
.mfs-progress-bar {
    position: relative;
    background: #ffbda6;
    height: 16px;
    border-radius: 8px;
    margin-top: 8px;
    overflow: hidden;
}

.mfs-progress-fill {
    height: 100%;
    background: #ee4d2d; /* Orange Fire */
    /* Gradient like image */
    background: linear-gradient(90deg, #ff9068 0%, #ff4b1f 100%);
    width: 0%; /* JS sets this */
}

.mfs-progress-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    font-size: 10px;
    color: #fff;
    line-height: 16px;
    text-transform: uppercase;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mfs-fire-icon {
    margin-right: 3px;
    /* Simple CSS fire or unicode */
}

/* Single product banner */
.mfs-single-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #ff512f 0%, #f09819 100%);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.mfs-single-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mfs-single-label {
    font-weight: 700;
    text-transform: uppercase;
}

.mfs-single-discount {
    background: #fff;
    color: #e53935;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 13px;
    font-weight: 700;
}

.mfs-single-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.mfs-single-timer .mfs-time-box {
    background: #000;
}

/* Add to cart button */
.mfs-atc-wrap {
    margin-top: 8px;
    text-align: center;
}

.mfs-atc-btn {
    background: linear-gradient(90deg, #ff9068 0%, #ff4b1f 100%);
    border-radius: 20px !important;
    padding: 6px 18px !important;
    border: none !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 600;
    text-transform: uppercase;
}

.mfs-atc-btn:hover {
    opacity: 0.9;
}

/* Slider arrows */
.mfs-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 64px;
    border: none;
    background: rgba(0,0,0,0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 5;
}

.mfs-arrow::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.mfs-arrow-prev {
    left: 0;
}

.mfs-arrow-prev::before {
    border-right: 10px solid #666;
}

.mfs-arrow-next {
    right: 0;
}

.mfs-arrow-next::before {
    border-left: 10px solid #666;
}

.mfs-arrow:hover {
    background: rgba(0,0,0,0.12);
}

/* Tuỳ chỉnh arrow theo yêu cầu */
.mfs-arrow {
    background: rgba(255,255,255,0.9);
    border: 1px solid #ff5722;
    border-radius: 5555px;
    height: 50px;
    width: 50px;
}

.mfs-arrow-next {
    padding: 0 0 0 20px;
}

