#hfwn-root {
  position: fixed;
  inset: 0;
  z-index: var(--hfwn-z, 999999);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Arial, sans-serif;
  transition: opacity .28s ease, visibility .28s ease;
}
#hfwn-root.hfwn-visible {
  opacity: 1;
  visibility: visible;
}
#hfwn-root.hfwn-bottom_left,
#hfwn-root.hfwn-bottom_right,
#hfwn-root.hfwn-top_left,
#hfwn-root.hfwn-top_right,
#hfwn-root.hfwn-center {
  align-items: center;
  justify-content: center;
}
.hfwn-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 25, 10, .55);
  backdrop-filter: blur(8px) saturate(1.04);
  -webkit-backdrop-filter: blur(8px) saturate(1.04);
  transition: opacity .34s ease;
}
#hfwn-root.hfwn-visible .hfwn-backdrop { opacity: 1; }

.hfwn-card {
  position: relative;
  z-index: 1;
  width: clamp(720px, var(--hfwn-width, 800px), 860px);
  max-width: calc(100vw - 48px);
  min-height: 260px;
  display: grid;
  grid-template-columns: clamp(180px, var(--hfwn-img, 206px), 220px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  padding: 22px;
  color: #172617;
  pointer-events: auto;
  overflow: hidden;
  isolation: isolate;
  border-radius: clamp(28px, var(--hfwn-radius, 32px), 36px);
  border: 1px solid rgba(255,255,255,.55);
  background:
    radial-gradient(circle at 95% 90%, rgba(255,170,20,.30), transparent 28%),
    radial-gradient(circle at 80% 100%, rgba(120,220,50,.18), transparent 35%),
    linear-gradient(135deg, rgba(255,255,245,.96), rgba(238,255,222,.92));
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  box-shadow:
    0 30px 80px rgba(0,0,0,.28),
    0 0 0 1px rgba(255,255,255,.55),
    0 0 45px rgba(155,220,85,.28);
  transform: translateY(22px) scale(.965);
  opacity: 0;
  transition: transform .56s cubic-bezier(.16,.92,.25,1), opacity .36s ease, filter .36s ease;
}
.hfwn-card::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -32px;
  height: 72px;
  z-index: -1;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(123,217,87,.36), transparent 72%);
  filter: blur(14px);
}
.hfwn-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(112deg, transparent 0 14%, rgba(255,255,255,.42) 24%, transparent 38% 100%);
  transform: translateX(-120%);
  animation: hfwn-glint 4.2s ease-in-out infinite;
}
.hfwn-card.hfwn-in { transform: translateY(0) scale(1); opacity: 1; }
.hfwn-card.hfwn-out { transform: translateY(18px) scale(.97); opacity: 0; filter: blur(2px); }
.hfwn-clickable { cursor: pointer; }

.hfwn-image {
  width: 100%;
  height: 100%;
  min-height: 210px;
  border-radius: 24px;
  object-fit: cover;
  background: rgba(255,255,255,.45);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 16px 34px rgba(40,80,30,.18);
}
.hfwn-card.hfwn-no-image { grid-template-columns: minmax(0, 1fr); }
.hfwn-card.hfwn-no-image .hfwn-image { display: none; }

.hfwn-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2px 54px 12px 0;
}
.hfwn-premium-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(213,245,191,.75);
  color: #2f6b2d;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.68), 0 10px 22px rgba(75,140,55,.10);
  white-space: nowrap;
}
.hfwn-premium-badge svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.hfwn-headline {
  font-size: clamp(28px, var(--hfwn-font-size, 32px), 34px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.035em;
  color: #172617;
  margin: 0 0 4px;
}
.hfwn-headline strong {
  font-weight: 900;
  color: #102510;
}
.hfwn-headline span {
  color: #445245;
  font-weight: 750;
}
.hfwn-amount {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 14px;
  color: #235f22;
  font-size: clamp(36px, calc(var(--hfwn-font-size, 32px) + 8px), 44px);
  line-height: 1.08;
  font-weight: 950;
  letter-spacing: -.5px;
}
.hfwn-sparkle {
  color: #ffb21a;
  font-size: .72em;
  filter: drop-shadow(0 5px 12px rgba(255,178,26,.36));
}
.hfwn-product-box {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255,255,255,.45);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}
.hfwn-leaf-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(219,248,201,.75);
  color: #2f7a2b;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.74), 0 12px 20px rgba(70,130,40,.12);
}
.hfwn-leaf-icon svg {
  width: 26px;
  height: 26px;
}
.hfwn-product-title {
  color: #193119;
  font-size: 17px;
  line-height: 1.34;
  font-weight: 850;
  letter-spacing: -.01em;
}
.hfwn-product-title a {
  color: inherit;
  text-decoration: none;
}
.hfwn-product-title a:hover { text-decoration: underline; }
.hfwn-time {
  margin-top: 5px;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 500;
}
.hfwn-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 4;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2c5425;
  background: rgba(255,255,255,.75);
  box-shadow: 0 10px 25px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.85);
  cursor: pointer;
  line-height: 1;
  font-size: 26px;
  font-weight: 500;
  padding: 0;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.hfwn-close:hover {
  transform: scale(1.05);
  background: rgba(255,255,255,.92);
  box-shadow: 0 14px 30px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.9);
}
.hfwn-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(1);
  border-radius: 0 0 32px 32px;
  background: linear-gradient(90deg, #7bd957, #ffb21a);
  animation: hfwn-progress var(--hfwn-duration, 5s) linear forwards;
  box-shadow: 0 0 18px rgba(123,217,87,.38);
  z-index: 3;
}

@keyframes hfwn-progress { to { transform: scaleX(0); } }
@keyframes hfwn-glint {
  0%, 64% { transform: translateX(-120%); opacity: 0; }
  75% { opacity: .72; }
  100% { transform: translateX(120%); opacity: 0; }
}

@media (max-width: 782px) {
  #hfwn-root {
    padding: 12px;
    align-items: center;
    justify-content: center;
  }
  .hfwn-backdrop {
    background: rgba(0,25,10,.38);
    backdrop-filter: blur(6px) saturate(1.02);
    -webkit-backdrop-filter: blur(6px) saturate(1.02);
  }
  .hfwn-card {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    min-height: 164px;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border-radius: 24px;
  }
  .hfwn-image {
    min-height: 140px;
    height: 100%;
    border-radius: 18px;
  }
  .hfwn-body {
    justify-content: center;
    padding: 0 32px 8px 0;
  }
  .hfwn-premium-badge {
    gap: 5px;
    margin-bottom: 6px;
    padding: 6px 9px;
    font-size: 9.5px;
    letter-spacing: .25px;
  }
  .hfwn-premium-badge svg {
    width: 13px;
    height: 13px;
  }
  .hfwn-headline {
    margin-bottom: 2px;
    font-size: 18px;
    line-height: 1.22;
    letter-spacing: -.025em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hfwn-amount {
    margin: 2px 0 7px;
    gap: 5px;
    font-size: 25px;
    line-height: 1.05;
    white-space: nowrap;
  }
  .hfwn-product-box {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 9px;
    border-radius: 15px;
  }
  .hfwn-leaf-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }
  .hfwn-leaf-icon svg {
    width: 19px;
    height: 19px;
  }
  .hfwn-product-title {
    font-size: 12.8px;
    line-height: 1.22;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hfwn-time {
    margin-top: 2px;
    font-size: 11.5px;
  }
  .hfwn-close {
    top: 9px;
    right: 9px;
    width: 30px;
    height: 30px;
    font-size: 20px;
  }
  .hfwn-progress { height: 3px; border-radius: 0 0 24px 24px; }
}

@media (max-width: 380px) {
  .hfwn-card { grid-template-columns: 76px minmax(0, 1fr); min-height: 154px; }
  .hfwn-image { min-height: 130px; }
  .hfwn-headline { font-size: 17px; }
  .hfwn-amount { font-size: 23px; }
  .hfwn-product-box { padding: 7px 8px; }
}

/* v1.0.4 — cleaner premium typography */
#hfwn-root {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
.hfwn-headline {
  font-weight: 680;
  letter-spacing: -.028em;
}
.hfwn-headline strong {
  font-weight: 820;
}
.hfwn-headline span {
  font-weight: 620;
}
.hfwn-amount {
  font-weight: 880;
  letter-spacing: -.035em;
}
.hfwn-product-title {
  font-weight: 760;
}
.hfwn-premium-badge {
  font-weight: 760;
}
.hfwn-time {
  font-weight: 520;
}
@media (max-width: 782px) {
  .hfwn-headline { font-weight: 660; letter-spacing: -.018em; }
  .hfwn-headline strong { font-weight: 790; }
  .hfwn-amount { font-weight: 840; }
}

