/* ==========================================================================
   Sunme — Hero (G2; G5F: dựng lại nửa phải theo DIWE)
   Nền tối (ảnh thành phố đỏ + lớp phủ), 3 slide Swiper, cụm ảnh phải:
   cutout người phụ nữ + laptop (trong suốt) trên đĩa hồng CSS,
   3 thẻ nổi: donut phải, pill subs giữa-trái, cụm avatar 28+ dưới-phải.
   H1 40px/700/chữ thường/LH 1.2 (mobile 28px qua token --fs-hero).
   KHÔNG chứa @media — mọi breakpoint nằm trong responsive.css.
   ========================================================================== */

.sunme-hero {
  background-color: var(--red-deep);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* Lớp phủ tối trên ảnh nền (giữ đúng màu đợt 1). */
.sunme-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--hero-overlay);
}

.sunme-hero .sunme-container {
  position: relative;
  z-index: 1;
}

.sunme-hero-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--space-40);
  align-items: center;
}

/* Grid item mặc định min-width: auto (bằng min-content) sẽ làm Swiper
   phình tới giới hạn layout của trình duyệt (đo được 33,5 triệu px):
   cho phép cả 2 cột co lại dưới min-content. */
.sunme-hero-grid > * {
  min-width: 0;
}

/* --- Slider trái --- */
.sunme-hero-slider {
  overflow: hidden;
  width: 100%;
}

.sunme-hero-title {
  font-size: var(--fs-hero);
  font-weight: 700;
  line-height: var(--lh-h1);
  /* Slide 1 dùng <h1>, slide 2-3 dùng <h2>: đặt tracking riêng ở class
     để cả 3 slide giống hệt nhau (không lệch -0.015em/-0.01em theo tag). */
  letter-spacing: var(--ls-h1);
  color: var(--white);
  margin: 0 0 var(--space-16);
  text-wrap: balance;
}

.sunme-hero-slide p {
  /* G5 (lệnh 12:04): body trên nền tối = trắng mờ .75, cùng nguyên tắc
     phân tầng như --ink-body trên nền sáng. */
  color: var(--white-75);
  font-size: var(--fs-lead);
  line-height: var(--lh-body);
  margin: 0 0 var(--space-12);
  max-width: 520px;
}

.sunme-hero-slide p:last-of-type {
  margin-bottom: 0;
}

.sunme-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
  margin-top: var(--space-24);
}

/* --- Điều hướng slider: dots + prev/next (44x44, plan 4.4) --- */
.sunme-hero-nav {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  margin-top: var(--space-32);
}

.sunme-hero-pagination {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

/* Swiper tự gắn class .swiper-pagination-bullets.swiper-pagination-horizontal
   vào dots, kèm rule width: 100% của nó — ghi đè về auto (cần đủ specificity
   0,2,0 mới thắng rule của Swiper) để dots không chiếm hết hàng nav. */
.sunme-hero-pagination.swiper-pagination-bullets {
  position: static;
  width: auto;
}

/* Ghi đè style mặc định của Swiper cho dots (dùng button riêng). */
.sunme-hero-pagination .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  margin: 0;
  background-color: var(--white);
  opacity: .4;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.sunme-hero-pagination .swiper-pagination-bullet-active {
  opacity: 1;
  transform: scale(1.25);
}

.sunme-hero-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border-on-dark);
  border-radius: var(--radius-circle);
  background-color: transparent;
  color: var(--white);
  cursor: pointer;
  transition: background-color var(--transition-base), border-color var(--transition-base);
}

.sunme-hero-nav-btn:hover {
  background-color: var(--white-12);
  border-color: var(--white);
}

.sunme-hero-nav-btn .lucide {
  width: 20px;
  height: 20px;
}

/* --- Hàng link dưới hero: Hồ sơ năng lực / Facebook / Zalo / hotline --- */
.sunme-hero-social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-24);
  margin-top: var(--space-32);
  padding-top: var(--space-24);
  border-top: 1px solid var(--line-on-dark);
}

.sunme-hero-social a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  color: var(--text-on-dark);
  font-weight: 600;
  font-size: var(--fs-small);
  text-decoration: none;
  transition: color var(--transition-base);
}

.sunme-hero-social a:hover {
  color: var(--white);
  text-decoration: none;
}

.sunme-hero-social .lucide {
  width: 17px;
  height: 17px;
}

