/* =========================================
NỀN TRANG VÀ BIẾN TRANG TRÍ
========================================= */
.custom-product-page {
	--room-border: color-mix(
		in srgb, var(--color-sub) 22%, transparent
	);
	--room-divider: color-mix(
		in srgb, var(--color-sub) 18%, transparent
	);
	--room-shadow: 0 6px 24px
		color-mix(in srgb, var(--color-main) 6%, transparent);

	background: color-mix(
		in srgb, var(--color-sub) 5%, var(--color-white)
	);
	color: var(--color-text-main);
}

/* =========================================
THƯ VIỆN ẢNH
========================================= */
.custom-product-page .ctsp_img,
.ctsp_img .col {
	padding-bottom: 0 !important;
}

.ctsp_img .sp-breadcrumb {
	color: var(--news-muted) !important;
	font-size: 13px !important;
	line-height: 1.8;
}

.ctsp_img .sp-breadcrumb a {
	color: var(--color-main) !important;
}

.ctsp_img .sp-breadcrumb a:hover {
	color: var(--color-sub-hover) !important;
}

.ctsp_img .sp-breadcrumb strong {
	color: var(--color-text-main);
}

.ctsp_img .sp-gallery-grid {
	gap: 12px;
	margin-bottom: 24px;
}

.ctsp_img .sp-gallery-item {
	width: calc((100% - 24px) / 3);
	overflow: hidden;
	border-radius: 12px;
	background: var(--color-white);
}

.ctsp_img .sp-gallery-item img {
	height: 240px;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.ctsp_img .sp-gallery-item:hover img {
	transform: scale(1.04);
}

.ctsp_img .sp-view-all-overlay {
	background: var(--color-white);
	color: var(--color-main);
	border: 1px solid var(--color-sub);
	border-radius: 8px;
}

/* LIGHTBOX */
.sp-lightbox {
	background: color-mix(
		in srgb, var(--color-black) 96%, transparent
	);
}

.sp-lightbox .sp-thumb-item.active {
	border-color: var(--color-sub);
}

.sp-lightbox .sp-lightbox-close,
.sp-lightbox .sp-lightbox-prev,
.sp-lightbox .sp-lightbox-next,
.sp-lightbox .sp-image-counter {
	color: var(--color-white);
}

.sp-lightbox .sp-lightbox-close:hover,
.sp-lightbox .sp-lightbox-prev:hover,
.sp-lightbox .sp-lightbox-next:hover {
	color: var(--color-sub);
}

/* =========================================
KHUNG TỔNG VÀ TIÊU ĐỀ
========================================= */
.ctsp_sanpham > .section-content > .row {
	padding: 26px 14px 8px;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 0;
	box-shadow: none;
}

.ctsp_sanpham .product-title-container .product_title {
	margin: 0 0 20px;
	color: var(--color-main);
	font-size: clamp(26px, 3vw, 38px);
	font-weight: 700;
	letter-spacing: -0.5px;
	line-height: 1.25;
}

.ctsp_sanpham .product-title-container .is-divider,
.ctsp_sanpham .tabs.wc-tabs,
.ctsp_sanpham .woocommerce-Tabs-panel--reviews {
	display: none;
}

/* =========================================
THANH THÔNG TIN PHÒNG
========================================= */
.ctsp_sanpham .phong-tags-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 22px;
	padding: 14px 16px;
	background: var(--color-white);
	border: 1px solid var(--room-border);
	border-radius: 14px;
	outline: none;
	box-shadow: none;
	box-sizing: border-box;
	justify-content: space-around;
}

.ctsp_sanpham .phong-tag-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 13px;
	background: color-mix(
		in srgb, var(--color-sub) 12%, var(--color-white)
	);
	border: 1px solid transparent;
	border-radius: 8px;
	color: var(--color-main);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
}

.ctsp_sanpham .phong-tag-item svg {
	flex-shrink: 0;
}

/* =========================================
KHUNG NỘI DUNG
========================================= */
.ctsp_sanpham .col.content > .col-inner {
	padding: 28px;
	background: var(--color-white);
	border: 1px solid var(--room-border);
	border-radius: 14px;
	outline: none;
	box-shadow: none;
	box-sizing: border-box;
}

