/*
 * Black Week 2026 — styl wariantu hero. Ładowany tylko gdy promocja jest aktywna
 * (patrz inc/black-week.php). Usunięcie tego pliku / wyłączenie flagi = zwykłe hero.
 */

/* Tokeny na :root, bo wyskakujące okno pojawia się też na podstronach. */
:root {
	--planu-bw-bg: #0b0612;
	--planu-bw-text: var(--planu-dzien);
	--planu-bw-muted: var(--planu-poranek);
	--planu-bw-accent: var(--planu-zolty);
}

/* Pasek statusu / tło za nagłówkiem na telefonie ma być czarne, nie fioletowe. */
html:has(body.planu-bw-on),
body.planu-bw-on,
body.planu-bw-on .ct-drawer-canvas,
body.planu-bw-on #main-container {
	background-color: var(--planu-bw-bg);
}

/* ---------- Hero ---------- */

.planu-hero--bw {
	/* H1 wyżej niż w zwykłym hero: 32 + 24 + wysokość nagłówka. */
	padding-top: calc(var(--planu-space-32) + var(--planu-space-24) + var(--planu-header-height));
	background:
		radial-gradient(60% 55% at 50% 0%, color-mix(in srgb, var(--planu-czerwony) 22%, transparent) 0%, transparent 70%),
		var(--planu-bw-bg);
	padding-bottom: var(--planu-space-64);
	min-height: 0;
}

.planu-hero--bw::before {
	opacity: 0.12;
}

.planu-hero--bw .planu-hero__inner h1 {
	/* Tylko w wariancie Black Week; zwykłe hero zostaje przy 50 px. */
	font-size: 44px;
	--theme-font-size: 44px;
	color: var(--planu-bw-text);
}

/* ---------- Oferta ---------- */

/*
 * Tytuł i oferta zawsze jedno pod drugim. Klasa planu-hero__avoid (potrzebna kółkom do omijania)
 * robi z nich inline-block, więc przy węższym tytule lądowały obok siebie.
 */
.planu-hero--bw .planu-hero__inner > h1,
.planu-hero--bw .planu-hero__inner > .planu-bw__offer {
	display: block;
	width: fit-content;
	max-width: 100%;
	margin-inline: auto;
}

.planu-hero--bw .planu-hero__inner > h1 {
	text-align: center;
}

.planu-bw__offer {
	--planu-bw-num: clamp(96px, 17vw, 190px);
	margin: 0 auto 60px;
	text-align: center;
}

.planu-bw__offer p {
	margin: 0;
}

.planu-bw__discount {
	margin-top: var(--planu-space-8) !important;
	font-size: var(--planu-bw-num);
	font-weight: var(--planu-fw-heading);
	line-height: 0.95;
	letter-spacing: var(--planu-tracking-display);
	color: var(--planu-bw-accent);
}

.planu-bw__minus {
	/* Krótszy minus narysowany CSS-em (znak − z fontu jest za długi). */
	display: inline-block;
	width: 0.3em;
	height: 0.12em;
	margin-right: 0.07em;
	vertical-align: 0.3em;
	background: currentColor;
}

.planu-bw__scope {
	/* Wciągamy pod same cyfry (linia -20% ma pusty margines pod cyframi). */
	margin-top: calc(var(--planu-bw-num) * -0.09) !important;
	font-size: 60px;
	font-weight: var(--planu-fw-emphasis);
	line-height: 1;
	color: var(--planu-bw-accent);
}

.planu-bw__part {
	white-space: nowrap;
}

.planu-bw__note {
	position: relative;
	/* Linia z datą (i znak wodny) wyśrodkowana między „na wszystko" a przyciskami: 60 px z obu stron. */
	margin-top: 60px !important;
	color: var(--planu-bw-muted);
}

/*
 * Znak wodny „BLACK WEEK": jedna linia, prosto, ledwo widoczny, wyśrodkowany za linią
 * „Do 30 listopada · Rabat naliczy się…". Leży pod tekstem (z-index -1 w kontekście hero/okna).
 */
