/**
 * Stylesheet: In-Place Product Modal View (Swaps Category Main & Keeps Site Header/Footer)
 * Package: Flatsome Lite
 * Author: Xe nâng Khuê Đăng / Antigravity
 */

/* 0. Khi Modal View bật lên: Ẩn luôn category-header-wrapper */
body.flatsome-product-view-active .category-header-wrapper,
body.flatsome-product-view-active .category-page-header {
	display: none !important;
}

/* 1. Container chi tiết sản phẩm nằm trực tiếp trong luồng trang (giữa Header và Footer) */
.flatsome-product-view-container {
	width: 100%;
	min-height: 80vh;
	background: #ffffff;
	position: relative;
	animation: flatsomeFadeInView 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes flatsomeFadeInView {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* 2. Thanh Topbar dính trên cùng chuẩn phong cách Facebook (Sticky Topbar) */
.flatsome-view-topbar {
	position: sticky;
	top: 0;
	z-index: 9999;
	height: 54px;
	min-height: 54px;
	background: #ffffff;
	border-bottom: 1px solid #e4e6eb;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px;
	user-select: none;
}

.flatsome-topbar-left,
.flatsome-topbar-right {
	display: flex;
	align-items: center;
	gap: 10px;
}

.flatsome-topbar-center {
	flex: 1;
	text-align: center;
	padding: 0 16px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.flatsome-view-title-preview {
	font-size: 15px;
	font-weight: 700;
	color: #050505;
	letter-spacing: -0.01em;
}

/* Nút tròn Facebook (Facebook Circle Button) */
.flatsome-fb-circle-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-width: 40px;
	border-radius: 50%;
	background: #e4e6eb;
	color: #050505;
	border: none;
	outline: none;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
	text-decoration: none;
	padding: 0;
	margin: 0;
}

.flatsome-fb-circle-btn:hover {
	background: #d8dadf;
	color: #050505;
	transform: scale(1.04);
}

.flatsome-fb-circle-btn:active {
	background: #ced0d4;
	transform: scale(0.96);
}

.flatsome-fb-circle-btn svg {
	stroke: #050505;
	display: block;
}

/* 3. Nội dung sản phẩm chi tiết */
.flatsome-product-view-content {
	padding: 15px 0 60px 0;
}

/* Không hiện Breadcrumb ở Modal View */
.flatsome-product-view-container .modern-breadcrumbs-wrapper,
.flatsome-product-view-container .woocommerce-breadcrumb,
.flatsome-product-view-container .breadcrumbs,
.flatsome-product-view-container .rank-math-breadcrumb,
.flatsome-product-view-content .modern-breadcrumbs-wrapper,
.flatsome-product-view-content .woocommerce-breadcrumb,
.flatsome-product-view-content .breadcrumbs,
.flatsome-product-view-content .rank-math-breadcrumb {
	display: none !important;
}

/* Loại bỏ hoàn toàn khối Related products trong Modal View để tránh rối */
.flatsome-product-view-content .related.products,
.flatsome-product-view-content .related-products-wrapper,
.flatsome-product-view-content .related,
.flatsome-product-view-content .up-sells,
.flatsome-product-view-content .upsells.products,
.flatsome-product-view-content .product-footer .related {
	display: none !important;
}

/* 4. Skeleton Loading Shimmer */
.flatsome-view-skeleton {
	padding: 24px 0 60px 0;
}

.flatsome-skel-grid {
	display: grid;
	grid-template-columns: minmax(0, 56fr) minmax(0, 44fr);
	gap: 28px;
}

.flatsome-skel-box {
	background: #f1f5f9;
	background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
	background-size: 200% 100%;
	animation: flatsomeShimmer 1.5s infinite;
	border-radius: 8px;
}

@keyframes flatsomeShimmer {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}

.flatsome-skel-main-img {
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 12px;
	margin-bottom: 12px;
}

.flatsome-skel-thumbs {
	display: flex;
	gap: 10px;
}

.flatsome-skel-thumb {
	width: 70px;
	height: 70px;
	border-radius: 8px;
}

.flatsome-skel-badge {
	width: 120px;
	height: 24px;
	margin-bottom: 14px;
}

.flatsome-skel-title {
	width: 90%;
	height: 32px;
	margin-bottom: 10px;
}

.flatsome-skel-title-sub {
	width: 65%;
	height: 20px;
	margin-bottom: 18px;
}

.flatsome-skel-price {
	width: 50%;
	height: 38px;
	margin-bottom: 24px;
}

.flatsome-skel-card {
	width: 100%;
	height: 180px;
	margin-bottom: 20px;
	border-radius: 10px;
}

.flatsome-skel-actions {
	width: 100%;
	height: 52px;
	border-radius: 8px;
}

/* 5. Responsive Mobile */
@media (max-width: 849px) {
	.flatsome-view-topbar {
		height: 48px;
		min-height: 48px;
		padding: 0 12px;
	}

	.flatsome-fb-circle-btn {
		width: 36px;
		height: 36px;
		min-width: 36px;
	}

	.flatsome-fb-circle-btn svg {
		width: 17px;
		height: 17px;
	}

	.flatsome-view-title-preview {
		font-size: 13.5px;
	}

	.flatsome-skel-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.flatsome-skel-card {
		height: 140px;
	}
}