/* v1.0.6 — Small top-left transaction toast, no full-page modal overlay */
#hfwn-root {
  align-items: flex-start;
  justify-content: flex-start;
  padding: var(--hfwn-y, 18px) var(--hfwn-x, 18px);
}
#hfwn-root.hfwn-center {
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#hfwn-root.hfwn-top_left {
  align-items: flex-start;
  justify-content: flex-start;
  padding: var(--hfwn-y, 18px) var(--hfwn-x, 18px);
}
#hfwn-root.hfwn-top_right {
  align-items: flex-start;
  justify-content: flex-end;
  padding: var(--hfwn-y, 18px) var(--hfwn-x, 18px);
}
#hfwn-root.hfwn-bottom_left {
  align-items: flex-end;
  justify-content: flex-start;
  padding: var(--hfwn-y, 18px) var(--hfwn-x, 18px);
}
#hfwn-root.hfwn-bottom_right {
  align-items: flex-end;
  justify-content: flex-end;
  padding: var(--hfwn-y, 18px) var(--hfwn-x, 18px);
}
.hfwn-backdrop {
  display: none !important;
  opacity: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.hfwn-card {
  width: min(var(--hfwn-width, 440px), calc(100vw - 28px));
  max-width: min(560px, calc(100vw - 28px));
  min-height: 0;
  grid-template-columns: clamp(74px, var(--hfwn-img, 92px), 112px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: clamp(18px, var(--hfwn-radius, 22px), 26px);
  border: 1px solid rgba(255,255,255,.66);
  background:
    radial-gradient(circle at 96% 95%, rgba(255,178,26,.24), transparent 31%),
    radial-gradient(circle at 72% 8%, rgba(123,217,87,.20), transparent 34%),
    linear-gradient(135deg, rgba(255,255,246,.96), rgba(238,255,222,.92));
  box-shadow:
    0 18px 42px rgba(0,0,0,.18),
    0 0 0 1px rgba(255,255,255,.55),
    0 0 28px rgba(155,220,85,.22);
  transform: translateY(-10px) translateX(-8px) scale(.985);
}
.hfwn-card.hfwn-in { transform: translateY(0) translateX(0) scale(1); }
.hfwn-card.hfwn-out { transform: translateY(-8px) translateX(-6px) scale(.985); }
.hfwn-card::before {
  left: 14%;
  right: 14%;
  bottom: -28px;
  height: 54px;
  opacity: .85;
}
.hfwn-card::after { opacity: .55; }

.hfwn-image {
  width: clamp(74px, var(--hfwn-img, 92px), 112px);
  height: clamp(74px, var(--hfwn-img, 92px), 112px);
  min-height: 0;
  border-radius: 17px;
  box-shadow: 0 10px 24px rgba(40,80,30,.16);
}
.hfwn-body {
  justify-content: center;
  padding: 0 34px 4px 0;
  min-height: clamp(74px, var(--hfwn-img, 92px), 112px);
}
.hfwn-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  margin: 0 0 5px;
}
.hfwn-premium-badge,
.hfwn-package-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: var(--hfwn-title-size, 10px);
  line-height: 1;
  font-weight: 760;
  letter-spacing: .24px;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 7px 16px rgba(75,140,55,.08);
}
.hfwn-premium-badge {
  margin: 0;
  background: rgba(213,245,191,.76);
  color: #2f6b2d;
}
.hfwn-premium-badge svg,
.hfwn-package-badge svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}
.hfwn-package-badge span,
.hfwn-premium-badge span { overflow: hidden; text-overflow: ellipsis; }
.hfwn-package-dong {
  color: #9a5a18;
  background: linear-gradient(135deg, rgba(255,244,220,.90), rgba(222,151,55,.20));
  border: 1px solid rgba(181,112,34,.18);
}
.hfwn-package-bac {
  color: #586574;
  background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(203,213,225,.40));
  border: 1px solid rgba(100,116,139,.18);
}
.hfwn-package-vang {
  color: #a86b00;
  background: linear-gradient(135deg, rgba(255,248,207,.95), rgba(255,189,46,.28));
  border: 1px solid rgba(245,158,11,.22);
}
.hfwn-package-kimcuong {
  color: #3152b7;
  background: linear-gradient(135deg, rgba(236,252,255,.96), rgba(167,139,250,.24));
  border: 1px solid rgba(99,102,241,.20);
}

.hfwn-headline {
  margin: 0 0 2px;
  font-size: clamp(14px, var(--hfwn-font-size, 16px), 20px);
  line-height: 1.22;
  font-weight: 650;
  letter-spacing: -.018em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hfwn-headline strong { font-weight: 820; }
.hfwn-headline span { font-weight: 600; color: #475447; }
.hfwn-amount {
  margin: 0 0 7px;
  gap: 5px;
  font-size: clamp(21px, calc(var(--hfwn-font-size, 16px) + 7px), 28px);
  line-height: 1.04;
  font-weight: 880;
  letter-spacing: -.032em;
  white-space: nowrap;
}
.hfwn-sparkle { font-size: .66em; }
.hfwn-product-box {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 9px;
  border-radius: 15px;
  background: rgba(255,255,255,.48);
}
.hfwn-leaf-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}
.hfwn-leaf-icon svg {
  width: 18px;
  height: 18px;
}
.hfwn-product-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.hfwn-product-title {
  display: block;
  font-size: 12.6px;
  line-height: 1.18;
  font-weight: 760;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hfwn-time {
  display: block;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.12;
  font-weight: 520;
}
.hfwn-close {
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
  font-size: 0;
  color: #285427;
  background: rgba(255,255,255,.78);
  box-shadow: 0 8px 18px rgba(0,0,0,.11), inset 0 1px 0 rgba(255,255,255,.88);
}
.hfwn-close svg {
  width: 16px;
  height: 16px;
  display: block;
}
.hfwn-progress {
  height: 3px;
  border-radius: 0 0 22px 22px;
}

@media (max-width: 782px) {
  #hfwn-root,
  #hfwn-root.hfwn-top_left,
  #hfwn-root.hfwn-top_right,
  #hfwn-root.hfwn-bottom_left,
  #hfwn-root.hfwn-bottom_right {
    padding: 12px;
  }
  #hfwn-root.hfwn-center { padding: 12px; }
  .hfwn-card {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    min-height: 0;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border-radius: 20px;
  }
  .hfwn-image {
    width: 76px;
    height: 76px;
    min-height: 0;
    border-radius: 15px;
  }
  .hfwn-body {
    min-height: 76px;
    padding: 0 30px 3px 0;
  }
  .hfwn-badge-row { gap: 4px; margin-bottom: 4px; }
  .hfwn-premium-badge,
  .hfwn-package-badge {
    padding: 4px 7px;
    font-size: 8.8px;
    gap: 4px;
  }
  .hfwn-premium-badge svg,
  .hfwn-package-badge svg { width: 10px; height: 10px; }
  .hfwn-headline {
    font-size: 14px;
    line-height: 1.18;
    -webkit-line-clamp: 1;
  }
  .hfwn-amount {
    margin-bottom: 5px;
    font-size: 21px;
  }
  .hfwn-product-box {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 7px;
    padding: 6px 7px;
    border-radius: 13px;
  }
  .hfwn-leaf-icon { width: 28px; height: 28px; border-radius: 9px; }
  .hfwn-leaf-icon svg { width: 16px; height: 16px; }
  .hfwn-product-title { font-size: 11.5px; }
  .hfwn-time { font-size: 10.5px; }
  .hfwn-close { top: 7px; right: 7px; width: 28px; height: 28px; }
  .hfwn-close svg { width: 15px; height: 15px; }
}

@media (max-width: 380px) {
  .hfwn-card { grid-template-columns: 70px minmax(0, 1fr); }
  .hfwn-image { width: 70px; height: 70px; }
  .hfwn-body { min-height: 70px; }
  .hfwn-premium-badge { display: none; }
  .hfwn-headline { font-size: 13.5px; }
  .hfwn-amount { font-size: 20px; }
}


/* v1.0.7 — Compact toast: remove top badge row, align close button with headline, keep content inside image height */
.hfwn-badge-row {
  display: none !important;
}
.hfwn-card {
  width: min(var(--hfwn-width, 430px), calc(100vw - 28px));
  max-width: min(520px, calc(100vw - 28px));
  grid-template-columns: clamp(82px, var(--hfwn-img, 92px), 112px) minmax(0, 1fr);
  gap: 11px;
  padding: 10px;
  align-items: center;
}
.hfwn-image {
  width: clamp(82px, var(--hfwn-img, 92px), 112px);
  height: clamp(82px, var(--hfwn-img, 92px), 112px);
  border-radius: 17px;
}
.hfwn-body {
  height: clamp(82px, var(--hfwn-img, 92px), 112px);
  min-height: 0;
  justify-content: space-between;
  padding: 2px 34px 2px 0;
  box-sizing: border-box;
  overflow: hidden;
}
.hfwn-headline {
  margin: 0;
  padding-right: 2px;
  font-size: clamp(14px, var(--hfwn-font-size, 16px), 19px);
  line-height: 1.12;
  letter-spacing: -.018em;
  -webkit-line-clamp: 1;
}
.hfwn-amount {
  margin: 1px 0 4px;
  font-size: clamp(21px, calc(var(--hfwn-font-size, 16px) + 7px), 27px);
  line-height: 1;
}
.hfwn-product-box {
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 8px;
  border-radius: 14px;
  min-height: 40px;
}
.hfwn-leaf-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}
.hfwn-leaf-icon svg {
  width: 17px;
  height: 17px;
}
.hfwn-product-title {
  font-size: 12.2px;
  line-height: 1.12;
}
.hfwn-time {
  font-size: 10.8px;
  line-height: 1.05;
}
.hfwn-close {
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
}
.hfwn-close svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 782px) {
  .hfwn-card {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 9px;
    padding: 9px;
    border-radius: 19px;
  }
  .hfwn-image {
    width: 72px;
    height: 72px;
    border-radius: 14px;
  }
  .hfwn-body {
    height: 72px;
    padding: 1px 29px 1px 0;
  }
  .hfwn-headline {
    font-size: 13.6px;
    line-height: 1.08;
  }
  .hfwn-amount {
    margin: 0 0 3px;
    font-size: 20px;
  }
  .hfwn-product-box {
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 6px;
    padding: 5px 6px;
    min-height: 34px;
    border-radius: 12px;
  }
  .hfwn-leaf-icon { width: 25px; height: 25px; border-radius: 8px; }
  .hfwn-leaf-icon svg { width: 14px; height: 14px; }
  .hfwn-product-title { font-size: 10.8px; line-height: 1.08; }
  .hfwn-time { font-size: 10px; line-height: 1.02; }
  .hfwn-close { top: 9px; right: 9px; width: 26px; height: 26px; }
  .hfwn-close svg { width: 13px; height: 13px; }
}

@media (max-width: 380px) {
  .hfwn-card { grid-template-columns: 66px minmax(0, 1fr); }
  .hfwn-image { width: 66px; height: 66px; }
  .hfwn-body { height: 66px; padding-right: 27px; }
  .hfwn-headline { font-size: 13px; }
  .hfwn-amount { font-size: 18.5px; }
  .hfwn-product-box { grid-template-columns: 23px minmax(0, 1fr); padding: 4px 5px; min-height: 31px; }
  .hfwn-leaf-icon { width: 23px; height: 23px; }
  .hfwn-product-title { font-size: 10.2px; }
  .hfwn-time { font-size: 9.4px; }
}