.planu-bw__note::before {
	content: "BLACK WEEK";
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: -1;
	transform: translate(-50%, -50%);
	font-size: 9.8vw;
	font-weight: 800;
	line-height: 1;
	letter-spacing: var(--planu-tracking-display);
	white-space: nowrap;
	color: color-mix(in srgb, var(--planu-bw-text) 11%, transparent);
	pointer-events: none;
	user-select: none;
}

.planu-bw-modal__inner {
	container-type: inline-size;
}

/* W oknie znak wodny na całą szerokość karty („BLACK WEEK" ma ok. 6,1 em szerokości). */
.planu-bw-modal .planu-bw__note::before {
	font-size: calc(100cqw / 6.1);
}

/* Większa kropka środkowa, odstęp po bokach ok. 3x zwykłej spacji (0,25em -> 0,75em). */
.planu-bw__dot {
	display: inline-block;
	margin-inline: 0.42em;
	font-size: 1.8em;
	line-height: 0;
	vertical-align: middle;
}

/* ---------- Przyciski na czarnym tle ---------- */

.planu-hero--bw .planu-btn--secondary {
	color: var(--planu-bw-text);
	border-color: color-mix(in srgb, var(--planu-bw-text) 55%, transparent);
	background: transparent;
}

/* ---------- Czarne tło kończy się w połowie boksu z zaletami ---------- */

.planu-hero--bw + .planu-benefits {
	position: relative;
	isolation: isolate;
	margin-top: 0;
}

.planu-hero--bw + .planu-benefits::before {
	content: "";
	position: absolute;
	z-index: -1;
	top: 0;
	left: 50%;
	width: 100vw;
	height: 50%;
	transform: translateX(-50%);
	background: var(--planu-bw-bg);
}

/* ---------- Nagłówek nad czarnym hero (zanim zrobi się „szklany" po przewinięciu) ---------- */

body.planu-bw-on header#header:not(.planu-header--glass) .site-title,
body.planu-bw-on header#header:not(.planu-header--glass) .site-title a,
body.planu-bw-on header#header:not(.planu-header--glass) .header-menu-1 > ul > li > a.ct-menu-link {
	color: var(--planu-bw-text);
}

body.planu-bw-on header#header:not(.planu-header--glass) .site-logo-container img,
body.planu-bw-on header#header:not(.planu-header--glass) .site-logo-container svg {
	filter: brightness(0) invert(1);
}

@media (max-width: 689.98px) {
	.planu-hero--bw {
		padding-top: calc(var(--planu-space-24) + var(--planu-space-32) + var(--planu-header-height-mobile));
		padding-bottom: var(--planu-space-48);
	}

	.planu-bw__offer {
		margin-bottom: 100px;
	}

	.planu-bw__discount {
		margin-top: 32px !important;
	}

	/* Telefon: bez latających magnesów (kółek ze zdjęciami) w wariancie Black Week. */
	.planu-hero--bw .planu-hero__orb {
		display: none !important;
	}

	.planu-bw__offer {
		--planu-bw-num: clamp(120px, 34vw, 190px);
	}

	/* Tytuł skaluje się z szerokością ekranu: „Dziecko ogarnie plan." (ok. 9,8 em) mieści się w jednej linii,
	   więc całość to 2 linie (przy węższym ekranie max 3), a nie 4. */
	.planu-hero--bw .planu-hero__inner h1 {
		font-size: min(44px, 8.8vw);
		--theme-font-size: min(44px, 8.8vw);
	}

	.planu-bw__scope {
		font-size: 48px;
	}

	/* Telefon: znak wodny w dwóch liniach (70% szerokości kontenera; hero ma po 16 px marginesu). */
	.planu-hero--bw .planu-bw__note::before {
		content: "BLACK\A WEEK";
		font-size: calc((100vw - 32px) / 4.43); /* 30% mniej niż pełna szerokość kontenera */
		line-height: 0.85;
		text-align: center;
		white-space: pre;
	}

	.planu-bw__note {
		margin-top: 100px !important;
		/* Rozmiar jak w body (18 px), na wąskim ekranie lekko skalowany, żeby „Rabat…" zmieścił się w jednej linii. */
		font-size: min(var(--planu-text), 4.5vw);
	}

	/* Telefon: dwie linie bez kropki — „Do 30 listopada" nad „Rabat naliczy się…"; żadna z nich się nie łamie. */
	.planu-bw__part {
		display: block;
	}

	.planu-bw__dot {
		display: none;
	}

	.planu-bw-modal .planu-bw__note {
		font-size: min(var(--planu-text), calc((100cqw - 48px) / 19.6));
	}
}

