/**
 * SMT Flash Sale — Frontend styles (standalone, prefix .smt-fs-)
 */

.smt-fs-bar-wrap {
	margin: 12px 0;
}

/* Shop / category / related product loops */
.smt-fs-loop-flash {
	width: 100%;
	margin: 6px 0 8px;
}

.smt-fs-loop-flash .smt-fs-loop-bar {
	margin: 0 0 6px;
}

.smt-fs-loop-flash .smt-fs-loop-price {
	margin: 0;
	line-height: 1.35;
}

.smt-fs-loop-flash .smt-fs-prices,
.smt-fs-price-html {
	display: flex;
	align-items: baseline;
	gap: 6px;
	flex-wrap: wrap;
	margin: 0;
	justify-content: center;
}

.product .smt-fs-loop-flash + .price,
.products .product .price:empty {
	display: none;
}

.smt-fs-bar {
	position: relative;
	height: 20px;
	border-radius: 25px;
	background: #e0e0e0;
	overflow: hidden;
}

.smt-fs-fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: var(--smt-pct, 0%);
	background: var(--smt-color, #2e7d32);
	border-radius: 25px;
	transition: width 0.5s ease;
}

.smt-fs-label {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 12px;
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
	z-index: 1;
	gap: 8px;
}

.smt-fs-label strong {
	font-weight: 700;
}

.smt-fs-bar-placeholder {
	display: none;
}

.smt-fs-bar.smt-fs-bar-sm {
	height: 20px;
	border-radius: 25px;
}

.smt-fs-bar.smt-fs-bar-sm .smt-fs-label {
	font-size: 12px;
	padding: 0 8px;
}

.smt-fs-bar-soldout {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #9e9e9e;
	color: #fff;
	text-shadow: none;
}

.smt-fs-soldout-label {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.smt-fs-bar-soldout.smt-fs-bar-sm .smt-fs-soldout-label {
	font-size: 11px;
}

.smt-fs-cart-notice {
	font-size: 14px;
	color: #c62828;
	margin-top: 4px;
}

/* Widget shortcode */
.smt-fs-widget {
	--smt-primary: #ff6d00;
	--smt-cols: 4;
	--smt-cols-t: 3;
	--smt-cols-m: 2;
	--smt-gap: 10px;
	font-family: inherit;
	border-radius: 5px;
	overflow: hidden;
	border: 1px solid #eee;
	margin: 16px 0;
}

.smt-fs-widget-header {
	background: var(--smt-primary);
	color: #fff;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	border-radius: 5px 5px 0 0;
	flex-wrap: wrap;
}

.smt-fs-widget-title {
	font-size: 16px;
	font-weight: 600;
}

.smt-fs-see-all {
	margin-left: auto;
	color: rgba(255, 255, 255, 0.85);
	font-size: 14px;
	text-decoration: none;
}

.smt-fs-see-all:hover {
	color: #fff;
}

.smt-fs-countdown {
	display: flex;
	gap: 4px;
	align-items: center;
}

.smt-fs-seg {
	background: rgba(0, 0, 0, 0.3);
	color: #fff;
	font-family: monospace;
	font-size: 14px;
	padding: 3px 8px;
	border-radius: 5px;
	min-width: 28px;
	text-align: center;
	display: inline-block;
}

.smt-fs-sep {
	color: rgba(255, 255, 255, 0.7);
	font-size: 14px;
}

.smt-fs-products-wrap {
	position: relative;
	background: #f9f9f9;
	border-radius: 0 0 5px 5px;
}

/* Row layout — kế thừa ul.products WooCommerce/theme */
.smt-fs-slider--row {
	padding: 12px;
}

.smt-fs-slider--row ul.products {
	margin: 0 !important;
	padding: 0;
}

.smt-fs-slider--row .smt-fs-card {
	height: 100%;
	display: flex;
	flex-direction: column;
}

.smt-fs-slider--row .smt-fs-card-body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}

.smt-fs-slider--row .smt-fs-prices {
	margin-top: auto;
}

/* Slider layout — jQuery carousel by columns */
.smt-fs-slider--slider {
	overflow: hidden;
	padding: 12px 40px;
}

.smt-fs-slider-track {
	display: flex;
	gap: var(--smt-gap);
	transition: transform 0.35s ease;
	will-change: transform;
	list-style: none;
	margin: 0 !important;
	padding: 0;
}

.smt-fs-slider--slider ul.products.smt-fs-slider-track {
	display: flex;
	flex-wrap: nowrap;
}

.smt-fs-slider--slider .smt-fs-slider-track > .product {
	float: none;
	margin: 0;
	clear: none;padding: 0;
}

.smt-fs-slider-track.is-no-transition {
	transition: none !important;
}