.sunme-hero-social .sunme-hero-hotline {
  color: var(--white);
  font-weight: 700;
  font-size: var(--fs-body);
  white-space: nowrap;
}

/* --- Cụm ảnh phải (G5F): cutout người + đĩa hồng + 3 thẻ nổi ---
   Không còn khung bo góc chứa ảnh gộp: ảnh cũ hero-bg-clean.webp chứa
   3 mảng đen (nền đen của thẻ gắn sẵn trong PSD). Cutout trong suốt
   đứng trực tiếp trên nền hero, đĩa hồng CSS phía sau tách người
   khỏi nền tối. Tỉ lệ khung = tỉ lệ cutout 856x976. */
.sunme-hero-visual {
  position: relative;
  aspect-ratio: 856 / 976;
  width: 100%;
  max-width: 520px;
  margin-left: auto;
}

.sunme-hero-woman {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  /* 30/11: anh moi tu can khung (mat 51%, dia o giua) nen khong dich
     chuyen nua — bo -13.5% G6T2. */
  /* Mờ dần 12% dưới cùng: che đường cắt chéo của cutout PSD,
     người hòa vào nền hero thay vì kết thúc bằng cạnh thẳng. */
  -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
}

/* 30/11 (Lobe, demo v3): desktop phong anh +22% ve ben trai — khu vuc
   tren-phai hero con trong, mat co gai vao vi tri khoanh do (1011,314),
   ho donut 56px. Chi desktop: tablet/mobile giu nguyen nhu v2 (khong
   transform) vi khung hinh nho hon, scale se tran va cham chu. */
@media (min-width: 1025px) {
  .sunme-hero-woman {
    transform: translate(-55px, -36px) scale(1.22);
  }
}

.sunme-hero-card {
  position: absolute;
  z-index: 2;
  will-change: transform;
}

.sunme-hero-card img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(var(--shadow-float));
}

/* G7-audit (01/12): entrance chỉ FADE (opacity), không trượt.
   Trước đây title bay từ -2000px (đo translateY tới -1899px) nên đỉnh
   chữ bị cắt, mô tả 2 slide bay ngang (±2000px) chồng nhau.
   Nay: slide cũ mờ dần 0.35s khi mất .swiper-slide-active, slide mới
   fade vào TUẦN TỰ (title -> desc 1 -> desc 2 -> CTA) sau khi slide
   cũ đã mờ hẳn, không crossfade đồng thời. Tốc độ autoplay (5000ms)
   và rewind KHÔNG đổi (quyết định của Lobe). */
@keyframes sunme-hero-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sunme-hero-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Slide không active: nội dung mờ dần (không hiện đồng thời với
   slide mới). Transition trên opacity để lúc mất active thì mờ êm
   0.35s thay vì biến mất ngay. */
.sunme-hero-slide .sunme-hero-title,
.sunme-hero-slide > p,
.sunme-hero-slide .sunme-hero-cta {
  transition: opacity 350ms ease;
}

.sunme-hero-slide:not(.swiper-slide-active) .sunme-hero-title,
.sunme-hero-slide:not(.swiper-slide-active) > p,
.sunme-hero-slide:not(.swiper-slide-active) .sunme-hero-cta {
  opacity: 0;
}

.sunme-hero-slide.swiper-slide-active .sunme-hero-title {
  animation: sunme-hero-fade 700ms ease 400ms both;
}

.sunme-hero-slide.swiper-slide-active > p:first-of-type {
  animation: sunme-hero-fade 700ms ease 550ms both;
}

.sunme-hero-slide.swiper-slide-active > p:nth-of-type(2) {
  animation: sunme-hero-fade 700ms ease 700ms both;
}

.sunme-hero-slide.swiper-slide-active .sunme-hero-cta {
  animation: sunme-hero-in-up 700ms ease 850ms both;
}

/* G5E: DIWE nút hero transition 300ms cubic-bezier(.4,0,.2,1). */
.sunme-hero-cta .sunme-btn {
  transition: background-color 300ms cubic-bezier(.4, 0, .2, 1),
    transform 300ms cubic-bezier(.4, 0, .2, 1),
    box-shadow 300ms cubic-bezier(.4, 0, .2, 1),
    color 300ms cubic-bezier(.4, 0, .2, 1),
    border-color 300ms cubic-bezier(.4, 0, .2, 1);
}

