/* Flash Sale by Dattk – frontend */
.fsd-block {
	--fsd-bg: #1a7a4c;
	--fsd-card-bg: #fff;
	--fsd-body-bg: #fff;
	--fsd-text: #1f2937;
	--fsd-muted: #6b7280;
	--fsd-line: #eceef1;
	--fsd-red: #dc2626;
	box-sizing: border-box;
	margin: 0 0 24px;
	border: 1px solid var(--fsd-line);
	border-radius: 14px;
	overflow: hidden;
	background: var(--fsd-body-bg);
	color: var(--fsd-text);
	font-size: var(--fsd-font-size, 15px);
	line-height: 1.4;
}
.fsd-block *, .fsd-single *, .fsd-block *::before, .fsd-block *::after { box-sizing: border-box; }
.fsd-block a { text-decoration: none; box-shadow: none; }
.fsd-block.fsd-mode-dark {
	--fsd-card-bg: #1b1d21;
	--fsd-body-bg: #111214;
	--fsd-text: #f3f4f6;
	--fsd-muted: #9ca3af;
	--fsd-line: #2a2d33;
	--fsd-red: #f87171;
}
.fsd-block-plain { border: 0; background: transparent; border-radius: 0; }
.fsd-block-plain .fsd-body { padding: 0; }
.fsd-plain-title { display: flex; align-items: center; margin: 0 0 12px; }