.ctsp_sanpham .product-short-description {
	color: var(--color-text-main);
	font-size: 16px;
	line-height: 1.8;
}

.ctsp_sanpham .product-short-description > :last-child {
	margin-bottom: 0;
}

/* TIỆN ÍCH */
.ctsp_sanpham .wrap-tien-ich-homestay {
	margin: 24px 0;
	padding: 0 0 24px;
	border-top: 0;
	border-bottom: 1px solid var(--room-divider);
}

.ctsp_sanpham .wrap-tien-ich-homestay .list-tien-ich {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	column-gap: 24px;
	row-gap: 20px;
	align-items: center;
}

.ctsp_sanpham .wrap-tien-ich-homestay .item-tien-ich {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	padding: 0;
	background: transparent;
	border: 0;
	color: var(--color-text-main);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.5;
}

.ctsp_sanpham .wrap-tien-ich-homestay .icon-tien-ich {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: var(--color-main);
}

.ctsp_sanpham .wrap-tien-ich-homestay .icon-tien-ich img,
.ctsp_sanpham .wrap-tien-ich-homestay .icon-tien-ich svg {
	width: 28px;
	height: 28px;
	object-fit: contain;
}

/* MÔ TẢ CHI TIẾT */
.ctsp_sanpham .woocommerce-tabs {
	padding: 0;
}

.ctsp_sanpham .tab-panels {
	padding-top: 0;
	border: 0;
	color: var(--color-text-main);
	line-height: 1.8;
}

.ctsp_sanpham .woocommerce-Tabs-panel--description > :last-child {
	margin-bottom: 0;
}

/* =========================================
THẺ ĐẶT PHÒNG
========================================= */
.ctsp_sanpham .bk-card-container {
	width: 100%;
	max-width: 450px;
	margin: 0 auto;
	padding: 22px;
	background: var(--color-white);
	border: 1px solid var(--room-border);
	border-radius: 14px;
	outline: none;
	box-shadow: var(--room-shadow);
	box-sizing: border-box;
}

.bk-card-container .bk-img-wrap {
	position: relative;
	margin-bottom: 20px;
	overflow: hidden;
	border-radius: 10px;
}

.bk-card-container .bk-image {
	display: block;
	width: 100%;
	height: 210px;
	margin: 0;
	object-fit: cover;
}

.bk-card-container .bk-badge {
	position: absolute;
	left: 12px;
	bottom: 12px;
	max-width: calc(100% - 24px);
	padding: 6px 11px;
	background: var(--color-main);
	border-radius: 5px;
	color: var(--color-white);
	font-size: 12px;
	line-height: 1.5;
	box-sizing: border-box;
}

.bk-card-container .bk-header-new {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.bk-card-container .bk-title-new {
	margin: 0;
	color: var(--color-main);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.35;
}

.bk-card-container .bk-price-label {
	color: var(--news-muted);
	font-size: 13px;
}

.bk-card-container .bk-price-val {
	color: var(--color-main);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.4;
}

.bk-card-container .bk-price-val small {
	color: var(--news-muted);
	font-size: 14px;
	font-weight: 400;
}

.bk-card-container .bk-divider {
	margin: 20px 0;
	border: 0;
	border-top: 1px solid
		color-mix(in srgb, var(--color-sub) 18%, transparent);
}

.bk-card-container .bk-perks {
	display: grid;
	gap: 12px;
	margin-bottom: 22px;
}

.bk-card-container .bk-perk-item {
	display: flex;
	align-items: center;
	gap: 9px;
	color: var(--color-text-main);
	font-size: 14px;
	line-height: 1.5;
}

.bk-card-container .bk-perk-item svg,
.bk-card-container .bk-perk-item i {
	flex-shrink: 0;
	color: var(--color-sub-hover);
}

.bk-card-container .bk-perk-item svg {
	stroke: currentColor;
}

.bk-card-container .bk-subnote {
	margin-top: 12px;
	color: var(--news-muted);
	font-size: 12px;
	line-height: 1.6;
	text-align: center;
}

/* NÚT ĐẶT PHÒNG */
.bk-card-container .bk-btn,
.bk-sticky-bottom .bk-btn,
.bk-modal-content .wpcf7-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 12px 20px;
	background: var(--color-main);
	border: 1px solid var(--color-main);
	border-radius: 8px;
	color: var(--color-white);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	text-transform: none;
	cursor: pointer;
	box-sizing: border-box;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.bk-card-container .bk-btn:hover,
.bk-sticky-bottom .bk-btn:hover,
.bk-modal-content .wpcf7-submit:hover {
	background: var(--color-main-light);
	border-color: var(--color-sub);
	color: var(--color-white);
}

/* =========================================
POPUP ĐẶT PHÒNG
========================================= */
.bk-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 2147483647;
	padding: 20px;
	background: color-mix(
		in srgb, var(--color-black) 65%, transparent
	);
	backdrop-filter: blur(4px);
	overflow-y: auto;
	box-sizing: border-box;
}

