/* #277/#279 — Trang chủ giao diện mới (phong cách FPT Shop). Phần riêng trang chủ; quy chuẩn chung ở ui2.css. Tiền tố .hm- */
.hm{background:var(--hv-bg);color:var(--hv-text);font-size:var(--hv-fs);line-height:1.4;padding:56px 0 20px;overflow-x:clip}
.hm *,.hm *::before,.hm *::after{box-sizing:border-box}
.hm ul{list-style:none;margin:0;padding:0}
.hm img{display:block;max-width:100%;height:auto}
.hm a{color:inherit;text-decoration:none}
.hm .hm-sec{padding:0;margin:0 0 8px;background:none!important}
.hm-wrap{max-width:1200px;margin:0 auto;padding:0}
.hm-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;margin:0!important}
.hm p{margin:0}
/* tiêu đề khối do admin nhập */
.hm .hm-sec h2,.hm .hm-head h2{margin:0;font-size:var(--hv-fs-title);font-weight:700;color:var(--hv-ink)}
.hm .hm-sec h2 a{color:inherit}
.hm-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.hm-head>a{font-size:13.5px;color:var(--hv-link)!important;white-space:nowrap}
/* khối trắng */
.hm-sec--hm_danhmuc .hm-wrap,
.hm-sec--hm_thuonghieu .hm-wrap,
.hm-sec--hm_tintuc .hm-wrap,
.hm-grp{background:var(--hv-white);padding:16px 12px}
.hm-sec--hm_danhmuc h2{margin-bottom:12px!important}

/* ---------- lối tắt: cuộn ngang + thanh chỉ báo ---------- */
.hm-sec--hm_loitat .hm-wrap{padding:14px 0 4px}
.hm-shortcuts{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;padding:0 10px;scroll-snap-type:x proximity}
.hm-shortcuts::-webkit-scrollbar{display:none}
.hm-shortcuts li{flex:0 0 88px;scroll-snap-align:start}
.hm-shortcuts a{display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px}
.hm-shortcuts img{width:64px;height:64px;object-fit:contain;background:var(--hv-white);border-radius:16px;padding:6px;box-shadow:0 1px 2px var(--hv-shade-06)}
.hm-shortcuts span{font-size:12.5px;line-height:1.3;color:var(--hv-ink);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.6em}
.hm-scrollbar{width:64px;height:6px;margin:12px auto 4px;border-radius:99px;background:var(--hv-dot);overflow:hidden}
.hm-scrollbar span{display:block;height:100%;width:40%;border-radius:99px;background:var(--hv-white);box-shadow:0 0 0 1px var(--hv-dot) inset}

