/* =========================================================
   AZPOS Frontpage — CSS scoped trong .azpos-frontpage
   Tất cả selector đều có .azpos-frontpage làm ancestor
   → Không xung đột với style.css chính của theme
   Brand: #124fb5 primary blue · #ff711b accent orange
   ========================================================= */

/* ---------- 1. CSS Variables (scoped) ---------- */
.azpos-frontpage {
  --c-primary: #124fb5;
  --c-primary-dark: #0c3d8e;
  --c-primary-light: #e6f1fb;
  --c-accent: #ff711b;
  --c-accent-light: #fff4ec;
  --c-accent-dark: #c2530c;
  --c-sale: #dc2626;
  --c-text: #0f172a;
  --c-text-soft: #475569;
  --c-text-mute: #94a3b8;
  --c-border: #e2e8f0;
  --c-border-soft: #f1f5f9;
  --c-bg: #ffffff;
  --c-bg-soft: #f8fafc;
  --c-bg-section: #f5f7fb;
  --c-yellow: #fff7ed;

  --container: 1200px;
  --gap: 16px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  font-family: var(--azp-font-system, "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  font-size: 15px;
  line-height: 1.55;
  color: var(--c-text);
}

/* ---------- 2. Reset selective trong scope ---------- */
.azpos-frontpage * { box-sizing: border-box; }
.azpos-frontpage img { max-width: 100%; height: auto; display: block; }
.azpos-frontpage a { color: inherit; text-decoration: none; }
.azpos-frontpage button { font: inherit; cursor: pointer; border: 0; background: none; }
.azpos-frontpage ul { list-style: none; margin: 0; padding: 0; }
.azpos-frontpage h1,
.azpos-frontpage h2,
.azpos-frontpage h3,
.azpos-frontpage h4 { margin: 0; padding: 0; }
.azpos-frontpage p { margin: 0; }

.azpos-frontpage .container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- 5. Hero ---------- */
.azpos-frontpage .az-hero {
  background: transparent; /* anh yêu cầu bỏ màu nền (cả desktop + mobile) */
  padding: 24px 0;
}

/* === HERO BANNER LỚN (TGDĐ-style) ===
   Banner giữ TỈ LỆ GỐC của ảnh anh upload — không crop 2 bên.
   Ảnh tự co theo width container (responsive thuần). */
.azpos-frontpage .az-hero__banner {
  display: block;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--c-primary-light);
  box-shadow: 0 6px 20px rgba(13, 78, 168, .08);
  transition: box-shadow .25s ease, transform .25s ease;
  /* Không set aspect-ratio cứng → ảnh giữ tỉ lệ thật, không bị cắt 2 bên */
  line-height: 0; /* loại trừ baseline gap dưới <img> */
}
.azpos-frontpage .az-hero__banner:hover {
  box-shadow: 0 12px 28px rgba(13, 78, 168, .14);
  transform: translateY(-2px);
}
.azpos-frontpage .az-hero__banner-img {
  display: block;
  width: 100%;
  height: auto;          /* tự co theo tỉ lệ ảnh gốc */
  max-width: 100%;
  object-fit: contain;
  object-position: center;
}

/* ===== Hero giờ là 1 banner big duy nhất (xem .az-hero__banner ở trên).
       Toàn bộ class .az-hero__grid, .az-hero__main, .az-hero__pre, .az-hero__title,
       .az-hero__sub, .az-hero__cta, .az-hero__side, .az-hero__visual, .az-hero__image
       đã được xoá vì không dùng nữa. ===== */

.azpos-frontpage .az-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  transition: transform .18s ease, box-shadow .18s ease, background .15s ease;
  white-space: nowrap;
}
.azpos-frontpage .az-btn:hover {
  transform: translateY(-2px);
}