.bk-modal-overlay.show {
	display: flex;
	align-items: center;
	justify-content: center;
}

.bk-modal-overlay .bk-modal-content {
	position: relative;
	width: 100%;
	max-width: 540px;
	max-height: 85dvh;
	margin: auto;
	padding: 34px 28px 28px;
	overflow-y: auto;
	background: var(--color-white);
	border: 1px solid var(--color-sub);
	border-radius: 16px;
	box-sizing: border-box;
}

.bk-modal-content .bk-modal-close {
	position: absolute;
	top: 12px;
	right: 16px;
	color: var(--color-main);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.bk-modal-content .bk-modal-close:hover {
	color: var(--color-sub-hover);
}

.bk-modal-content > h3,
.bk-modal-content .booking-title {
	color: var(--color-main);
	font-size: 24px;
	font-weight: 700;
}

.bk-modal-content .form-row {
	display: flex;
	gap: 14px;
}

.bk-modal-content .form-col {
	flex: 1;
	min-width: 0;
}

.bk-modal-content .form-field {
	margin-bottom: 16px;
}

.bk-modal-content .booking-form-container label {
	display: block;
	color: var(--color-text-main);
	font-size: 14px;
	font-weight: 500;
}

.bk-modal-content .wpcf7-form-control-wrap {
	display: block;
	margin-top: 7px;
}

.bk-modal-content .wpcf7-text,
.bk-modal-content .wpcf7-date,
.bk-modal-content .wpcf7-number,
.bk-modal-content .wpcf7-select,
.bk-modal-content .wpcf7-textarea {
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 11px 13px;
	background: color-mix(
		in srgb, var(--color-sub) 6%, var(--color-white)
	);
	border: 1px solid
		color-mix(in srgb, var(--color-sub) 40%, transparent);
	border-radius: 8px;
	color: var(--color-text-main);
	font-size: 16px;
	box-shadow: none;
	box-sizing: border-box;
}

.bk-modal-content .wpcf7-textarea {
	height: 110px;
	resize: vertical;
}

.bk-modal-content .wpcf7-form-control:focus {
	outline: 2px solid var(--color-sub);
	outline-offset: 2px;
}

.bk-modal-content .wpcf7-form-control::placeholder {
	color: var(--news-muted);
}

.bk-modal-content .form-submit {
	margin-top: 20px;
	text-align: center;
}

/* =========================================
PHÒNG LIÊN QUAN
========================================= */
.ctsp_lq .product-section-title {
	margin: 12px 0 28px;
	color: var(--color-main);
	font-size: clamp(25px, 3vw, 34px);
	font-weight: 700;
	text-align: center;
	text-transform: none;
}

.ctsp_lq .product-small.box {
	height: 100%;
	overflow: hidden;
	background: var(--color-white);
	border: 1px solid
		color-mix(in srgb, var(--color-sub) 22%, transparent);
	border-radius: 14px;
	box-shadow: 0 4px 16px
		color-mix(in srgb, var(--color-main) 5%, transparent);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ctsp_lq .product-small.box:hover {
	transform: translateY(-4px);
	box-shadow: 0 10px 24px
		color-mix(in srgb, var(--color-main) 10%, transparent);
}

.ctsp_lq .box-image {
	width: 100%;
	margin: 0;
	overflow: hidden;
}

.ctsp_lq .box-image img {
	width: 100%;
	height: 220px;
	object-fit: cover;
}

.ctsp_lq .box-text-products {
	padding: 20px;
	text-align: left;
}

.ctsp_lq .category,
.ctsp_lq .price-wrapper {
	display: none;
}

.ctsp_lq .product-title {
	margin-bottom: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.5;
}

.ctsp_lq .product-title a {
	color: var(--color-main);
}

.ctsp_lq .product-title a:hover {
	color: var(--color-sub-hover);
}

.ctsp_lq .quick-view {
	background: var(--color-main);
	color: var(--color-white);
}

/* =========================================
THANH ĐẶT PHÒNG TRÊN ĐIỆN THOẠI
========================================= */
.bk-sticky-bottom {
	display: none;
	position: fixed;
	inset: auto 0 0;
	z-index: 10000;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	padding-bottom: calc(12px + env(safe-area-inset-bottom));
	background: var(--color-white);
	border-top: 1px solid var(--color-sub);
	box-shadow: 0 -4px 20px
		color-mix(in srgb, var(--color-main) 10%, transparent);
	box-sizing: border-box;
}

.bk-sticky-bottom .bk-price-main {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px;
}

.bk-sticky-bottom .bk-price-number {
	color: var(--color-main);
	font-size: 21px;
	font-weight: 700;
}

.bk-sticky-bottom .bk-price-unit {
	color: var(--news-muted);
	font-size: 12px;
}

.bk-btn:focus-visible,
.ctsp_lq .product-title a:focus-visible {
	outline: 2px solid var(--color-sub-hover);
	outline-offset: 3px;
}

/* =========================================
RESPONSIVE
========================================= */
/* =========================================
RESPONSIVE TABLET & MOBILE (ĐÃ FIX CÂN ĐỐI 100%)
========================================= */
@media (max-width: 991px) {
	.ctsp_sanpham .wrap-tien-ich-homestay .list-tien-ich {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 768px) {
	/* --- PHẦN GALLERY ẢNH --- */
	.ctsp_img .sp-gallery-item {
		width: calc((100% - 12px) / 2);
	}

	.ctsp_img .sp-gallery-item img {
		height: 170px;
	}

	/* --- KHUNG TỔNG & TIÊU ĐỀ (.ctsp_sanpham) --- */
	.ctsp_sanpham > .section-content > .row {
		padding: 16px 4px 0;
	}

	.ctsp_sanpham .product-title-container .product_title {
		margin: 0 0 14px;
		font-size: 24px;
	}

	/* --- THANH TAG THÔNG TIN PHÒNG (CHUẨN 2 CỘT ĐỀU TĂM TẮP) --- */
	.ctsp_sanpham .phong-tags-list {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		align-items: stretch !important; /* Ép 2 ô trái phải luôn cao bằng nhau */
		gap: 8px !important;
		padding: 10px !important;
		margin-bottom: 16px !important;
		border-radius: 12px;
	}

	.ctsp_sanpham .phong-tag-item {
		width: 100% !important;
		height: 100% !important;
		margin: 0 !important;
		gap: 7px !important;
		padding: 9px 10px !important;
		font-size: 12.5px !important;
		line-height: 1.3 !important;
		justify-content: flex-start !important; /* Đồng bộ căn trái thẳng hàng từ trên xuống */
		box-sizing: border-box !important;
	}

	.ctsp_sanpham .phong-tag-item svg {
		width: 16px !important;
		height: 16px !important;
		flex-shrink: 0 !important;
		color: var(--color-main);
	}

	.ctsp_sanpham .phong-tag-item span {
		white-space: nowrap; /* Giữ chữ gọn trên 1 dòng, không bị rớt chữ "thị" lẻ loi */
		overflow: hidden;
		text-overflow: ellipsis;
	}

	/* Chỉ cho phép ô cuối nếu dài quá hoặc lẻ ô thì trải ngang, nhưng vẫn căn trái cho thẳng trục */
	.ctsp_sanpham .phong-tags-list .phong-tag-item:nth-child(6) {
		white-space: normal;
	}

	/* --- KHUNG NỘI DUNG & TAB CHI TIẾT (.ctsp_sanpham) --- */
	.ctsp_sanpham .col.content > .col-inner {
		padding: 18px 16px;
		border-radius: 12px;
	}

	.ctsp_sanpham .ctd-room-wrap .ctd-nav {
		gap: 6px !important;
		margin-bottom: 18px !important;
	}

	.ctsp_sanpham .ctd-room-wrap .ctd-tab {
		min-height: 42px !important;
		padding: 10px 14px !important;
		font-size: 12.5px !important;
	}

	.ctsp_sanpham .ctd-room-wrap .ctd-panel-title {
		font-size: 18px;
		margin-bottom: 14px;
		padding-bottom: 10px;
	}

	/* --- KHỐI TIỆN ÍCH TRANG BỊ SẴN (.ctsp_sanpham) --- */
	.ctsp_sanpham .ctd-room-wrap .ctd-service-box {
		padding: 14px;
		margin-top: 16px;
	}

	.ctsp_sanpham .wrap-tien-ich-homestay {
		margin: 12px 0 0;
		padding-bottom: 0;
		border-bottom: 0;
	}

	/* --- ĐẶT PHÒNG & STICKY BAR MOBILE --- */
	.ctsp_sanpham .bk-card-container {
		display: none;
	}

	.ctsp_sanpham .bk-sticky-bottom,
	.bk-sticky-bottom {
		display: flex;
	}

	.ctsp_sanpham .bk-sticky-bottom .bk-btn,
	.bk-sticky-bottom .bk-btn {
		flex: 0 0 auto;
		width: auto;
		min-width: 120px;
	}

	.custom-product-page {
		padding-bottom: calc(95px + env(safe-area-inset-bottom));
	}

	/* --- POPUP MODAL FORM --- */
	.bk-modal-overlay .bk-modal-content {
		padding: 38px 20px 24px;
	}

	.bk-modal-content .form-row {
		flex-direction: column;
		gap: 0;
	}

	.bk-modal-content .form-col {
		width: 100%;
	}

	/* --- SẢN PHẨM LIÊN QUAN --- */
	.ctsp_lq .box-image img {
		height: 180px;
	}

	.ctsp_lq .box-text-products {
		padding: 15px;
	}

	.ctsp_lq .product-title {
		font-size: 16px;
	}
	.ctsp_sanpham{
		z-index: 99998 !important;
	}
}

/* Nếu màn hình điện thoại quá nhỏ (dưới 380px) mà câu cuối dài quá thì cho phép xuống dòng nhưng 2 ô vẫn cao bằng nhau */
@media (max-width: 576px) {
	.ctsp_sanpham .phong-tag-item span {
		white-space: normal;
	}

	.ctsp_sanpham .wrap-tien-ich-homestay .list-tien-ich {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		column-gap: 12px !important;
		row-gap: 14px !important;
	}

	.ctsp_sanpham .wrap-tien-ich-homestay .item-tien-ich {
		font-size: 13.5px;
		gap: 8px;
	}

	.ctsp_sanpham .wrap-tien-ich-homestay .icon-tien-ich img,
	.ctsp_sanpham .wrap-tien-ich-homestay .icon-tien-ich svg {
		width: 22px;
		height: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ctsp_img .sp-gallery-item img,
	.ctsp_lq .product-small.box,
	.ctsp_sanpham .bk-card-container .bk-btn,
	.bk-card-container .bk-btn,
	.ctsp_sanpham .bk-sticky-bottom .bk-btn,
	.bk-sticky-bottom .bk-btn,
	.bk-modal-content .wpcf7-submit {
		transition: none;
	}

	.ctsp_img .sp-gallery-item:hover img,
	.ctsp_lq .product-small.box:hover {
		transform: none;
	}
}