/* ---------- Wyskakujące okno (podstrony) ---------- */

.planu-bw-modal {
	width: min(92vw, 560px);
	max-width: none;
	max-height: 92vh;
	margin: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--planu-bw-text);
	overflow: visible;
}

.planu-bw-modal::backdrop {
	background: color-mix(in srgb, var(--planu-bw-bg) 78%, transparent);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.planu-bw-modal__inner {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding: var(--planu-space-64) var(--planu-space-32) var(--planu-space-64);
	text-align: center;
	border-radius: var(--planu-radius-section, 24px);
	background:
		radial-gradient(70% 50% at 50% 0%, color-mix(in srgb, var(--planu-czerwony) 26%, transparent) 0%, transparent 72%),
		var(--planu-bw-bg);
	box-shadow: var(--planu-shadow-overlay);
}

.planu-bw-modal__inner::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: var(--planu-grain);
	background-size: 128px 128px;
	opacity: 0.12;
	mix-blend-mode: overlay;
	pointer-events: none;
}

.planu-bw-modal__title {
	margin: 0;
	font-size: clamp(24px, 5vw, 32px);
	font-weight: var(--planu-fw-heading);
	line-height: var(--planu-leading-heading);
	letter-spacing: var(--planu-tracking-display);
	color: var(--planu-bw-text);
}

.planu-bw-modal .planu-bw__offer {
	--planu-bw-num: clamp(88px, 24vw, 132px);
}

.planu-bw-modal .planu-bw__discount {
	margin-top: 32px !important;
}

.planu-bw-modal .planu-bw__offer {
	margin-bottom: 90px;
}

.planu-bw-modal .planu-bw__note {
	margin-top: 90px !important;
}

.planu-bw-modal__close {
	position: absolute;
	top: var(--planu-space-12);
	right: var(--planu-space-12);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	font-size: 26px;
	line-height: 1;
	color: var(--planu-bw-text);
	background: color-mix(in srgb, var(--planu-bw-text) 14%, transparent);
	cursor: pointer;
}

.planu-bw-modal__close:hover,
.planu-bw-modal__close:focus-visible {
	background: color-mix(in srgb, var(--planu-bw-text) 26%, transparent);
}

body.planu-bw-modal-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
	.planu-bw-modal[open] .planu-bw-modal__inner {
		animation: planu-bw-pop 300ms var(--planu-ease-enter);
	}

	@keyframes planu-bw-pop {
		from {
			opacity: 0;
			transform: translateY(16px) scale(0.97);
		}
	}
}

@media (max-width: 689.98px) {
	.planu-bw-modal__inner {
		padding: var(--planu-space-64) var(--planu-space-24) var(--planu-space-48);
	}
}

@media (max-width: 689.98px) {
	.planu-bw-modal .planu-bw__offer {
		margin-bottom: 52px;
	}

	.planu-bw-modal .planu-bw__note {
		margin-top: 52px !important;
	}

	.planu-bw-modal .planu-bw__note::before {
		font-size: calc(100cqw / 6.1);
	}
}

.planu-bw-modal__cta {
	text-transform: uppercase;
}
