/**
 * Một giao diện PC, responsive cho mobile (không dùng thư mục templates/mb).
 * Tải sau style.css
 * Quy ước: mobile-first utilities dưới max-width; dùng env(safe-area-*) cùng viewport-fit=cover.
 */

/* ---- Tablet trở xuống: menu ngang -> ẩn, dùng panel trái + nút list ---- */
@media screen and (max-width: 991.98px) {
	/* Header 2 dòng (logo + ô tìm) — chừa đủ để nội dung không bị che bởi .header fixed */
	.is-fixed {
		padding-top: calc(150px + env(safe-area-inset-top, 0px));
	}

	/* Header fixed: thụt theo notch / trạng thái iOS; tránh nội dung chạm mép màn hình cong */
	.is-fixed .header {
		padding-top: env(safe-area-inset-top, 0px);
		padding-left: env(safe-area-inset-left, 0px);
		padding-right: env(safe-area-inset-right, 0px);
		-webkit-box-sizing: border-box;
		box-sizing: border-box;
	}

	.container,
	.container-sm,
	.container-md {
		padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
		padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
	}

	/* Luôn hiện nút mở menu (trước đây chỉ rõ khi .is-scrolling) */
	.header .header-user .header-bar {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		-webkit-transform: scale(1);
		-ms-transform: scale(1);
		transform: scale(1);
		margin-right: 0;
	}

	/* Ẩnh menu desktop */
	.header-bottom {
		display: none !important;
	}

	/* Hàng 1: logo + bản đồ + tài khoản; hàng 2: ô tìm kiếm full width */
	.header-top .container > .d-flex {
		-webkit-flex-wrap: wrap;
		-ms-flex-wrap: wrap;
		flex-wrap: wrap;
		-webkit-align-items: center;
		-ms-flex-align: center;
		align-items: center;
	}

	.header-logo {
		-webkit-box-ordinal-group: 1;
		-ms-flex-order: 1;
		order: 1;
	}

	.header-map {
		-webkit-box-ordinal-group: 2;
		-ms-flex-order: 2;
		order: 2;
		margin-left: auto !important;
	}

	.header-user {
		-webkit-box-ordinal-group: 3;
		-ms-flex-order: 3;
		order: 3;
	}

	.header .header-search {
		-webkit-box-ordinal-group: 4;
		-ms-flex-order: 4;
		order: 4;
		-webkit-flex: 0 0 100%;
		-ms-flex: 0 0 100%;
		flex: 0 0 100%;
		max-width: 100% !important;
		width: 100%;
		margin-left: 0 !important;
		margin-top: 0.5rem;
	}

	/* Panel menu trái: không ép min-width 450px trên màn nhỏ */
	.header-floating {
		width: min(100%, 100vw) !important;
		max-width: 100% !important;
		min-width: 0 !important;
	}

	/* Dropdown tìm nhanh: full khung, tránh tràn ngang */
	.header .search-quick {
		width: 100% !important;
		max-width: 100vw;
		left: 0;
		right: 0;
		-webkit-box-sizing: border-box;
		box-sizing: border-box;
	}
}

