/* ============================================================
   TRANG CHỦ — banner ảnh + 4 nút vuốt + thanh thông báo HOT
   Kích thước gọn, bố cục giống coderent.vn. Tiền tố: hm-
   ============================================================ */
/* --cp = đúng padding của .admio-content ở từng cỡ màn hình (admio.css: 24 / 20 / 16 / 12) */
.admio-content:has(.hm){--cp:24px}
@media(max-width:1400px){.admio-content:has(.hm){--cp:20px}}
@media(max-width:768px){.admio-content:has(.hm){--cp:16px}}
@media(max-width:576px){.admio-content:has(.hm){--cp:12px}}
.page-header:has(+ .hm){display:none;margin:0}
/* Chống dựt khi tải lại: ui.css làm main + .pd-page trượt từ dưới lên 14px (2 lớp cộng dồn) → trên trang chủ chỉ mờ dần, KHÔNG dịch chuyển */
@keyframes hmFade{from{opacity:0}to{opacity:1}}
main.admio-content:has(.hm),main.admio-content:has(.hm) .pd-page{animation:hmFade .35s ease-out backwards}
.hm-bn-track{contain:layout paint}

.hm{margin:0 0 8px;color:#16161a}
.hm-wrap{max-width:1240px;margin:0 auto;padding:0 15px}

/* ---------- 1. Banner ảnh (chuyển mờ dần + thanh chỉ báo trong ảnh) ---------- */
.hm-banner{position:relative;box-sizing:border-box;max-width:1240px;margin:0 auto;padding:0 15px;touch-action:pan-y pinch-zoom}
.hm-bn-track{position:relative;aspect-ratio:3/1;border-radius:14px;overflow:hidden;background:#fdf2f8}
.hm-bn-slide{position:absolute;inset:0;display:block;overflow:hidden;opacity:0;visibility:hidden;transform:scale(1.035);
  transition:opacity .9s ease,transform 5.5s cubic-bezier(.2,.6,.2,1),visibility 0s linear .9s}
.hm-bn-slide.on{opacity:1;visibility:visible;transform:scale(1);z-index:1;transition:opacity .9s ease,transform 5.5s cubic-bezier(.2,.6,.2,1),visibility 0s}
.hm-bn-slide img{width:100%;height:100%;object-fit:cover;display:block;user-select:none;-webkit-user-drag:none}
/* thanh xanh: mỗi ảnh 1 viên thuốc nhỏ, ảnh đang chiếu = viên xanh đặc dài ra (không chạy đầy dần) */
.hm-bn-bar{position:absolute;left:15px;right:15px;bottom:12px;z-index:2;display:flex;justify-content:center;gap:6px}
.hm-bn-bar button{width:16px;height:4px;padding:0;border:0;border-radius:4px;background:rgba(255,255,255,.6);cursor:pointer;
  box-shadow:0 1px 3px rgba(15,23,42,.25);transition:width .45s cubic-bezier(.3,.7,.2,1),background .45s}
.hm-bn-bar button.on{width:34px;background:var(--tc,#f472b6)}
.hm-bn-bar button:focus-visible{outline:2px solid #fff;outline-offset:2px}
/* PC/tablet: banner sát header hơn (trước đây = padding 24px + margin 26px) */
@media(min-width:768px){
  .admio-content:has(.hm){padding-top:0}
  .hm-banner{margin-top:19px}   /* 16px + 3px */
  /* Banner / 4 khung / HOT: bỏ giới hạn 1240px + padding 15px → dài đủ bằng phần sản phẩm bên dưới (trái & phải) */
  .hm-wrap,.hm-banner{max-width:none;padding-left:0;padding-right:0}
  .hm-bn-bar{left:0;right:0}
}
@media(max-width:767px){
  /* Mobile: banner nằm ngay dưới header, không bị kéo chui lên dưới header */
  .admio-content:has(.hm){padding-top:0}
  .hm{margin:0 calc(var(--cp,0px) * -1) 8px}
  .hm-banner{max-width:none;margin:var(--hm-fix,0px) 0 0;padding:0;border-radius:0 0 8px 8px;overflow:hidden;background:#fdf2f8}
  .hm-bn-track{border-radius:0}
  .hm-bn-bar{left:0;right:0;bottom:10px}
}

/* ---------- 2. 4 nút màu, chia 2 trang, vuốt ngang ---------- */
.hm-cards{margin-top:30px}
.hm-cd-track{position:relative;display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;padding-bottom:6px;margin-bottom:-6px}
.hm-cd-track::-webkit-scrollbar{display:none}
.hm-cd-page{flex:0 0 100%;scroll-snap-align:start;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.hm-cd{position:relative;display:flex;align-items:center;gap:12px;min-width:0;min-height:90px;padding:12px 14px;border-radius:8px;color:#fff;text-decoration:none;overflow:hidden;background:linear-gradient(135deg,var(--a),var(--b));box-shadow:none;transition:transform .18s}
.hm-cd:hover{color:#fff;transform:translateY(-2px)}
.hm-cd:active{transform:scale(.98)}
.hm-cd::after{display:none}
.hm-cd-ic{flex:0 0 auto;display:grid;place-items:center;width:40px;height:40px;border-radius:8px;background:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.35);line-height:1}
.hm-cd-ic .iconify{width:20px;height:20px}
.hm-cd-tx{min-width:0;position:relative;z-index:1}
.hm-cd-tx strong{display:block;font-size:15px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;line-height:1.25}
.hm-cd-tx span{display:block;margin-top:3px;font-size:12.5px;font-weight:500;line-height:1.4;opacity:.95}

/* chấm phân trang dạng thanh */
.hm-dots{display:flex;justify-content:center;gap:8px;margin-top:18px}
.hm-dots button{width:20px;height:4px;border:0;padding:0;border-radius:4px;background:#dcdfe3;cursor:pointer;transition:width .25s,background .25s}
.hm-dots button.on{width:35px;background:var(--tc,#f472b6)}
[data-theme="dark"] .hm-dots button{background:#3a3a48}

/* PC/tablet đủ chỗ → 4 nút cùng một hàng, bỏ vuốt + ẩn chấm */
@media(min-width:768px){
  .hm-cd-track{position:static;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;overflow:visible;padding-bottom:0;margin-bottom:0}
  .hm-cd-page{display:contents}
  .hm-dots{display:none}
  .hm-cd{min-height:96px;padding:14px 16px}
  .hm-cd-ic{width:44px;height:44px}
  .hm-cd-ic .iconify{width:22px;height:22px}
  .hm-cd-tx strong{font-size:16px}
  .hm-cd-tx span{font-size:13px}
}
@media(max-width:380px){
  .hm-cd{min-height:80px;gap:10px;padding:10px 12px}
  .hm-cd-ic{width:36px;height:36px}
  .hm-cd-ic .iconify{width:18px;height:18px}
  .hm-cd-tx strong{font-size:14px}
  .hm-cd-tx span{font-size:11.5px}
}

/* ---------- 3. Thanh thông báo HOT ---------- */
.hm-notice{--nt:#f472b6;position:relative;display:flex;align-items:center;gap:6px;margin-top:16px;padding:5px;min-height:48px;border-radius:999px;
  background:#fff;border:0;box-shadow:none;overflow:hidden}
.hm-nt-lb{position:relative;z-index:2;flex:0 0 auto;display:flex;align-items:center;gap:7px;height:38px;padding:0 16px 0 11px;border-radius:999px;color:#fff;
  font-size:13px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;
  background:#db2777;background:linear-gradient(135deg,#be185d 0%,#f472b6 100%);
  box-shadow:none}
.hm-nt-lb .iconify{width:20px;height:20px;color:#fff;transform-origin:50% 90%;animation:hmFire 1.6s ease-in-out infinite}
@keyframes hmFire{0%,100%{transform:scale(1) rotate(-3deg)}50%{transform:scale(1.14) rotate(4deg)}}
.hm-nt-mq{position:relative;flex:1 1 0;min-width:0;display:flex;align-items:center;overflow:hidden;
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 22px,#000 calc(100% - 28px),transparent 100%);mask-image:linear-gradient(90deg,transparent 0,#000 22px,#000 calc(100% - 28px),transparent 100%)}
.hm-nt-track{display:flex;align-items:center;width:max-content;animation:hmMarq var(--mq,30s) linear infinite}
.hm-notice:hover .hm-nt-track{animation-play-state:paused}
.hm-nt-item{display:inline-flex;align-items:center;white-space:nowrap;padding-right:44px;font-size:13.5px;font-weight:500;color:#3a3d44;text-decoration:none;position:relative}
.hm-nt-item::after{content:"";position:absolute;right:19px;top:50%;width:6px;height:6px;margin-top:-3px;border-radius:2px;transform:rotate(45deg);
  background:#f472b6}
.hm-nt-item em{font-style:normal;display:inline-block;margin:0 5px;padding:1px 8px;border-radius:999px;font-size:.92em;font-weight:700;line-height:1.5;
  color:#be185d;background:#fdf2f8}
a.hm-nt-item:hover{color:#be185d}
@keyframes hmMarq{from{transform:translateX(0)}to{transform:translateX(-50%)}}
[data-theme="dark"] .hm-notice{background:#1e1e2a}
[data-theme="dark"] .hm-nt-item{color:#e6e6ee}
[data-theme="dark"] .hm-nt-item em{color:#f472b6;background:#be185d}
@media(min-width:768px){
  .hm-notice{min-height:54px;padding:6px}
  .hm-nt-lb{height:40px;font-size:14px;padding:0 20px 0 14px}
  .hm-nt-item{font-size:14.5px}
}
@media(prefers-reduced-motion:reduce){.hm-nt-track,.hm-nt-lb .iconify{animation:none}.hm-bn-slide,.hm-bn-slide.on{transition:none;transform:none}}