/* v1.0.8 — Stack dọc, tránh thanh admin WordPress, hỗ trợ dark mode */
#hfwn-root {
  flex-direction: column;
  gap: 10px;
  align-content: flex-start;
}
#hfwn-root.hfwn-top_left,
#hfwn-root.hfwn-bottom_left {
  align-items: flex-start;
}
#hfwn-root.hfwn-top_right,
#hfwn-root.hfwn-bottom_right {
  align-items: flex-end;
}
#hfwn-root.hfwn-bottom_left,
#hfwn-root.hfwn-bottom_right {
  flex-direction: column-reverse;
}
#hfwn-root.hfwn-center {
  align-items: center;
  justify-content: center;
}
body.admin-bar #hfwn-root.hfwn-top_left,
body.admin-bar #hfwn-root.hfwn-top_right,
body.admin-bar #hfwn-root:not(.hfwn-bottom_left):not(.hfwn-bottom_right):not(.hfwn-center) {
  padding-top: calc(var(--hfwn-y, 18px) + 32px);
}
.hfwn-card {
  flex: 0 0 auto;
  will-change: transform, opacity;
}
.hfwn-headline {
  padding-right: 34px;
}
.hfwn-close {
  top: 11px;
  right: 11px;
}
.hfwn-card.hfwn-in {
  transform: translateY(0) translateX(0) scale(1);
}
.hfwn-card.hfwn-out {
  transform: translateY(-8px) translateX(-4px) scale(.985);
}

#hfwn-root.hfwn-theme-dark .hfwn-card {
  color: #eefbe8;
  border-color: rgba(187, 255, 172, .16);
  background:
    radial-gradient(circle at 96% 95%, rgba(255,178,26,.18), transparent 34%),
    radial-gradient(circle at 74% 10%, rgba(123,217,87,.18), transparent 35%),
    linear-gradient(135deg, rgba(10,31,22,.94), rgba(2,18,12,.94));
  box-shadow:
    0 18px 48px rgba(0,0,0,.38),
    0 0 0 1px rgba(255,255,255,.08),
    0 0 32px rgba(123,217,87,.16);
}
#hfwn-root.hfwn-theme-dark .hfwn-card::after {
  background: linear-gradient(112deg, transparent 0 14%, rgba(184,255,166,.14) 24%, transparent 38% 100%);
}
#hfwn-root.hfwn-theme-dark .hfwn-image {
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
}
#hfwn-root.hfwn-theme-dark .hfwn-headline {
  color: #eaffdf;
}
#hfwn-root.hfwn-theme-dark .hfwn-headline strong {
  color: #ffffff;
}
#hfwn-root.hfwn-theme-dark .hfwn-headline span {
  color: rgba(230,255,222,.76);
}
#hfwn-root.hfwn-theme-dark .hfwn-amount {
  color: #9eff73;
  text-shadow: 0 8px 24px rgba(123,217,87,.16);
}
#hfwn-root.hfwn-theme-dark .hfwn-product-box {
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}
#hfwn-root.hfwn-theme-dark .hfwn-leaf-icon {
  background: rgba(123,217,87,.16);
  color: #a9ff86;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 10px 20px rgba(0,0,0,.18);
}
#hfwn-root.hfwn-theme-dark .hfwn-product-title,
#hfwn-root.hfwn-theme-dark .hfwn-product-title a {
  color: #f3ffe8;
}
#hfwn-root.hfwn-theme-dark .hfwn-time {
  color: rgba(232,255,225,.62);
}
#hfwn-root.hfwn-theme-dark .hfwn-close {
  color: #e9ffdf;
  background: rgba(255,255,255,.13);
  box-shadow: 0 9px 20px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.14);
}
#hfwn-root.hfwn-theme-dark .hfwn-close:hover {
  background: rgba(255,255,255,.20);
}
#hfwn-root.hfwn-theme-dark .hfwn-progress {
  background: linear-gradient(90deg, #99ff6b, #ffb21a);
  box-shadow: 0 0 20px rgba(153,255,107,.28);
}

@media (max-width: 782px) {
  #hfwn-root { gap: 8px; }
  body.admin-bar #hfwn-root.hfwn-top_left,
  body.admin-bar #hfwn-root.hfwn-top_right,
  body.admin-bar #hfwn-root:not(.hfwn-bottom_left):not(.hfwn-bottom_right):not(.hfwn-center) {
    padding-top: calc(12px + 46px);
  }
  .hfwn-headline { padding-right: 31px; }
  .hfwn-close { top: 9px; right: 9px; }
}

/* v1.0.9 — Fix headline bị cắt/đè: title, số tiền và khối sản phẩm tự xếp theo chiều dọc ổn định */
.hfwn-card {
  overflow: visible;
}
.hfwn-body {
  height: auto;
  min-height: clamp(82px, var(--hfwn-img, 92px), 112px);
  justify-content: center;
  gap: 2px;
  overflow: visible;
  padding: 0 36px 0 0;
}
.hfwn-headline {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding-right: 34px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
  line-height: 1.22;
  min-height: 1.22em;
}
.hfwn-amount {
  flex: 0 0 auto;
  margin: 0 0 5px;
  line-height: 1.08;
}
.hfwn-product-box {
  flex: 0 0 auto;
  min-height: 0;
  padding: 6px 8px;
}
.hfwn-close {
  top: 10px;
  right: 10px;
}

@media (max-width: 782px) {
  .hfwn-body {
    height: auto;
    min-height: 72px;
    gap: 1px;
    padding: 0 31px 0 0;
  }
  .hfwn-headline {
    padding-right: 30px;
    line-height: 1.2;
    min-height: 1.2em;
  }
  .hfwn-amount {
    margin: 0 0 4px;
    line-height: 1.05;
  }
  .hfwn-product-box {
    padding: 5px 6px;
  }
  .hfwn-close {
    top: 8px;
    right: 8px;
  }
}

@media (max-width: 380px) {
  .hfwn-body {
    min-height: 66px;
    padding-right: 28px;
  }
  .hfwn-headline {
    padding-right: 28px;
  }
  .hfwn-product-box {
    padding: 4px 5px;
  }
}


/* v1.0.10 — Exact notification corner positions: top-left/top-right/bottom-left/bottom-right */
#hfwn-root {
  box-sizing: border-box;
}
#hfwn-root.hfwn-top_left {
  align-items: flex-start !important;
  justify-content: flex-start !important;
  flex-direction: column !important;
  padding: var(--hfwn-y, 18px) var(--hfwn-x, 18px) !important;
}
#hfwn-root.hfwn-top_right {
  align-items: flex-end !important;
  justify-content: flex-start !important;
  flex-direction: column !important;
  padding: var(--hfwn-y, 18px) var(--hfwn-x, 18px) !important;
}
#hfwn-root.hfwn-bottom_left {
  align-items: flex-start !important;
  justify-content: flex-start !important;
  flex-direction: column-reverse !important;
  padding: var(--hfwn-y, 18px) var(--hfwn-x, 18px) !important;
}
#hfwn-root.hfwn-bottom_right {
  align-items: flex-end !important;
  justify-content: flex-start !important;
  flex-direction: column-reverse !important;
  padding: var(--hfwn-y, 18px) var(--hfwn-x, 18px) !important;
}
#hfwn-root.hfwn-center {
  align-items: center !important;
  justify-content: center !important;
  flex-direction: column !important;
  padding: 24px !important;
}
body.admin-bar #hfwn-root.hfwn-top_left,
body.admin-bar #hfwn-root.hfwn-top_right {
  padding-top: calc(var(--hfwn-y, 18px) + 32px) !important;
}
#hfwn-root.hfwn-top_right .hfwn-card,
#hfwn-root.hfwn-bottom_right .hfwn-card {
  transform: translateY(-10px) translateX(8px) scale(.985);
}
#hfwn-root.hfwn-top_right .hfwn-card.hfwn-in,
#hfwn-root.hfwn-bottom_right .hfwn-card.hfwn-in,
#hfwn-root.hfwn-top_left .hfwn-card.hfwn-in,
#hfwn-root.hfwn-bottom_left .hfwn-card.hfwn-in {
  transform: translateY(0) translateX(0) scale(1);
}
#hfwn-root.hfwn-top_right .hfwn-card.hfwn-out,
#hfwn-root.hfwn-bottom_right .hfwn-card.hfwn-out {
  transform: translateY(-8px) translateX(6px) scale(.985);
}
#hfwn-root.hfwn-bottom_left .hfwn-card,
#hfwn-root.hfwn-bottom_right .hfwn-card {
  transform: translateY(10px) translateX(0) scale(.985);
}
#hfwn-root.hfwn-bottom_right .hfwn-card {
  transform: translateY(10px) translateX(8px) scale(.985);
}
#hfwn-root.hfwn-bottom_left .hfwn-card.hfwn-out {
  transform: translateY(8px) translateX(-4px) scale(.985);
}
#hfwn-root.hfwn-bottom_right .hfwn-card.hfwn-out {
  transform: translateY(8px) translateX(6px) scale(.985);
}
@media (max-width: 782px) {
  #hfwn-root.hfwn-top_left,
  #hfwn-root.hfwn-top_right,
  #hfwn-root.hfwn-bottom_left,
  #hfwn-root.hfwn-bottom_right {
    padding: 12px !important;
  }
  body.admin-bar #hfwn-root.hfwn-top_left,
  body.admin-bar #hfwn-root.hfwn-top_right {
    padding-top: calc(12px + 46px) !important;
  }
}

/* v1.0.11 — Glass stability + rounded progress clipping
   Giữ lớp kính luôn ổn định, không phụ thuộc khoảnh khắc chạy glint; progress được cắt theo bo góc card. */
