/* =====================================================================
   HERO — thẻ tìm kiếm trên cùng (gần header); dưới: tiêu đề 4 dòng bên trái,
   cảnh nhà & xe bên phải (2 lớp ảnh AI nền trong suốt). Khi tải trang: nhà
   "bật đèn" và xe chạy từ xa vào vị trí. Tôn trọng prefers-reduced-motion.
   ===================================================================== */

.mb-hero-live {
	--h-navy: #12307a;
	--h-navy-deep: #0e2660;
	--h-gold: #c2933a;
	--h-gold-lt: #e6c477;
	--h-muted: #5b6a86;
	position: relative;
	overflow: hidden;
	isolation: isolate;
	background: linear-gradient(180deg, #e8f1fc 0%, #f2f8ff 46%, #fbfdff 100%);
}

/* ---- Lớp nền ---- */
.mb-hero-sky {
	position: absolute; inset: 0; z-index: 0; pointer-events: none;
	background:
		radial-gradient(1150px 620px at 72% 2%, rgba(255, 255, 255, .9), transparent 60%),
		radial-gradient(760px 620px at 82% 62%, rgba(230, 196, 110, .1), transparent 64%);
}
.mb-hero-skyline { position: absolute; left: 0; right: 0; bottom: 0; z-index: 0; width: 100%; height: 40%; pointer-events: none; opacity: .46; }
.mb-hero-skyline path { fill: #cbdcf0; }
.mb-hero-ribbons { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; opacity: .76; }
.mb-rib { fill: none; stroke: url(#mbRib); stroke-width: 2.4; stroke-linecap: round; }
.mb-rib-thin { stroke-width: 1.4; opacity: .7; }
.mb-hero-motes { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.mb-mote { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(230, 200, 120, .95), rgba(230, 200, 120, 0) 70%); }

/* ---- Khung nội dung: full-bleed, thẻ tìm kiếm nổi trên cùng ---- */
.mb-hero-inner {
	position: relative; z-index: 2;
	max-width: 1180px; margin: 0 auto;
	padding: 28px clamp(16px, 3vw, 40px) 34px;
}

/* Thẻ tìm kiếm nằm ngay dưới tiêu đề trong cột trái */
.mb-hero-search { margin-top: 22px; width: 100%; max-width: 560px; }
.mb-hero-live .mb-hero-search .mb-search-card { margin: 0; max-width: 100%; }

/* Tiêu đề sát viền trái + cảnh nhà xe sát viền phải, lấp đầy chiều cao hero */
.mb-hero-body {
	position: relative; z-index: 2;
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.05fr);
	align-items: center;
	gap: 24px;
	min-height: 400px;
}
.mb-hero-copy { }
.mb-hero-title {
	margin: 0 0 6px;
	font-weight: 800; text-transform: uppercase;
	line-height: 1.06; letter-spacing: .01em;
	font-size: clamp(24px, 3vw, 46px);
	white-space: nowrap;
}
.mb-hero-line { display: block; }
.mb-hero-title .mb-hnavy { display: inline; color: var(--h-navy); }
.mb-hero-title .mb-hgold {
	display: inline;
	font-style: italic; padding-right: .08em;
	background-image: linear-gradient(110deg, #b5872f 0%, #d9ab48 40%, #fff3c9 49%, #ffffff 50%, #fff3c9 51%, #d9ab48 60%, #b5872f 100%);
	background-size: 220% 100%;
	background-position: 42% 0;
	-webkit-background-clip: text; background-clip: text;
	-webkit-text-fill-color: transparent; color: var(--h-gold);
}
.mb-hero-sub { margin: 0; color: var(--h-muted); font-size: clamp(13.5px, 1.1vw, 16px); }

/* ---- Sân khấu nhà + xe ---- */
.mb-hero-stage { position: relative; display: flex; justify-content: flex-end; perspective: 1400px; }
.mb-hero-art-wrap {
	position: relative;
	width: min(100%, 604px);
	transform-style: preserve-3d;
	transform: rotateY(calc(var(--mx, 0) * 3deg)) rotateX(calc(var(--my, 0) * -2deg));
	transition: transform .35s cubic-bezier(.16, 1, .3, 1);
	will-change: transform;
}
.mb-hero-house {
	position: relative; z-index: 2;
	display: block; width: 100%; height: auto;
	filter: drop-shadow(0 20px 26px rgba(15, 40, 90, .12));
	animation: mbFloat 6.5s ease-in-out infinite;
}
@keyframes mbFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }
.mb-hero-car {
	position: absolute; z-index: 4;
	width: 58%; left: 4%; bottom: 15%;
	filter: drop-shadow(0 10px 12px rgba(15, 40, 90, .22));
}
/* Quầng sáng ấm mô phỏng đèn nhà bật lên (đặt trên vùng cửa sổ) */
.mb-hero-glow {
	position: absolute; z-index: 3;
	left: 22%; top: 26%; width: 48%; height: 44%;
	background: radial-gradient(closest-side, rgba(255, 208, 128, .55), rgba(255, 208, 128, 0) 72%);
	mix-blend-mode: screen; pointer-events: none; opacity: .5;
}

/* ---- Chuyển động vào trang ---- */
@media (prefers-reduced-motion: no-preference) {
	.mb-rib { stroke-dasharray: 26 640; animation: mbFlow 8s linear infinite; }
	.mb-hero-ribbons .mb-rib:nth-child(3) { animation-duration: 6.5s; }
	.mb-hero-ribbons .mb-rib:nth-child(4) { animation-duration: 10s; }
	@keyframes mbFlow { to { stroke-dashoffset: -666; } }

	.mb-hero-line, .mb-hero-sub, .mb-hero-search { opacity: 0; }
	.mb-hero-line { animation: mbRise .72s cubic-bezier(.16, 1, .3, 1) forwards; }
	.mb-hero-line:nth-child(1) { animation-delay: .34s; }
	.mb-hero-line:nth-child(2) { animation-delay: .42s; }
	.mb-hero-line:nth-child(3) { animation-delay: .5s; }
	.mb-hero-line:nth-child(4) { animation-delay: .58s; }
	.mb-hero-sub { animation: mbRise .8s cubic-bezier(.16, 1, .3, 1) .66s forwards; }
	@keyframes mbRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
	/* Thẻ tìm kiếm ở desktop dùng translateX(-50%) để căn giữa — entrance phải
	   GIỮ lại translateX, nếu không animation kết thúc bằng transform:none sẽ
	   xóa mất căn giữa và đẩy thẻ lệch phải. */
	/* Thẻ tìm kiếm chỉ fade (KHÔNG animate transform) — nếu animate transform,
	   phần tử tạo containing-block khiến modal Bộ lọc (position:fixed) bị nhốt
	   trong hero thay vì bung toàn màn hình. */
	.mb-hero-search { animation: mbFade .7s ease .1s forwards; }
	@keyframes mbFade { from { opacity: 0; } to { opacity: 1; } }
	/* Chữ vàng lấp lánh — dải sáng quét ngang qua chữ */
	.mb-hero-title .mb-hgold { animation: mbShine 3.6s linear infinite; }
	@keyframes mbShine { from { background-position: 140% 0; } to { background-position: -140% 0; } }

	/* Nhà bật đèn: cảnh tối rồi sáng dần + quầng sáng cửa sổ bừng lên */
	.mb-hero-house { animation: mbFloat 6.5s ease-in-out infinite, mbLightsOn 1.5s ease-out .25s both; }
	@keyframes mbLightsOn { 0% { filter: brightness(.6) saturate(.72) drop-shadow(0 20px 26px rgba(15, 40, 90, .12)); } 100% { filter: brightness(1) saturate(1) drop-shadow(0 20px 26px rgba(15, 40, 90, .12)); } }
	.mb-hero-glow { opacity: 0; animation: mbGlowOn 1.8s ease-out .5s both; }
	@keyframes mbGlowOn { 0% { opacity: 0; } 55% { opacity: .95; } 100% { opacity: .5; } }

	/* Xe chạy từ xa vào vị trí (xe quay đầu sang trái nên tiến từ phải sang) */
	.mb-hero-car { animation: mbCarIn 1.7s cubic-bezier(.2, .62, .3, 1) .55s both; }
	@keyframes mbCarIn {
		0% { transform: translateX(240%); opacity: 0; }
		18% { opacity: 1; }
		88% { transform: translateX(-2%); }
		100% { transform: translateX(0); opacity: 1; }
	}
	.mb-mote { animation: mbDrift var(--d, 7s) ease-in-out infinite alternate; }
	@keyframes mbDrift { from { transform: translateY(0); } to { transform: translateY(-24px); } }
}

@media (prefers-reduced-motion: reduce) {
	.mb-hero-house, .mb-hero-car, .mb-rib, .mb-mote { animation: none !important; }
	.mb-hero-art-wrap { transform: none !important; }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
	.mb-hero-inner { min-height: 0; padding-top: 0; padding-bottom: 20px; }
	.mb-hero-search { position: relative; top: auto; left: auto; transform: none; width: 100%; margin: 16px auto 12px; display: flex; justify-content: center; }
	/* Mobile căn giữa bằng flex — tắt entrance translateX để thẻ không lệch */
	@media (prefers-reduced-motion: no-preference) { .mb-hero-search { animation: none; opacity: 1; } }
	.mb-hero-body { position: static; min-height: 0; grid-template-columns: 1fr; gap: 6px; }
	.mb-hero-stage { order: -1; justify-content: center; }
	.mb-hero-art-wrap { width: min(84%, 440px); }
	.mb-hero-copy { text-align: center; }
	.mb-hero-title { white-space: normal; }
}
@media (max-width: 560px) {
	.mb-hero-title { font-size: clamp(24px, 7.6vw, 34px); }
	.mb-hero-art-wrap { width: min(96%, 360px); }
	.mb-hero-live .mb-hero-search .mb-search-card { max-width: 100%; }
}