/* Header */
.fsd-header {
	position: relative; isolation: isolate;
	display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap;
	padding: 18px 22px; color: #fff; overflow: hidden;
	background-color: var(--fsd-bg);
	background-image:
		radial-gradient(120% 140% at 0% 0%, rgb(255 255 255 / 14%), transparent 55%),
		repeating-linear-gradient(-55deg, rgb(255 255 255 / 4%) 0 14px, transparent 14px 28px),
		linear-gradient(110deg, transparent 40%, rgb(0 0 0 / 18%));
}
.fsd-header::after {
	content: ""; position: absolute; z-index: -1; right: 18%; top: -60%; width: 220px; height: 220%;
	background: linear-gradient(90deg, transparent, rgb(255 255 255 / 7%), transparent); transform: skewX(-25deg); pointer-events: none;
}
.fsd-head-left { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.fsd-title, .fsd-single-title {
	display: inline-flex; align-items: center; gap: .12em; margin: 0;
	font-size: 2.15em; font-weight: 900; font-style: italic; line-height: 1; letter-spacing: .5px; text-transform: uppercase;
	color: #fff; text-shadow: 2px 2px 0 rgb(0 0 0 / 35%), 0 4px 14px rgb(0 0 0 / 18%);
}
.fsd-t-a { color: #fff; }
.fsd-t-b { color: #fcd34d; }
.fsd-t-bolt { width: .72em; height: .9em; margin: 0 .08em; color: #fcd34d; filter: drop-shadow(2px 2px 0 rgb(0 0 0 / 35%)); transform: skewX(-8deg); }
.fsd-bolt-inline { width: .85em; height: .95em; margin: 0 1px; color: #facc15; }
.fsd-head-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.fsd-live {
	display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
	font-size: .74em; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; white-space: nowrap;
}
.fsd-live.is-running { background: #e53935; box-shadow: 0 2px 8px rgb(229 57 53 / 40%); }
.fsd-live.is-upcoming { background: #f59e0b; color: #1f2937; }
.fsd-live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fsd-live.is-running .fsd-live-dot { background: #fff; animation: fsd-pulse 1.2s infinite; }
@keyframes fsd-pulse { 50% { opacity: .25; } }
.fsd-sub {
	display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px;
	background: rgb(255 255 255 / 16%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 10%);
	font-size: .78em; font-weight: 600; color: #fff;
}
.fsd-head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fsd-cd-label { font-size: .9em; font-weight: 600; white-space: nowrap; }

.fsd-cd { display: inline-flex; align-items: center; gap: 5px; }
.fsd-cd-box {
	display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 7px;
	background: rgb(0 0 0 / 45%); background: color-mix(in srgb, var(--fsd-bg) 35%, #000);
	color: #fff; font-weight: 800; font-size: 1em; font-variant-numeric: tabular-nums;
}
.fsd-cd-box[hidden] { display: none; }
.fsd-cd-days { min-width: auto; }
.fsd-cd-sep { font-weight: 800; }
.fsd-viewall {
	display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border: 1.5px solid rgb(255 255 255 / 85%); border-radius: 999px;
	color: #fff !important; font-size: .88em; font-weight: 700; white-space: nowrap; transition: background .15s;
}
.fsd-viewall:hover { background: rgb(255 255 255 / 12%); }

/* Body + grid */
.fsd-body { padding: 18px 20px 20px; }
.fsd-grid { display: grid; gap: 16px; grid-template-columns: repeat(var(--fsd-cols-pc, 4), minmax(0, 1fr)); }
@media (max-width: 1023px) { .fsd-grid { grid-template-columns: repeat(var(--fsd-cols-tablet, 3), minmax(0, 1fr)); } }
@media (max-width: 767px) {
	.fsd-grid { gap: 10px; grid-template-columns: repeat(var(--fsd-cols-mobile, 2), minmax(0, 1fr)); }
	.fsd-body { padding: 12px; }
	.fsd-header { padding: 14px 12px; }
	.fsd-title { font-size: 1.65em; }
	.fsd-sub, .fsd-live { font-size: .7em; }
	.fsd-cd-box { min-width: 28px; height: 28px; }
}

/* Card */
.fsd-card {
	--fsd-r: var(--fsd-radius, 12px);
	position: relative; display: flex; flex-direction: column; min-width: 0;
	border: 1px solid rgb(17 24 39 / 7%); border-radius: var(--fsd-r); overflow: hidden;
	background: var(--fsd-card-bg); box-shadow: var(--fsd-shadow, none);
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.fsd-card:hover {
	transform: translateY(-3px); border-color: rgb(17 24 39 / 10%);
	box-shadow: 0 2px 4px rgb(16 24 40 / 4%), 0 14px 28px -6px rgb(16 24 40 / 16%);
}
.fsd-card.is-soldout:hover { transform: none; }
.fsd-mode-dark .fsd-card { border-color: var(--fsd-line); }
.fsd-thumb { position: relative; display: block; aspect-ratio: var(--fsd-ratio, 1 / 1); background: #f6f7f9; overflow: hidden; }
.fsd-thumb img, .fsd-thumb .fsd-img { display: block; width: 100% !important; height: 100% !important; max-width: none; margin: 0 !important; border-radius: 0 !important; object-fit: cover; transition: transform .4s ease; }
.fsd-card:hover .fsd-thumb img { transform: scale(1.04); }
.fsd-badge {
	position: absolute; top: 10px; left: 10px; z-index: 1; padding: 3px 8px; border-radius: 999px;
	background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; font-size: .74em; font-weight: 800; line-height: 1.3; letter-spacing: .2px;
	box-shadow: 0 2px 6px rgb(220 38 38 / 35%);
}
.fsd-soldout-pill { position: absolute; top: 50%; left: 50%; z-index: 1; transform: translate(-50%, -50%); padding: 7px 15px; border-radius: 999px; background: rgb(17 24 39 / 82%); color: #fff; font-size: .82em; font-weight: 700; white-space: nowrap; backdrop-filter: blur(2px); }
.fsd-card.is-soldout .fsd-thumb img { opacity: .45; filter: grayscale(.6); }

.fsd-card-body { display: flex; flex-direction: column; flex: 1; gap: 9px; padding: 12px 12px 14px; }
.fsd-name {
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--fsd-title-lines, 2); overflow: hidden;
	min-height: calc(1.4em * var(--fsd-title-lines, 2)); color: var(--fsd-text) !important; font-weight: 600; font-size: .93em; line-height: 1.4;
}
.fsd-name:hover { color: var(--fsd-red) !important; }

/* Giá: giá sale nổi bật, giá gốc nhỏ + gạch ngang ở giữa chiều cao chữ (không phụ thuộc theme). */
.fsd-prices { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; margin-top: auto; line-height: 1.2; }
.fsd-price { color: var(--fsd-red); font-weight: 800; font-size: 1.12em; letter-spacing: -.2px; white-space: nowrap; }
.fsd-price .amount, .fsd-price bdi { color: inherit; font-weight: inherit; }
.fsd-block .fsd-price .woocommerce-Price-currencySymbol { position: static; top: auto; vertical-align: baseline; font-size: .78em; margin-left: 1px; }
.fsd-regular {
	position: relative; display: inline-block; color: #9ca3af; font-size: .74em; font-weight: 500; white-space: nowrap;
	text-decoration: none !important; opacity: 1;
}
.fsd-regular *, .fsd-regular .amount { color: inherit !important; text-decoration: none !important; font-weight: inherit; }
.fsd-block .fsd-regular .woocommerce-Price-currencySymbol { position: static; top: auto; vertical-align: baseline; font-size: 1em; margin-left: 1px; }
.fsd-regular::after {
	content: ""; position: absolute; left: -1px; right: -1px; top: 52%; height: 1px; background: currentColor; pointer-events: none;
}

.fsd-progress { height: 5px; border-radius: 999px; background: var(--fsd-line); overflow: hidden; }
.fsd-progress span { display: block; height: 100%; border-radius: inherit; transition: width .4s; }
.fsd-progress.tone-orange span { background: linear-gradient(90deg, #f59e0b, #f97316); }
.fsd-progress.tone-red span { background: linear-gradient(90deg, #f97316, #ef4444); }
.fsd-progress.tone-green span { background: #16a34a; }
.fsd-progress.tone-gray span { background: #9ca3af; }

.fsd-status { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: .78em; }
.fsd-status-text { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.fsd-flame { width: 13px; height: 13px; flex-shrink: 0; }
.fsd-status.tone-green .fsd-status-text { color: #15803d; }
.fsd-status.tone-orange .fsd-status-text { color: #c2410c; }
.fsd-status.tone-red .fsd-status-text { color: #dc2626; }
.fsd-status.tone-gray .fsd-status-text { color: var(--fsd-muted); }
.fsd-mode-dark .fsd-status.tone-green .fsd-status-text { color: #4ade80; }
.fsd-mode-dark .fsd-status.tone-orange .fsd-status-text { color: #fb923c; }
.fsd-sold { color: var(--fsd-muted); white-space: nowrap; }

.fsd-buy {
	display: block; width: 100%; margin-top: 3px; padding: 10px 12px; border-radius: max(6px, calc(var(--fsd-r, 12px) - 3px));
	background: var(--fsd-buy, var(--fsd-bg)); color: #fff !important; font-weight: 700; font-size: .92em; text-align: center; transition: filter .15s;
}
.fsd-buy:hover { filter: brightness(1.1); box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--fsd-buy, var(--fsd-bg)) 45%, transparent); }
.fsd-buy.is-disabled { background: #f3f4f6; color: #6b7280 !important; cursor: not-allowed; filter: none; }
.fsd-mode-dark .fsd-buy.is-disabled { background: #2a2d33; color: #9ca3af !important; }

/* Slider */
.fsd-grid.is-slider { display: block; position: relative; }
.fsd-viewport { overflow: hidden; margin: -10px -6px -18px; padding: 10px 0 18px; touch-action: pan-y; }
.fsd-track { display: flex; will-change: transform; }
.fsd-slide { flex: 0 0 auto; display: flex; flex-direction: column; gap: 12px; padding: 0 6px; }
.fsd-slide > .fsd-card { flex: 1; }
.fsd-is-fading .fsd-track { opacity: 0; }
.fsd-arrow {
	position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
	transform: translateY(-50%); border: 0; background: #fff; color: #111827; cursor: pointer; box-shadow: 0 2px 10px rgb(0 0 0 / 15%); transition: opacity .15s;
}
.fsd-arrow svg { width: 18px; height: 18px; }
.fsd-arrow[disabled] { opacity: 0; pointer-events: none; }
.fsd-arrow-prev { left: -8px; }
.fsd-arrow-next { right: -8px; }
.fsd-arrows-circle .fsd-arrow { border-radius: 50%; }
.fsd-arrows-square .fsd-arrow { border-radius: 6px; }
.fsd-arrows-default .fsd-arrow { width: 30px; background: rgb(0 0 0 / 35%); color: #fff; border-radius: 3px; box-shadow: none; }
.fsd-dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.fsd-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: #d1d5db; cursor: pointer; transition: width .2s, background .2s; }
.fsd-dots button.is-active { width: 22px; background: var(--fsd-bg); }
.fsd-is-center .fsd-viewport { padding-left: 6%; padding-right: 6%; }

/* Single product countdown */
.fsd-single .fsd-single-title { font-size: 1.6em; }
.fsd-single {
	--fsd-bg: #1a7a4c;
	display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
	margin: 0 0 16px; padding: 12px 16px; border-radius: 10px; background: var(--fsd-bg); color: #fff;
	font-size: var(--fsd-font-size, 15px); line-height: 1.3;
}
.fsd-single-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 180px; }
.fsd-single-row { display: flex; align-items: center; gap: 10px; }
.fsd-cd-light .fsd-cd-box { min-width: 30px; height: 30px; background: #fff; color: #111827; }
.fsd-single .fsd-cd-sep { color: #fff; }
.fsd-single-progress { width: 100%; height: 6px; border-radius: 999px; background: rgb(255 255 255 / 30%); overflow: hidden; }
.fsd-single-progress span { display: block; height: 100%; border-radius: inherit; background: #facc15; transition: width .4s; }
.fsd-single-quota { font-size: .8em; opacity: .95; }
.fsd-single-preview { font-size: .85em; }
.fsd-single-preview strong { color: #facc15; }
.fsd-single .fsd-single-data { display: none; }
@media (max-width: 480px) {
	.fsd-single-right { align-items: stretch; width: 100%; }
	.fsd-single-row { justify-content: space-between; }
}
@media (max-width: 767px) {
	.fsd-status { flex-wrap: wrap; }
	.fsd-status-text { white-space: nowrap; }
	.fsd-arrow { width: 30px; height: 30px; }
	.fsd-arrow svg { width: 15px; height: 15px; }
	.fsd-arrow-prev { left: -4px; }
	.fsd-arrow-next { right: -4px; }
}

/* Chỉ hiển thị sản phẩm (tắt header) – để nhúng vào landing có sẵn giao diện. */
.fsd-block.fsd-no-header { border: 0; border-radius: 0; background: transparent; overflow: visible; }
.fsd-block.fsd-no-header .fsd-body { padding: 0; }
.fsd-block.fsd-no-header .fsd-arrow-prev { left: 4px; }
.fsd-block.fsd-no-header .fsd-arrow-next { right: 4px; }
