/* =========================================================================
   Sản phẩm (thay WooCommerce) – MetaForce
   1. Lưới sản phẩm (giữ đúng bố cục WooCommerce cũ)
   2. Trang chi tiết sản phẩm
   3. Form yêu cầu báo giá (popup)
   ========================================================================= */

/* ---------- 1. Lưới sản phẩm: chép từ CSS WooCommerce (layout + smallscreen) ---------- */
.woocommerce ul.products {
	margin: 0 0 1em;
	padding: 0;
	list-style: none outside;
	clear: both;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
	content: " ";
	display: table;
}

.woocommerce ul.products::after {
	clear: both;
}

.woocommerce ul.products li {
	list-style: none outside;
}

.woocommerce ul.products li.product a {
	text-decoration: none;
}

.woocommerce ul.products li.product a img {
	width: 100%;
	height: auto;
	display: block;
	margin: 0 0 1em;
	box-shadow: none;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	padding: .5em 0;
	margin: 0;
	font-size: 1em;
}

.woocommerce ul.products li.product .price {
	font-weight: 400;
	margin-bottom: .5em;
	font-size: .857em;
}

.woocommerce ul.products li.product .price del {
	color: inherit;
	opacity: .7;
	display: inline-block;
}

.woocommerce ul.products li.product .price ins {
	background: 0 0;
	font-weight: 700;
	display: inline-block;
}

.woocommerce img {
	height: auto;
	max-width: 100%;
}

/* Khung ảnh giữ khoảng cách dưới ảnh như bản cũ (thẻ cao 352px) */
.woocommerce ul.products li.product .thumnail-img {
	display: flow-root;
}

/* Lưới 4 cột (trang Library / danh mục / tìm kiếm) */
.mf-library ul.products li.product {
	float: left;
	margin: 0 3.8% 2.992em 0;
	padding: 0;
	position: relative;
	width: 22.05%;
}

.mf-library ul.products li.product:nth-child(4n+1) {
	clear: both;
}

.mf-library ul.products li.product:nth-child(4n) {
	margin-right: 0;
}

@media only screen and (max-width: 768px) {
	.mf-library ul.products li.product {
		width: 48%;
		float: left;
		clear: both;
		margin: 0 0 2.992em;
	}

	.mf-library ul.products li.product:nth-child(2n) {
		float: right;
		clear: none;
	}
}

.mf-library .mf-search-title,
.mf-library .mf-no-products {
	margin: 0 0 24px;
	font-size: 18px;
	color: #3b3b3b;
}

.mf-library .mf-no-products {
	padding: 24px 0 48px;
}