/* G5F: donut góc phải-trên, pill subs giữa-trái (theo mẫu DIWE).
   G5S (Lobe 24/11): CẢ 3 cụm đều lơ lửng — donut giữ 4.2s/.4s, subs
   3.6s/1.1s, avatars 3s/.7s (tham số DIWE hu__hu__ 3/3.6/4.2s):
   thời lượng + độ trễ khác nhau nên 3 cụm không di chuyển đồng bộ.
   G6T (Lobe 28/11): lưới 2×2 — 4 cụm căn thẳng hàng theo TÂM (đường đỏ
   trong ảnh mẫu của Lobe đi qua tâm các card, không phải mép): hàng trên
   AI + donut cùng tâm dọc, hàng dưới subs + avatars cùng tâm dọc, cột
   trái AI + subs cùng tâm ngang, cột phải donut + avatars cùng tâm ngang
   (donut right:7% = avatars right:7% nên cả mép phải lẫn tâm đều thẳng).
   Số đo ở desktop (visual 520×593, aspect 856/976 cố định nên % giữ
   đúng khi thu nhỏ): AI 16% ở left:7%/top:7%, donut 27% right:7%/top:0,
   subs 34% left:-2%/top:82% (căn theo tâm PILL — phần trắng trên của
   ảnh, không phải tâm khung). Icon AI là ẢNH, không phải card code.
   LƯU Ý: mỗi cụm vẫn lơ lửng ±15px với nhịp khác nhau (DIWE), nên trong
   một khung hình tĩnh các tâm có thể lệch nhau vài px — vị trí tĩnh
   (lúc nghỉ) mới thẳng hàng tuyệt đối. */
.sunme-hero-card--donut {
  right: 7%;
  top: 0;
  width: 27%;
  animation: sunme-float-sm 4.2s ease-in-out .4s infinite alternate;
}

.sunme-hero-card--ai {
  left: 7%;
  top: 7%;
  width: 16%;
  animation: sunme-float-sm 3.9s ease-in-out .8s infinite alternate;
}

.sunme-hero-card--subs {
  left: -2%;
  top: 82%;
  width: 34%;
  animation: sunme-float-sm 3.6s ease-in-out 1.1s infinite alternate;
}

/* G6N: cụm avatar khách hàng dưới-phải: 3 ảnh chân dung thật chồng nhau
   + huy hiệu 2.500+ khách hàng tin tưởng (số thật). Chữ S-U-N / 28+ nhân
   sự đã bỏ (G5F) vì 3 ảnh này không phải đội ngũ Sunme. */
.sunme-hero-avatars {
  position: absolute;
  z-index: 2;
  /* Lệch vào trong (không sát góc): cụm nút nổi Zalo/gọi fixed ở góc
     phải-dưới viewport sẽ che mất huy hiệu 28+ nếu đặt sát góc. */
  right: 7%;
  bottom: 11%;
  display: flex;
  align-items: center;
  animation: sunme-float-sm 3s ease-in-out .7s infinite alternate;
}

.sunme-hero-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--white);
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  color: var(--white);
  background-color: var(--avatar-bg, var(--red));
}

.sunme-hero-avatar + .sunme-hero-avatar {
  margin-left: -12px;
}

.sunme-hero-avatar--photo {
  object-fit: cover;
  padding: 0;
}

.sunme-hero-avatar--count {
  background-color: var(--white);
  color: var(--red);
  font-size: 10px; /* G6N: "2.500+" đo thực 41px ở 11px, tràn vòng 44px (lòng 40px) — 10px vừa */
}

/* G5E: DIWE ảnh lơ lửng ±15px (hu__hu__ 3/3.6/4.2s ease-in-out). */
@keyframes sunme-float-sm {
  from { transform: translateY(-15px); }
  to { transform: translateY(15px); }
}

/* v1.2.2 — Huy hiệu "MỚI" trong tiêu đề slide hero (slide 4 AI).
   Dùng trong tiêu đề qua <span class="sunme-hero-badge">MỚI</span>;
   sanitizer cho phép span[class] nên lưu qua meta box bình thường.
   Viên vàng + chấm đỏ, ngồi cùng dòng với tiêu đề. */
.sunme-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FBBF24;
  color: #231F1F;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 12px;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}
.sunme-hero-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E30613;
  flex: none;
}
@media (max-width: 767px) {
  .sunme-hero-badge {
    font-size: 13px;
    padding: 6px 10px;
  }
}