.hfwn-card {
  overflow: hidden !important;
  isolation: isolate;
  -webkit-backdrop-filter: blur(var(--hfwn-blur, 18px)) saturate(1.22) brightness(1.03) !important;
  backdrop-filter: blur(var(--hfwn-blur, 18px)) saturate(1.22) brightness(1.03) !important;
  background:
    linear-gradient(155deg, rgba(255,255,255,.58) 0%, rgba(255,255,255,.20) 36%, rgba(255,255,255,.06) 68%),
    radial-gradient(circle at 96% 95%, rgba(255,178,26,.24), transparent 31%),
    radial-gradient(circle at 72% 8%, rgba(123,217,87,.20), transparent 34%),
    linear-gradient(135deg, rgba(255,255,246,.84), rgba(238,255,222,.74)) !important;
  box-shadow:
    0 18px 42px rgba(0,0,0,.18),
    0 0 0 1px rgba(255,255,255,.60),
    inset 0 1px 0 rgba(255,255,255,.76),
    inset 0 -1px 0 rgba(255,255,255,.30),
    0 0 28px rgba(155,220,85,.22) !important;
}
.hfwn-card::before,
.hfwn-card::after {
  pointer-events: none;
}
.hfwn-card::before {
  z-index: 0 !important;
  left: 8% !important;
  right: 8% !important;
  bottom: -22px !important;
  height: 46px !important;
  opacity: .95 !important;
  background: radial-gradient(ellipse at center, rgba(123,217,87,.32), rgba(255,178,26,.10) 44%, transparent 74%) !important;
  filter: blur(12px) !important;
}
.hfwn-card::after {
  z-index: 1 !important;
  inset: 0 !important;
  opacity: .42 !important;
  transform: none !important;
  animation: none !important;
  background:
    linear-gradient(116deg, rgba(255,255,255,.50) 0%, rgba(255,255,255,.18) 18%, transparent 42%),
    radial-gradient(circle at 16% 0%, rgba(255,255,255,.42), transparent 34%) !important;
  mix-blend-mode: screen;
}
.hfwn-image,
.hfwn-body,
.hfwn-close {
  position: relative;
  z-index: 2;
}
.hfwn-progress {
  z-index: 5 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: auto !important;
  height: 3px !important;
  border-radius: 0 0 var(--hfwn-radius, 22px) var(--hfwn-radius, 22px) !important;
  overflow: hidden !important;
  transform-origin: left center !important;
  background: linear-gradient(90deg, var(--hfwn-progress, #7bd957), var(--hfwn-accent, #ffb21a)) !important;
  box-shadow: 0 -1px 8px rgba(123,217,87,.28) !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-card {
  background:
    linear-gradient(155deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,.055) 36%, rgba(255,255,255,.02) 70%),
    radial-gradient(circle at 96% 95%, rgba(255,178,26,.16), transparent 34%),
    radial-gradient(circle at 74% 10%, rgba(123,217,87,.17), transparent 35%),
    linear-gradient(135deg, rgba(10,31,22,.82), rgba(2,18,12,.86)) !important;
  box-shadow:
    0 18px 48px rgba(0,0,0,.38),
    0 0 0 1px rgba(255,255,255,.09),
    inset 0 1px 0 rgba(255,255,255,.16),
    inset 0 -1px 0 rgba(255,255,255,.06),
    0 0 32px rgba(123,217,87,.16) !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-card::after {
  opacity: .30 !important;
  background:
    linear-gradient(116deg, rgba(190,255,175,.22) 0%, rgba(255,255,255,.08) 18%, transparent 44%),
    radial-gradient(circle at 16% 0%, rgba(184,255,166,.18), transparent 34%) !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-progress {
  background: linear-gradient(90deg, #99ff6b, #ffb21a) !important;
  box-shadow: 0 -1px 10px rgba(153,255,107,.24) !important;
}
@media (max-width: 782px) {
  .hfwn-card {
    -webkit-backdrop-filter: blur(calc(var(--hfwn-blur, 18px) * .82)) saturate(1.18) brightness(1.03) !important;
    backdrop-filter: blur(calc(var(--hfwn-blur, 18px) * .82)) saturate(1.18) brightness(1.03) !important;
  }
  .hfwn-progress {
    height: 2.5px !important;
    border-radius: 0 0 var(--hfwn-radius, 20px) var(--hfwn-radius, 20px) !important;
  }
}


/* v1.0.12 — Fix close button bị rơi xuống dưới do rule glass v1.0.11 đổi position thành relative.
   Nút đóng luôn nằm tuyệt đối ở góc phải trên card, cùng hàng với tiêu đề. */
.hfwn-close {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 8 !important;
  margin: 0 !important;
  transform: none;
}
.hfwn-close:hover {
  transform: scale(1.05);
}
.hfwn-close svg {
  margin: auto !important;
  pointer-events: none;
}
.hfwn-body {
  padding-right: 36px !important;
}
.hfwn-headline {
  padding-right: 28px !important;
}
@media (max-width: 782px) {
  .hfwn-close {
    top: 8px !important;
    right: 8px !important;
    width: 26px !important;
    height: 26px !important;
  }
  .hfwn-close svg {
    width: 13px !important;
    height: 13px !important;
  }
  .hfwn-body {
    padding-right: 31px !important;
  }
  .hfwn-headline {
    padding-right: 25px !important;
  }
}


/* v1.0.13 — Đưa cụm "đã góp vốn" xuống cùng hàng số tiền, giảm 50% để số tiền nổi bật hơn. */
.hfwn-headline {
  padding-right: 28px !important;
  margin-bottom: 0 !important;
  color: var(--hfwn-text, #172617) !important;
}
.hfwn-amount {
  display: flex !important;
  align-items: baseline !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  margin-top: 0 !important;
  margin-bottom: 7px !important;
  min-width: 0 !important;
}
.hfwn-amount-value {
  display: inline-block !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.hfwn-amount-action {
  display: inline-block !important;
  flex: 0 0 auto !important;
  font-size: .50em !important;
  line-height: 1 !important;
  font-weight: 650 !important;
  letter-spacing: -.012em !important;
  color: #556255 !important;
  white-space: nowrap !important;
  transform: translateY(-1px);
}
#hfwn-root.hfwn-theme-dark .hfwn-amount-action {
  color: rgba(227,238,222,.74) !important;
}
.hfwn-sparkle {
  flex: 0 0 auto !important;
}
@media (max-width: 782px) {
  .hfwn-headline {
    padding-right: 24px !important;
  }
  .hfwn-amount {
    gap: 4px !important;
  }
  .hfwn-amount-action {
    font-size: .48em !important;
  }
}
@media (max-width: 420px) {
  .hfwn-amount-action {
    font-size: .46em !important;
  }
}


/* v1.0.14 — Đồng bộ popup test trong Admin + sửa màu chữ "ở" và vị trí chữ "đã góp vốn" */
.hfwn-headline .hfwn-loc-word {
  color: var(--hfwn-text, #172617) !important;
  opacity: .88 !important;
  font: inherit !important;
  font-weight: 640 !important;
  letter-spacing: inherit !important;
}
.hfwn-headline > span:not(.hfwn-loc-word) {
  display: none !important;
}
.hfwn-amount > span:not(.hfwn-amount-value):not(.hfwn-amount-action):not(.hfwn-sparkle) {
  display: inline-block !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-headline .hfwn-loc-word {
  color: rgba(245,255,240,.92) !important;
  opacity: .86 !important;
}
.hfwn-admin-preview-card .hfwn-amount-action,
.hfwn-card .hfwn-amount-action {
  display: inline-flex !important;
  align-items: baseline !important;
  align-self: baseline !important;
}


/* v1.0.15 — Đưa "đã góp vốn" lên trước số tiền, đồng bộ màu chữ "ở" và tăng hiệu ứng tráng gương */
.hfwn-headline .hfwn-loc-word {
  color: #556255 !important;
  opacity: 1 !important;
  font-weight: 650 !important;
}
.hfwn-amount {
  display: flex !important;
  align-items: baseline !important;
  flex-wrap: nowrap !important;
  gap: 7px !important;
}
.hfwn-amount-action {
  order: 1 !important;
  color: #556255 !important;
  font-size: .50em !important;
  font-weight: 680 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  transform: translateY(-1px) !important;
}
.hfwn-amount-value {
  order: 2 !important;
  color: #155e20 !important;
}
.hfwn-sparkle {
  order: 3 !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-headline .hfwn-loc-word,
#hfwn-root.hfwn-theme-dark .hfwn-amount-action {
  color: rgba(227,238,222,.74) !important;
  opacity: 1 !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-amount-value {
  color: #9cff7b !important;
}

/* Tráng gương chạy thật trên mặt kính: phủ nhẹ qua nội dung, không chặn click */
.hfwn-card::after {
  z-index: 3 !important;
  inset: -1px -70% !important;
  pointer-events: none !important;
  opacity: 0;
  transform: none !important;
  mix-blend-mode: screen !important;
  background:
    linear-gradient(105deg,
      transparent 0%,
      transparent 36%,
      rgba(255,255,255,.06) 42%,
      rgba(255,255,255,.70) 49%,
      rgba(255,255,255,.18) 56%,
      transparent 64%,
      transparent 100%) !important;
  background-size: 240% 100% !important;
  background-position: -170% 0 !important;
  animation: hfwn-mirror-sheen 3.2s cubic-bezier(.22,.8,.26,1) infinite !important;
}
.hfwn-image,
.hfwn-body {
  position: relative !important;
  z-index: 2 !important;
}
.hfwn-close {
  z-index: 8 !important;
}
.hfwn-progress {
  z-index: 9 !important;
}
@keyframes hfwn-mirror-sheen {
  0%, 42% {
    opacity: 0;
    background-position: -170% 0;
  }
  52% {
    opacity: .82;
  }
  68% {
    opacity: .28;
  }
  82%, 100% {
    opacity: 0;
    background-position: 170% 0;
  }
}
#hfwn-root.hfwn-theme-dark .hfwn-card::after {
  background:
    linear-gradient(105deg,
      transparent 0%,
      transparent 36%,
      rgba(185,255,164,.04) 42%,
      rgba(226,255,214,.36) 49%,
      rgba(255,255,255,.10) 56%,
      transparent 64%,
      transparent 100%) !important;
}
@media (max-width: 782px) {
  .hfwn-amount {
    gap: 5px !important;
  }
  .hfwn-amount-action {
    font-size: .48em !important;
  }
  .hfwn-card::after {
    animation-duration: 3.6s !important;
  }
}

/* v1.0.16 — Mobile gọn hơn + hỗ trợ thông báo thật trên trang cảm ơn WooCommerce */
.hfwn-card.hfwn-real-order .hfwn-amount-action {
  color: #4e5b4f !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-card.hfwn-real-order .hfwn-amount-action {
  color: rgba(227,238,222,.76) !important;
}

@media (max-width: 782px) {
  .hfwn-card {
    grid-template-columns: 64px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 8px !important;
    border-radius: 18px !important;
    max-width: calc(var(--hfwn-mobile-width, 94vw) - 0px) !important;
  }
  .hfwn-image {
    width: 64px !important;
    height: 64px !important;
    border-radius: 13px !important;
  }
  .hfwn-body {
    min-height: 64px !important;
    padding: 0 29px 0 0 !important;
    gap: 0 !important;
  }
  .hfwn-headline {
    font-size: 13.1px !important;
    line-height: 1.12 !important;
    min-height: 1.12em !important;
    padding-right: 25px !important;
  }
  .hfwn-amount {
    margin: -1px 0 3px !important;
    gap: 4px !important;
    font-size: 18.8px !important;
    line-height: 1.02 !important;
  }
  .hfwn-amount-action {
    font-size: .46em !important;
    transform: translateY(-1px) !important;
  }
  .hfwn-product-box {
    grid-template-columns: 22px minmax(0, 1fr) !important;
    gap: 5px !important;
    padding: 4px 5px !important;
    min-height: 28px !important;
    border-radius: 11px !important;
  }
  .hfwn-leaf-icon {
    width: 22px !important;
    height: 22px !important;
    border-radius: 8px !important;
  }
  .hfwn-leaf-icon svg {
    width: 13px !important;
    height: 13px !important;
  }
  .hfwn-product-title {
    font-size: 10px !important;
    line-height: 1.05 !important;
  }
  .hfwn-time {
    font-size: 9px !important;
    line-height: 1 !important;
  }
  .hfwn-close {
    top: 7px !important;
    right: 7px !important;
    width: 24px !important;
    height: 24px !important;
  }
  .hfwn-close svg {
    width: 12px !important;
    height: 12px !important;
  }
  .hfwn-progress {
    height: 2px !important;
  }
}

@media (max-width: 380px) {
  .hfwn-card { grid-template-columns: 60px minmax(0, 1fr) !important; }
  .hfwn-image { width: 60px !important; height: 60px !important; }
  .hfwn-body { min-height: 60px !important; padding-right: 27px !important; }
  .hfwn-headline { font-size: 12.6px !important; }
  .hfwn-amount { font-size: 17.8px !important; }
  .hfwn-product-title { font-size: 9.4px !important; }
  .hfwn-time { font-size: 8.6px !important; }
}


/* v1.0.19 — Fix cài đặt vị trí áp dụng thật: không hard-code 12px trên mobile nữa.
   Thêm khoảng an toàn phía trên để popup không che logo/header, nhưng vẫn cho Admin chỉnh bằng Cách mép ngang/dọc. */
#hfwn-root {
  box-sizing: border-box !important;
}
#hfwn-root.hfwn-top_left,
#hfwn-root.hfwn-top_right {
  padding-top: calc(var(--hfwn-y, 25px) + 22px) !important;
  padding-right: var(--hfwn-x, 25px) !important;
  padding-bottom: var(--hfwn-y, 25px) !important;
  padding-left: var(--hfwn-x, 25px) !important;
}
#hfwn-root.hfwn-bottom_left,
#hfwn-root.hfwn-bottom_right {
  padding-top: var(--hfwn-y, 25px) !important;
  padding-right: var(--hfwn-x, 25px) !important;
  padding-bottom: var(--hfwn-y, 25px) !important;
  padding-left: var(--hfwn-x, 25px) !important;
}
body.admin-bar #hfwn-root.hfwn-top_left,
body.admin-bar #hfwn-root.hfwn-top_right {
  padding-top: calc(var(--hfwn-y, 25px) + 54px) !important;
}
#hfwn-root.hfwn-center {
  padding: var(--hfwn-y, 25px) var(--hfwn-x, 25px) !important;
}
.hfwn-card {
  width: min(var(--hfwn-width, 440px), calc(100vw - (var(--hfwn-x, 25px) * 2))) !important;
  max-width: min(560px, calc(100vw - (var(--hfwn-x, 25px) * 2))) !important;
  color: var(--hfwn-text, #172617) !important;
  border-color: var(--hfwn-border, rgba(255,255,255,.66)) !important;
  background:
    linear-gradient(155deg, rgba(255,255,255,.58) 0%, rgba(255,255,255,.20) 36%, rgba(255,255,255,.06) 68%),
    radial-gradient(circle at 96% 95%, color-mix(in srgb, var(--hfwn-accent, #ffb21a) 24%, transparent), transparent 31%),
    radial-gradient(circle at 72% 8%, color-mix(in srgb, var(--hfwn-progress, #7bd957) 20%, transparent), transparent 34%),
    linear-gradient(135deg, var(--hfwn-bg, #f8fff0), rgba(238,255,222,.74)) !important;
}
.hfwn-headline,
.hfwn-headline strong {
  color: var(--hfwn-text, #172617) !important;
}
.hfwn-headline .hfwn-loc-word,
.hfwn-amount-action {
  color: var(--hfwn-muted, #556255) !important;
}
.hfwn-amount-value {
  color: #155e20 !important;
}
.hfwn-time {
  color: var(--hfwn-muted, #6b7280) !important;
}
.hfwn-product-title,
.hfwn-product-title a {
  color: var(--hfwn-text, #193119) !important;
}
.hfwn-progress {
  background: linear-gradient(90deg, var(--hfwn-progress, #7bd957), var(--hfwn-accent, #ffb21a)) !important;
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .hfwn-card {
    background:
      linear-gradient(155deg, rgba(255,255,255,.58) 0%, rgba(255,255,255,.20) 36%, rgba(255,255,255,.06) 68%),
      radial-gradient(circle at 96% 95%, rgba(255,178,26,.24), transparent 31%),
      radial-gradient(circle at 72% 8%, rgba(123,217,87,.20), transparent 34%),
      linear-gradient(135deg, var(--hfwn-bg, #f8fff0), rgba(238,255,222,.74)) !important;
  }
}
@media (max-width: 782px) {
  #hfwn-root.hfwn-top_left,
  #hfwn-root.hfwn-top_right {
    padding-top: calc(var(--hfwn-y, 25px) + 54px + env(safe-area-inset-top, 0px)) !important;
    padding-right: var(--hfwn-x, 25px) !important;
    padding-bottom: calc(var(--hfwn-y, 25px) + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: var(--hfwn-x, 25px) !important;
  }
  #hfwn-root.hfwn-bottom_left,
  #hfwn-root.hfwn-bottom_right {
    padding-top: calc(var(--hfwn-y, 25px) + env(safe-area-inset-top, 0px)) !important;
    padding-right: var(--hfwn-x, 25px) !important;
    padding-bottom: calc(var(--hfwn-y, 25px) + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: var(--hfwn-x, 25px) !important;
  }
  body.admin-bar #hfwn-root.hfwn-top_left,
  body.admin-bar #hfwn-root.hfwn-top_right {
    padding-top: calc(var(--hfwn-y, 25px) + 100px + env(safe-area-inset-top, 0px)) !important;
  }
  .hfwn-card {
    width: min(var(--hfwn-mobile-width, 94vw), calc(100vw - (var(--hfwn-x, 25px) * 2))) !important;
    max-width: min(var(--hfwn-mobile-width, 94vw), calc(100vw - (var(--hfwn-x, 25px) * 2))) !important;
  }
}


/* v1.0.20 — Trả màu popup về bộ màu sáng premium cũ.
   Giữ nguyên fix vị trí/cách mép v1.0.19, nhưng không để màu trong Admin làm popup bị xám/tối/trắng chữ. */
#hfwn-root:not(.hfwn-theme-dark) .hfwn-card {
  color: #172617 !important;
  border-color: rgba(255,255,255,.60) !important;
  background:
    linear-gradient(155deg, rgba(255,255,255,.58) 0%, rgba(255,255,255,.20) 36%, rgba(255,255,255,.06) 68%),
    radial-gradient(circle at 96% 95%, rgba(255,178,26,.24), transparent 31%),
    radial-gradient(circle at 72% 8%, rgba(123,217,87,.20), transparent 34%),
    linear-gradient(135deg, rgba(255,255,246,.84), rgba(238,255,222,.74)) !important;
  box-shadow:
    0 18px 42px rgba(0,0,0,.18),
    0 0 0 1px rgba(255,255,255,.60),
    inset 0 1px 0 rgba(255,255,255,.76),
    inset 0 -1px 0 rgba(255,255,255,.30),
    0 0 28px rgba(155,220,85,.22) !important;
}
#hfwn-root:not(.hfwn-theme-dark) .hfwn-headline,
#hfwn-root:not(.hfwn-theme-dark) .hfwn-headline strong {
  color: #172617 !important;
}
#hfwn-root:not(.hfwn-theme-dark) .hfwn-headline .hfwn-loc-word,
#hfwn-root:not(.hfwn-theme-dark) .hfwn-amount-action {
  color: #556255 !important;
  opacity: 1 !important;
}
#hfwn-root:not(.hfwn-theme-dark) .hfwn-amount-value {
  color: #155e20 !important;
}
#hfwn-root:not(.hfwn-theme-dark) .hfwn-product-box {
  background: rgba(255,255,255,.45) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.50) !important;
}
#hfwn-root:not(.hfwn-theme-dark) .hfwn-product-title,
#hfwn-root:not(.hfwn-theme-dark) .hfwn-product-title a {
  color: #193119 !important;
}
#hfwn-root:not(.hfwn-theme-dark) .hfwn-time {
  color: #6b7280 !important;
}
#hfwn-root:not(.hfwn-theme-dark) .hfwn-close {
  color: #2c5425 !important;
  background: rgba(255,255,255,.78) !important;
}
#hfwn-root:not(.hfwn-theme-dark) .hfwn-progress {
  background: linear-gradient(90deg, #7bd957, #ffb21a) !important;
}
#hfwn-root:not(.hfwn-theme-dark) .hfwn-leaf-icon {
  background: rgba(219,248,201,.75) !important;
  color: #2f7a2b !important;
}


/* v1.0.21 — Đồng bộ font test Admin / ngoài website + hiệu ứng trượt từ mép vào/ra
   Mục tiêu: popup không bị theme ngoài website làm phóng to chữ; mọi chữ trong popup dùng đúng CSS riêng của plugin. */
#hfwn-root,
#hfwn-root * {
  box-sizing: border-box !important;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif !important;
  text-transform: none !important;
  letter-spacing: normal;
}
#hfwn-root .hfwn-card {
  font-size: 16px !important;
  line-height: 1.2 !important;
}
#hfwn-root .hfwn-card .hfwn-headline {
  font-size: clamp(14px, var(--hfwn-font-size, 16px), 18px) !important;
  line-height: 1.18 !important;
  font-weight: 660 !important;
  letter-spacing: -0.018em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
#hfwn-root .hfwn-card .hfwn-headline strong,
#hfwn-root .hfwn-card .hfwn-headline span {
  font-size: 1em !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  text-transform: none !important;
}
#hfwn-root .hfwn-card .hfwn-headline strong {
  font-weight: 820 !important;
}
#hfwn-root .hfwn-card .hfwn-headline .hfwn-loc-word {
  font-weight: 650 !important;
  color: #556255 !important;
}
#hfwn-root .hfwn-card .hfwn-amount {
  font-size: clamp(21px, calc(var(--hfwn-font-size, 16px) + 7px), 27px) !important;
  line-height: 1.04 !important;
  font-weight: 880 !important;
  letter-spacing: -0.032em !important;
  white-space: nowrap !important;
}
#hfwn-root .hfwn-card .hfwn-amount-value {
  font-size: 1em !important;
  line-height: inherit !important;
  font-weight: 880 !important;
  letter-spacing: inherit !important;
  color: #155e20 !important;
}
#hfwn-root .hfwn-card .hfwn-amount-action {
  font-size: .50em !important;
  line-height: 1 !important;
  font-weight: 680 !important;
  color: #556255 !important;
  letter-spacing: -0.012em !important;
}
#hfwn-root .hfwn-card .hfwn-sparkle {
  font-size: .66em !important;
  line-height: 1 !important;
}
#hfwn-root .hfwn-card .hfwn-product-title,
#hfwn-root .hfwn-card .hfwn-product-title a {
  font-size: 12.2px !important;
  line-height: 1.12 !important;
  font-weight: 760 !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  color: #193119 !important;
}
#hfwn-root .hfwn-card .hfwn-time {
  font-size: 10.8px !important;
  line-height: 1.05 !important;
  font-weight: 520 !important;
  letter-spacing: 0 !important;
}
#hfwn-root .hfwn-card .hfwn-close,
#hfwn-root .hfwn-card .hfwn-close * {
  font-size: 0 !important;
  line-height: 0 !important;
}
#hfwn-root .hfwn-card .hfwn-close svg {
  width: 14px !important;
  height: 14px !important;
}