/* Primary (CAM) — gradient + shadow nổi để CTA "pop" trên nền xanh */
.azpos-frontpage .az-btn--primary {
  background: linear-gradient(135deg, #ff8a3d 0%, #ff711b 50%, #ea5f0c 100%);
  color: #fff;
  box-shadow:
    0 4px 14px rgba(255, 113, 27, .42),
    inset 0 1px 0 rgba(255, 255, 255, .25);
}
.azpos-frontpage .az-btn--primary:hover {
  box-shadow:
    0 8px 22px rgba(255, 113, 27, .55),
    inset 0 1px 0 rgba(255, 255, 255, .3);
}

/* Ghost (TRẮNG) — dùng cho combo, banner CTA, etc. */
.azpos-frontpage .az-btn--ghost {
  background: #fff;
  color: var(--c-primary);
  border: 1px solid var(--c-border-soft);
}
.azpos-frontpage .az-btn--ghost:hover {
  border-color: var(--c-primary);
  background: var(--c-primary-light);
}

.azpos-frontpage .az-btn--block { display: flex; width: 100%; justify-content: center; }

/* ---------- 6. Catstrip + Slider ---------- */
.azpos-frontpage .az-catstrip {
  background: #fff;
  padding: 15px 0 0px;
}
.azpos-frontpage .az-catstrip__wrap {
  position: relative;
}
.azpos-frontpage .az-catstrip__scroll {
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.azpos-frontpage .az-catstrip__scroll::-webkit-scrollbar { display: none; }
.azpos-frontpage .az-catstrip__grid {
  display: flex;
  gap: 12px;
  padding: 4px 0;
}
.azpos-frontpage .az-catstrip__item {
  flex: 0 0 calc((100% - 84px) / 8);
  scroll-snap-align: start;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border-soft);
  border-radius: var(--radius-md);
  text-align: center;
  transition: all .2s;
}
/* Hover NHẸ NHÀNG: chỉ đổi border + nâng nhẹ 1px, KHÔNG đổi background, KHÔNG biến icon */
.azpos-frontpage .az-catstrip__item:hover {
  border-color: var(--c-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(18, 79, 181, 0.08);
}
/* Icon wrapper — KHÔNG nền, KHÔNG bo tròn, để ảnh hiển thị nguyên bản */
.azpos-frontpage .az-catstrip__icon {
  width: 80px;
  height: 80px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}
.azpos-frontpage .az-catstrip__icon img {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: contain;
}
/* ĐÃ BỎ: hover state đổi background icon thành primary + scale + filter invert (icon trắng).
   Icon giữ nguyên màu gốc khi rê chuột — chỉ card có hiệu ứng nhẹ nhàng. */
.azpos-frontpage .az-catstrip__name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--c-text);
  line-height: 1.3;
}

.azpos-frontpage .az-catstrip__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  color: var(--c-primary);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: background-color .15s, border-color .15s, transform .12s, opacity .15s;
  line-height: 1;
  padding: 0;
}
.azpos-frontpage .az-catstrip__wrap.has-scroll .az-catstrip__nav {
  display: inline-flex;
}
.azpos-frontpage .az-catstrip__nav:hover:not(.is-disabled) {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  transform: translateY(-50%) scale(1.06);
}
.azpos-frontpage .az-catstrip__nav.is-disabled { opacity: .35; cursor: not-allowed; }
.azpos-frontpage .az-catstrip__nav--prev { left: -14px; }
.azpos-frontpage .az-catstrip__nav--next { right: -14px; }

/* ---------- 7. Trust strip ---------- */
.azpos-frontpage .az-trust {
  background: var(--c-yellow);
  padding: 14px 0;
  border-top: 1px solid #fed7aa;
  border-bottom: 1px solid #fed7aa;
}
.azpos-frontpage .az-trust__list {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--c-accent-dark);
}
.azpos-frontpage .az-trust__list strong { color: var(--c-accent); font-size: 15px; }

/* ---------- 8. Section common ---------- */
.azpos-frontpage .az-section {
  padding: 10px 0;
}
/* Margin top cho main content trang chủ — desktop sát đầu (0px) vì header
   không còn sticky ở desktop, mobile đẩy xuống 70px tránh header mobile che.
   Selector chạm body class vì <main#main> nằm NGOÀI .azpos-frontpage. */
body.home main#main,
body.page-template-template-frontpage main#main {
  margin-top: 0px;
}
@media (max-width: 849px) {
  body.home main#main,
  body.page-template-template-frontpage main#main {
    margin-top: 70px;
  }
}
.azpos-frontpage .az-section--soft {
  background: var(--c-bg-section);
}
.azpos-frontpage .az-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}
/* ============================================================
   SECTION TITLE — TGDĐ style (1 dòng, sạch, gọn)
   ------------------------------------------------------------
   - Title bold đậm, 20px, 1 dòng — không decoration
   - Icon emoji giữ inline nhỏ gọn (không khung)
   - Subtitle ẨN hoàn toàn (anh đã yêu cầu bỏ)
   ============================================================ */
