/*
 * Thẻ ưu đãi dùng chung (.hithean-offer-card) — MỘT kiểu hiển thị cho:
 *   - popup "Ưu đãi đang áp dụng" ở trang sản phẩm (product-purchase.js dựng thẻ),
 *   - trang /uu-dai/ chế độ "Theo sản phẩm" (hithean_offer_card_html() ở offers/offer-card.php),
 *   - panel "Ưu đãi của tôi" của thanh menu đáy (site-footer-menu.js).
 * Sửa kiểu thẻ ở đây, không sửa riêng từng nơi. Handle: 'hithean-offer-card' (đăng ký ở offers.php).
 */
.hithean-offer-card,
.hithean-offer-list { --ho-ink: var(--default-color-brown, #3b2222); --ho-green: #214f3c; --ho-cream: var(--default-color-beige, #f7f6f2); }
.hithean-offer-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.hithean-offer-card { box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 18px; border: 1px solid #3b222210; border-radius: 16px; background: #fff; box-shadow: 0 3px 12px #3b222206; color: var(--ho-ink); line-height: 1.55; text-align: left; }
.hithean-offer-card * { box-sizing: border-box; }
.hithean-offer-card[hidden] { display: none; }
.hithean-offer-card__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
/* Ảnh / icon góc phải trên, cao bằng chip + 1 dòng tiêu đề (popup trang SP: JS đo → --ho-media, kẹp 40–72px). */
.hithean-offer-card__head { display: flex; align-items: flex-start; gap: 14px; }
.hithean-offer-card__main { display: flex; flex: 1 1 auto; flex-direction: column; gap: 10px; min-width: 0; }
.hithean-offer-card__media { --ho-media-size: clamp(40px, var(--ho-media, 60px), 72px); flex: 0 0 var(--ho-media-size); width: var(--ho-media-size); height: var(--ho-media-size); overflow: hidden; border: 1px solid #3b22221a; border-radius: 12px; background: var(--ho-cream); }
.hithean-offer-card__media img { display: block; width: 100%; height: 100%; margin: 0; object-fit: cover; }
.hithean-offer-card__media--icon { display: grid; place-items: center; border: 0; color: var(--default-color-dark-blue, #0047ba); background: #e8f0fb; }
.hithean-offer-card__media--icon.is-wheel { color: #9a6a00; background: #fff4d6; }
.hithean-offer-card__media--icon.is-coupon { color: #8a1c4a; background: #fde8f0; }
.hithean-offer-card__media--icon svg { width: 36%; height: 36%; min-width: 20px; min-height: 20px; }
.hithean-offer-card__badge { padding: 5px 12px; border-radius: 99px; background: #ecefe6; color: var(--ho-green); font-size: 11px; font-weight: 700; line-height: 1.4; }
.hithean-offer-card__price,
.hithean-offer-card__price .amount { font-size: 15px !important; font-weight: 700; color: var(--ho-green); }
.hithean-offer-card__title { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.hithean-offer-card__title * { color: inherit !important; background: none !important; }
.hithean-offer-card__extra { font-size: 13px; opacity: .85; }
.hithean-offer-card__extra > :last-child { margin-bottom: 0; }
.hithean-offer-card__note { margin: 0; font-size: 12px; color: var(--ho-green); }
.hithean-offer-card__price small { font-size: 12px; font-weight: 400; opacity: .75; }
.hithean-offer-card.is-active { border-color: #214f3c55; box-shadow: inset 0 0 0 1px #214f3c33; }
/*
 * Màu theo loại ưu đãi (.is-tone-*; PHP offer-card.php + product-purchase.js) — mỗi loại 1 dải màu trái, nền nhạt,
 * chip và ghi chú cùng tông → danh sách nhiều thẻ không bị đều màu, khó lẫn.
 */
.hithean-offer-card { --ho-tone: var(--ho-green); --ho-tone-bg: #fff; --ho-tone-soft: #ecefe6; border-left: 4px solid var(--ho-tone); background: var(--ho-tone-bg); }
.hithean-offer-card.is-tone-addon { --ho-tone: #b4235a; --ho-tone-bg: #fff7fa; --ho-tone-soft: #fde4ee; }
.hithean-offer-card.is-tone-tiers { --ho-tone: #0047ba; --ho-tone-bg: #f5f8ff; --ho-tone-soft: #e2ecfb; }
.hithean-offer-card.is-tone-shipping { --ho-tone: #0e7a5f; --ho-tone-bg: #f2faf6; --ho-tone-soft: #d9f1e6; }
.hithean-offer-card.is-tone-discount { --ho-tone: #c2410c; --ho-tone-bg: #fff8f2; --ho-tone-soft: #ffe7d4; }
.hithean-offer-card.is-tone-wheel { --ho-tone: #9a6a00; --ho-tone-bg: #fffbef; --ho-tone-soft: #fff0c2; }
.hithean-offer-card.is-tone-coupon { --ho-tone: #6d28d9; --ho-tone-bg: #f9f6ff; --ho-tone-soft: #ece4ff; }
.hithean-offer-card .hithean-offer-card__badge { background: var(--ho-tone-soft); color: var(--ho-tone); }
.hithean-offer-card .hithean-offer-card__note { color: var(--ho-tone); }
.hithean-offer-card .hithean-offer-card__media--icon { background: var(--ho-tone-soft); color: var(--ho-tone); }
.hithean-offer-card.is-active { border-left-color: var(--ho-tone); }
/* Nút trong thẻ — cùng màu nút Thêm vào giỏ; theme cha ép style button / a.button nên dùng !important. */
.hithean-offers-dialog .hithean-offer-card__action,
.hithean-offer-card .hithean-offer-card__action { display: flex !important; align-items: center; justify-content: center; gap: 6px; width: 100%; height: auto !important; min-height: 44px; margin: 4px 0 0 !important; padding: 10px 16px !important; border: 2px solid var(--default-color-dark-blue, #0047ba) !important; border-radius: 8px !important; background: var(--default-color-dark-blue, #0047ba) !important; color: #fff !important; box-shadow: none !important; font-family: inherit; font-size: 14px !important; font-weight: 600; line-height: 1.3 !important; letter-spacing: 0 !important; text-align: center; text-decoration: none !important; text-transform: none !important; cursor: pointer; }
.hithean-offers-dialog .hithean-offer-card__action:hover:not(:disabled),
.hithean-offer-card .hithean-offer-card__action:hover:not(:disabled) { background: var(--default-color-light-blue, #b0dded) !important; border-color: var(--default-color-light-blue, #b0dded) !important; color: var(--default-color-dark-blue, #0047ba) !important; }
.hithean-offers-dialog .hithean-offer-card__action:focus-visible,
.hithean-offer-card .hithean-offer-card__action:focus-visible { outline: 2px solid #0047ba; outline-offset: 3px; }
.hithean-offers-dialog .hithean-offer-card__action:disabled,
.hithean-offer-card .hithean-offer-card__action:disabled { border-color: #3b22221c !important; background: #f7f6f2 !important; color: #214f3c !important; cursor: default; font-weight: 500; }
/* Nút phụ (viền) — vd "Sao chép mã". */
.hithean-offer-card .hithean-offer-card__action.is-ghost { background: #fff !important; color: var(--default-color-dark-blue, #0047ba) !important; }
.hithean-offer-card__actions { display: flex; gap: 8px; }
.hithean-offer-card__actions > * { flex: 1 1 0; min-width: 0; }
/* Mã giảm giá trong thẻ ("Ưu đãi của tôi"). */
.hithean-offer-card__code { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px dashed #214f3c66; border-radius: 10px; background: #f4f8f3; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; font-weight: 700; letter-spacing: .04em; color: var(--ho-green); }
.hithean-offer-card__code small { font-family: inherit; font-size: 11px; font-weight: 500; letter-spacing: 0; opacity: .75; }
/* Thẻ bậc giá gộp: danh sách bậc. */
.hithean-offer-tiers { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hithean-offer-tiers li { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 8px 12px; border: 1px solid #3b22221c; border-radius: 10px; }
.hithean-offer-tiers li.is-current { border-color: #214f3c; background: #edf5ec; }
.hithean-offer-tiers__label { display: flex; flex-direction: column; min-width: 0; font-size: 14px; font-weight: 600; }
.hithean-offer-tiers__label small { font-size: 12px; font-weight: 400; opacity: .7; }

/* ---------- Khung popup ưu đãi (trang SP "Ưu đãi đang áp dụng" + "Ưu đãi tiêu biểu" thanh menu đáy). ---------- */
/* Popup: cùng kiểu .ho-group-dialog của trang /uu-dai/ (pages/uu-dai/uu-dai.css). */
html.hithean-offers-open { overflow: hidden; }
.hithean-offers-dialog { --ho-ink: var(--default-color-brown, #3b2222); --ho-green: #214f3c; --ho-cream: var(--default-color-beige, #f7f6f2); box-sizing: border-box; width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 64px); padding: 0; border: 0; border-radius: 20px; background: #fff; color: var(--ho-ink); box-shadow: 0 20px 60px #3b222233; line-height: 1.55; text-align: left; }
.hithean-offers-dialog[open] { display: flex; flex-direction: column; }
.hithean-offers-dialog::backdrop { background: #3b222299; }
.hithean-offers-dialog * { box-sizing: border-box; }
.hithean-offers-dialog__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 24px; border-bottom: 1px solid #3b22221c; }
.hithean-offers-dialog__head h3 { margin: 0; padding: 0; font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -0.035em; text-transform: none; color: inherit; }
.hithean-offers-dialog__head p { margin: 4px 0 0; font-size: 13px; opacity: .7; }
.hithean-offers-dialog .hithean-offers-dialog__close { flex-shrink: 0; width: 40px; height: 40px; min-height: 0; margin: 0; padding: 0; border: 1px solid #3b22223a; border-radius: 0; background: #fff; color: var(--ho-ink); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: none; }
.hithean-offers-dialog__list { display: grid; gap: 12px; margin: 0; padding: 16px; overflow-y: auto; list-style: none; background: var(--ho-cream); }
.hithean-offers-dialog__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 14px 24px 18px; border-top: 1px solid #3b22221c; font-size: 12px; }
.hithean-offers-dialog__foot p { margin: 0; opacity: .7; }
.hithean-offers-dialog__all { font-weight: 600; color: var(--default-color-dark-blue, #0047ba) !important; text-decoration: none !important; }
@media (max-width: 767px) {
    .hithean-offers-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 48px); }
    .hithean-offers-dialog__head { padding: 16px 18px; }
    .hithean-offers-dialog__list { padding: 12px; }
    .hithean-offers-dialog__foot { padding: 12px 18px 16px; }
}