/* Hiệu ứng mới: trượt từ mép màn hình vào, khi ẩn trượt ngược ra mép. Áp dụng cho cả lựa chọn cũ để người dùng không phải chỉnh lại. */
#hfwn-root .hfwn-card.hfwn-anim-edge_slide,
#hfwn-root .hfwn-card.hfwn-anim-ios_lift,
#hfwn-root .hfwn-card.hfwn-anim-slide,
#hfwn-root .hfwn-card.hfwn-anim-fade {
  opacity: 0 !important;
  transition: transform .52s cubic-bezier(.18,.92,.24,1), opacity .28s ease, filter .28s ease !important;
  filter: none !important;
}
#hfwn-root.hfwn-top_left .hfwn-card.hfwn-anim-edge_slide,
#hfwn-root.hfwn-bottom_left .hfwn-card.hfwn-anim-edge_slide,
#hfwn-root.hfwn-top_left .hfwn-card.hfwn-anim-ios_lift,
#hfwn-root.hfwn-bottom_left .hfwn-card.hfwn-anim-ios_lift,
#hfwn-root.hfwn-top_left .hfwn-card.hfwn-anim-slide,
#hfwn-root.hfwn-bottom_left .hfwn-card.hfwn-anim-slide,
#hfwn-root.hfwn-top_left .hfwn-card.hfwn-anim-fade,
#hfwn-root.hfwn-bottom_left .hfwn-card.hfwn-anim-fade {
  transform: translate3d(calc(-100% - var(--hfwn-x, 25px) - 36px), 0, 0) scale(.99) !important;
}
#hfwn-root.hfwn-top_right .hfwn-card.hfwn-anim-edge_slide,
#hfwn-root.hfwn-bottom_right .hfwn-card.hfwn-anim-edge_slide,
#hfwn-root.hfwn-top_right .hfwn-card.hfwn-anim-ios_lift,
#hfwn-root.hfwn-bottom_right .hfwn-card.hfwn-anim-ios_lift,
#hfwn-root.hfwn-top_right .hfwn-card.hfwn-anim-slide,
#hfwn-root.hfwn-bottom_right .hfwn-card.hfwn-anim-slide,
#hfwn-root.hfwn-top_right .hfwn-card.hfwn-anim-fade,
#hfwn-root.hfwn-bottom_right .hfwn-card.hfwn-anim-fade {
  transform: translate3d(calc(100% + var(--hfwn-x, 25px) + 36px), 0, 0) scale(.99) !important;
}
#hfwn-root.hfwn-center .hfwn-card.hfwn-anim-edge_slide,
#hfwn-root.hfwn-center .hfwn-card.hfwn-anim-ios_lift,
#hfwn-root.hfwn-center .hfwn-card.hfwn-anim-slide,
#hfwn-root.hfwn-center .hfwn-card.hfwn-anim-fade {
  transform: translate3d(0, 18px, 0) scale(.97) !important;
}
#hfwn-root .hfwn-card.hfwn-in {
  opacity: 1 !important;
  transform: translate3d(0,0,0) scale(1) !important;
  filter: none !important;
}
#hfwn-root.hfwn-top_left .hfwn-card.hfwn-out,
#hfwn-root.hfwn-bottom_left .hfwn-card.hfwn-out {
  opacity: 0 !important;
  transform: translate3d(calc(-100% - var(--hfwn-x, 25px) - 36px), 0, 0) scale(.99) !important;
  filter: none !important;
}
#hfwn-root.hfwn-top_right .hfwn-card.hfwn-out,
#hfwn-root.hfwn-bottom_right .hfwn-card.hfwn-out {
  opacity: 0 !important;
  transform: translate3d(calc(100% + var(--hfwn-x, 25px) + 36px), 0, 0) scale(.99) !important;
  filter: none !important;
}
#hfwn-root.hfwn-center .hfwn-card.hfwn-out {
  opacity: 0 !important;
  transform: translate3d(0, 18px, 0) scale(.97) !important;
  filter: none !important;
}