/* Khung chờ khi bấm "Load more" */
.mf-skeleton {
	float: left;
	width: 22.05%;
	margin: 0 3.8% 2.992em 0;
	height: 352px;
	border-radius: 8px;
	background: linear-gradient(90deg, #e4e4e4 25%, #efefef 50%, #e4e4e4 75%);
	background-size: 200% 100%;
	animation: mf-shimmer 1.2s infinite;
	list-style: none;
}

.mf-skeleton:nth-child(4n) {
	margin-right: 0;
}

@media only screen and (max-width: 768px) {
	.mf-skeleton {
		width: 48%;
		margin-right: 4%;
	}

	.mf-skeleton:nth-child(2n) {
		margin-right: 0;
	}
}

@keyframes mf-shimmer {
	to {
		background-position: -200% 0;
	}
}

/* ---------- 2. Trang chi tiết sản phẩm ---------- */
.mf-single {
	--mf-red: var(--button-color-red, #ba1f19);
	--mf-red-text: var(--text-color-red, #e61810);
	--mf-dark: #1c1c1b;
	--mf-dark-2: #2a2a29;
	--mf-line: #363636;
	color: #fff;
	overflow-x: clip;
}

/* Rộng bằng thanh menu ở trang sản phẩm (header: max-w-[95%]) */
.mf-container {
	width: 95%;
	max-width: none;
	margin: 0 auto;
	padding: 0;
	box-sizing: border-box;
}

.mf-single *,
.mf-single *::before,
.mf-single *::after {
	box-sizing: border-box;
}

.mf-single-top {
	background: #232323;
	padding: 20px 0 48px;
}

/* Breadcrumb */
.mf-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	font-size: inherit; /* cùng cỡ chữ với phần còn lại của trang (18px) */
	color: #9c9c9c;
	margin-bottom: 20px;
}

.mf-breadcrumb a {
	color: #cfcfcf;
	text-decoration: none;
}

.mf-breadcrumb a:hover {
	color: var(--mf-red-text);
}

.mf-breadcrumb-current {
	color: #fff;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Bố cục 2 cột */
.mf-single-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 24px;
}

/* Ảnh 2 phần, thông tin 1 phần */
@media (min-width: 992px) {
	.mf-single-grid {
		grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
		gap: 32px;
		align-items: start;
	}

	.mf-summary {
		position: sticky;
		top: 24px;
	}
}

/* Thư viện ảnh */
.mf-gallery {
	min-width: 0;
}

/* content-single-product.css có ".swiper { padding: 24px 0 32px !important }" cho mọi slider -> bỏ ở đây */
.mf-single .mf-gallery-main.swiper,
.mf-single .mf-gallery-thumbs.swiper {
	padding: 0 !important;
}

.mf-single .mf-related-swiper.swiper {
	padding: 6px 4px 12px !important;
}

.mf-gallery-main .swiper-slide {
	width: 100% !important;
}

.mf-gallery-main {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
	background: #e9e9e9;
	aspect-ratio: 4 / 3;
}

.mf-gallery-main .swiper-slide {
	display: flex;
	align-items: center;
	justify-content: center;
	height: auto;
}

.mf-gallery-main .swiper-slide a {
	display: flex;
	width: 100%;
	height: 100%;
	align-items: center;
	justify-content: center;
}

.mf-gallery-main img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.mf-gallery-empty {
	aspect-ratio: 4 / 3;
	border-radius: 12px;
	background: #e9e9e9;
}

.mf-gallery-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 0;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: 30px;
	line-height: 40px;
	cursor: pointer;
	transition: background .2s;
}

.mf-gallery-nav:hover {
	background: var(--mf-red);
}

.mf-gallery-prev {
	left: 12px;
}

.mf-gallery-next {
	right: 12px;
}

.mf-gallery-nav.swiper-button-disabled {
	opacity: .35;
	cursor: default;
}

.mf-gallery-count {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 5;
	background: rgba(0, 0, 0, .6);
	color: #fff;
	font-size: 13px;
	padding: 4px 10px;
	border-radius: 999px;
}

.mf-gallery-thumbs {
	margin-top: 12px;
}

.mf-gallery-thumbs .swiper-slide {
	width: 88px !important;
	height: 88px;
	border-radius: 8px;
	overflow: hidden;
	border: 2px solid transparent;
	opacity: .6;
	cursor: pointer;
	background: #e9e9e9;
	transition: opacity .2s, border-color .2s;
}

.mf-gallery-thumbs .swiper-slide:hover {
	opacity: .9;
}

.mf-gallery-thumbs .swiper-slide-thumb-active {
	border-color: var(--mf-red-text);
	opacity: 1;
}

.mf-gallery-thumbs img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

@media (max-width: 600px) {
	.mf-gallery-thumbs .swiper-slide {
		width: 64px !important;
		height: 64px;
	}

	.mf-gallery-nav {
		width: 36px;
		height: 36px;
		font-size: 24px;
		line-height: 32px;
	}
}

/* Thẻ thông tin */
.mf-summary {
	min-width: 0;
}

.mf-summary-card {
	background: var(--mf-dark);
	border: 1px solid var(--mf-line);
	border-radius: 12px;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.mf-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.mf-chip {
	padding: 4px 12px;
	border-radius: 999px;
	border: 1px solid #22d3ee;
	color: #22d3ee;
	background: rgba(34, 211, 238, .1);
	font-size: 13px;
	text-decoration: none;
	transition: background .2s;
}

.mf-chip:hover {
	background: rgba(34, 211, 238, .22);
}

.mf-title {
	margin: 0;
	font-size: 28px;
	line-height: 1.25;
	font-weight: 700;
	color: #fff;
	overflow-wrap: anywhere;
}

.mf-price-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	padding: 14px 0;
	border-top: 1px solid var(--mf-line);
	border-bottom: 1px solid var(--mf-line);
}

.mf-price-label {
	color: #bdbdbd;
}

.mf-price .price {
	display: flex;
	flex-direction: row-reverse;
	align-items: baseline;
	gap: 10px;
}

.mf-price ins {
	text-decoration: none;
	font-size: 28px;
	font-weight: 700;
	color: var(--mf-red-text);
}

.mf-price .price>.woocommerce-Price-amount {
	font-size: 28px;
	font-weight: 700;
	color: var(--mf-red-text);
}

.mf-price del {
	color: #8a8a8a !important;
	font-size: 16px;
}

.mf-price-contact {
	font-size: 20px;
	font-weight: 700;
	color: var(--mf-red-text);
}

.mf-badge-sale {
	background: var(--mf-red);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 6px;
}

.mf-excerpt {
	color: #cecdc3;
	line-height: 1.65;
	max-height: 260px;
	overflow-y: auto;
	padding-right: 4px;
}

.mf-excerpt p {
	margin: 0 0 .75em;
}

.mf-excerpt p:last-child {
	margin-bottom: 0;
}

.mf-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.mf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 10px 20px;
	border-radius: 10px;
	font-weight: 700;
	font-size: 16px;
	text-decoration: none;
	cursor: pointer;
	transition: background .2s, color .2s, border-color .2s;
	width: 100%;
}

