/* Flash Sale VN – frontend */
:root {
	--wfs-primary: #ee4d2d;
	--wfs-accent: #ffd424;
	--wfs-text: #fff;
}

/* Nhãn + đồng hồ */
.wfs-label { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-style: italic; letter-spacing: .02em; text-transform: uppercase; color: var(--wfs-text); }
.wfs-bolt { color: var(--wfs-accent); flex: none; }
.wfs-countdown { display: inline-flex; align-items: center; gap: 2px; font-variant-numeric: tabular-nums; }
.wfs-countdown b { display: inline-block; min-width: 1.7em; padding: 2px 4px; border-radius: 3px; background: #1f1f1f; color: #fff; font-weight: 700; font-size: .9em; text-align: center; line-height: 1.4; }
.wfs-countdown b.wfs-cd-d { min-width: 0; padding: 2px 6px; margin-right: 4px; }
.wfs-countdown b[hidden] { display: none; }
.wfs-countdown i { font-style: normal; font-weight: 700; color: inherit; }

/* Thanh tiến trình */
.wfs-progress { position: relative; height: 18px; border-radius: 999px; background: color-mix(in srgb, var(--wfs-primary) 22%, #fff); overflow: hidden; }
.wfs-progress__bar { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, var(--wfs-primary), color-mix(in srgb, var(--wfs-primary) 70%, var(--wfs-accent))); transition: width .4s ease; }
.wfs-progress.is-unlimited .wfs-progress__bar { opacity: .55; }
.wfs-progress.is-soldout .wfs-progress__bar { background: #9e9e9e; }
.wfs-progress__text { position: relative; z-index: 1; display: block; padding: 0 8px; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; text-transform: uppercase; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Trang sản phẩm */
.wfs-single { margin: 0 0 16px; padding: 10px 12px 12px; border-radius: 6px; background: linear-gradient(100deg, var(--wfs-primary), color-mix(in srgb, var(--wfs-primary) 75%, #ff8a00)); color: #fff; }
.wfs-single__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.wfs-single .wfs-label { font-size: 18px; }
.wfs-single__timer { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; text-transform: uppercase; }
.wfs-single .wfs-progress { background: rgba(255, 255, 255, .3); }
.wfs-single .wfs-progress__bar { background: var(--wfs-accent); }
.wfs-single .wfs-progress__text { color: #3a1a00; text-shadow: none; }
.wfs-single.wfs-state-upcoming { background: linear-gradient(100deg, #26a69a, #00897b); }
.wfs-single__upcoming { font-size: 14px; }
.wfs-single__upcoming .amount { color: var(--wfs-accent); font-size: 1.15em; }

/* Danh sách sản phẩm */
.wfs-loop { margin: 6px 0 4px; }
.wfs-loop .wfs-progress { height: 16px; }
.wfs-loop .wfs-progress__text { font-size: 10px; line-height: 16px; }
.wfs-loop--upcoming { font-size: 12px; color: var(--wfs-primary); }

/* Giỏ hàng */
.wfs-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 3px; background: var(--wfs-primary); color: #fff; font-size: 10px; font-weight: 700; font-style: italic; line-height: 1.6; vertical-align: middle; white-space: nowrap; }

/* Khối shortcode */
.wfs-block { margin: 0 0 24px; border-radius: 8px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); overflow: hidden; }
.wfs-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: linear-gradient(100deg, var(--wfs-primary), color-mix(in srgb, var(--wfs-primary) 75%, #ff8a00)); color: #fff; }
.wfs-head__left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wfs-label--lg { font-size: 22px; }
.wfs-label--lg .wfs-bolt { width: 22px; height: 22px; }
.wfs-head__txt { font-size: 13px; text-transform: uppercase; opacity: .95; }
.wfs-head__more, .wfs-head__more:hover { color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.wfs-state-upcoming .wfs-head { background: linear-gradient(100deg, #26a69a, #00897b); }
.wfs-banner img { display: block; width: 100%; height: auto; }
.wfs-products { position: relative; padding: 12px 8px 4px; }
.wfs-empty { padding: 24px; text-align: center; color: #666; }

/* Theme không phải Flatsome: lưới đơn giản */
.wfs-products ul.products:not(.row) { display: grid !important; grid-template-columns: repeat(var(--wfs-cols, 4), minmax(0, 1fr)); gap: 16px; margin: 0; }
.wfs-products ul.products:not(.row)::before, .wfs-products ul.products:not(.row)::after { display: none; }
.wfs-products ul.products:not(.row) li.product { width: auto !important; margin: 0 !important; float: none !important; }

/* Slider (cuộn ngang, không cần thư viện) */
.wfs-layout-slider .products { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 0; }
.wfs-layout-slider .products::-webkit-scrollbar { display: none; }
.wfs-layout-slider .products > * { flex: 0 0 calc(100% / var(--wfs-cols, 4)) !important; max-width: calc(100% / var(--wfs-cols, 4)) !important; scroll-snap-align: start; }
.wfs-layout-slider ul.products:not(.row) > li.product { padding: 0 8px; }
.wfs-nav { position: absolute; top: 40%; z-index: 3; width: 34px; height: 34px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .95); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); color: #333; font-size: 24px; line-height: 32px; cursor: pointer; }
.wfs-nav--prev { left: 4px; }
.wfs-nav--next { right: 4px; }

@media (max-width: 849px) {
	.wfs-products ul.products:not(.row) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.wfs-layout-slider .products > * { flex-basis: 45% !important; max-width: 45% !important; }
	.wfs-label--lg { font-size: 18px; }
	.wfs-nav { display: none; }
}
@media (max-width: 549px) {
	.wfs-head { padding: 10px 12px; }
	.wfs-head__txt { display: none; }
}
@supports not (background: color-mix(in srgb, red 50%, white)) {
	.wfs-progress { background: #fde3dc; }
	.wfs-single, .wfs-head { background: var(--wfs-primary); }
}

/* ==========================================================================
   Khối Flash Sale dạng tab (nền tối) – [flash_sale layout="tabs"]
   ========================================================================== */
.wfs-fs {
	--wfs-fs-bg: #262626;
	--wfs-fs-card: #333333;
	--wfs-fs-text: #ffffff;
	--wfs-fs-muted: #9b9b9b;
	--wfs-fs-price: #ff9500;
	--wfs-fs-gold-1: #ffe14d;
	--wfs-fs-gold-2: #ffb300;
	--wfs-fs-per: 6;
	position: relative;
	margin: 0 0 30px;
	padding: 6px 22px 24px;
	border-radius: 16px;
	background: var(--wfs-fs-bg);
	color: var(--wfs-fs-text);
}
.wfs-fs *, .wfs-fs *::before, .wfs-fs *::after { box-sizing: border-box; }

/* Đầu khối */
.wfs-fs__head {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) auto minmax(0, 1.25fr);
	grid-template-areas: "logo timer tabs";
	align-items: center;
	gap: 24px;
	padding: 10px 6px 18px;
}
.wfs-fs__logo { grid-area: logo; min-width: 0; }
.wfs-fs__logo-img { display: block; width: auto; max-width: 100%; height: auto; max-height: 96px; }
.wfs-fs__logo-text {
	display: inline-flex;
	align-items: center;
	font-size: clamp(30px, 4.4vw, 68px);
	font-weight: 900;
	font-style: italic;
	line-height: 1;
	letter-spacing: -.01em;
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--wfs-fs-gold-2);
	background: linear-gradient(180deg, var(--wfs-fs-gold-1) 15%, var(--wfs-fs-gold-2) 85%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35));
}
.wfs-fs__bolt {
	width: .66em;
	height: .94em;
	margin: 0 .02em;
	color: var(--wfs-fs-gold-2);
	transform: skewX(-10deg);
	filter: drop-shadow(0 0 6px rgba(255, 179, 0, .55));
}

.wfs-fs__timer { grid-area: timer; text-align: center; }
.wfs-fs__timer-label {
	margin-bottom: 10px;
	font-size: 20px;
	font-weight: 800;
	letter-spacing: .02em;
	text-transform: uppercase;
}
.wfs-fs .wfs-countdown { gap: 6px; font-size: 30px; }
.wfs-fs .wfs-countdown b {
	min-width: 1.8em;
	padding: 4px 6px;
	border-radius: 7px;
	background: #111;
	color: #fff;
	font-size: 1em;
	font-weight: 500;
	line-height: 1.25;
}
.wfs-fs .wfs-countdown b.wfs-cd-d { min-width: 0; margin-right: 2px; padding: 4px 10px; font-size: .62em; line-height: 2; }
.wfs-fs .wfs-countdown i { font-weight: 700; }

/* Tab phiên */
.wfs-fs__tabs {
	grid-area: tabs;
	display: flex;
	justify-content: space-around;
	gap: 8px;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: none;
}
.wfs-fs__tabs::-webkit-scrollbar { display: none; }
.wfs-fs__tab {
	position: relative;
	display: flex;
	flex: 0 1 auto;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	min-width: 120px;
	margin: 0;
	padding: 6px 12px 14px;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--wfs-fs-text);
	font: inherit;
	line-height: 1.2;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	opacity: .82;
	box-shadow: none;
}
.wfs-fs__tab:hover { background: none; color: var(--wfs-fs-text); opacity: 1; }
.wfs-fs__tab-day { font-size: 17px; font-weight: 400; }
.wfs-fs__tab-time { font-size: 23px; font-weight: 400; font-variant-numeric: tabular-nums; }
.wfs-fs__tab.is-active { opacity: 1; }
.wfs-fs__tab.is-active .wfs-fs__tab-day { font-size: 19px; }
.wfs-fs__tab.is-active .wfs-fs__tab-time { font-weight: 800; }
.wfs-fs__tab.is-active::after {
	content: "";
	position: absolute;
	bottom: 2px;
	left: 50%;
	width: 48px;
	height: 4px;
	border-radius: 4px;
	background: #fff;
	transform: translateX(-50%);
}
.wfs-fs__tab:focus-visible { outline: 2px solid var(--wfs-fs-gold-2); outline-offset: 2px; }

/* Danh sách thẻ */
.wfs-fs__body { position: relative; }
.wfs-fs__panel[hidden] { display: none; }
.wfs-fs__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--wfs-fs-per) - 1) * 14px) / var(--wfs-fs-per));
	gap: 14px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.wfs-fs__track::-webkit-scrollbar { display: none; }

.wfs-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 0;
	padding: 12px 8px 10px;
	border-radius: 14px;
	background: var(--wfs-fs-card);
	color: var(--wfs-fs-text);
	text-align: center;
	text-decoration: none;
	scroll-snap-align: start;
	transition: transform .2s ease, box-shadow .2s ease;
}
.wfs-card:hover { color: var(--wfs-fs-text); transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0, 0, 0, .35); }
.wfs-card:focus-visible { outline: 2px solid var(--wfs-fs-gold-2); outline-offset: 2px; }
.wfs-card__img { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1 / 1; margin-bottom: 14px; overflow: hidden; border-radius: 10px; }
.wfs-card__img img { width: 100%; height: 100%; object-fit: contain; margin: 0; }
.wfs-card__name {
	display: -webkit-box;
	min-height: 2.6em;
	margin-bottom: 8px;
	overflow: hidden;
	font-size: 16px;
	line-height: 1.3;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.wfs-card__regular { min-height: 1.3em; color: var(--wfs-fs-muted); font-size: 14px; line-height: 1.3; }
.wfs-card__regular del { color: inherit; opacity: 1; }
.wfs-card__regular .amount { color: inherit; font-weight: 400; }
.wfs-card__price { margin: 2px 0 10px; color: var(--wfs-fs-price); font-size: 21px; font-weight: 800; line-height: 1.2; }
.wfs-card__price .amount, .wfs-card__price bdi { color: inherit; font-weight: inherit; }
.wfs-card__price small { font-size: .6em; font-weight: 600; }
.wfs-masked { letter-spacing: .01em; }
.wfs-card__cta {
	display: block;
	width: 100%;
	margin-top: auto;
	padding: 4px 8px;
	border-radius: 999px;
	background: #f2f2f2;
	color: #222;
	font-size: 13px;
	line-height: 1.35;
}
.wfs-card__cta--progress { padding: 0; background: none; }
.wfs-card__cta .wfs-progress { height: 22px; background: rgba(255, 255, 255, .16); }
.wfs-card__cta .wfs-progress__bar { background: linear-gradient(90deg, #ff6a00, var(--wfs-fs-price)); }
.wfs-card__cta .wfs-progress__text { font-size: 11px; line-height: 22px; }
.wfs-card__badge {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 1;
	padding: 2px 7px;
	border-radius: 6px;
	background: var(--wfs-fs-gold-2);
	color: #3a1a00;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.5;
}
.wfs-card.is-soldout .wfs-card__img, .wfs-card.is-soldout .wfs-card__price { opacity: .45; }

/* Nút trượt */
.wfs-fs__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #3a3a3a;
	color: #fff;
	cursor: pointer;
	transform: translateY(-50%);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
	transition: opacity .2s ease, background .2s ease;
}
.wfs-fs__nav:hover { background: #4a4a4a; color: #fff; }
.wfs-fs__nav svg { width: 24px; height: 24px; }
.wfs-fs__nav--prev { left: -52px; }
.wfs-fs__nav--next { right: -52px; }
.wfs-fs__nav[disabled] { opacity: 0; pointer-events: none; }

@media (max-width: 1399px) {
	.wfs-fs__nav--prev { left: -36px; }
	.wfs-fs__nav--next { right: -36px; }
}
@media (max-width: 1199px) {
	.wfs-fs { --wfs-fs-per: 5; }
	.wfs-fs__head { grid-template-columns: auto auto; grid-template-areas: "logo timer" "tabs tabs"; gap: 12px 20px; }
	.wfs-fs__timer { justify-self: end; }
	.wfs-fs__tabs { justify-content: flex-start; }
	.wfs-fs__nav { width: 46px; height: 46px; }
	.wfs-fs__nav--prev { left: -12px; }
	.wfs-fs__nav--next { right: -12px; }
}
@media (max-width: 849px) {
	.wfs-fs { --wfs-fs-per: 3; padding: 4px 12px 16px; border-radius: 12px; }
	.wfs-fs__timer-label { margin-bottom: 6px; font-size: 13px; }
	.wfs-fs .wfs-countdown { font-size: 20px; gap: 4px; }
	.wfs-fs__tab { min-width: 0; flex: 1 0 auto; padding: 4px 10px 12px; }
	.wfs-fs__tab-day { font-size: 13px; }
	.wfs-fs__tab.is-active .wfs-fs__tab-day { font-size: 14px; }
	.wfs-fs__tab-time { font-size: 17px; }
	.wfs-fs__nav { display: none; }
}
@media (max-width: 549px) {
	.wfs-fs { --wfs-fs-per: 2.2; }
	.wfs-fs__head { grid-template-columns: 1fr; grid-template-areas: "logo" "timer" "tabs"; justify-items: center; text-align: center; }
	.wfs-fs__timer { justify-self: center; }
	.wfs-fs__logo-text { font-size: 40px; }
	.wfs-fs__track { gap: 10px; grid-auto-columns: calc((100% - 10px) / var(--wfs-fs-per)); }
	.wfs-card { padding: 10px 6px 8px; }
	.wfs-card__name { font-size: 14px; }
	.wfs-card__regular { font-size: 12px; }
	.wfs-card__price { font-size: 17px; }
	.wfs-card__cta { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.wfs-fs__track { scroll-behavior: auto; }
	.wfs-card { transition: none; }
}