@media (max-width: 782px) {
  #hfwn-root .hfwn-card .hfwn-headline {
    font-size: 13.1px !important;
    line-height: 1.12 !important;
    letter-spacing: -0.012em !important;
  }
  #hfwn-root .hfwn-card .hfwn-amount {
    font-size: 18.8px !important;
    line-height: 1.02 !important;
    gap: 4px !important;
  }
  #hfwn-root .hfwn-card .hfwn-amount-action {
    font-size: .46em !important;
  }
  #hfwn-root .hfwn-card .hfwn-product-title,
  #hfwn-root .hfwn-card .hfwn-product-title a {
    font-size: 10px !important;
    line-height: 1.05 !important;
  }
  #hfwn-root .hfwn-card .hfwn-time {
    font-size: 9px !important;
    line-height: 1 !important;
  }
  #hfwn-root .hfwn-card .hfwn-close svg {
    width: 12px !important;
    height: 12px !important;
  }
}

/* v1.0.22 — Fix popup không hiện do session/animation cũ + giữ font ngoài website đồng bộ test Admin.
   Lưu ý: JS v1.0.22 đã reset session key theo version và chuẩn hóa các tên hiệu ứng cũ về edge_slide. */
#hfwn-root.hfwn-visible {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}
#hfwn-root .hfwn-card {
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
}
#hfwn-root .hfwn-card.hfwn-in {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
#hfwn-root .hfwn-card.hfwn-out {
  pointer-events: none !important;
}

/* Font khóa riêng cho popup để theme/hero ngoài website không phóng to chữ. */
#hfwn-root .hfwn-card,
#hfwn-root .hfwn-card *:not(svg):not(path) {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif !important;
  text-transform: none !important;
}
#hfwn-root .hfwn-card .hfwn-headline {
  font-size: clamp(14px, var(--hfwn-font-size, 16px), 18px) !important;
  line-height: 1.18 !important;
  font-weight: 660 !important;
  letter-spacing: -0.018em !important;
  max-width: 100% !important;
}
#hfwn-root .hfwn-card .hfwn-headline strong,
#hfwn-root .hfwn-card .hfwn-headline span {
  font-size: 1em !important;
  line-height: inherit !important;
}
#hfwn-root .hfwn-card .hfwn-amount {
  font-size: clamp(21px, calc(var(--hfwn-font-size, 16px) + 7px), 27px) !important;
  line-height: 1.04 !important;
}
#hfwn-root .hfwn-card .hfwn-product-title,
#hfwn-root .hfwn-card .hfwn-product-title a {
  font-size: 12.2px !important;
  line-height: 1.12 !important;
}
#hfwn-root .hfwn-card .hfwn-time {
  font-size: 10.8px !important;
  line-height: 1.05 !important;
}

/* Edge slide an toàn: trượt từ mép vào, trượt ngược ra mép. */
#hfwn-root .hfwn-card.hfwn-anim-edge_slide {
  opacity: 0 !important;
  transition: transform .52s cubic-bezier(.18,.92,.24,1), opacity .28s ease, filter .28s ease !important;
}
#hfwn-root.hfwn-top_left .hfwn-card.hfwn-anim-edge_slide,
#hfwn-root.hfwn-bottom_left .hfwn-card.hfwn-anim-edge_slide {
  transform: translate3d(calc(-100% - var(--hfwn-x, 25px) - 36px), 0, 0) scale(.99) !important;
}
#hfwn-root.hfwn-top_right .hfwn-card.hfwn-anim-edge_slide,
#hfwn-root.hfwn-bottom_right .hfwn-card.hfwn-anim-edge_slide {
  transform: translate3d(calc(100% + var(--hfwn-x, 25px) + 36px), 0, 0) scale(.99) !important;
}
#hfwn-root.hfwn-center .hfwn-card.hfwn-anim-edge_slide {
  transform: translate3d(0, 18px, 0) scale(.97) !important;
}
#hfwn-root .hfwn-card.hfwn-anim-edge_slide.hfwn-in {
  transform: translate3d(0,0,0) scale(1) !important;
  opacity: 1 !important;
}
#hfwn-root.hfwn-top_left .hfwn-card.hfwn-anim-edge_slide.hfwn-out,
#hfwn-root.hfwn-bottom_left .hfwn-card.hfwn-anim-edge_slide.hfwn-out {
  transform: translate3d(calc(-100% - var(--hfwn-x, 25px) - 36px), 0, 0) scale(.99) !important;
  opacity: 0 !important;
}
#hfwn-root.hfwn-top_right .hfwn-card.hfwn-anim-edge_slide.hfwn-out,
#hfwn-root.hfwn-bottom_right .hfwn-card.hfwn-anim-edge_slide.hfwn-out {
  transform: translate3d(calc(100% + var(--hfwn-x, 25px) + 36px), 0, 0) scale(.99) !important;
  opacity: 0 !important;
}
#hfwn-root.hfwn-center .hfwn-card.hfwn-anim-edge_slide.hfwn-out {
  transform: translate3d(0, 18px, 0) scale(.97) !important;
  opacity: 0 !important;
}