.mf-btn-primary {
	background: var(--mf-red);
	color: #fff;
	border: 1px solid var(--mf-red);
}

.mf-btn-primary:hover {
	background: #9c1813;
}

.mf-btn-outline {
	background: transparent;
	color: #fff;
	border: 1px solid #5a5a5a;
}

.mf-btn-outline:hover {
	border-color: #fff;
}

.mf-meta {
	font-size: 14px;
	color: #9c9c9c;
}

.mf-meta a {
	color: #cfcfcf;
}

/* Mô tả */
.mf-single-desc {
	background: #fff;
	color: #1b232e;
	padding: 48px 0;
}

.mf-section-title {
	font-size: 24px;
	font-weight: 700;
	margin: 0 0 20px;
	padding-bottom: 12px;
	border-bottom: 2px solid #e5e5e5;
}

.mf-center {
	text-align: center;
	border-bottom: 0;
}

.mf-desc {
	position: relative;
	max-width: 1100px;
	line-height: 1.75;
	overflow: hidden;
	transition: max-height .35s ease;
}

.mf-desc.is-collapsed {
	max-height: 420px;
}

.mf-desc-fade {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 90px;
	background: linear-gradient(to top, #fff, rgba(255, 255, 255, 0));
	pointer-events: none;
}

.mf-desc.is-collapsed .mf-desc-fade {
	display: block;
}

.mf-desc-inner p {
	margin: 0 0 1em;
}

.mf-desc-inner ul,
.mf-desc-inner ol {
	padding-left: 1.4em;
	margin: 0 0 1em;
}

.mf-desc-inner ul {
	list-style: disc;
}

.mf-desc-inner ol {
	list-style: decimal;
}

.mf-desc-inner h2,
.mf-desc-inner h3,
.mf-desc-inner h4 {
	font-weight: 700;
	margin: 1.2em 0 .5em;
	line-height: 1.3;
}

.mf-desc-inner h2 {
	font-size: 22px;
}

.mf-desc-inner h3 {
	font-size: 19px;
}

.mf-desc-inner img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

.mf-desc-inner a {
	color: var(--mf-red-text);
	text-decoration: underline;
}

.mf-desc-toggle {
	margin-top: 12px;
	background: none;
	border: 0;
	padding: 0;
	color: #2563eb;
	font-weight: 600;
	cursor: pointer;
	font-size: 16px;
}

/* Sản phẩm liên quan */
.mf-related {
	background: #f3f3f3;
	color: #000;
	padding: 48px 0;
}

.mf-related-slider {
	position: relative;
}

.mf-related-swiper {
	padding: 6px 4px 12px;
}

.mf-related ul.products {
	margin: 0;
}

.mf-related ul.products li.product {
	height: auto;
}

.mf-related-nav {
	position: absolute;
	top: 40%;
	z-index: 5;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 0;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
	font-size: 26px;
	line-height: 36px;
	color: #222;
	cursor: pointer;
}

.mf-related-prev {
	left: -8px;
}

.mf-related-next {
	right: -8px;
}

.mf-related-nav.swiper-button-disabled,
.mf-related-nav.swiper-button-lock {
	display: none;
}


/* ---------- 3. Popup yêu cầu báo giá ---------- */
.mf-modal[hidden] {
	display: none;
}

.mf-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.mf-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .65);
}

.mf-modal-dialog {
	position: relative;
	width: 100%;
	max-width: 640px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	background: #f8f9fa;
	color: #1b232e;
	border-radius: 16px;
	padding: 28px 24px 24px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}

.mf-modal-close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #555;
}

.mf-modal-close:hover {
	background: #e7e7e7;
}

.mf-modal-title {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 16px;
	padding-right: 32px;
}

.mf-modal-product {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	margin-bottom: 12px;
}

.mf-modal-product img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 6px;
	flex: none;
}

.mf-modal-price .price {
	display: flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
	gap: 8px;
	font-size: 14px;
}

.mf-modal-price ins {
	text-decoration: none;
	color: var(--mf-red-text);
	font-weight: 700;
}

.mf-modal-intro {
	margin: 0 0 16px;
	color: #555;
	font-size: 15px;
}

.mf-modal-form .wpcf7-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mf-modal-form .wpcf7-form>div {
	display: flex;
	gap: 12px;
}

.mf-modal-form .wpcf7-form>div>div {
	flex: 1;
	min-width: 0;
}

.mf-modal-form .wpcf7-form>div.flex.justify-center {
	margin-left: 0;
	justify-content: center;
}

@media (max-width: 600px) {
	.mf-modal-form .wpcf7-form>div {
		flex-direction: column;
	}
}

body.mf-modal-open {
	overflow: hidden;
}