.azpos-frontpage .az-section__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
/* Bỏ icon emoji trong title — anh yêu cầu ẩn hoàn toàn */
.azpos-frontpage .az-section__title .icon {
  display: none !important;
}
/* Bỏ subtitle — anh không cần mô tả */
.azpos-frontpage .az-section__sub {
  display: none !important;
}
.azpos-frontpage .az-section__viewall {
  font-size: 14px;
  color: var(--c-primary);
  font-weight: 500;
  white-space: nowrap;
}

/* ---------- 9. Product grid ---------- */
.azpos-frontpage .az-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.azpos-frontpage .az-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ---------- Helper render output (BEM) — dùng cho azpos_fp_render_card() ---------- */
/* Bỏ subtitle — anh đã yêu cầu ẩn hoàn toàn cho mọi section */
.azpos-frontpage .az-section__subtitle {
  display: none !important;
}
.azpos-frontpage .az-section__empty {
  text-align: center;
  padding: 24px;
  color: var(--c-text-soft);
  font-style: italic;
}
.azpos-frontpage .az-grid--products {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.azpos-frontpage .az-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.azpos-frontpage .az-card:hover {
  box-shadow: 0 8px 20px rgba(13, 78, 168, .1);
  transform: translateY(-2px);
  border-color: var(--c-primary-light);
}
.azpos-frontpage .az-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f8fafc;
  overflow: hidden;
}
.azpos-frontpage .az-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s;
}
.azpos-frontpage .az-card:hover .az-card__img {
  transform: scale(1.04);
}
.azpos-frontpage .az-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  z-index: 2;
  letter-spacing: .3px;
}
.azpos-frontpage .az-card__badge--sale  { background: var(--c-sale, #dc2626); }
.azpos-frontpage .az-card__badge--hot   { background: #ff711b; left: auto; right: 8px; }
.azpos-frontpage .az-card__body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.azpos-frontpage .az-card__title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--c-text);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.azpos-frontpage .az-card__price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}
.azpos-frontpage .az-card__price-now {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-sale, #dc2626);
}
.azpos-frontpage .az-card__price-old {
  font-size: 12.5px;
  color: var(--c-text-soft);
  text-decoration: line-through;
}
.azpos-frontpage .az-card__price-now bdi { font-weight: inherit; }
.azpos-frontpage .az-card__price-old bdi { font-weight: inherit; }

/* Responsive cho .az-grid--products */
@media (max-width: 1024px) {
  .azpos-frontpage .az-grid--products { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
  .azpos-frontpage .az-grid--products { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 540px) {
  .azpos-frontpage .az-grid--products { grid-template-columns: repeat(2, 1fr); }
  .azpos-frontpage .az-card__title { font-size: 12.5px; min-height: 34px; }
  .azpos-frontpage .az-card__price-now { font-size: 14px; }

  /* Ẩn sản phẩm thứ 5+ trên mobile (limit=5 → 4 hàng chẵn 2 cột × 2 dòng).
     User vẫn click "Xem tất cả →" để xem hết. */
  .azpos-frontpage .az-grid--products > *:nth-child(n+5) {
    display: none !important;
  }
}

/* ---------- Product card (LEGACY: dùng cho .az-product, các section sau) ---------- */
.azpos-frontpage .az-product {
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.azpos-frontpage .az-product:hover {
  box-shadow: 0 8px 20px rgba(13, 78, 168, .1);
  transform: translateY(-2px);
  border-color: var(--c-primary-light);
}
.azpos-frontpage .az-product__image {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--c-bg-soft);
  overflow: hidden;
}
.azpos-frontpage .az-product__image img {
  width: 100%; height: 100%; object-fit: cover;
}
.azpos-frontpage .az-product__badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--c-sale);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}
.azpos-frontpage .az-product__badge--hot { background: var(--c-accent); }
.azpos-frontpage .az-product__badge--new { background: #16a34a; }
.azpos-frontpage .az-product__body {
  padding: 12px;
}
.azpos-frontpage .az-product__title {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--c-text);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.azpos-frontpage .az-product__price-old {
  display: inline-block;
  font-size: 12px;
  color: var(--c-text-mute);
  text-decoration: line-through;
  margin-right: 6px;
}
.azpos-frontpage .az-product__price-new {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  color: var(--c-sale);
}
.azpos-frontpage .az-product__gift {
  display: block;
  font-size: 11.5px;
  color: var(--c-accent-dark);
  background: var(--c-accent-light);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
  font-weight: 500;
}

/* ---------- 10. Combo card ---------- */
.azpos-frontpage .az-combo {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.azpos-frontpage .az-combo:hover {
  box-shadow: 0 8px 24px rgba(13, 78, 168, .12);
  transform: translateY(-3px);
}
.azpos-frontpage .az-combo__image {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--c-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.azpos-frontpage .az-combo__tag {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--c-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}
.azpos-frontpage .az-combo__body {
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.azpos-frontpage .az-combo__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 10px;
}
.azpos-frontpage .az-combo__items {
  font-size: 13px;
  color: var(--c-text-soft);
  margin-bottom: 14px;
  flex: 1;
}
.azpos-frontpage .az-combo__items li {
  padding: 3px 0 3px 18px;
  position: relative;
  line-height: 1.4;
}
.azpos-frontpage .az-combo__items li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--c-primary);
  font-weight: 700;
}
.azpos-frontpage .az-combo__price {
  margin-bottom: 12px;
}
.azpos-frontpage .az-combo__price-new {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--c-sale);
}
.azpos-frontpage .az-combo__price-old {
  display: block;
  font-size: 13px;
  color: var(--c-text-mute);
  text-decoration: line-through;
  margin-top: 2px;
}

/* ---------- 11. Banner ngang ---------- */
.azpos-frontpage .az-banner-h {
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.azpos-frontpage .az-banner-h--blue {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
}
.azpos-frontpage .az-banner-h h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff !important;
}
.azpos-frontpage .az-banner-h p {
  font-size: 14px;
  color: #fff;
  opacity: 1;
  line-height: 1.5;
  margin: 0;
}
.azpos-frontpage .az-banner-h .az-btn {
  background: #fff;
  color: var(--c-accent-dark);
  flex-shrink: 0;
}
.azpos-frontpage .az-banner-h--blue .az-btn { color: var(--c-primary-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .azpos-frontpage .az-grid-5 { grid-template-columns: repeat(4, 1fr); }
  .azpos-frontpage .az-catstrip__item {
    flex: 0 0 calc((100% - 48px) / 5);
  }
}
@media (max-width: 900px) {
  .azpos-frontpage .az-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .azpos-frontpage .az-grid-5 { grid-template-columns: repeat(3, 1fr); }
  /* Banner mobile: bo góc nhỏ hơn cho hài hoà */
  .azpos-frontpage .az-hero__banner { border-radius: var(--radius-md); }
}
@media (max-width: 640px) {
  .azpos-frontpage .az-section__title { font-size: 17px; }
  .azpos-frontpage .az-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .azpos-frontpage .az-grid-4 { grid-template-columns: 1fr; }

  /* Ẩn item thứ 5+ trong .az-grid-5 trên mobile (combo / section sản phẩm cũ).
     Tránh hàng cuối lẻ (2+2+1) → giữ 4 item chẵn 2 hàng. */
  .azpos-frontpage .az-grid-5 > *:nth-child(n+5) {
    display: none !important;
  }
  .azpos-frontpage .az-catstrip__item { flex: 0 0 calc((100% - 30px) / 3.5); }
  .azpos-frontpage .az-catstrip__icon { width: 48px; height: 48px; }
  .azpos-frontpage .az-catstrip__icon img { width: 44px; height: 44px; }
  .azpos-frontpage .az-catstrip__nav { width: 32px; height: 32px; font-size: 18px; }
  .azpos-frontpage .az-catstrip__nav--prev { left: -6px; }
  .azpos-frontpage .az-catstrip__nav--next { right: -6px; }
  .azpos-frontpage .az-trust__list { font-size: 12px; }
  .azpos-frontpage .az-banner-h { flex-direction: column; align-items: stretch; text-align: center; }
}