.smt-fs-slider--slider .smt-fs-card {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	min-width: 0;
	box-sizing: border-box;
}

.smt-fs-slider--slider .smt-fs-card-body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}

.smt-fs-slider--slider .smt-fs-prices {
	margin-top: auto;
}

.smt-fs-slider-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 32px;
	height: 32px;
	min-height: 32px;
	border: 1px solid #ddd;
	border-radius: 40px;
	background: #fff;
	margin: 0;
	color: #333;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
	transition: opacity 0.2s, background 0.2s;
}

.smt-fs-slider-nav:hover {
	background: #f5f5f5;
}

.smt-fs-slider-nav:disabled,
.smt-fs-slider-nav.is-disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

.smt-fs-slider-prev {
	left: 6px;
}

.smt-fs-slider-next {
	right: 6px;
}

.smt-fs-layout-row .smt-fs-slider-nav {
	display: none;
}

/* Product card */
.smt-fs-card {
	display: block;
	text-decoration: none;
	color: inherit;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 5px;
	overflow: hidden;
	transition: box-shadow 0.2s;
}

.smt-fs-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	color: inherit;
}

.smt-fs-card-img {
	position: relative;
	aspect-ratio: 1;
	background: #f5f5f5;
	flex-shrink: 0;
}

.smt-fs-card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.smt-fs-pct-badge {
	position: absolute;
	top: 6px;
	left: 6px;
	background: #c62828;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	padding: 2px 6px;
	border-radius: 5px;
	z-index: 1;
}

.smt-fs-card-body {
	padding: 8px 10px;
}

.smt-fs-card-name {
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	margin-bottom: 5px;
	color: #333;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.8em;
}

.smt-fs-prices {
	display: flex;
	align-items: baseline;
	gap: 6px;
	margin-bottom: 6px;
	flex-wrap: wrap;
	font-size: 14px;
}

.smt-fs-price-flash {
	font-size: 14px;
	font-weight: 700;
	color: var(--smt-primary, #ff6d00);
}

.smt-fs-price-orig {
	font-size: 14px;
	color: #999;
	text-decoration: line-through;
}

/* Flash page — grid bung từng SKU/variation */
.smt-fs-page-products {
	--smt-primary: #ff6d00;
	--smt-cols: 4;
	--smt-cols-t: 3;
	--smt-cols-m: 2;
	--smt-gap: 12px;
	display: grid;
	grid-template-columns: repeat(var(--smt-cols), minmax(0, 1fr));
	gap: var(--smt-gap);
	margin: 0 0 24px;
	padding: 12px;
	background: #f9f9f9;
	border-radius: 5px;
	align-items: stretch;
}

.smt-fs-page-products .smt-fs-card {
	height: 100%;
	display: flex;
	flex-direction: column;
}

.smt-fs-page-products .smt-fs-card-body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}

.smt-fs-page-products .smt-fs-prices {
	margin-top: auto;
}

/* Flash page header */
.smt-fs-page-header {
	--smt-primary: #ff6d00;
	margin: 0 0 24px;
}

.smt-fs-page-banner {
	padding: 24px 20px;
	background: #0d2137;
	border-radius: 5px;
}

.smt-fs-page-banner img {
	max-height: 200px;
	width: 100%;
	object-fit: cover;
	border-radius: 5px;
	margin-bottom: 12px;
	display: block;
}

.smt-fs-page-title,
.smt-fs-page-header .woocommerce-products-header__title {
	color: #fff;
	margin: 0 0 4px;
	font-size: 22px;
	font-weight: 600;
}

.smt-fs-page-sub {
	color: rgba(255, 255, 255, 0.65);
	margin: 0 0 10px;
	font-size: 14px;
}

.smt-fs-page-cta {
	display: inline-block;
	margin-top: 12px;
	background: var(--smt-primary, #ff6d00);
	color: #fff !important;
	padding: 8px 16px;
	border-radius: 5px;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	border: none;
}

.smt-fs-page-cta:hover {
	color: #fff !important;
	opacity: 0.92;
}

.smt-fs-flash-page .smt-fs-page-banner .smt-fs-countdown {
	margin-top: 8px;
}

@media (max-width: 991px) {
	.smt-fs-page-products {
		grid-template-columns: repeat(var(--smt-cols-t), minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.smt-fs-page-products {
		grid-template-columns: repeat(var(--smt-cols-m), minmax(0, 1fr));
	}

	.smt-fs-slider--slider {
		padding: 12px 36px;
	}

	.smt-fs-page .smt-fs-slider--slider.smt-fs-page-grid {
		padding: 12px 36px;
	}

	.smt-fs-label {
		font-size: 14px;
		padding: 0 8px;
	}

	.smt-fs-bar {
		height: 26px;
	}
}