@media (max-width: 782px) {
  #hfwn-root .hfwn-card .hfwn-headline {
    font-size: 13.1px !important;
    line-height: 1.12 !important;
  }
  #hfwn-root .hfwn-card .hfwn-amount {
    font-size: 18.8px !important;
    line-height: 1.02 !important;
  }
  #hfwn-root .hfwn-card .hfwn-product-title,
  #hfwn-root .hfwn-card .hfwn-product-title a {
    font-size: 10px !important;
    line-height: 1.05 !important;
  }
  #hfwn-root .hfwn-card .hfwn-time {
    font-size: 9px !important;
    line-height: 1 !important;
  }
}

/* v1.0.23 — Chỉ chỉnh các lỗi người dùng nêu:
   1) tách cách mép desktop/mobile, 2) desktop trượt vào/trượt ra từ mép,
   3) thanh thời gian mobile được clip theo bo góc, 4) không đổi màu/giao diện khác. */
#hfwn-root {
  --hfwn-current-x: var(--hfwn-desktop-x, var(--hfwn-x, 25px));
  --hfwn-current-y: var(--hfwn-desktop-y, var(--hfwn-y, 25px));
}
#hfwn-root.hfwn-top_left,
#hfwn-root.hfwn-top_right {
  padding-top: var(--hfwn-current-y) !important;
  padding-right: var(--hfwn-current-x) !important;
  padding-bottom: var(--hfwn-current-y) !important;
  padding-left: var(--hfwn-current-x) !important;
}
#hfwn-root.hfwn-bottom_left,
#hfwn-root.hfwn-bottom_right,
#hfwn-root.hfwn-center {
  padding: var(--hfwn-current-y) var(--hfwn-current-x) !important;
}
body.admin-bar #hfwn-root.hfwn-top_left,
body.admin-bar #hfwn-root.hfwn-top_right {
  padding-top: calc(var(--hfwn-current-y) + 32px) !important;
}
#hfwn-root .hfwn-card {
  width: min(var(--hfwn-width, 440px), calc(100vw - (var(--hfwn-current-x) * 2))) !important;
  max-width: min(560px, calc(100vw - (var(--hfwn-current-x) * 2))) !important;
}

/* Ép lại trạng thái ban đầu theo đúng mép hiện tại, tránh desktop chỉ fade mà không trượt. */
#hfwn-root .hfwn-card.hfwn-anim-edge_slide {
  opacity: 0 !important;
  transition: transform .52s cubic-bezier(.18,.92,.24,1), opacity .28s ease, filter .28s ease !important;
  will-change: transform, opacity !important;
}
#hfwn-root.hfwn-top_left .hfwn-card.hfwn-anim-edge_slide,
#hfwn-root.hfwn-bottom_left .hfwn-card.hfwn-anim-edge_slide {
  transform: translate3d(calc(-100% - var(--hfwn-current-x) - 44px), 0, 0) scale(.995) !important;
}
#hfwn-root.hfwn-top_right .hfwn-card.hfwn-anim-edge_slide,
#hfwn-root.hfwn-bottom_right .hfwn-card.hfwn-anim-edge_slide {
  transform: translate3d(calc(100% + var(--hfwn-current-x) + 44px), 0, 0) scale(.995) !important;
}
#hfwn-root .hfwn-card.hfwn-anim-edge_slide.hfwn-in {
  opacity: 1 !important;
  transform: translate3d(0,0,0) scale(1) !important;
}
#hfwn-root.hfwn-top_left .hfwn-card.hfwn-anim-edge_slide.hfwn-out,
#hfwn-root.hfwn-bottom_left .hfwn-card.hfwn-anim-edge_slide.hfwn-out {
  opacity: 0 !important;
  transform: translate3d(calc(-100% - var(--hfwn-current-x) - 44px), 0, 0) scale(.995) !important;
}
#hfwn-root.hfwn-top_right .hfwn-card.hfwn-anim-edge_slide.hfwn-out,
#hfwn-root.hfwn-bottom_right .hfwn-card.hfwn-anim-edge_slide.hfwn-out {
  opacity: 0 !important;
  transform: translate3d(calc(100% + var(--hfwn-current-x) + 44px), 0, 0) scale(.995) !important;
}

/* Progress wrapper: card bo góc sẽ clip thanh chạy, không bị lộ đoạn thừa ở mobile. */
.hfwn-progress-wrap {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: 3px !important;
  z-index: 9 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  border-radius: 0 0 var(--hfwn-radius, 22px) var(--hfwn-radius, 22px) !important;
  clip-path: inset(0 round 0 0 var(--hfwn-radius, 22px) var(--hfwn-radius, 22px));
}
.hfwn-progress-wrap .hfwn-progress,
.hfwn-card > .hfwn-progress {
  position: absolute !important;
  inset: 0 auto 0 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  border-radius: 0 !important;
  transform-origin: left center !important;
  background: linear-gradient(90deg, #7bd957, #ffb21a) !important;
  animation: hfwn-progress var(--hfwn-duration, 5s) linear forwards !important;
  box-shadow: none !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-progress-wrap .hfwn-progress,
#hfwn-root.hfwn-theme-dark .hfwn-card > .hfwn-progress {
  background: linear-gradient(90deg, #99ff6b, #ffb21a) !important;
}

@media (max-width: 782px) {
  #hfwn-root {
    --hfwn-current-x: var(--hfwn-mobile-x, var(--hfwn-x, 18px));
    --hfwn-current-y: var(--hfwn-mobile-y, var(--hfwn-y, 56px));
  }
  #hfwn-root.hfwn-top_left,
  #hfwn-root.hfwn-top_right {
    padding-top: calc(var(--hfwn-current-y) + env(safe-area-inset-top, 0px)) !important;
    padding-right: var(--hfwn-current-x) !important;
    padding-bottom: calc(var(--hfwn-current-y) + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: var(--hfwn-current-x) !important;
  }
  #hfwn-root.hfwn-bottom_left,
  #hfwn-root.hfwn-bottom_right,
  #hfwn-root.hfwn-center {
    padding-top: calc(var(--hfwn-current-y) + env(safe-area-inset-top, 0px)) !important;
    padding-right: var(--hfwn-current-x) !important;
    padding-bottom: calc(var(--hfwn-current-y) + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: var(--hfwn-current-x) !important;
  }
  body.admin-bar #hfwn-root.hfwn-top_left,
  body.admin-bar #hfwn-root.hfwn-top_right {
    padding-top: calc(var(--hfwn-current-y) + 46px + env(safe-area-inset-top, 0px)) !important;
  }
  #hfwn-root .hfwn-card {
    width: min(var(--hfwn-mobile-width, 94vw), calc(100vw - (var(--hfwn-current-x) * 2))) !important;
    max-width: min(var(--hfwn-mobile-width, 94vw), calc(100vw - (var(--hfwn-current-x) * 2))) !important;
  }
  .hfwn-progress-wrap {
    height: 2px !important;
    border-radius: 0 0 var(--hfwn-radius, 18px) var(--hfwn-radius, 18px) !important;
    clip-path: inset(0 round 0 0 var(--hfwn-radius, 18px) var(--hfwn-radius, 18px));
  }
}

/* v1.0.24 — Mobile exact placement + compact scale only.
   Chỉ chỉnh mobile: đẩy popup xuống thêm một chút, ép về mép phải,
   thu nhỏ toàn bộ để không mất số tiền/chữ như bản thực tế ngoài website. */
@media (max-width: 782px) {
  #hfwn-root {
    --hfwn-current-x: var(--hfwn-mobile-x, var(--hfwn-x, 18px)) !important;
    --hfwn-current-y: var(--hfwn-mobile-y, var(--hfwn-y, 56px)) !important;
    gap: 7px !important;
  }

  /* Mobile ưu tiên né logo bên trái: dù đang chọn trên trái vẫn ép toast về gần mép phải. */
  #hfwn-root.hfwn-top_left,
  #hfwn-root.hfwn-top_right {
    align-items: flex-end !important;
    justify-content: flex-start !important;
    padding-top: calc(var(--hfwn-current-y) + 14px + env(safe-area-inset-top, 0px)) !important;
    padding-right: var(--hfwn-current-x) !important;
    padding-bottom: calc(var(--hfwn-current-y) + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: 10px !important;
  }

  #hfwn-root.hfwn-bottom_right {
    align-items: flex-end !important;
    padding-right: var(--hfwn-current-x) !important;
    padding-left: 10px !important;
  }

  body.admin-bar #hfwn-root.hfwn-top_left,
  body.admin-bar #hfwn-root.hfwn-top_right {
    padding-top: calc(var(--hfwn-current-y) + 60px + env(safe-area-inset-top, 0px)) !important;
  }

  #hfwn-root .hfwn-card {
    width: min(342px, calc(100vw - var(--hfwn-current-x) - 12px)) !important;
    max-width: min(342px, calc(100vw - var(--hfwn-current-x) - 12px)) !important;
    grid-template-columns: 56px minmax(0, 1fr) !important;
    gap: 7px !important;
    padding: 7px !important;
    border-radius: 16px !important;
  }

  #hfwn-root .hfwn-card .hfwn-image {
    width: 56px !important;
    height: 56px !important;
    min-height: 0 !important;
    border-radius: 12px !important;
  }

  #hfwn-root .hfwn-card .hfwn-body {
    min-height: 56px !important;
    height: auto !important;
    padding: 0 27px 0 0 !important;
    gap: 0 !important;
    justify-content: center !important;
  }

  #hfwn-root .hfwn-card .hfwn-headline {
    font-size: 12.2px !important;
    line-height: 1.1 !important;
    min-height: 1.1em !important;
    padding-right: 23px !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #hfwn-root .hfwn-card .hfwn-amount {
    font-size: 16.2px !important;
    line-height: 1.02 !important;
    gap: 3px !important;
    margin: 0 0 3px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: nowrap !important;
  }

  #hfwn-root .hfwn-card .hfwn-amount-action {
    font-size: .43em !important;
    line-height: 1 !important;
    flex: 0 0 auto !important;
    transform: translateY(-1px) !important;
  }

  #hfwn-root .hfwn-card .hfwn-amount-value {
    flex: 0 0 auto !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    max-width: none !important;
  }

  #hfwn-root .hfwn-card .hfwn-sparkle {
    font-size: .58em !important;
    flex: 0 0 auto !important;
  }

  #hfwn-root .hfwn-card .hfwn-product-box {
    grid-template-columns: 20px minmax(0, 1fr) !important;
    gap: 5px !important;
    padding: 4px 5px !important;
    min-height: 26px !important;
    border-radius: 10px !important;
  }

  #hfwn-root .hfwn-card .hfwn-leaf-icon {
    width: 20px !important;
    height: 20px !important;
    border-radius: 8px !important;
  }

  #hfwn-root .hfwn-card .hfwn-leaf-icon svg {
    width: 12px !important;
    height: 12px !important;
  }

  #hfwn-root .hfwn-card .hfwn-product-title,
  #hfwn-root .hfwn-card .hfwn-product-title a {
    font-size: 9.3px !important;
    line-height: 1.04 !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #hfwn-root .hfwn-card .hfwn-time {
    font-size: 8.2px !important;
    line-height: 1 !important;
  }

  #hfwn-root .hfwn-card .hfwn-close {
    top: 6px !important;
    right: 6px !important;
    width: 22px !important;
    height: 22px !important;
  }

  #hfwn-root .hfwn-card .hfwn-close svg {
    width: 11px !important;
    height: 11px !important;
  }

  #hfwn-root .hfwn-progress-wrap {
    height: 2px !important;
    border-radius: 0 0 16px 16px !important;
    clip-path: inset(0 round 0 0 16px 16px) !important;
  }
}

