/* HPP Flash sale — section trang chủ + khung giá trang chi tiết.
   Theme dùng Meyer reset (b/strong/em mất đậm, nghiêng) nên mọi kiểu chữ đều khai báo lại ở đây. */

.hpp-fs,
.hpp-fs-pdp {
	--fs-red: #e3121e;
	--fs-red-dark: #b5000f;
	--fs-orange: #ff7a00;
	--fs-yellow: #ffd83d;
	--fs-ink: #1d1d1f;
	--fs-muted: #7a7a80;
	box-sizing: border-box;
}

.hpp-fs *,
.hpp-fs-pdp * {
	box-sizing: border-box;
}

.hpp-fs[hidden],
.hpp-fs [hidden],
.hpp-fs-pdp[hidden],
.hpp-fs-pdp [hidden] {
	display: none !important;
}

/* ---------- Đồng hồ đếm ngược ---------- */

.hpp-fs-clock {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-variant-numeric: tabular-nums;
}

.hpp-fs-clock b {
	display: inline-block;
	min-width: 30px;
	padding: 4px 5px;
	border-radius: 6px;
	background: var(--fs-ink);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
}

.hpp-fs-clock i {
	color: inherit;
	font-style: normal;
	font-weight: 700;
}

.hpp-fs-clock__day {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-right: 4px;
	font-size: 13px;
	font-weight: 600;
}

/* ---------- Thanh "Đã bán" ---------- */

.hpp-fs-bar {
	position: relative;
	display: block;
	width: 100%;
	height: 20px;
	overflow: hidden;
	border-radius: 999px;
	background: #ffd9b8;
}

.hpp-fs-bar i {
	position: absolute;
	inset: 0 auto 0 0;
	min-width: 20px;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--fs-orange), var(--fs-red));
}

.hpp-fs-bar em {
	position: relative;
	display: block;
	color: #fff;
	font-size: 11px;
	font-style: normal;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
	text-shadow: 0 1px 2px rgba(120, 0, 0, .55);
	white-space: nowrap;
}

.hpp-fs-preview {
	margin: 0 0 8px;
	padding: 6px 10px;
	border: 1px dashed #c98a00;
	border-radius: 6px;
	background: #fff8e1;
	color: #7a5200;
	font-size: 12px;
	line-height: 1.4;
}

/* =====================================================================
 * Section trang chủ
 * ================================================================== */

.hpp-fs {
	--fs-home: #cf0f07;
	--fs-home-dark: #8f0f1a;
	margin: 32px 0 24px;
}

.hpp-fs__wrap {
	position: relative;
}

/* ---------- Khung tiêu đề nhô lên giữa mép trên (vẽ bằng CSS, không dùng ảnh) ---------- */

.hpp-fs__header {
	position: relative;
	z-index: 1;
	width: calc(100% - 60px);
	height: 54px;
	margin: 0 auto;
}

/* Dải nền hình thang phía sau thẻ tiêu đề. Đặt ở ::before để clip-path không cắt
   mất phần thẻ tiêu đề nhô lên trên. */
.hpp-fs__header::before {
    content: "";
    position: absolute;
    top: 50%;
    background-image: url(/wp-content/themes/monatheme/public/images/bg.png);
    background-repeat: no-repeat;
    background-size: 100%100%;
    height: 50%;
    width: 100%;
}

.hpp-fs__title {
	position: absolute;
	inset: 0 28px 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 30%;
	height: 100%;
	margin: 0 auto;
	user-select: none;
	margin-left: 0;
}

