/*
 * Promo campaign: banner card + pill (template-parts/promo-banner.php) and the
 * product strip (template-parts/promo-strip.php). Logic: assets/js/promo.js,
 * config: inc/promo-campaign.php. A campaign theme is one token block below
 * (.promo--<theme>); only transform and opacity are animated.
 * Layers: page 0 < FAB 80 < promo 85 < sticky bars 90 < header 100 < dialogs.
 */

.promo--halloween {
	--pr-bg-1: #130e1c; --pr-bg-2: #1a1226; --pr-glow: rgba(123, 63, 228, .3);
	--pr-accent: #ff7a1a; --pr-accent-hover: #ff9440; --pr-accent-active: #e5650a; --pr-on-accent: #1a0f08;
	--pr-muted: #a79fb5; --pr-border: rgba(255, 122, 26, .35); --pr-pill-border: rgba(255, 122, 26, .5);
	--pr-border-hover: rgba(255, 122, 26, .95); --pr-chip-border: rgba(255, 122, 26, .6); --pr-chip-bg: rgba(255, 122, 26, .07);
	--pr-pill-active: #241935; --pr-tint: #fff5ed; --pr-tint-border: #ffd8bc; --pr-tint-hover: #ffede0;
	--pr-tint-border-hover: #ffc293; --pr-tint-active: #ffe4d0; --pr-ink-accent: #c2540a;
}

/* --- Card ------------------------------------------------------------------ */

.promo__card, .promo__pill {
	position: fixed; z-index: 85; left: 24px;
	bottom: max(24px, calc(var(--ec-bar-h, 0px) + 12px));
	box-sizing: border-box; font-family: inherit; color: #fff; text-align: left;
	transform-origin: left bottom; transition: opacity .2s, visibility .2s;
}
.promo [hidden] { display: none !important; }

.promo__card {
	display: flex; flex-direction: column; gap: 16px; width: 340px; padding: 20px;
	border: 1px solid var(--pr-border); border-radius: 20px;
	background: linear-gradient(160deg, var(--pr-bg-1), var(--pr-bg-2));
	box-shadow: 0 18px 44px -14px rgba(255, 122, 26, .45), 0 6px 18px rgba(10, 6, 16, .35);
}
.promo__card p { margin: 0; }
.promo__glow { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.promo__glow::before { content: ""; position: absolute; right: -80px; top: -100px; width: 240px; height: 240px; background: radial-gradient(circle, var(--pr-glow), transparent 65%); }

.promo__decor { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.promo__decor > span { position: absolute; display: block; }
.promo__decor svg, .promo__art svg, .promo__pill-art svg, .promo-strip__art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.promo__bat:nth-child(1) { left: 170px; top: -10px; width: 20px; height: 10px; opacity: .9; }
.promo__bat:nth-child(2) { left: 206px; top: -15px; width: 13px; height: 7px; opacity: .78; }
.promo__bat:nth-child(3) { left: 238px; top: -7px; width: 15px; height: 8px; opacity: .66; }
.promo__spark { opacity: .85; }
.promo__spark:nth-child(4) { left: 78px; top: 8px; width: 7px; height: 7px; }
.promo__spark:nth-child(5) { left: 150px; top: -2px; width: 5px; height: 5px; }
.promo__spark:nth-child(6) { left: 306px; top: 104px; width: 6px; height: 6px; }

.promo__close {
	position: absolute; z-index: 2; top: 6px; right: 6px; display: flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; margin: 0; padding: 0; border: 0; background: none; color: #d3ccdf; cursor: pointer;
}
.promo__close > span { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, .08); transition: background-color .15s; }
.promo__close:hover > span { background: rgba(255, 255, 255, .16); }

.promo__head { position: relative; display: flex; align-items: flex-start; gap: 14px; padding-right: 24px; }
.promo__art { flex: none; width: 56px; height: 56px; }
.promo__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.promo__eyebrow { font-size: 11px; line-height: 1.3; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--pr-accent); }
.promo__title { font-size: 24px; line-height: 28px; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.promo__pct { color: var(--pr-accent); }
.promo__sub { margin-top: 2px !important; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--pr-muted); }
.promo__sub--chip, .promo__hint, .promo__applied { display: none; }
.promo[data-offer="active"] .promo__hint { display: inline; }
.promo[data-offer="active"] .promo__when { display: none; }