/* ---- Điện thoại: tối ưn chữ, card, khoảng cách ---- */
@media screen and (max-width: 575.98px) {
	/* Cao hơn một chút (logo + hàng action + ô tìm) + vùng an toàn trên */
	.is-fixed {
		padding-top: calc(168px + env(safe-area-inset-top, 0px));
	}

	/* iOS: font input < 16px sẽ zoom cả trang khi focus — giữ 16px cho ô gõ / select */
	.form-control,
	.form-select,
	.input-text,
	.select2-container--bootstrap-5 .select2-selection,
	.select2-container--default .select2-selection--single,
	textarea {
		font-size: 16px;
	}

	.section-hero,
	.section-margin {
		margin-left: 0;
		margin-right: 0;
	}

	.hero-box .hero-content {
		padding: 1rem 1rem 1rem 1.25rem;
	}

	.hero-box .hero-content .hero-title {
		font-size: 1.25rem;
	}

	.product-card .card-header_link--image,
	.article-card .card-left_image {
		width: 100%;
	}

	/* Card tin ngang: xếp dọc (Bootstrap col-12) — ảnh trên, chữ dưới */
	.article-card.card.flex-row {
		-webkit-box-orient: vertical !important;
		-webkit-box-direction: normal !important;
		-ms-flex-direction: column !important;
		flex-direction: column !important;
	}

	.article-card .card-left,
	.article-card .card-right {
		width: 100% !important;
	}

	/* Giảm chữ "Đăng tin" vẫn giữ nút gọn */
	.header .header-user .header-post {
		padding: 4px 8px 4px 4px;
		font-size: var(--size-sm);
	}

	.header .header-user .header-post > .icon {
		margin-right: 6px;
	}

	#search-extended .row.gx-2 > [class^="col"] {
		-webkit-flex: 0 0 100%;
		-ms-flex: 0 0 100%;
		flex: 0 0 100%;
		max-width: 100%;
	}

	/* Tiêu đề section, breadcrumb, phân trang: không tràn, chữ gọn hơn */
	.section-heading .title,
	.section-heading_small .title,
	.section-heading_highlight .title {
		font-size: 1.15rem;
		line-height: 1.35;
	}

	.breadcrumb {
		font-size: var(--size-sm);
		-webkit-flex-wrap: wrap;
		-ms-flex-wrap: wrap;
		flex-wrap: wrap;
	}

	.breadcrumb a {
		font-size: inherit;
	}

	.page-link {
		padding: 0.35rem 0.6rem;
	}

	/* Chi tiết tin: meta xuống dòng, nội dung chèn (CMS) tương thích màn hẹp */
	.article-inner .article-title {
		font-size: 1.35rem;
		line-height: 1.35;
	}

	.article-inner .article-meta {
		-webkit-flex-wrap: wrap;
		-ms-flex-wrap: wrap;
		flex-wrap: wrap;
		gap: 0.5rem 0.75rem;
		row-gap: 0.5rem;
		-webkit-align-items: center;
		-ms-flex-align: center;
		align-items: center;
		-webkit-box-pack: start;
		-ms-flex-pack: start;
		justify-content: flex-start;
	}

	.article-inner .article-meta .article-meta_list,
	.article-inner .article-meta .article-meta_social {
		-webkit-flex-wrap: wrap;
		-ms-flex-wrap: wrap;
		flex-wrap: wrap;
	}

	/* Nội dung bài: đọc trên màn hẹp; overflow-x khi bảng / media rộng từ CMS */
	.article-content,
	.content-html {
		line-height: 1.55;
		font-size: var(--size-md);
		overflow-wrap: break-word;
		word-wrap: break-word;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.article-content img,
	.content-html img {
		max-width: 100% !important;
		height: auto !important;
	}

	.article-content video,
	.content-html video {
		max-width: 100% !important;
		height: auto !important;
	}

	.article-content table,
	.content-html table {
		max-width: 100%;
	}

	/* Cỡ chữ: tránh zoom “giật” trên một số Android; giữ 100% tương đời ổn với 14px root */
	html {
		-webkit-text-size-adjust: 100%;
		-ms-text-size-adjust: 100%;
		text-size-adjust: 100%;
	}
}

