/**
 * Cookie consent banner + preferences modal + "Nhận ưu đãi" popup. Markup: inc/consent-promo.php · behaviour: assets/js/consent-promo.js.
 * Colours / font size / radius arrive as --cp-* custom properties on each component (VNT39 → Cookie & Ưu đãi); every var() keeps the admin default as fallback.
 * Everything is position:fixed → no layout shift. Animation = opacity + a few px of translate only.
 */
.vnt39-cp *, .vnt39-cp *::before, .vnt39-cp *::after { box-sizing: border-box; }
.vnt39-cp [hidden] { display: none !important; }
.vnt39-cp .vnt39-cp-ico { display: block; width: 100%; height: 100%; }

/* ---------------------------------------------------------------- buttons (shared) */
.vnt39-cp .vnt39-cp-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 40px; margin: 0; padding: 8px 16px;
	border: 1px solid var(--cp-btn, #a30d1b); border-radius: 999px;
	background: transparent; color: var(--cp-btn, #a30d1b);
	font: inherit; font-size: .93em; font-weight: 700; letter-spacing: 0; line-height: 1.2; text-transform: none; white-space: nowrap;
	cursor: pointer; box-shadow: none;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.vnt39-cp .vnt39-cp-btn--solid { background: var(--cp-btn, #a30d1b); color: #fff; }
.vnt39-cp .vnt39-cp-btn--ghost { border-color: #d0d5dd; color: var(--cp-fg, #252a31); }
.vnt39-cp .vnt39-cp-btn--ghost:hover { border-color: var(--cp-btn, #a30d1b); color: var(--cp-btn, #a30d1b); }
.vnt39-cp .vnt39-cp-btn--solid:hover { filter: brightness(.92); }
.vnt39-cp .vnt39-cp-btn:focus-visible, .vnt39-cp .vnt39-cp-x:focus-visible, .vnt39-cp .vnt39-promo__ch:focus-visible, .vnt39-cp .vnt39-promo__back:focus-visible { outline: 2px solid var(--cp-btn, #a30d1b); outline-offset: 2px; }
.vnt39-cp .vnt39-cp-x {
	position: absolute; top: 10px; right: 10px; z-index: 2;
	display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; min-height: 0; margin: 0; padding: 8px;
	border: 0; border-radius: 50%; background: #f2f4f7; color: #475467; cursor: pointer; box-shadow: none;
}
.vnt39-cp .vnt39-cp-x:hover { background: #e4e7ec; }

/* ---------------------------------------------------------------- cookie banner */
.vnt39-cp .vnt39-cc {
	position: fixed; bottom: 16px; left: 16px; z-index: 99980;
	display: flex; align-items: center; gap: 14px 18px;
	width: min(760px, calc(100% - 32px)); padding: 14px 16px;
	border: 1px solid #e5e7eb; border-radius: var(--cp-r, 14px);
	background: var(--cp-bg, #fff); color: var(--cp-fg, #252a31);
	font-size: var(--cp-fs, 14px); line-height: 1.45;
	box-shadow: 0 6px 24px rgba(16, 24, 40, .14);
	opacity: 0; transform: translateY(14px); transition: opacity .28s ease, transform .28s ease;
}
.vnt39-cp .vnt39-cc.is-in { opacity: 1; transform: none; }
.vnt39-cp .vnt39-cc__icon { flex: 0 0 34px; width: 34px; height: 34px; padding: 6px; border-radius: 50%; background: #fbeaec; color: #8f0b18; }
.vnt39-cp .vnt39-cc__text { flex: 1 1 auto; min-width: 0; }
.vnt39-cp .vnt39-cc__title { display: block; margin: 0 0 2px; font-size: 1.07em; font-weight: 800; color: var(--cp-fg, #252a31); }
.vnt39-cp .vnt39-cc__desc { margin: 0; color: var(--cp-fg, #252a31); opacity: .82; font-size: .95em; }
.vnt39-cp .vnt39-cc__btns { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 8px; }

/* Single product: keep clear of the fixed buy bar (desktop bar ≈ 78px, phone bar ≈ 97px + safe area). */
body.single-product .vnt39-cp .vnt39-cc { bottom: 96px; }

@media (max-width: 849px) {
	.vnt39-cp .vnt39-cc { right: 12px; bottom: 12px; left: 12px; flex-wrap: wrap; width: auto; padding: 12px 14px; gap: 10px 12px; }
	.vnt39-cp .vnt39-cc__text { flex: 1 1 calc(100% - 56px); }
	.vnt39-cp .vnt39-cc__btns { flex: 1 1 100%; flex-wrap: nowrap; }
	.vnt39-cp .vnt39-cc__btns .vnt39-cp-btn { flex: 1 1 0; min-width: 0; padding: 8px 6px; font-size: .86em; }
	.vnt39-cp .vnt39-cc__btns .vnt39-cp-btn--solid { flex: 1.35 1 0; }
	body.single-product .vnt39-cp .vnt39-cc { bottom: calc(110px + env(safe-area-inset-bottom)); }
}

/* ---------------------------------------------------------------- cookie options modal (no scroll lock; light backdrop) */
.vnt39-cp .vnt39-ccp { position: fixed; inset: 0; z-index: 100005; display: flex; align-items: center; justify-content: center; padding: 16px; font-size: var(--cp-fs, 14px); }
.vnt39-cp .vnt39-ccp__backdrop { position: absolute; inset: 0; background: rgba(17, 19, 24, .28); opacity: 0; transition: opacity .25s ease; }
.vnt39-cp .vnt39-ccp__panel {
	position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 22px 20px 18px;
	border-radius: var(--cp-r, 14px); background: var(--cp-bg, #fff); color: var(--cp-fg, #252a31);
	box-shadow: 0 10px 40px rgba(16, 24, 40, .2);
	opacity: 0; transform: translateY(10px); transition: opacity .25s ease, transform .25s ease;
}
.vnt39-cp .vnt39-ccp.is-in .vnt39-ccp__backdrop { opacity: 1; }
.vnt39-cp .vnt39-ccp.is-in .vnt39-ccp__panel { opacity: 1; transform: none; }
.vnt39-cp .vnt39-ccp__title { margin: 0 0 6px; padding-right: 40px; font-size: 1.25em; font-weight: 800; line-height: 1.25; color: var(--cp-fg, #252a31); text-transform: none; }
.vnt39-cp .vnt39-ccp__lead { margin: 0 0 12px; font-size: .95em; opacity: .8; }
.vnt39-cp .vnt39-ccp__list { margin: 0 0 14px; padding: 0; list-style: none; }
.vnt39-cp .vnt39-ccp__row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0; padding: 12px 0; border-top: 1px solid #eaecf0; }
.vnt39-cp .vnt39-ccp__row strong { display: block; font-size: 1em; font-weight: 700; }
.vnt39-cp .vnt39-ccp__row span { display: block; margin-top: 2px; font-size: .88em; opacity: .72; }
.vnt39-cp .vnt39-ccp__foot { display: flex; justify-content: flex-end; }
.vnt39-cp .vnt39-ccp__foot .vnt39-cp-btn { width: 100%; }

.vnt39-cp .vnt39-sw { position: relative; flex: 0 0 auto; display: block; width: 44px; height: 26px; margin: 0; cursor: pointer; }
.vnt39-cp .vnt39-sw input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.vnt39-cp .vnt39-sw i { position: absolute; inset: 0; border-radius: 999px; background: #d0d5dd; transition: background-color .18s ease; }
.vnt39-cp .vnt39-sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .3); transition: transform .18s ease; }
.vnt39-cp .vnt39-sw input:checked + i { background: var(--cp-btn, #a30d1b); }
.vnt39-cp .vnt39-sw input:checked + i::after { transform: translateX(18px); }
.vnt39-cp .vnt39-sw input:focus-visible + i { outline: 2px solid var(--cp-btn, #a30d1b); outline-offset: 2px; }
.vnt39-cp .vnt39-sw.is-locked { cursor: not-allowed; opacity: .6; }
.vnt39-cp .vnt39-sw.is-locked input { cursor: not-allowed; }

/* ---------------------------------------------------------------- marketing popup */
html.vnt39-promo-lock { overflow: hidden; }
.vnt39-cp .vnt39-promo { position: fixed; inset: 0; z-index: 100010; display: flex; align-items: center; justify-content: center; padding: 16px; font-size: var(--cp-fs, 15px); }
.vnt39-cp .vnt39-promo__backdrop { position: absolute; inset: 0; background: rgba(17, 19, 24, .34); opacity: 0; transition: opacity .28s ease; }
.vnt39-cp .vnt39-promo__panel {
	position: relative; width: min(420px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 30px 24px 22px;
	border-radius: var(--cp-r, 18px); background: var(--cp-bg, #fff); color: var(--cp-fg, #252a31); text-align: center;
	box-shadow: 0 12px 44px rgba(16, 24, 40, .22);
	opacity: 0; transform: translateY(14px); transition: opacity .28s ease, transform .28s ease;
}
.vnt39-cp .vnt39-promo.is-in .vnt39-promo__backdrop { opacity: 1; }
.vnt39-cp .vnt39-promo.is-in .vnt39-promo__panel { opacity: 1; transform: none; }
.vnt39-cp .vnt39-promo__badge { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin: 0 auto 14px; padding: 14px; border-radius: 50%; background: #fbeaec; color: #8f0b18; }
.vnt39-cp .vnt39-promo__title { margin: 0 0 8px; font-size: 1.2em; font-weight: 800; line-height: 1.3; letter-spacing: .01em; color: var(--cp-fg, #252a31); text-transform: none; }
.vnt39-cp .vnt39-promo__text { margin: 0 auto 18px; max-width: 34ch; font-size: .96em; line-height: 1.5; opacity: .82; }
.vnt39-cp .vnt39-promo__btns { display: flex; flex-direction: column; gap: 8px; }
.vnt39-cp .vnt39-promo__btns .vnt39-cp-btn { width: 100%; min-height: 46px; }
.vnt39-cp .vnt39-promo__btns .vnt39-cp-btn--ghost { border-color: transparent; font-weight: 600; opacity: .8; }
.vnt39-cp .vnt39-promo__channels { display: flex; flex-direction: column; gap: 8px; margin: 0 0 4px; }
.vnt39-cp .vnt39-promo__ch {
	display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; margin: 0; padding: 8px 14px;
	border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; color: var(--cp-fg, #252a31);
	font: inherit; font-size: .96em; font-weight: 700; letter-spacing: 0; text-transform: none; text-align: left; text-decoration: none; cursor: pointer; box-shadow: none;
	transition: border-color .15s ease, background-color .15s ease;
}
.vnt39-cp .vnt39-promo__ch:hover { border-color: var(--cp-btn, #a30d1b); background: #fff7f8; }
.vnt39-cp .vnt39-promo__ch .vnt39-cp-ico { flex: 0 0 22px; width: 22px; height: 22px; color: var(--cp-btn, #a30d1b); }
.vnt39-cp .vnt39-promo__ch.is-active { border-color: var(--cp-btn, #a30d1b); background: #fff7f8; }
.vnt39-cp .vnt39-promo__email { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; text-align: left; }
.vnt39-cp .vnt39-promo__email input[type="email"] { flex: 1 1 180px; min-width: 0; height: 44px; margin: 0; padding: 0 14px; border: 1px solid #d0d5dd; border-radius: 999px; background: #fff; color: var(--cp-fg, #252a31); font: inherit; font-size: .96em; box-shadow: none; }
.vnt39-cp .vnt39-promo__email input[type="email"]:focus { border-color: var(--cp-btn, #a30d1b); outline: 0; }
.vnt39-cp .vnt39-promo__email .vnt39-cp-btn { flex: 0 0 auto; min-height: 44px; }
.vnt39-cp .vnt39-promo__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.vnt39-cp .vnt39-promo__msg { flex: 1 1 100%; margin: 2px 4px 0; font-size: .88em; line-height: 1.4; color: #475467; }
.vnt39-cp .vnt39-promo__msg.is-error { color: #b42318; }
.vnt39-cp .vnt39-promo__msg.is-ok { color: #067647; }
.vnt39-cp .vnt39-promo__back { display: inline-flex; align-items: center; gap: 4px; margin: 14px auto 0; padding: 4px 8px; border: 0; background: none; color: var(--cp-fg, #252a31); font: inherit; font-size: .9em; font-weight: 600; letter-spacing: 0; text-transform: none; opacity: .7; cursor: pointer; box-shadow: none; }
.vnt39-cp .vnt39-promo__back .vnt39-cp-ico { width: 16px; height: 16px; }
.vnt39-cp .vnt39-promo__back:hover { opacity: 1; }

@media (max-width: 549px) {
	.vnt39-cp .vnt39-promo { padding: 12px; }
	.vnt39-cp .vnt39-promo__panel { padding: 26px 18px 18px; }
}
@media (prefers-reduced-motion: reduce) {
	.vnt39-cp .vnt39-cc, .vnt39-cp .vnt39-ccp__backdrop, .vnt39-cp .vnt39-ccp__panel, .vnt39-cp .vnt39-promo__backdrop, .vnt39-cp .vnt39-promo__panel, .vnt39-cp .vnt39-sw i, .vnt39-cp .vnt39-sw i::after { transition: none; }
}