/* ---------- banner: thẻ bo góc, ảnh trọn, chấm viên thuốc trong khối xám ---------- */
.hm-sec--hm_banner .hm-wrap{padding:6px 12px 4px}
.hm-banner__track{display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.hm-banner__track::-webkit-scrollbar{display:none}
.hm-banner__item{flex:0 0 100%;scroll-snap-align:start;border-radius:var(--hv-radius-card);overflow:hidden;background:var(--hv-white)}
.hm-banner__item a{display:block}
.hm-banner__item img{width:100%;height:auto}
.hm-dots{display:flex;gap:6px;width:max-content;margin:10px auto 2px;padding:5px 8px;border-radius:99px;background:var(--hv-dot)}
.hm-dots button{width:8px;height:8px;padding:0;border:0;border-radius:99px;background:var(--hv-on-dark-3);cursor:pointer;transition:width .2s}
.hm-dots button.on{width:22px;background:var(--hv-white)}

/* ---------- danh mục nổi bật: 5 cột mobile / 10 cột desktop, ảnh không khung ---------- */
.hm-cats{display:grid;grid-template-columns:repeat(5,1fr);gap:14px 4px}
.hm-cats a{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px}
.hm-cats__img{position:relative;display:block;width:56px;height:56px;padding:4px;border-radius:var(--hv-radius-card);background:var(--hv-bg-2)}
.hm-cats__img img{width:100%;height:100%;object-fit:contain;border-radius:var(--hv-radius-sm)}
.hm-tag{position:absolute;top:-6px;right:-10px;padding:1px 6px;border-radius:99px;background:var(--hv-red);color:var(--hv-white);font-size:10px;font-weight:700;line-height:1.4}
.hm-cats__t{font-size:12px;line-height:1.3;color:var(--hv-ink);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.hm-cats a:hover .hm-cats__t{color:var(--hv-red)}

/* ---------- khối sản phẩm theo nhóm ---------- */
.hm-sec--hm_nhomsp .hm-wrap{padding:0}
.hm-grp+.hm-grp{margin-top:8px}
.hm-tabs{display:flex;gap:18px;overflow-x:auto;scrollbar-width:none;border-bottom:1px solid var(--hv-line);margin:0 0 12px!important}
.hm-tabs::-webkit-scrollbar{display:none}
.hm-tabs a,.hm-tabs span{display:block;padding:8px 0 10px;font-size:14px;white-space:nowrap;color:var(--hv-text);border-bottom:2px solid transparent;margin-bottom:-1px}
.hm-tabs a:hover{color:var(--hv-red)}
.hm-tabs .on{color:var(--hv-red);font-weight:600;border-bottom-color:var(--hv-red)}
.hm-glogos{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;margin:0 0 12px!important}
.hm-glogos::-webkit-scrollbar{display:none}
.hm-glogos li{flex:0 0 auto}
.hm-glogos a{display:flex;align-items:center;justify-content:center;width:88px;height:40px;padding:4px 10px;border:1px solid var(--hv-line);border-radius:var(--hv-radius);background:var(--hv-white);font-size:12px;font-weight:600}
.hm-glogos a:hover{border-color:var(--hv-red)}
.hm-glogos img{width:100%;height:100%;object-fit:contain}
.hm-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.hm-grp__all{text-align:center;margin-top:14px!important}
.hm-grp__all .hv-btn{color:var(--hv-ink)!important}

/* ---------- thương hiệu ---------- */
.hm-brands{display:flex;gap:8px;overflow-x:auto;scrollbar-width:thin;padding-bottom:4px}
.hm-brands li{flex:0 0 104px}
.hm-brands a{display:flex;align-items:center;justify-content:center;height:70px;padding:6px;border:1px solid var(--hv-line);border-radius:var(--hv-radius-card);background:var(--hv-white);font-weight:700;font-size:13px}
.hm-brands a:hover{border-color:var(--hv-red)}
.hm-brands img{width:100%;height:100%;object-fit:contain}

/* ---------- tin tức ---------- */
.hm-news{display:grid;grid-template-columns:1fr;gap:10px}
.hm-news a{display:flex;gap:10px;align-items:flex-start;border-radius:0}
.hm-news__img{flex:0 0 120px;position:relative;aspect-ratio:16/9;border-radius:var(--hv-radius-sm);overflow:hidden;background:var(--hv-bg)}
.hm-news__img img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.hm-news__b{display:flex;flex-direction:column;gap:4px;min-width:0}
.hm-news__t{font-size:14px;font-weight:500;line-height:1.35;color:var(--hv-ink);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.hm-news a:hover .hm-news__t{color:var(--hv-red)}
.hm-news time{font-size:12px;color:var(--hv-muted)}

/* ---------- ≥ 576 ---------- */
@media (min-width:576px){
	.hm-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
	.hm-news{grid-template-columns:1fr 1fr}
}
/* ---------- ≥ 768 ---------- */
@media (min-width:768px){
	.hm-banner__item{flex-basis:calc(50% - 6px)}
	.hm-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
	.hm-cats{grid-template-columns:repeat(8,1fr)}
}
/* ---------- ≥ 992: desktop ---------- */
@media (min-width:992px){
	.hm{padding-top:66px}
	.hm-wrap{padding:0 12px}
	.hm .hm-sec{margin-bottom:12px}
	.hm-sec--hm_danhmuc .hm-wrap,
	.hm-sec--hm_thuonghieu .hm-wrap,
	.hm-sec--hm_tintuc .hm-wrap{border-radius:var(--hv-radius-card);padding:18px 20px;max-width:1176px}
	.hm-sec--hm_nhomsp .hm-wrap{padding:0 12px}
	.hm-grp{border-radius:var(--hv-radius-card);padding:18px 20px}
	.hm-grp+.hm-grp{margin-top:12px}
	.hm-sec--hm_loitat .hm-wrap{padding:16px 12px 4px}
	.hm-shortcuts{padding:0;justify-content:space-between}
	.hm-shortcuts li{flex-basis:104px}
	.hm-shortcuts img{width:72px;height:72px}
	.hm-sec--hm_banner .hm-wrap{padding:6px 12px 4px}
	.hm-cats{grid-template-columns:repeat(10,1fr);gap:18px 8px}
	.hm-cats__img{width:72px;height:72px}
	.hm-cats__t{font-size:13px}
	.hm-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
	.hm-brands{overflow-x:auto}
	.hm-brands li{flex-basis:calc((100% - 72px)/10)}
	.hm-news{grid-template-columns:repeat(3,1fr);gap:16px 20px}
	.hm .hm-sec h2,.hm .hm-head h2{font-size:20px}
}
/* ảnh thẻ SP / tin nằm tuyệt đối trong khung vuông (thắng quy tắc .hm img{height:auto}) */
.hm .hv-pcard__img img,.hm .hm-news__img img{height:100%}

/* ---------- #314: dải logo hãng = Owl Carousel; trước khi khởi tạo giữ 1 hàng cố định chiều cao (không CLS, không thanh cuộn) ---------- */
.hm .hm-brands{display:flex;gap:10px;overflow:hidden;padding:0;-webkit-mask-image:none;mask-image:none}
.hm .hm-brands__i{flex:0 0 calc((100% - 20px)/3)}
.hm .hm-brands a{display:flex;align-items:center;justify-content:center;height:72px;padding:6px;border:1px solid var(--hv-line);border-radius:var(--hv-radius-card);background:var(--hv-white);font-weight:700;font-size:13px}
.hm .hm-brands a:hover{border-color:var(--hv-red)}
.hm .hm-brands img{width:100%!important;height:100%!important;object-fit:contain}
.hm .hm-brands.owl-loaded{display:block;overflow:visible}
.hm .hm-brands.owl-loaded .hm-brands__i{flex:none}
.hm .hm-brands .owl-nav{margin:0}
.hm .hm-brands .owl-nav button.owl-prev,.hm .hm-brands .owl-nav button.owl-next{position:absolute;top:50%;margin:-15px 0 0!important;width:30px;height:30px;border-radius:50%!important;background:var(--hv-white)!important;border:1px solid var(--hv-line)!important;color:var(--hv-ink)!important;display:flex;align-items:center;justify-content:center;font-size:14px}
.hm .hm-brands .owl-nav button.owl-prev{left:-15px}
.hm .hm-brands .owl-nav button.owl-next{right:-15px}
.hm .hm-brands .owl-dots{margin-top:10px!important}
.hm .hm-brands .owl-dots .owl-dot span{width:7px;height:7px;margin:3px;background:var(--hv-dot)}
.hm .hm-brands .owl-dots .owl-dot.active span{width:18px;background:var(--hv-red)}
@media (min-width:576px){.hm .hm-brands__i{flex-basis:calc((100% - 30px)/4)}}
@media (min-width:768px){.hm .hm-brands__i{flex-basis:calc((100% - 50px)/6)}}
@media (min-width:1200px){.hm .hm-brands__i{flex-basis:calc((100% - 70px)/8)}}

/* ---------- #314: icon lối tắt (Bootstrap Icons, MIT) cùng kiểu ô vuông bo góc nền trắng với ảnh ---------- */
.hm-shortcuts .hm-ico{display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:16px;background:var(--hv-white);box-shadow:0 1px 2px var(--hv-shade-06);color:var(--hv-red);font-size:30px}
@media (min-width:992px){.hm-shortcuts .hm-ico{width:72px;height:72px;font-size:34px}}

/* ---------- #314: khối tin trang chủ: 1 tin tiêu điểm + thẻ tin nhỏ (đồng bộ trang /tin-tuc) ---------- */
.hm-tin{display:grid;grid-template-columns:1fr;gap:12px}
.hm-tin__ds{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.hm-tin__ds .hv-news__b{padding:10px 12px 12px}
.hm-tin__ds .hv-news__t{font-size:14px!important}
@media (min-width:992px){
	/* #674: tin tiêu điểm cao bằng cột tin nhỏ (trước align-items:start -> khoảng trống lớn dưới tin lớn) */
	.hm-tin{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:16px;align-items:stretch}
	.hm-tin__lon{display:flex}
	.hm-tin .hv-news--lon{display:flex;flex-direction:column;flex:1 1 auto}
	.hm-tin .hv-news--lon .hv-news__img{flex:1 1 auto;aspect-ratio:auto;min-height:260px}
	.hm-tin .hv-news--lon .hv-news__b{padding:16px 18px 18px}
	.hm-tin .hv-news--lon .hv-news__t{font-size:22px!important}
	.hm-tin__ds{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
}
body.ui2 .hm .hm-brands{margin-left:0!important;margin-right:0!important;padding:0!important;-webkit-mask-image:none!important;mask-image:none!important}
@media (min-width:768px){body.ui2 .hm .hm-brands{padding:0 18px!important}}
/* #313/#314: logo hãng to hơn, khung cố định (mobile ~140×70, desktop ~180×90), logo chiếm gần hết khung */
.hm .hm-brands a{height:70px;padding:8px 10px}
@media (min-width:992px){.hm .hm-brands a{height:90px;padding:10px 14px}}
.hm .hm-brands__i{flex-basis:calc((100% - 12px)/2)}
@media (min-width:420px){.hm .hm-brands__i{flex-basis:calc((100% - 24px)/3)}}
@media (min-width:768px){.hm .hm-brands__i{flex-basis:calc((100% - 36px)/4)}}
@media (min-width:992px){.hm .hm-brands__i{flex-basis:calc((100% - 48px)/5)}}
@media (min-width:1200px){.hm .hm-brands__i{flex-basis:calc((100% - 60px)/6)}}
.hm .hm-brands{gap:12px}
.hm .hv-news__img img{height:100%!important;max-width:none}