.promo__row { position: relative; display: flex; gap: 8px; }
.promo__chip {
	display: flex; flex: 1; flex-direction: column; justify-content: center; min-width: 0; height: 44px; padding: 0 12px;
	box-sizing: border-box; border: 1.5px dashed var(--pr-chip-border); border-radius: 12px; background: var(--pr-chip-bg);
}
.promo__code { overflow: hidden; font-family: "IBM Plex Mono", ui-monospace, monospace; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; user-select: all; }
.promo__code { font-size: 15px; line-height: 1.2; letter-spacing: .08em; }
.promo__btn, .promo__done, .promo__applied {
	display: flex; flex: none; align-items: center; justify-content: center; gap: 8px; min-width: 142px; height: 44px;
	margin: 0; padding: 0 16px; box-sizing: border-box; border: 0; border-radius: 999px; font-family: inherit; font-size: 14px; line-height: 20px; font-weight: 700;
}
.promo__row .promo__done, .promo__row .promo__applied { display: none; }
.promo__btn {
	background: var(--pr-accent); color: var(--pr-on-accent); cursor: pointer;
	transition: background-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.promo__btn:hover { background: var(--pr-accent-hover); box-shadow: 0 8px 20px -8px var(--pr-accent); }
.promo__btn:active { background: var(--pr-accent-active); transform: scale(.97); }
.promo:is([data-offer="active"], [data-offer="applied"]) .promo__btn { display: none; }
.promo[data-offer="active"] .promo__row .promo__done { display: flex; background: #3dbe6a; color: #07170d; }
.promo[data-offer="applied"] .promo__row .promo__applied { display: flex; background: rgba(61, 190, 106, .16); color: #7fe0a2; }
.promo[data-offer="applied"] .promo__hint { display: none; }
.promo[data-offer="applied"] .promo__when { display: inline; }
.promo__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.promo__close:focus-visible, .promo__btn:focus-visible, .promo__pill:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* --- Pill ------------------------------------------------------------------- */

.promo__pill {
	display: inline-flex; align-items: center; gap: 6px; height: 44px; margin: 0; padding: 0 16px 0 6px;
	border: 1px solid var(--pr-pill-border); border-radius: 999px; background: linear-gradient(160deg, var(--pr-bg-1), var(--pr-bg-2));
	box-shadow: 0 18px 44px -14px rgba(255, 122, 26, .45), 0 6px 18px rgba(10, 6, 16, .35);
	font-family: inherit; font-size: 16px; line-height: 1; font-weight: 800; letter-spacing: -.01em; cursor: pointer;
	transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.promo__pill:hover { transform: translateY(-2px); border-color: var(--pr-border-hover); box-shadow: 0 14px 30px -10px rgba(255, 122, 26, .6), 0 4px 12px rgba(10, 6, 16, .35); }
.promo__pill:active { transform: scale(.96); background: linear-gradient(160deg, var(--pr-pill-active), var(--pr-bg-2)); }
.promo__pill-art { flex: none; width: 32px; height: 32px; }
.promo__ring { position: absolute; inset: -1px; border: 2px solid var(--pr-accent); border-radius: inherit; opacity: 0; pointer-events: none; }

/* --- Motion (designer's timings) ---------------------------------------------- */

@keyframes pr-enter { from { transform: translateY(24px); opacity: 0; } }
@keyframes pr-collapse { to { transform: scale(.16); opacity: 0; } }
@keyframes pr-pop { from { transform: scale(.6); opacity: 0; } }
@keyframes pr-fade { from { opacity: 0; } }
@keyframes pr-out { to { opacity: 0; } }
@keyframes pr-glow { 0%, 100% { opacity: .55; } 8% { opacity: 1; } 14% { opacity: .7; } 20% { opacity: .95; } 40% { opacity: .6; } }
@keyframes pr-face { 0%, 100% { opacity: .88; } 8%, 20% { opacity: 1; } 14% { opacity: .82; } 40% { opacity: .88; } }
@keyframes pr-bats { 0% { transform: translate(-110px, 22px) scale(.6); opacity: 0; } 25% { opacity: 1; } }
@keyframes pr-ring { 0% { transform: scale(1); opacity: .7; } 22%, 100% { transform: scale(1.15, 1.4); opacity: 0; } }

.promo__card.is-in { animation: pr-enter .4s cubic-bezier(.34, 1.56, .64, 1) both; }
.promo__card.is-out { animation: pr-collapse .25s cubic-bezier(.4, 0, .2, 1) forwards; }
.promo__pill.is-in { animation: pr-pop .22s cubic-bezier(.34, 1.56, .64, 1) both; }
.promo__card.is-in .promo__decor { animation: pr-bats 1.1s cubic-bezier(.2, .8, .2, 1) .15s both; }

@media (prefers-reduced-motion: no-preference) {
	.promo .pr-halo { opacity: .75; animation: pr-glow 3s ease-in-out infinite; }
	.promo .pr-inner { animation: pr-glow 3s ease-in-out infinite; }
	.promo .pr-face { animation: pr-face 3s ease-in-out infinite; }
	.promo__ring { animation: pr-ring 5s cubic-bezier(.2, .6, .3, 1) 1.2s infinite; }
}
@media (prefers-reduced-motion: reduce) {
	.promo__card.is-in, .promo__pill.is-in { animation: pr-fade .2s ease-out both; }
	.promo__card.is-out { animation: pr-out .15s ease forwards; }
	.promo__card.is-in .promo__decor { animation: none; }
}

/* Never over the mobile menu, a modal or the delivery picker. */
body:has(.is-drawer-open) .promo, html.ec-lock .promo, html.ef-cartm-lock .promo, html.ef-dlv-lock .promo {
	opacity: 0; visibility: hidden; pointer-events: none;
}

/* --- Breakpoints ------------------------------------------------------------- */

@media (min-width: 768px) and (max-width: 1023px) {
	.promo__card, .promo__pill { left: 16px; bottom: max(16px, calc(var(--ec-bar-h, 0px) + 12px)); }
}

@media (max-width: 767px) {
	.promo__card {
		right: 12px; left: 12px; width: auto; gap: 8px; padding: 12px; border-radius: 16px;
		bottom: max(calc(12px + env(safe-area-inset-bottom, 0px)), calc(var(--ec-bar-h, 0px) + 8px));
	}
	.promo__pill { left: 12px; bottom: max(calc(16px + env(safe-area-inset-bottom, 0px)), calc(var(--ec-bar-h, 0px) + 16px)); }
	.promo__close { top: 0; right: 0; }
	.promo__head { align-items: center; gap: 12px; padding-right: 28px; }
	.promo__art { width: 44px; height: 44px; }
	.promo__text { gap: 3px; }
	.promo__eyebrow { font-size: 10px; }
	.promo__title { font-size: 17px; line-height: 22px; }
	.promo__text .promo__sub { display: none; }
	.promo__sub--chip { display: block; margin: 0 !important; overflow: hidden; font-size: 10.5px; line-height: 13px; white-space: nowrap; text-overflow: ellipsis; }
	.promo__code { font-size: 14px; }
	.promo__btn, .promo__done, .promo__applied { min-width: 136px; }
	.promo__applied { padding: 0 12px; font-size: 13px; }
	.promo__bat:nth-child(1) { left: 200px; top: -7px; width: 15px; height: 8px; }
	.promo__bat:nth-child(2) { left: 228px; top: -11px; width: 10px; height: 5px; }
	.promo__bat:nth-child(3) { left: 252px; top: -4px; width: 12px; height: 6px; }
	.promo__spark:nth-child(4) { left: 52px; top: 4px; width: 6px; height: 6px; }
	.promo__spark:nth-child(5) { left: 178px; top: 2px; width: 4px; height: 4px; }
	.promo__spark:nth-child(6) { display: none; }
	/* The open card covers the FAB corner; the buttons come back with the pill. */
	body.ec-promo-open .ec-fab { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* Narrowest phones (320px): the code must stay whole next to the button. */
@media (max-width: 359px) {
	.promo__btn, .promo__done, .promo__applied { min-width: 0; padding: 0 12px; gap: 6px; font-size: 13px; }
	.promo__chip { padding: 0 8px; }
	.promo__code { font-size: 13px; letter-spacing: .04em; }
	.promo__sub--chip { font-size: 10px; }
}

/* --- Product strip ----------------------------------------------------------- */

.promo-strip {
	position: relative; display: flex; align-items: center; min-height: 48px; margin-top: 12px; padding-right: 4px;
	box-sizing: border-box; border: 1px solid var(--pr-tint-border); border-radius: 12px; background: var(--pr-tint);
	color: #141414; container-type: inline-size; transition: background-color .15s ease, border-color .15s ease;
}
.product-summary__buybox-card > .promo-strip { margin-top: -8px; } /* 12px under the buttons in the 20px-gap column. */
.promo-strip p { margin: 0; }
.promo-strip__main {
	display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; min-height: 46px; margin: 0; padding: 0 0 0 12px;
	border: 0; border-radius: 12px 0 0 12px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; outline: 0;
}
.promo-strip:has(.promo-strip__main:hover) { background: var(--pr-tint-hover); border-color: var(--pr-tint-border-hover); }
.promo-strip:has(.promo-strip__main:active) { background: var(--pr-tint-active); border-color: var(--pr-tint-border-hover); }
.promo-strip:has(.promo-strip__main:focus-visible) { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #141414; }
.promo-strip__art { flex: none; width: 26px; height: 26px; }
.promo-strip__art .pr-halo, .promo-strip__art .pr-inner { display: none; }
.promo-strip__text, .promo-strip__line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.promo-strip__text { flex: 1; font-size: 14px; line-height: 20px; color: #4a4a4a; white-space: nowrap; }
.promo-strip__bold { font-weight: 800; color: #141414; }
/* «Активувати»: the strip's action, so a solid outline rather than a coupon's dashed one. */
.promo-strip__chip {
	display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 6px;
	height: 32px; min-width: 120px; padding: 0 12px; box-sizing: border-box; border: 1.5px solid var(--pr-accent);
	border-radius: 8px; background: #fff; color: #141414; font-size: 13px; font-weight: 700;
	transition: transform .12s ease, background-color .15s ease;
}
.promo-strip__chip svg { color: var(--pr-accent); }
.promo-strip__main:hover .promo-strip__chip { background: var(--pr-tint-hover); }
.promo-strip__main:active .promo-strip__chip { transform: scale(.97); }
.promo-strip__bold--active, .promo-strip__later, .promo-strip__applied { display: none; }
.promo-strip:is([data-offer="active"], [data-offer="applied"]) .promo-strip__main { cursor: default; }
.promo-strip:is([data-offer="active"], [data-offer="applied"]) .promo-strip__chip { display: none; }
.promo-strip[data-offer="active"] .promo-strip__bold:not(.promo-strip__bold--active) { display: none; }
.promo-strip[data-offer="active"] .promo-strip__bold--active { display: inline; color: #1c6b39; }
.promo-strip[data-offer="active"] .promo-strip__later { display: inline; }
.promo-strip[data-offer="applied"] .promo-strip__applied { display: inline; font-weight: 700; color: #1c6b39; }

.promo-strip__info {
	display: flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px;
	margin: 0; padding: 0; border: 0; background: none; color: #141414; cursor: pointer;
}
.promo-strip__info > span { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; transition: background-color .15s; }
.promo-strip__info[aria-expanded="true"] > span { background: rgba(20, 20, 20, .1); }
.promo-strip__info:focus-visible { outline: 2px solid #141414; outline-offset: -4px; border-radius: 50%; }
.promo-strip__pop {
	position: absolute; z-index: 5; top: calc(100% + 10px); right: 0; width: 320px; padding: 14px 16px; box-sizing: border-box;
	border: 1px solid var(--pr-border); border-radius: 12px; background: linear-gradient(160deg, var(--pr-bg-1), var(--pr-bg-2));
	box-shadow: 0 18px 40px -12px rgba(20, 14, 28, .45); color: #e9e5ef; font-size: 13px; line-height: 19px; font-weight: 500;
}
.promo-strip__pop::before {
	content: ""; position: absolute; top: -6px; right: 21px; width: 11px; height: 11px; background: var(--pr-bg-1);
	border: solid var(--pr-border); border-width: 1px 0 0 1px; transform: rotate(45deg);
}
.promo-strip__pop-title { margin-bottom: 6px !important; font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--pr-accent); }
.promo-strip--plain .promo-strip__main { cursor: default; }

/* Narrow purchase block (phones, and the 45% column on small desktops): two lines. */
@container (max-width: 539px) {
	.promo-strip__main { gap: 10px; min-height: 62px; padding: 5px 0 5px 12px; }
	.promo-strip__art { width: 24px; height: 24px; }
	.promo-strip__text { flex-direction: column; align-items: flex-start; gap: 5px; white-space: normal; }
	.promo-strip__bold { line-height: 19px; }
	.promo-strip__line { gap: 8px; font-size: 13px; line-height: 18px; white-space: nowrap; }
	.promo-strip__chip { height: 28px; min-width: 112px; padding: 0 10px; font-size: 12.5px; }
}
@container (max-width: 299px) {
	.promo-strip__rest { display: none; }
}
@media (max-width: 767px) {
	.promo-strip { margin-top: 10px; padding-right: 2px; }
	.promo-strip__pop { left: 0; width: auto; }
	.promo-strip__pop::before { right: 16px; }
}
