/* ============================================================
HBWeb Flash Sale - Frontend CSS
============================================================ */

/* ---- Variables ---- */
:root {
	--hbfs-primary:   #f35627;
	--hbfs-secondary: #fda524;
	--hbfs-text:      #fff;
	--hbfs-radius:    8px;
}

/* ============================================================
   BOX FRAME WRAPPER (Khung bao viền cho toàn bộ nội dung slider & tabs)
   ============================================================ */
.hbfs-slider-box-frame {
	background: var(--hbfs-frame-bg, #160803);
	padding: 10px;
	border-bottom-right-radius: 10px;
	border-bottom-left-radius: 10px;
	overflow: hidden;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
	position: relative;
	z-index: 2;
}

/* ============================================================
   FLASH SALE TABS (Ngày & Giờ sự kiện)
   ============================================================ */
.flash-sale-tabs {
	display: flex;
	align-items: stretch;
	list-style: none;
	margin: 0;
	padding: 0;
	border-bottom: 1px solid #f0f0f0;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	background: #fff;
	border-top-left-radius: 6px;
	border-top-right-radius: 6px;
}
.flash-sale-tabs::-webkit-scrollbar {
	display: none;
}

.flash-sale-tabs li {
	flex: 0 0 auto;
	min-width: 150px;
	margin: 0 !important;
	padding: 10px 20px;
	text-align: left;
	cursor: pointer;
	position: relative;
	transition: all 0.25s ease;
	background: #fff;
	user-select: none;
	border-right: 1px solid #f5f5f5;
}

.flash-sale-tabs li:hover {
	background: #fffafa;
}

.flash-sale-tabs li.active {
	background: #ffe8e8;
	border-bottom: 2px solid #e5101d;
}

.flash-sale-tabs li .tab-date {
	text-align: center;
	font-size: 1.15rem;
	font-weight: 800;
	line-height: 1.2;
	margin-bottom: 4px;
	color: #222;
}

.flash-sale-tabs li.active .tab-date {
	color: #d31e1e;
}


.flash-sale-tabs li .tab-countdown {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	font-size: 0.85rem;
	color: #444;
	white-space: nowrap;
}

.flash-sale-tabs li .tab-status {
	font-weight: 500;
	color: #333;
}

.flash-sale-tabs li .tab-timer {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	margin-left: 2px;
}

.flash-sale-tabs li .time-block {
	background: #eb2f2f;
	color: #fff;
	font-weight: 700;
	font-size: 0.82rem;
	padding: 2px 4px;
	border-radius: 4px;
	min-width: 22px;
	text-align: center;
	display: inline-block;
	line-height: 1.1;
}

.flash-sale-tabs li .colon {
	color: #eb2f2f;
	font-weight: 700;
	font-size: 0.82rem;
}

/* ============================================================
   PRODUCT ITEM - Cấu trúc theo mẫu
   ============================================================ */
.hbfs-products-row .item {
	padding: 4px;
	height: 100%;
}

.news-item-products.news-item-products-flashsale.product-item {
	position: relative;
	background: #fff;
	border-radius: 8px;
	border: 1px solid #eaeaea;
	padding: 10px;
	display: flex;
	flex-direction: column;
	height: 100%;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	text-decoration: none;
	color: inherit;
	box-sizing: border-box;
}

.news-item-products.news-item-products-flashsale.product-item:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

/* Link toàn bộ card */
.news-item-products.news-item-products-flashsale.product-item > a {
	position: absolute;
	inset: 0;
	z-index: 4;
}

/* Khung ảnh */
.news-item-products-flashsale .fix-images {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 10px;
	overflow: hidden;
	background: #fdfdfd;
}

.news-item-products-flashsale .fix-images img.img-responsive {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
	margin: 0 auto;
	transition: transform 0.3s ease;
}

.news-item-products-flashsale:hover .fix-images img.img-responsive {
	transform: scale(1.04);
}

/* Frame overlay */
.news-item-products-flashsale .hbfs-product-card__frame {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 2;
}
.news-item-products-flashsale .hbfs-product-card__frame img {
	width: 100%;
	height: 100%;
	object-fit: fill;
}

/* Suất mở bán badge (vàng + đỏ) */
.news-item-products-flashsale .aaa-sale-slot {
	display: inline-flex;
	align-items: stretch;
	margin-bottom: 6px;
	z-index: 5;
	align-self: flex-start;
}

.news-item-products-flashsale .aaa-sale-slot .sale-slot-icon {
	background: #ffcc00;
	color: #d80000;
	font-size: 0.85rem;
	padding: 3px 6px;
	border-radius: 4px 0 0 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.news-item-products-flashsale .aaa-sale-slot img {
	height: 18px;
	margin-right: -2px;
	display: block;
}

.news-item-products-flashsale .aaa-sale-slot .sale-slot {
	background: #d80000;
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	padding: 3px 8px 3px 6px;
	border-radius: 0 4px 4px 0;
	line-height: 1.3;
	white-space: nowrap;
}

/* Khối Giá Flash Sale Banner Nền price-gvgs */
.news-item-products-flashsale .price_flashsale {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
	position: relative;
	background-image: var(--hbfs-price-bg, url('../../assets/images/price-gvgs.webp'));
	background-repeat: no-repeat;
	background-position: 100%;
	background-size: cover;
	border-radius: 8px;
	overflow: hidden;
	padding: 6px 8px;
	width: 100%;
	height: 50px;
	color: #fff;
	min-height: 42px;
	box-sizing: border-box;
}

.news-item-products-flashsale .price-content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	z-index: 2;
}

.news-item-products-flashsale .current-price {
	font-size: 0.9rem;
	font-weight: 800;
	color: #fff;
	line-height: 1.2;
	white-space: nowrap;
}

.news-item-products-flashsale .current-price .woocommerce-Price-amount {
	color: #fff !important;
	font-weight: 800 !important;
}

.news-item-products-flashsale .original-price {
	font-size: 0.72rem;
	color: rgba(255, 255, 255, 0.85);
	text-decoration: line-through;
	line-height: 1.1;
}

.news-item-products-flashsale .original-price .woocommerce-Price-amount {
	color: rgba(255, 255, 255, 0.85) !important;
	font-size: 0.72rem !important;
}

/* Discount badge chữ đỏ trên nền vàng của banner */
.news-item-products-flashsale .discount-badge {
	position: absolute;
	right: 0;
	top: 0;
	bottom: 0;
	color: #d80000;
	font-size: 0.78rem;
	font-weight: 800;
	padding: 0 8px 0 16px;
	display: flex;
	align-items: center;
	z-index: 1;
	white-space: nowrap;
}

/* Tiêu đề sản phẩm */
.news-item-products-flashsale h3 {
	font-size: 0.88rem;
	font-weight: 600;
	color: #333;
	line-height: 1.35;
	margin: 0 0 10px 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.4em;
}

/* Nút Sắp diễn ra / Mua ngay hình viên thuốc */
.news-item-products-flashsale .product-coming {
	margin-top: auto;
	text-align: center;
	border: 1px solid #eb2f2f;
	border-radius: 20px;
	padding: 6px 12px;
	transition: all 0.2s ease;
	background: #fff;
}

.news-item-products-flashsale .product-coming span {
	color: #eb2f2f;
	font-size: 0.82rem;
	font-weight: 600;
}

.news-item-products-flashsale .product-coming:hover {
	background: #eb2f2f;
}

.news-item-products-flashsale .product-coming:hover span {
	color: #fff;
}

/* Nút khi đang diễn ra: Mua ngay */
.news-item-products-flashsale .product-coming.product-buying {
	background: #e5101d;
	border-color: #e5101d;
}

.news-item-products-flashsale .product-coming.product-buying span {
	color: #fff;
	font-weight: 700;
}

.news-item-products-flashsale .product-coming.product-buying:hover {
	background: #c50c18;
	border-color: #c50c18;
}


/* ============================================================
   SINGLE PRODUCT BAR
   ============================================================ */
.hbfs-product-bar {
	background: linear-gradient(135deg, #ff4500 0%, #fda524 100%);
	border-radius: var(--hbfs-radius);
	padding: 12px 16px;
	margin-bottom: 18px;
	color: #fff;
	font-family: inherit;
	position: relative;
	overflow: hidden;
}

.hbfs-product-bar__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
	flex-wrap: wrap;
	gap: 8px;
}

.hbfs-product-bar__title {
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: .5px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.hbfs-product-bar__title svg { width: 20px; height: 20px; fill: #fff; }

/* Countdown */
.hbfs-countdown {
	display: flex;
	gap: 6px;
	align-items: center;
}

.hbfs-countdown__block {
	background: rgba(0,0,0,.25);
	border-radius: 5px;
	min-width: 36px;
	text-align: center;
	padding: 2px 6px;
	font-size: .85rem;
	font-weight: 700;
}

.hbfs-countdown__sep {
	font-weight: 900;
	font-size: 1rem;
	opacity: .8;
}

/* Progress Bar */
.hbfs-progress-wrap {
	background: rgba(255,255,255,.3);
	border-radius: 50px;
	height: 14px;
	overflow: hidden;
	position: relative;
}

.hbfs-progress-bar {
	height: 100%;
	background: #fff;
	border-radius: 50px;
	transition: width .6s ease;
	position: relative;
}

.hbfs-progress-bar::after {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.4) 50%, transparent 100%);
	animation: hbfs-shine 1.8s linear infinite;
}

@keyframes hbfs-shine {
	0%   { transform: translateX(-100%); }
	100% { transform: translateX(200%); }
}

.hbfs-progress-label {
	margin-top: 5px;
	font-size: .8rem;
	opacity: .9;
	display: flex;
	align-items: center;
	gap: 4px;
}

/* ============================================================
   CART BADGE
   ============================================================ */
.hbfs-cart-badge {
	display: inline-block;
	background: linear-gradient(135deg, #f35627, #fda524);
	color: #fff;
	font-size: .7rem;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 20px;
	margin-left: 6px;
	vertical-align: middle;
	letter-spacing: .5px;
}

/* ============================================================
   SLIDER [hbfs_slider]
   ============================================================ */
.hbfs-slider-wrap {
	margin-bottom: 32px;
	position: relative;
	overflow: visible !important;
}

/* Header bar */
.hbfs-slider-header {
	background: linear-gradient(135deg, #f35627 0%, #fda524 100%);
	padding: 12px 18px;
	display: flex;
	align-items: center;
	gap: 12px;
	color: #fff;
	border-radius: var(--hbfs-radius) var(--hbfs-radius) 0 0;
}

.hbfs-slider-header__name {
	font-size: 1.1rem;
	font-weight: 800;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.hbfs-slider-header__countdown {
	display: flex;
	gap: 4px;
	margin-left: auto;
}

.hbfs-slider-header__countdown .hbfs-countdown__block {
	background: rgba(0,0,0,.3);
}

.hbfs-slider-header__link {
	color: #fff;
	font-size: .85rem;
	text-decoration: none;
	border: 1px solid rgba(255,255,255,.6);
	padding: 3px 10px;
	border-radius: 20px;
	white-space: nowrap;
	transition: background .2s;
}

.hbfs-slider-header__link:hover { background: rgba(255,255,255,.2); }

/* Banner */
.hbfs-slider-banner img {
	width: 100%;
	display: block;
	object-fit: cover;
}

/* Splide carousel container */
.hbfs-products-row {
	background: #fff;
	position: relative;
	padding: 16px 12px;
}
.hbfs-products-row:focus { outline: none; }

/* Splide arrow */
.hbfs-products-row.splide {
	padding-left: 0px;
	padding-right: 0px;
	padding-top: 10px;
}

.hbfs-products-row.splide .splide__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 35px;
	height: 35px;
	margin: 0;
	border-radius: 50%;
	background: linear-gradient(135deg, #f35627, #fda524) !important;
	box-shadow: 0 2px 10px rgba(0,0,0,.3);
	border: none;
	outline: none;
	opacity: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .2s, box-shadow .2s;
	padding: 0;
}
.hbfs-products-row.splide .splide__arrow:hover {
	background: linear-gradient(135deg, #e04b1e, #f09010) !important;
	box-shadow: 0 4px 14px rgba(0,0,0,.35);
	opacity: 1;
}
.hbfs-products-row.splide .splide__arrow svg {
	fill: #fff;
	height: 14px;
	flex-shrink: 0;
}
.hbfs-products-row.splide .splide__arrow:disabled {
	display: none !important;
}
.hbfs-products-row.splide .splide__arrow--prev {
	left: -10px;
	transform: translateY(-50%) rotate(180deg);
}
.hbfs-products-row.splide .splide__arrow--next { right: -10px; }

/* Splide slide items fill full height */
.hbfs-products-row .splide__slide {
	display: flex;
	flex-direction: column;
	margin-left: 0;
	padding: 2px;
	box-sizing: border-box;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
	.flash-sale-tabs li {
		min-width: 120px;
		padding: 8px 10px;
	}
	.flash-sale-tabs li .tab-date {
		font-size: 1rem;
	}
	.flash-sale-tabs li .tab-countdown {
		font-size: 0.78rem;
	}
	.hbfs-products-row.splide .splide__arrow--prev { left: 0; }
	.hbfs-products-row.splide .splide__arrow--next { right: 0; }
}

@media (max-width: 480px) {
	.flash-sale-tabs li {
		min-width: 100px;
		padding: 6px 8px;
	}
	.news-item-products-flashsale .current-price {
		font-size: 0.92rem;
	}
}

/* ============================================================
   PRODUCT LOOP OVERLAY — Flatsome product box
   ============================================================ */
.hbfs-loop-wrap {
	position: relative;
}

.hbfs-loop-overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 5;
}

.hbfs-loop-overlay__badge {
	position: absolute;
	top: 8px;
	left: 8px;
	color: #fff;
	font-size: .68rem;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 20px;
	letter-spacing: .3px;
	line-height: 1.5;
	box-shadow: 0 2px 6px rgba(0,0,0,.2);
	pointer-events: none;
}

.hbfs-loop-wrap .price ins,
.hbfs-loop-wrap .price ins .woocommerce-Price-amount {
	text-decoration: none;
	color: #f35627 !important;
	font-weight: 800 !important;
	font-size: 0.9em !important;
}

.hbfs-loop-wrap .price del,
.hbfs-loop-wrap .price del .woocommerce-Price-amount {
	color: #aaa !important;
	font-size: .8em !important;
	opacity: .75;
}

.hbfs-loop-wrap .price > .woocommerce-Price-amount {
	color: #f35627 !important;
	font-weight: 800 !important;
}

.hbfs-loop-overlay__frame {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 3;
}
.hbfs-loop-overlay__frame img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: fill;
	pointer-events: none;
}