/* Tránh nội dung tràn khi bảng / form rộng trên màn hẹp */
@media screen and (max-width: 767.98px) {
	.table-responsive,
	.dataTables_wrapper {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* Select2: không vượt khung, tránh tràn ngang */
	.select2-container {
		max-width: 100% !important;
	}

	/* iframe nhúng trong bài: không vượt khung (không sửa height để bản đồ/video vẫn set chiều cao) */
	.article-content iframe,
	.content-html iframe,
	.article-content embed,
	.content-html object {
		max-width: 100% !important;
	}

	/* Footer: chừa vùng home indicator iPhone */
	.footer {
		padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
	}
}

/* Owl Carousel — “Bất động sản mới nhất” (trang chủ) */
.owl-new-listing {
	position: relative;
}

.owl-new-listing .item {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
}

.owl-new-listing .product-card {
	width: 100%;
}

.owl-new-listing .owl-nav {
	margin-top: 0.5rem;
	text-align: center;
}

.owl-new-listing .owl-nav button.owl-prev,
.owl-new-listing .owl-nav button.owl-next {
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: var(--primary-color) !important;
	color: #fff !important;
	font-size: 1rem;
	line-height: 1;
	margin: 0 4px;
}

.owl-new-listing .owl-nav button.owl-prev:hover,
.owl-new-listing .owl-nav button.owl-next:hover {
	background: var(--primary-hover) !important;
}

.owl-new-listing .owl-dots {
	margin-top: 0.75rem;
}

.owl-new-listing .owl-dots .owl-dot span {
	background: var(--gray-300);
}

.owl-new-listing .owl-dots .owl-dot.active span,
.owl-new-listing .owl-dots .owl-dot:hover span {
	background: var(--primary-color);
}

@media screen and (max-width: 575.98px) {
	.owl-new-listing .owl-nav button.owl-prev,
	.owl-new-listing .owl-nav button.owl-next {
		width: 2.5rem;
		height: 2.5rem;
	}
}

/* Hero trang chủ: cao hơn, nhiều nội dung; nền ảnh/ SVG từng slide */
.hero-fullpage {
	position: relative;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	overflow: hidden;
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
}

/* Hero slide: ~50–64vh, tối đa 620px; đủ chỗ gạch đầu dòng + chú thích */
.hero-fullpage-owl,
.hero-fullpage-owl .owl-stage-outer,
.hero-fullpage__item,
.hero-fullpage__link {
	min-height: clamp(320px, 58dvh, 620px) !important;
}

.hero-fullpage-owl {
	max-height: 620px;
}

.hero-fullpage-owl .owl-item {
	max-height: 620px;
}

@media screen and (max-width: 575.98px) {
	.hero-fullpage-owl,
	.hero-fullpage-owl .owl-stage-outer,
	.hero-fullpage__item,
	.hero-fullpage__link {
		min-height: clamp(280px, 52dvh, 520px) !important;
	}

	.hero-fullpage-owl,
	.hero-fullpage-owl .owl-item {
		max-height: 520px;
	}
}

.hero-fullpage__item {
	position: relative;
	width: 100%;
}

.hero-fullpage__link {
	display: block;
	position: relative;
	color: #fff;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}

.hero-fullpage__link:hover {
	color: #fff;
}

.hero-fullpage__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
}

.hero-fullpage__img {
	width: 100%;
	height: 100%;
	-o-object-fit: cover;
	object-fit: cover;
	-o-object-position: center;
	object-position: center;
}

.hero-fullpage__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* Lớp phủ: trái đọc rõ, phải lộ ảnh; giảm “nặng” giữa khung */
.hero-fullpage__item--tim-kiem .hero-fullpage__overlay,
.hero-fullpage__item--ban-do .hero-fullpage__overlay,
.hero-fullpage__item--thong-tin .hero-fullpage__overlay {
	background: -webkit-linear-gradient(105deg, rgba(6, 22, 16, 0.88) 0%, rgba(6, 22, 16, 0.45) 38%, rgba(6, 22, 16, 0.12) 68%, rgba(0, 0, 0, 0) 100%);
	background: -o-linear-gradient(105deg, rgba(6, 22, 16, 0.88) 0%, rgba(6, 22, 16, 0.45) 38%, rgba(6, 22, 16, 0.12) 68%, rgba(0, 0, 0, 0) 100%);
	background: linear-gradient(105deg, rgba(6, 22, 16, 0.88) 0%, rgba(6, 22, 16, 0.45) 38%, rgba(6, 22, 16, 0.12) 68%, rgba(0, 0, 0, 0) 100%);
}

.hero-fullpage__item--ban-do .hero-fullpage__overlay {
	background: -webkit-linear-gradient(105deg, rgba(4, 28, 20, 0.9) 0%, rgba(4, 28, 20, 0.48) 40%, rgba(4, 28, 20, 0.1) 70%, rgba(0, 0, 0, 0) 100%);
	background: -o-linear-gradient(105deg, rgba(4, 28, 20, 0.9) 0%, rgba(4, 28, 20, 0.48) 40%, rgba(4, 28, 20, 0.1) 70%, rgba(0, 0, 0, 0) 100%);
	background: linear-gradient(105deg, rgba(4, 28, 20, 0.9) 0%, rgba(4, 28, 20, 0.48) 40%, rgba(4, 28, 20, 0.1) 70%, rgba(0, 0, 0, 0) 100%);
}

.hero-fullpage__item--thong-tin .hero-fullpage__overlay {
	background: -webkit-linear-gradient(105deg, rgba(8, 30, 24, 0.9) 0%, rgba(8, 30, 24, 0.5) 42%, rgba(8, 30, 24, 0.12) 72%, rgba(0, 0, 0, 0) 100%);
	background: -o-linear-gradient(105deg, rgba(8, 30, 24, 0.9) 0%, rgba(8, 30, 24, 0.5) 42%, rgba(8, 30, 24, 0.12) 72%, rgba(0, 0, 0, 0) 100%);
	background: linear-gradient(105deg, rgba(8, 30, 24, 0.9) 0%, rgba(8, 30, 24, 0.5) 42%, rgba(8, 30, 24, 0.12) 72%, rgba(0, 0, 0, 0) 100%);
}

.hero-fullpage__content {
	position: absolute;
	z-index: 2;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-orient: vertical;
	-webkit-box-direction: normal;
	-ms-flex-direction: column;
	flex-direction: column;
	-webkit-box-pack: center;
	-ms-flex-pack: center;
	justify-content: center;
	-webkit-box-align: start;
	-ms-flex-align: start;
	align-items: flex-start;
	padding: 1.5rem 0.75rem 2.6rem 0.75rem;
}

@media screen and (min-width: 576px) {
	.hero-fullpage__content {
		padding: 1.75rem 1rem 2.75rem 1rem;
	}
}

@media screen and (min-width: 992px) {
	.hero-fullpage__content {
		padding: 2rem 1.25rem 2.85rem 1.25rem;
	}
}

/* Khối nội dung: giới hạn độ rộng, nền mờ, chữ bớt chói trên ảnh nhiễu */
.hero-fullpage__body {
	width: 100%;
	max-width: 36.5rem;
	margin: 0;
	padding: 1rem 1rem 1.15rem;
	border-radius: 0.65rem;
	background: rgba(0, 0, 0, 0.2);
	-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 8px 32px rgba(0, 0, 0, 0.12);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 8px 32px rgba(0, 0, 0, 0.12);
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
}

@media screen and (min-width: 768px) {
	.hero-fullpage__body {
		max-width: 38rem;
		padding: 1.25rem 1.35rem 1.4rem;
	}
}

@media screen and (min-width: 1200px) {
	.hero-fullpage__body {
		max-width: 40rem;
		padding: 1.4rem 1.5rem 1.5rem;
	}
}

.hero-fullpage__kicker {
	margin: 0 0 0.5rem;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.78);
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

@media screen and (min-width: 768px) {
	.hero-fullpage__kicker {
		font-size: 0.75rem;
	}
}

.hero-fullpage__title {
	font-size: 1.3rem;
	font-weight: 700;
	margin: 0 0 0.75rem;
	line-height: 1.32;
	letter-spacing: -0.02em;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.hero-fullpage__subtitle {
	font-size: 0.9rem;
	margin: 0 0 1.1rem;
	max-width: none;
	line-height: 1.65;
	color: rgba(255, 255, 255, 0.9);
	font-weight: 400;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hero-fullpage__badges {
	margin: 0 0 1rem;
	padding: 0;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-ms-flex-wrap: wrap;
	flex-wrap: wrap;
	gap: 0.45rem 0.5rem;
	max-width: none;
}

.hero-fullpage__badge {
	display: -webkit-inline-box;
	display: -ms-inline-flexbox;
	display: inline-flex;
	-webkit-align-items: center;
	-ms-flex-align: center;
	align-items: center;
	font-size: 0.65rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.95);
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.28);
	padding: 0.3rem 0.55rem;
	border-radius: 999px;
	line-height: 1.2;
	-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

@media screen and (min-width: 768px) {
	.hero-fullpage__badge {
		font-size: 0.68rem;
		padding: 0.32rem 0.6rem;
	}
}

.hero-fullpage__list {
	margin: 0 0 1.15rem;
	padding: 0.25rem 0 0.15rem 0.1rem;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	font-size: 0.86rem;
	list-style: none;
	line-height: 1.6;
}

@media screen and (min-width: 768px) {
	.hero-fullpage__list {
		font-size: 0.92rem;
	}
}

.hero-fullpage__list li {
	position: relative;
	margin: 0.45rem 0 0.45rem 0;
	padding: 0 0 0 1.2rem;
	color: rgba(255, 255, 255, 0.92);
}

.hero-fullpage__list li::before {
	content: "✓";
	position: absolute;
	left: 0;
	top: 0.2em;
	color: #9fd4af;
	font-size: 0.88em;
	font-weight: 700;
	line-height: 1.2;
}

.hero-fullpage__footnote {
	margin: 0.85rem 0 0 0;
	max-width: none;
	font-size: 0.7rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.65);
	font-style: normal;
	letter-spacing: 0.01em;
}

@media screen and (min-width: 768px) {
	.hero-fullpage__title {
		font-size: 1.5rem;
		margin-bottom: 0.85rem;
	}

	.hero-fullpage__subtitle {
		font-size: 0.95rem;
	}
}

@media screen and (min-width: 1200px) {
	.hero-fullpage__title {
		font-size: 1.65rem;
	}
}

.hero-fullpage__cta {
	display: -webkit-inline-box;
	display: -ms-inline-flexbox;
	display: inline-flex;
	-webkit-align-items: center;
	-ms-flex-align: center;
	align-items: center;
	gap: 0.4rem;
	-ms-flex-item-align: start;
	-ms-grid-row-align: start;
	-webkit-align-self: flex-start;
	align-self: flex-start;
	margin-top: 0.2rem;
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.hero-fullpage__cta .hero-fullpage__cta-text {
	background: #fff;
	color: var(--primary-color, #1b4332);
	padding: 0.45rem 1.1rem 0.45rem 1.15rem;
	border-radius: 2rem;
	-webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	-webkit-transition: background 0.2s, color 0.2s, -webkit-transform 0.2s, -webkit-box-shadow 0.2s;
	transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s, -webkit-box-shadow 0.2s;
}

.hero-fullpage__link:hover .hero-fullpage__cta .hero-fullpage__cta-text {
	background: var(--primary-color, #1b4332);
	color: #fff;
	-webkit-box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	-webkit-transform: translateY(-1px);
	-ms-transform: translateY(-1px);
	transform: translateY(-1px);
}

.hero-fullpage__cta i {
	color: var(--primary-color, #1b4332);
	-webkit-transition: color 0.2s;
	transition: color 0.2s;
}

.hero-fullpage__link:hover .hero-fullpage__cta i {
	color: #fff;
}

/* Điều khiển hero: nổi trên slide */
.hero-fullpage-owl .owl-dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0.5rem;
	margin-top: 0;
}

.hero-fullpage-owl .owl-dots .owl-dot span {
	background: rgba(255, 255, 255, 0.4);
}

.hero-fullpage-owl .owl-dots .owl-dot.active span,
.hero-fullpage-owl .owl-dots .owl-dot:hover span {
	background: #fff;
}

.hero-fullpage-owl .owl-nav {
	margin-top: 0;
}

.hero-fullpage-owl .owl-nav button.owl-prev,
.hero-fullpage-owl .owl-nav button.owl-next {
	position: absolute;
	top: 50%;
	-webkit-transform: translateY(-50%);
	-ms-transform: translateY(-50%);
	transform: translateY(-50%);
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9) !important;
	color: var(--gray-800) !important;
	font-size: 1rem;
	-webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
}

.hero-fullpage-owl .owl-nav button.owl-prev {
	left: 0.5rem;
}

.hero-fullpage-owl .owl-nav button.owl-next {
	right: 0.5rem;
}

.hero-fullpage-owl .owl-nav button.owl-prev:hover,
.hero-fullpage-owl .owl-nav button.owl-next:hover {
	background: #fff !important;
}

/* Điều chỉnh nút prev/next ở hero thấp */
@media screen and (max-width: 480px) {
	.hero-fullpage-owl .owl-dots {
		bottom: 0.2rem;
	}
}