@media (max-width: 380px) {
  #hfwn-root .hfwn-card {
    width: min(326px, calc(100vw - var(--hfwn-current-x) - 10px)) !important;
    max-width: min(326px, calc(100vw - var(--hfwn-current-x) - 10px)) !important;
    grid-template-columns: 52px minmax(0, 1fr) !important;
    gap: 6px !important;
    padding: 6px !important;
  }
  #hfwn-root .hfwn-card .hfwn-image {
    width: 52px !important;
    height: 52px !important;
  }
  #hfwn-root .hfwn-card .hfwn-body {
    min-height: 52px !important;
    padding-right: 25px !important;
  }
  #hfwn-root .hfwn-card .hfwn-headline {
    font-size: 11.6px !important;
  }
  #hfwn-root .hfwn-card .hfwn-amount {
    font-size: 15.2px !important;
    gap: 2px !important;
  }
  #hfwn-root .hfwn-card .hfwn-product-title,
  #hfwn-root .hfwn-card .hfwn-product-title a {
    font-size: 8.9px !important;
  }
  #hfwn-root .hfwn-card .hfwn-time {
    font-size: 7.9px !important;
  }
}


/* v1.0.25 — Mobile final safe top + progress edge clip only.
   Chỉ chỉnh 2 điểm: đẩy popup mobile xuống thêm để tránh che logo và xử lý thanh thời gian không lộ 2 đầu ở bo góc. */
@media (max-width: 782px) {
  #hfwn-root.hfwn-top_left,
  #hfwn-root.hfwn-top_right {
    padding-top: calc(var(--hfwn-current-y) + 30px + env(safe-area-inset-top, 0px)) !important;
  }

  body.admin-bar #hfwn-root.hfwn-top_left,
  body.admin-bar #hfwn-root.hfwn-top_right {
    padding-top: calc(var(--hfwn-current-y) + 76px + env(safe-area-inset-top, 0px)) !important;
  }

  #hfwn-root .hfwn-card .hfwn-progress-wrap {
    left: 13px !important;
    right: 13px !important;
    width: auto !important;
    bottom: 0 !important;
    height: 2px !important;
    border-radius: 999px !important;
    clip-path: none !important;
    overflow: hidden !important;
    transform: translateZ(0) !important;
  }

  #hfwn-root .hfwn-card .hfwn-progress-wrap .hfwn-progress,
  #hfwn-root .hfwn-card > .hfwn-progress {
    border-radius: 999px !important;
  }
}

@media (max-width: 380px) {
  #hfwn-root .hfwn-card .hfwn-progress-wrap {
    left: 12px !important;
    right: 12px !important;
  }
}


/* v1.0.26 — Mobile logo safe spacing.
   Chỉ dời popup mobile xuống thêm, giữ nguyên kích thước/chữ/màu/vị trí ngang. */
@media (max-width: 782px) {
  #hfwn-root.hfwn-top_left,
  #hfwn-root.hfwn-top_right {
    padding-top: calc(var(--hfwn-current-y) + 72px + env(safe-area-inset-top, 0px)) !important;
  }

  body.admin-bar #hfwn-root.hfwn-top_left,
  body.admin-bar #hfwn-root.hfwn-top_right {
    padding-top: calc(var(--hfwn-current-y) + 118px + env(safe-area-inset-top, 0px)) !important;
  }
}


/* v1.0.27 — Desktop top spacing only.
   Chỉ dời popup máy tính xuống xa mép trên hơn; không đổi mobile, không đổi mép trái/phải, không đổi layout. */
@media (min-width: 783px) {
  #hfwn-root.hfwn-top_left,
  #hfwn-root.hfwn-top_right {
    padding-top: calc(var(--hfwn-current-y) + 54px) !important;
  }

  body.admin-bar #hfwn-root.hfwn-top_left,
  body.admin-bar #hfwn-root.hfwn-top_right {
    padding-top: calc(var(--hfwn-current-y) + 86px) !important;
  }
}

/* v1.0.28 — Desktop top spacing extra.
   Chỉ dời popup máy tính xuống thêm; không đổi mobile, không đổi mép trái/phải, không đổi layout/màu/chữ. */
@media (min-width: 783px) {
  #hfwn-root.hfwn-top_left,
  #hfwn-root.hfwn-top_right {
    padding-top: calc(var(--hfwn-current-y) + 96px) !important;
  }

  body.admin-bar #hfwn-root.hfwn-top_left,
  body.admin-bar #hfwn-root.hfwn-top_right {
    padding-top: calc(var(--hfwn-current-y) + 128px) !important;
  }
}


/* v1.0.29 — Dark contrast + living glass/sparkle + đổi nhãn thời gian "Từ ... trước".
   Chỉ tăng độ đọc chế độ tối và thêm animation trang trí; không đổi layout mobile/desktop đã chốt. */
#hfwn-root.hfwn-theme-dark .hfwn-card {
  color: #f4fff1 !important;
  border-color: rgba(219, 255, 198, .30) !important;
  background:
    linear-gradient(155deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.07) 36%, rgba(255,255,255,.025) 72%),
    radial-gradient(circle at 96% 95%, rgba(255,178,26,.22), transparent 34%),
    radial-gradient(circle at 74% 10%, rgba(123,217,87,.26), transparent 35%),
    linear-gradient(135deg, rgba(18,45,29,.92), rgba(7,28,18,.94)) !important;
  box-shadow:
    0 18px 48px rgba(0,0,0,.42),
    0 0 0 1px rgba(255,255,255,.10),
    inset 0 1px 0 rgba(255,255,255,.20),
    inset 0 -1px 0 rgba(255,255,255,.07),
    0 0 34px rgba(123,217,87,.20) !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-headline,
#hfwn-root.hfwn-theme-dark .hfwn-headline strong {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.32) !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-headline .hfwn-loc-word,
#hfwn-root.hfwn-theme-dark .hfwn-amount-action {
  color: rgba(239,255,232,.88) !important;
  opacity: 1 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.24) !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-amount-value {
  color: #8cff69 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.34), 0 0 14px rgba(140,255,105,.22) !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-product-box {
  background: rgba(255,255,255,.14) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 8px 18px rgba(0,0,0,.10) !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-product-title,
#hfwn-root.hfwn-theme-dark .hfwn-product-title a {
  color: #f7fff1 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.24) !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-time {
  color: rgba(244,255,239,.86) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.20) !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-leaf-icon {
  color: #a7ff87 !important;
  background: rgba(123,217,87,.24) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.20), 0 8px 16px rgba(0,0,0,.22) !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-close {
  color: #efffe8 !important;
  background: rgba(255,255,255,.18) !important;
  box-shadow: 0 9px 20px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.22) !important;
}

/* Lớp kính chạy rõ hơn nhưng không đổi kích thước/card. */
.hfwn-card::after {
  opacity: 0 !important;
  background:
    linear-gradient(105deg,
      transparent 0%,
      transparent 34%,
      rgba(255,255,255,.08) 42%,
      rgba(255,255,255,.82) 49%,
      rgba(255,244,196,.24) 56%,
      transparent 66%,
      transparent 100%) !important;
  background-size: 240% 100% !important;
  animation: hfwn-mirror-sheen-strong 3.8s cubic-bezier(.22,.8,.26,1) infinite !important;
}
#hfwn-root.hfwn-theme-dark .hfwn-card::after {
  background:
    linear-gradient(105deg,
      transparent 0%,
      transparent 34%,
      rgba(192,255,169,.08) 42%,
      rgba(238,255,229,.48) 49%,
      rgba(255,178,26,.16) 56%,
      transparent 66%,
      transparent 100%) !important;
}
@keyframes hfwn-mirror-sheen-strong {
  0%, 38% { opacity: 0; background-position: -170% 0; }
  50% { opacity: .88; }
  64% { opacity: .34; }
  82%, 100% { opacity: 0; background-position: 170% 0; }
}

.hfwn-sparkle {
  display: inline-block !important;
  transform-origin: center !important;
  animation: hfwn-sparkle-pop 1.85s ease-in-out infinite !important;
}
@keyframes hfwn-sparkle-pop {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); filter: drop-shadow(0 4px 10px rgba(255,178,26,.25)); }
  42% { transform: translateY(-1px) scale(1.16) rotate(6deg); filter: drop-shadow(0 0 12px rgba(255,178,26,.62)); }
  62% { transform: translateY(0) scale(.98) rotate(-3deg); }
}

.hfwn-leaf-icon::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.62), transparent 42%);
  opacity: .55;
  animation: hfwn-soft-pulse 2.6s ease-in-out infinite;
}
.hfwn-leaf-icon { position: relative !important; overflow: hidden !important; }
@keyframes hfwn-soft-pulse {
  0%, 100% { opacity: .32; transform: scale(.96); }
  50% { opacity: .68; transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .hfwn-card::after,
  .hfwn-sparkle,
  .hfwn-leaf-icon::after {
    animation: none !important;
  }
}