/* Thẻ đỏ bo 2 góc trên */
.hpp-fs__title-tab {
    position: absolute;
    top: 0;
    left: 4%;
    z-index: 1;
    width: 92%;
    height: 54px;
    border-radius: 16px 16px 0 0;
    box-shadow: rgb(143, 15, 26) 0 -5px 5px inset;
    background: linear-gradient(180deg, #FFFFFB 0%, #FFEEAC 100%);
}

/* Đế sẫm rộng hơn thẻ, lộ ra ở 2 bên chân */
.hpp-fs__title-base {
	position: absolute;
	bottom: 0;
	left: 0;
	z-index: 0;
	width: 100%;
	height: 12px;
	border-radius: 18px 18px 0 0;
	background-color: rgb(143, 15, 26);
}

.hpp-fs__title span {
	position: relative;
	z-index: 2;
	max-width: 88%;
	padding: 0 12px;
	overflow: hidden;
	color: #C50200;
	font-size: 20px;
	font-style: italic;
	font-weight: 800;
	line-height: 1.2;
	text-align: center;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
}

/* ---------- Hộp đỏ viền vàng ---------- */
.hpp-fs__box-wrap {
	padding: 3px;
    padding-top: 10px;
    border-radius: 24px;
    background: linear-gradient(180deg, #FFEEAC 0%, #FFB650 100%);
}
.hpp-fs__box {
	position: relative;
	z-index: 2;
	margin-top: -7px;
	padding: 16px 24px 16px;
	border: 1px solid #fff3cf;
	border-radius: 24px;
	background: linear-gradient(180deg, #FF0007 0%, #D30008 100%);
	box-shadow: 15px 15px 20px 0px rgb(130 2 0 / 75%) inset, -15px -15px 20px 0px rgb(130 2 0 / 75%) inset;
}

.hpp-fs__deco {
	position: absolute;
	z-index: 3;
	object-fit: contain;
	pointer-events: none;
}

/* Icon trang trí 1-8 (fs-deco-1 ... fs-deco-8). 3 và 4 nằm trong .hpp-fs__title nên
   bám theo mép phải tiêu đề; còn lại tính theo hộp đỏ. */
.hpp-fs__deco--1 {
    top: -28px;
    left: -20px;
    width: 52px;
    height: 74px;
}
.hpp-fs__deco--2 { top: 3px; left: 30px; width: 30px; height: 30px; }
.hpp-fs__deco--3 { top: 28px; left: calc(96% + 12px); width: 27px; height: 27px; }
.hpp-fs__deco--4 { top: 28px; left: calc(96% + 38px); width: 43px; height: 37px; }
.hpp-fs__deco--5 {
    top: -30px;
    right: 33px;
    width: 36px;
    height: 40px;
}
.hpp-fs__deco--6 {
    top: -57px;
    right: -37px;
    width: 80px;
    height: 100px;
}
.hpp-fs__deco--7 { bottom: 0; left: 0; width: 77px; height: 45px; }
.hpp-fs__deco--8 { bottom: 0; right: -2px; width: 52px; height: 36px; }

.hpp-fs__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 0 0 12px;
    z-index: 4;
    position: relative;
}

/* ---------- Nút tab ---------- */

.hpp-fs__tabs {
    display: flex;
    gap: 10px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.hpp-fs__tabs::-webkit-scrollbar {
	display: none;
}

.hpp-fs__tab {
    flex: 0 0 auto;
    margin: 0;
    padding: 6px 16px;
    border: 3px solid #fff;
    border-radius: 999px;
    background: white;
    color: #D20001;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .3s, background .3s, color .3s;
    opacity: .8;
}

.hpp-fs__tab.is-active {
    background: #D20001;
    color: #fff;
    border-color: #FFEEAC;
    opacity: 1;
}


.hpp-fs__tab[disabled] {
	opacity: .6;
	cursor: not-allowed;
	transform: none;
}

/* ---------- Đếm ngược ---------- */

.hpp-fs__cd {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	margin-left: auto;
	color: #fff;
}

.hpp-fs__cd-label {
	font-size: 18px;
	font-weight: 500;
	text-transform: uppercase;
	white-space: nowrap;
}


.hpp-fs-clock--box b {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	min-width: 0;
	height: 36px;
	padding: 0;
	border-radius: 4px;
	background: #fff;
	color: #000;
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
}

.hpp-fs-clock--box i {
	color: #fff;
	font-size: 24px;
	font-weight: 700;
	line-height: 1;
}

/* Dấu 2 chấm bằng ảnh (fs-icon-colon.png) */
.hpp-fs-clock__sep {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.hpp-fs-clock__sep img {
    display: block;
    width: 33px;
    height: 70px;
    object-fit: contain;
}

/* ---------- Slider ---------- */

.hpp-fs__slider {
	position: relative;
}

.hpp-fs__track {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	border-radius: 16px;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.hpp-fs__track::-webkit-scrollbar {
	display: none;
}

/* Kéo bằng chuột: tắt snap + smooth trong lúc kéo, nếu không dải trượt sẽ giật ngược lại. */
@media (hover: hover) and (pointer: fine) {
	.hpp-fs__track { cursor: grab; }
}

.hpp-fs__track.is-dragging {
	cursor: grabbing;
	scroll-behavior: auto;
	scroll-snap-type: none;
	user-select: none;
}

.hpp-fs__track.is-dragging .hpp-fs-card {
	pointer-events: none;
}

.hpp-fs__nav {
	position: absolute;
	top: 50%;
	z-index: 4;
	display: flex;
	align-items: center;
	width: 36px;
	height: 72px;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(255, 255, 255, .8);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
	color: #262626;
	font-size: 30px;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background .15s;
}

.hpp-fs__nav:hover {
	background: #fff;
}

.hpp-fs__nav--prev {
	left: 0;
	justify-content: flex-start;
	border-radius: 0 999px 999px 0;
}

.hpp-fs__nav--next {
	right: 0;
	justify-content: flex-end;
	border-radius: 999px 0 0 999px;
}

.hpp-fs__nav[disabled] {
	display: none;
}

/* ---------- Thẻ sản phẩm ---------- */

.hpp-fs-card {
	position: relative;
	display: flex;
	flex: 0 0 calc((100% - 48px) / 5);
	flex-direction: column;
	min-width: 0;
	padding: 10px;
	border-radius: 12px;
	background: #fff;
	color: var(--fs-ink);
	text-decoration: none;
	scroll-snap-align: start;
}

.hpp-fs-card:hover {
	color: var(--fs-ink);
}

.hpp-fs-card__img {
	display: block;
	padding: 0 !important;
}

.hpp-fs-card__img img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	transform: scale(.95);
	transition: transform .3s;
}

.hpp-fs-card:hover .hpp-fs-card__img img {
	transform: scale(1);
}

.hpp-fs-card__name {
	display: -webkit-box;
	min-height: 66px;
	margin-top: 6px;
	overflow: hidden;
	font-size: 15px;
	font-weight: 600;
	line-height: 22px;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.hpp-fs-card__foot {
	display: flex;
	flex: 1;
	flex-direction: column;
	justify-content: space-between;
	gap: 6px;
	margin-top: auto;
}

.hpp-fs-card__prices {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
}

.hpp-fs-card__price {
	margin-right: 6px;
	color: #d70018;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.hpp-fs-card__was {
	color: #a3a3a3;
	font-size: 16px;
	line-height: 1.3;
	text-decoration: line-through;
}

/* Thanh "Đã bán" (thẻ trang chủ + khung giá trang chi tiết dùng chung một kiểu):
   nền hồng nhạt, phần đã bán đỏ, icon nhô ra đầu trái. */
.hpp-fs-pdp .hpp-fs-bar,
.hpp-fs-pdp-bar,
.hpp-fs-card .hpp-fs-bar {
	width: auto;
	height: 15px;
	margin: 0 16px;
	overflow: visible;
	background: rgba(215, 0, 24, .22);
}

.hpp-fs-pdp .hpp-fs-bar i,
.hpp-fs-pdp-bar i,
.hpp-fs-card .hpp-fs-bar i {
	min-width: 0;
	background: #d70018;
	transition: width .3s ease-in-out;
}

.hpp-fs-pdp .hpp-fs-bar em,
.hpp-fs-pdp-bar em,
.hpp-fs-card .hpp-fs-bar em {
	font-size: 12px;
	font-weight: 400;
	line-height: 15px;
	text-shadow: none;
}

.hpp-fs-bar__icon {
	position: absolute;
	top: 50%;
	left: -12px;
	z-index: 1;
	width: 28px;
	height: 28px;
	object-fit: contain;
	transform: translateY(-50%);
}

.hpp-fs__note {
	margin: 12px 0;
	color: #fff;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.4;
	text-align: center;
}

@media (max-width: 1199px) {
	.hpp-fs__bar { flex-direction: column; }
	.hpp-fs__cd { margin-left: 0; }
	.hpp-fs-card { flex-basis: calc((100% - 24px) / 3); }
}

@media (max-width: 767px) {
	.hpp-fs { margin: 28px 0 16px; }
	.hpp-fs__header { width: calc(100% - 24px); height: 40px; }
	.hpp-fs__header::before { clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 100%, 0 100%); }
	.hpp-fs__title { inset: 0 16px 4px; max-width: none; }
	.hpp-fs__title-tab { height: 36px; }
	.hpp-fs__title span { font-size: 12px; }
	.hpp-fs__box { padding: 8px 8px 2px; border-radius: 20px; }
	/* Điện thoại: icon thu nhỏ khoảng 60% */
	.hpp-fs__deco--1 { top: 2px; left: -7px; width: 31px; height: 44px; }
	.hpp-fs__deco--2 { top: 13px; left: 18px; width: 18px; height: 18px; }
	.hpp-fs__deco--3 { top: 16px; left: calc(96% + 7px); width: 16px; height: 16px; }
	.hpp-fs__deco--4 { top: 16px; left: calc(96% + 23px); width: 26px; height: 22px; }
	.hpp-fs__deco--5 { top: -6px; right: 29px; width: 22px; height: 24px; }
	.hpp-fs__deco--6 { top: -20px; right: -10px; width: 48px; height: 60px; }
	.hpp-fs__deco--7 { width: 46px; height: 27px; }
	.hpp-fs__deco--8 { width: 31px; height: 22px; }
	.hpp-fs__bar { padding: 0 8px; }
	.hpp-fs__tabs { max-width: 100%; }
	.hpp-fs__tab {
		padding: 6px 12px;
		border-width: 0 0 2px;
		border-radius: 0;
		font-size: 12px;
		font-weight: 400;
	}
	.hpp-fs__tab.is-active {
		border-color: #fde047;
		background: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .4));
		color: #fff;
	}
	.hpp-fs__cd { min-height: 34px; }
	.hpp-fs__cd-label { font-size: 16px; font-weight: 600; }
	.hpp-fs-clock--box b { width: 28px; height: 28px; border-radius: 6px; font-size: 18px; }
	.hpp-fs-clock--box i { font-size: 18px; }
	.hpp-fs-clock__sep img { height: 18px; }
	.hpp-fs__nav { width: 28px; height: 56px; font-size: 24px; }
	.hpp-fs-card { flex-basis: calc((100% - 12px) / 2); }
	.hpp-fs-card__img { padding: 0 8px; }
	.hpp-fs-card__name { min-height: 60px; font-size: 14px; line-height: 20px; }
	.hpp-fs-card__price { font-size: 16px; }
	.hpp-fs-card__was { font-size: 13px; }
	.hpp-fs-card .hpp-fs-bar { margin: 0 8px; }
	.hpp-fs__note { margin: 10px 0; font-size: 12px; font-weight: 400; }
}

/* =====================================================================
 * Khung giá trang chi tiết
 * ================================================================== */

/* Nằm LIỀN trong khung giá có sẵn của theme (.pro-price / .hpp-price), không tự đóng
   khung riêng: dải đỏ đếm ngược ở trên cùng, giá flash + thanh đã bán ngay dưới. */
.hpp-fs-pdp {
	width: 100%;
	margin: 0 0 10px;
	border: 0;
	background: none;
}

.hpp-fs-pdp__top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 12px;
	padding: 8px 14px;
	border-radius: 10px;
	background: linear-gradient(90deg, var(--fs-red) 0%, #ff3d2e 55%, var(--fs-orange) 100%);
	color: #fff;
}

.hpp-fs-pdp__tag {
	font-size: 16px;
	font-style: italic;
	font-weight: 800;
	letter-spacing: .4px;
	line-height: 1.2;
}

.hpp-fs-pdp__tag span {
	color: var(--fs-yellow);
	font-style: normal;
}

.hpp-fs-pdp__cd {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.hpp-fs-pdp__cd em {
	font-size: 12px;
	font-style: normal;
	font-weight: 600;
}

.hpp-fs-pdp__cd .hpp-fs-clock b {
	background: #fff;
	color: var(--fs-red);
}

/* Ô số ở trang chi tiết nhỏ hơn trang chủ nên dấu 2 chấm bằng ảnh cũng nhỏ lại */
.hpp-fs-pdp__cd .hpp-fs-clock__sep img {
	height: 16px;
}

.hpp-fs-pdp__body {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 12px;
	padding: 10px 2px 2px;
}

.hpp-fs-pdp__price {
	color: var(--fs-red);
	font-size: 30px;
	font-weight: 800;
	line-height: 1.1;
}

.hpp-fs-pdp__was {
	color: var(--fs-muted);
	font-size: 15px;
	text-decoration: line-through;
}

.hpp-fs-pdp__off {
	padding: 2px 8px;
	border-radius: 6px;
	background: var(--fs-red);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
}

.hpp-fs-pdp > .hpp-fs-bar {
	width: auto;
	margin: 10px 0 2px;
}

.hpp-fs-pdp > .hpp-fs-preview {
	margin: 8px 0 0;
}

/* Bản PDP: giá đã do khối giá tự tính lại (pdp.js), dải flash chỉ có đếm ngược + suất. */
.hpp-fs-pdp--slim {
	margin-bottom: 0;
	padding: 16px 18px 14px;
    padding-bottom: 0;
}

.hpp-price.hpp-fs-active {
	border-color: var(--fs-red, #e3121e);
}

/* Các phần của dải flash luôn nổi lên trên mọi lớp nền / lớp phủ của khung giá theme. */
.hpp-fs-pdp__top,
.hpp-fs-pdp__body,
.hpp-fs-pdp .hpp-fs-preview,
.hpp-fs-pdp-bar {
	position: relative;
	z-index: 2;
}

/* Trang chi tiết: thanh "Đã bán" cao hơn thẻ trang chủ một chút, chừa chỗ cho icon nhô trái.
   Giao diện thường: JS chuyển thanh xuống cuối khung giá (.hpp-fs-pdp-bar). */
.hpp-fs-pdp .hpp-fs-bar,
.hpp-fs-pdp-bar {
	display: block;
	height: 18px;
	margin: 12px 0 4px 14px;
}

.hpp-fs-pdp .hpp-fs-bar em,
.hpp-fs-pdp-bar em {
	line-height: 18px;
}

/* Khung giá của theme (.pro-price) xếp con theo hàng ngang (flex). Khi có dải flash:
   cho xuống dòng, dải đếm ngược và thanh "Đã bán" mỗi cái chiếm trọn 1 hàng,
   giá của theme nằm giữa. */
.pro-price.hpp-fs-active {
	flex-wrap: wrap !important;
}

.pro-price > .hpp-fs-pdp {
	flex: 0 0 100% !important;
	width: 100% !important;
	max-width: 100% !important;
}

/* Thanh suất lùi vào 14px để icon nhô ra bên trái không tràn khỏi khung giá. */
.pro-price > .hpp-fs-pdp-bar {
	flex: 0 0 calc(100% - 14px) !important;
	width: calc(100% - 14px) !important;
	max-width: calc(100% - 14px) !important;
}

.pro-price > .hpp-fs-pdp {
	order: -1;
}

.pro-price > .hpp-fs-pdp-bar {
	order: 99;
}

/* Nhãn "Kết thúc sau" không bị bẻ thành nhiều dòng */
.hpp-fs-pdp__cd em {
	white-space: nowrap;
}

@media (max-width: 640px) {
	.hpp-fs-pdp__price { font-size: 24px; }
	.hpp-fs-pdp__tag { font-size: 14px; }
}
