/* ============================================================
   SCAR - CSS TRANG CHỦ (giao diện mới, prefix .hm-)
   Biến màu & nút dùng chung nằm ở main.css.
   ============================================================ */
/* ---------- HERO ---------- */
.hm-hero { position: relative; background: linear-gradient(180deg, #ffffff 0%, #f2f4f7 60%, #eef1f5 100%); padding: 40px 0 30px; overflow: hidden; }
.hm-hero::after { content: ""; position: absolute; right: -6%; top: 8%; width: 60%; height: 60%; background: radial-gradient(ellipse at center, rgba(225,27,34,.10) 0%, rgba(225,27,34,0) 70%); pointer-events: none; }
.hm-hero-row { display: flex; align-items: center; gap: 30px; min-height: 240px; }
.hm-hero-text { flex: 1 1 45%; position: relative; z-index: 2; }
.hm-hero-title { font-size: 52px; line-height: 1.05; font-weight: 900; color: var(--hm-text); margin: 0 0 16px; letter-spacing: -.5px; }
.hm-hero-title span { color: var(--hm-red); }
.hm-hero-sub { font-size: 16px; color: #4b5563; margin: 0; line-height: 1.6; }
.hm-hero-img { flex: 1 1 55%; text-align: right; position: relative; z-index: 1; }
.hm-hero-img img { max-width: 100%; height: auto; }

/* Cột chứa ô tìm kiếm bên phải hero (PC) */
.hm-hero-search-col { flex: 1 1 55%; display: flex; justify-content: flex-end; position: relative; z-index: 3; }

.hm-hero-bottom { display: flex; align-items: center; gap: 30px; margin-top: 26px; flex-wrap: wrap; }

/* Ô tìm kiếm */
.hm-search-card { background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(16,24,40,.10); padding: 0 0 20px; width: 470px; max-width: 100%; position: relative; z-index: 3; }
.hm-search-tabs { display: flex; border-bottom: 1px solid var(--hm-border); }
.hm-search-tab { flex: 0 0 auto; padding: 16px 22px; font-size: 14px; font-weight: 600; color: var(--hm-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; border-bottom: 2px solid transparent; cursor: pointer; }
.hm-search-tab.active { color: var(--hm-red); border-bottom-color: var(--hm-red); }
.hm-search-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 18px 20px 0; }
.hm-search-label { display: block; font-size: 13px; font-weight: 700; color: var(--hm-text); margin-bottom: 8px; }
.hm-search-submit { grid-column: 1 / -1; display: flex; justify-content: flex-end; margin-top: 4px; }

/* Thống kê */
.hm-stats { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding-bottom: 14px; min-width: 300px; }
.hm-stat { display: flex; align-items: center; gap: 10px; }
.hm-stat i { font-size: 20px; color: var(--hm-red); flex: 0 0 auto; }
.hm-stat strong { display: block; font-size: 15px; font-weight: 800; color: var(--hm-text); line-height: 1.3; }
.hm-stat span { display: block; font-size: 12px; color: var(--hm-muted); }

/* ---------- DANH MỤC XE ---------- */
.hm-cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.hm-cat-card { background: #fff; border: 1px solid var(--hm-border); border-radius: 10px; padding: 18px 14px; text-align: center; text-decoration: none; display: block; transition: box-shadow .2s, transform .2s; }
.hm-cat-card:hover { box-shadow: 0 8px 20px rgba(16,24,40,.10); transform: translateY(-2px); }
.hm-cat-img { height: 70px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.hm-cat-img img { max-height: 70px; max-width: 100%; width: auto; object-fit: contain; }
.hm-cat-name { font-size: 15px; font-weight: 700; color: var(--hm-text); margin: 0 0 4px; }
.hm-cat-count { font-size: 13px; color: var(--hm-muted); }

/* ---------- SALON ---------- */
.hm-salon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.hm-salon-card { background: #fff; border: 1px solid var(--hm-border); border-radius: 10px; padding: 14px; display: flex; gap: 12px; align-items: center; }
.hm-salon-thumb { width: 56px; height: 56px; border-radius: 8px; background: var(--hm-bg); flex: 0 0 auto; overflow: hidden; }
.hm-salon-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hm-salon-info { flex: 1; min-width: 0; }
.hm-salon-name { font-size: 14px; font-weight: 700; margin: 0 0 6px; color: var(--hm-text); }
.hm-salon-meta { display: block; font-size: 12px; color: var(--hm-muted); line-height: 1.6; }
.hm-salon-card.is-empty .hm-salon-thumb,
.hm-salon-card.is-empty .hm-salon-name,
.hm-salon-card.is-empty .hm-salon-meta { background: #f1f3f5; border-radius: 4px; color: transparent; }

/* ---------- TIN TỨC ---------- */
.hm-news-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.hm-news-feature { position: relative; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--hm-border); display: flex; align-items: stretch; }
.hm-news-feature-img { flex: 0 0 48%; display: block; }
.hm-news-feature-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-news-feature-body { flex: 1; padding: 24px; display: flex; flex-direction: column; justify-content: center; }
.hm-news-feature-title { font-size: 20px; font-weight: 700; line-height: 1.4; margin: 0 0 18px; }
.hm-news-feature-title a { color: var(--hm-text); text-decoration: none; }
.hm-news-feature-title a:hover { color: var(--hm-red); }
.hm-news-feature-body .hm-btn-ghost { align-self: flex-start; }
.hm-news-list { display: flex; flex-direction: column; gap: 16px; }
.hm-news-item { display: flex; gap: 14px; align-items: center; }
.hm-news-thumb { flex: 0 0 96px; height: 66px; border-radius: 8px; overflow: hidden; background: var(--hm-bg); }
.hm-news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-news-item-title { font-size: 14px; font-weight: 600; line-height: 1.5; margin: 0; }
.hm-news-item-title a { color: var(--hm-text); text-decoration: none; }
.hm-news-item-title a:hover { color: var(--hm-red); }

/* ---------- CTA ---------- */
.hm-cta-wrap { padding: 40px 0 0; }
.hm-cta { background: var(--hm-red); border-radius: 10px; padding: 26px 32px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.hm-cta-text { flex: 1; min-width: 240px; }
.hm-cta-text h2 { font-size: 22px; font-weight: 800; color: #fff; margin: 0 0 6px; }
.hm-cta-text p { font-size: 14px; color: rgba(255,255,255,.9); margin: 0; }

/* ---------- ƯU ĐIỂM ---------- */
.hm-features { padding: 34px 0 50px; }
.hm-feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.hm-feature { display: flex; gap: 12px; align-items: center; }
.hm-feature i { font-size: 22px; color: var(--hm-red); flex: 0 0 auto; }
.hm-feature strong { display: block; font-size: 14px; font-weight: 700; color: var(--hm-text); }
.hm-feature span { display: block; font-size: 12px; color: var(--hm-muted); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1199px) {
	.hm-hero-title { font-size: 42px; }
	.hm-cat-grid { grid-template-columns: repeat(3, 1fr); }
	.hm-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991px) {
	.hm-hero-row { flex-direction: column; text-align: center; }
	.hm-hero-img { text-align: center; }
	.hm-hero-search-col { display: none; } /* mobile dùng nút tìm kiếm ở header */
	.hm-hero-bottom { flex-direction: column; align-items: stretch; }
	.hm-car-grid, .hm-salon-grid { grid-template-columns: repeat(2, 1fr); }
	.hm-news-row { grid-template-columns: 1fr; }
	.hm-news-feature { flex-direction: column; }
	.hm-news-feature-img { flex: 0 0 auto; height: 220px; }
	.hm-feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.hm-hero-title { font-size: 32px; }
	.hm-search-form { grid-template-columns: 1fr; }
	.hm-section-head { flex-wrap: wrap; }
	.hm-tabs { order: 3; width: 100%; overflow-x: auto; }
	.hm-cta { flex-direction: column; align-items: flex-start; }

	/* Salon -> slider 1 item */
	.hm-salon-grid {
		display: flex;
		grid-template-columns: none;
		gap: 12px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		padding: 0 15px 6px;
		margin: 0 -15px;
		scrollbar-width: none;
	}
	.hm-salon-grid::-webkit-scrollbar { display: none; }
	.hm-salon-grid > .hm-salon-card { flex: 0 0 88%; scroll-snap-align: start; }

	/* Danh mục xe -> slider ngang */
	.hm-cat-grid {
		display: flex;
		grid-template-columns: none;
		gap: 12px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		padding: 0 15px 6px;
		margin: 0 -15px;
		scrollbar-width: none;
	}
	.hm-cat-grid::-webkit-scrollbar { display: none; }
	.hm-cat-grid > .hm-cat-card { flex: 0 0 27%; scroll-snap-align: start; }
	.hm-cat-img { height: 48px; }
	.hm-cat-img img { max-height: 48px; }
	.hm-cat-name { font-size: 13px; }
}
