﻿/* ==========================================================================
   HESP PopUp — frontend modal
   ========================================================================== */

.hesp-popup-root {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
}

.hesp-popup-root[hidden] {
	display: none !important;
}

.hesp-popup-root.is-visible {
	animation: hespPopupFadeIn 0.28s ease;
}

.hesp-popup-overlay {
	position: absolute;
	inset: 0;
	background: rgba(16, 32, 47, 0.55);
	opacity: 1;
	transition: opacity 0.28s ease;
}

.hesp-popup-modal {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-height: calc(100svh - 48px);
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(16, 32, 47, 0.28);
	transform: translateY(12px) scale(0.98);
	opacity: 0;
	transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.hesp-popup-root.is-visible .hesp-popup-modal {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.hesp-popup-root.is-closing {
	pointer-events: none;
}

.hesp-popup-root.is-closing .hesp-popup-overlay {
	opacity: 0;
}

.hesp-popup-root.is-closing .hesp-popup-modal {
	transform: translateY(16px) scale(0.96);
	opacity: 0;
}

.hesp-popup-scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.hesp-popup-close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 10;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 44px !important;
	height: 44px !important;
	min-width: 44px !important;
	min-height: 44px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: rgba(255, 255, 255, 0.2) !important;
	color: inherit !important;
	font-size: 0 !important;
	line-height: 0 !important;
	cursor: pointer;
	box-shadow: none !important;
	flex-shrink: 0;
	transition: background 0.2s ease, transform 0.15s ease;
}

.hesp-popup-close__icon {
	display: block;
	flex-shrink: 0;
	pointer-events: none;
}

.hesp-popup-close:hover {
	background: rgba(255, 255, 255, 0.32) !important;
	transform: scale(1.05);
	color: inherit !important;
}

.hesp-popup-close:focus {
	outline: none;
}

.hesp-popup-close:focus-visible {
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35) !important;
}

.hesp-popup-content {
	font-family: 'Manrope', sans-serif;
	line-height: 1.65;
	padding-right: 36px;
}

.hesp-popup-content > :first-child {
	margin-top: 0;
}

.hesp-popup-content > :last-child {
	margin-bottom: 0;
}

.hesp-popup-content h1,
.hesp-popup-content h2,
.hesp-popup-content h3 {
	font-family: var(--hesp-font);
	line-height: 1.15;
	margin-bottom: 14px;
}

.hesp-popup-content h2 {
	font-size: var(--hesp-text-h2);
	font-weight: var(--hesp-font-bold);
	line-height: var(--hesp-leading-h2);
	letter-spacing: 0;
	max-width: 18ch;
}

.hesp-popup-content .hesp-popup-eyebrow {
	font-family: var(--hesp-font);
	font-weight: var(--hesp-font-semibold);
	font-size: var(--hesp-text-eyebrow);
	letter-spacing: var(--hesp-tracking-eyebrow);
	text-transform: uppercase;
	color: #d9a635 !important;
	margin: 0 0 10px;
}

.hesp-popup-content p {
	margin: 0 0 14px;
	font-size: var(--hesp-text-body);
	line-height: var(--hesp-leading-body);
}

.hesp-popup-content p strong {
	font-weight: 700;
}

.hesp-popup-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 22px 0 !important;
}

.hesp-popup-stats .wp-block-column {
	flex: 1 1 140px;
	min-width: 120px;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 14px;
	padding: 14px 12px;
	margin: 0 !important;
}

.hesp-popup-stats p {
	margin: 0 !important;
	font-size: 13px;
	line-height: 1.45;
	color: rgba(255, 255, 255, 0.82);
}

.hesp-popup-stats strong {
	display: block;
	font-family: var(--hesp-font);
	font-size: 21px;
	font-weight: var(--hesp-font-bold);
	color: #ffffff;
	margin-bottom: 4px;
	line-height: 1.1;
}

.hesp-popup-content ul {
	margin: 18px 0 0;
	padding-left: 1.15em;
}

.hesp-popup-content li {
	margin-bottom: 10px;
	font-size: 14.5px;
	line-height: 1.55;
}

.hesp-popup-content li:last-child {
	margin-bottom: 0;
}

.hesp-popup-content li strong {
	font-weight: 700;
}

.hesp-popup-content a {
	color: inherit;
}

.hesp-popup-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 24px;
	padding: 14px 28px;
	border-radius: 999px;
	font-family: 'Manrope', sans-serif;
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
	transition: opacity 0.2s ease, transform 0.15s ease;
}

.hesp-popup-button:hover {
	opacity: 0.92;
	transform: translateY(-1px);
	color: inherit;
}

.hesp-popup-button[hidden] {
	display: none !important;
}

body.hesp-popup-open {
	/* Desktop can lock; mobile must keep page scroll (audit 9.7). */
	overflow: hidden;
}

@media (max-width: 600px) {
	body.hesp-popup-open {
		overflow: auto;
	}
}

@keyframes hespPopupFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* ==========================================================================
   Audit flyer layout (Audyt generalny)
   ========================================================================== */

.hesp-popup-modal:has(.hesp-popup-audit),
.hesp-popup-root--audit .hesp-popup-modal {
	background: #ffffff !important;
	color: #1a365d !important;
	max-width: min(960px, calc(100vw - 48px)) !important;
	padding: 0 !important;
	max-height: calc(100svh - 32px);
}

.hesp-popup-root--audit .hesp-popup-scroll,
.hesp-popup-modal:has(.hesp-popup-audit) .hesp-popup-scroll {
	overflow: visible;
	flex: 0 1 auto;
}

.hesp-popup-modal:has(.hesp-popup-audit) .hesp-popup-close,
.hesp-popup-root--audit .hesp-popup-close {
	top: 12px;
	right: 12px;
	width: 44px !important;
	height: 44px !important;
	min-width: 44px !important;
	min-height: 44px !important;
	color: #ffffff !important;
	background: #d4af37 !important;
	box-shadow: 0 4px 14px rgba(26, 54, 93, 0.25) !important;
}

.hesp-popup-modal:has(.hesp-popup-audit) .hesp-popup-close:hover,
.hesp-popup-root--audit .hesp-popup-close:hover {
	background: #e0c15a !important;
	color: #1a365d !important;
}

.hesp-popup-modal:has(.hesp-popup-audit) .hesp-popup-close:focus-visible,
.hesp-popup-root--audit .hesp-popup-close:focus-visible {
	box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.45) !important;
}

.hesp-popup-content:has(.hesp-popup-audit) {
	padding-right: 0;
}

.hesp-popup-audit {
	margin: 0;
	color: #1a365d;
}

.hesp-popup-audit__header {
	background: #1a365d;
	color: #ffffff;
	padding: 28px 56px 22px 32px;
	text-align: left;
}

.hesp-popup-audit__header .hesp-popup-eyebrow {
	color: #d4af37 !important;
	letter-spacing: var(--hesp-tracking-eyebrow);
	margin: 0 0 8px;
	font-size: 11px;
}

.hesp-popup-audit__header h2 {
	max-width: none;
	margin: 0 0 8px;
	color: #ffffff;
	font-size: clamp(24px, 3vw, 30px);
	font-weight: var(--hesp-font-bold);
	line-height: 1.2;
}

.hesp-popup-audit__tagline {
	margin: 0 0 8px !important;
	color: #d4af37 !important;
	font-family: var(--hesp-font);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.hesp-popup-audit__intro {
	margin: 0 !important;
	max-width: 62em;
	color: rgba(255, 255, 255, 0.9) !important;
	font-size: 14px !important;
	line-height: 1.5;
}

.hesp-popup-audit__body {
	padding: 20px 28px 18px;
	background: #ffffff;
}

.hesp-popup-audit__columns {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.9fr);
	gap: 18px 28px;
	align-items: start;
	margin-top: 18px;
}

.hesp-popup-audit .hesp-popup-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin: 0 !important;
}

.hesp-popup-audit .hesp-popup-stats__item {
	background: #ffffff;
	border: 1px solid #e8eef4;
	border-top: 3px solid #d4af37;
	border-radius: 10px;
	padding: 12px 10px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(26, 54, 93, 0.06);
}

.hesp-popup-audit .hesp-popup-stats__value {
	display: block;
	font-family: var(--hesp-font);
	font-size: 26px;
	font-weight: var(--hesp-font-bold);
	line-height: 1;
	color: #1a365d;
	margin-bottom: 6px;
}

.hesp-popup-audit .hesp-popup-stats__label {
	display: block;
	font-family: var(--hesp-font);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: #5a6b7d;
	line-height: 1.3;
}

.hesp-popup-audit__section-title {
	margin: 0 0 10px !important;
	font-family: var(--hesp-font);
	font-size: 16px;
	font-weight: var(--hesp-font-bold);
	color: #1a365d;
	line-height: 1.3;
}

.hesp-popup-audit__list {
	list-style: none;
	margin: 0 !important;
	padding: 0 !important;
}

.hesp-popup-audit__list li {
	position: relative;
	margin: 0 0 8px;
	padding-left: 20px;
	font-size: 13.5px;
	line-height: 1.45;
	color: #2d3e50;
}

.hesp-popup-audit__list li:last-child {
	margin-bottom: 0;
}

.hesp-popup-audit__list li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.4em;
	width: 9px;
	height: 9px;
	border-radius: 2px;
	background: #d4af37;
}

.hesp-popup-cert {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 16px 0 0;
	padding: 12px 14px;
	background: #f0f4f8;
	border-radius: 10px;
	border-left: 4px solid #d4af37;
}

.hesp-popup-cert__seal {
	flex: 0 0 52px;
	width: 52px;
	height: 52px;
}

.hesp-popup-cert__seal svg {
	display: block;
	width: 100%;
	height: 100%;
}

.hesp-popup-cert__text {
	flex: 1 1 auto;
	min-width: 0;
}

.hesp-popup-cert__title {
	margin: 0 0 4px !important;
	font-family: var(--hesp-font);
	font-size: 13.5px;
	font-weight: var(--hesp-font-bold);
	color: #1a365d;
	line-height: 1.35;
}

.hesp-popup-cert__note {
	margin: 0 !important;
	font-size: 12px !important;
	line-height: 1.45;
	color: #5a6b7d !important;
}

.hesp-popup-offer {
	position: relative;
	margin: 8px 0 0;
	padding-top: 12px;
}

.hesp-popup-offer.has-regional {
	padding-top: 8px;
	padding-right: 0;
}

.hesp-popup-offer__badge,
.hesp-popup-offer__old,
.hesp-popup-offer__discount {
	display: none !important;
}

.hesp-popup-offer__box {
	background: #fdf6e3;
	border: 1px solid #e5c158;
	border-radius: 12px;
	padding: 22px 16px 14px;
	text-align: center;
}

.hesp-popup-offer__prices {
	display: flex;
	align-items: baseline;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin-bottom: 8px;
}

.hesp-popup-offer__old {
	font-size: 14px;
	color: #8a96a3;
	text-decoration: line-through;
}

.hesp-popup-offer__new {
	font-family: var(--hesp-font);
	font-size: clamp(24px, 3vw, 30px);
	font-weight: var(--hesp-font-bold);
	color: #1a365d;
	line-height: 1;
}

.hesp-popup-offer__discount {
	display: inline-flex;
	align-items: center;
	padding: 4px 8px;
	border-radius: 999px;
	background: #d9534f;
	color: #ffffff;
	font-family: var(--hesp-font);
	font-size: 12px;
	font-weight: var(--hesp-font-bold);
	line-height: 1;
}

.hesp-popup-offer__gross {
	margin: 0 0 8px !important;
	font-family: var(--hesp-font);
	font-size: 14px !important;
	font-weight: 600;
	color: #5a6b7d !important;
}

.hesp-popup-offer__omnibus {
	margin: 0 0 8px !important;
	font-size: 12px !important;
	line-height: 1.4;
	color: #5a6b7d !important;
}

.hesp-popup-offer__label {
	margin: 0 !important;
	font-family: var(--hesp-font);
	font-size: 10.5px !important;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #8a96a3 !important;
}

.hesp-popup-offer .hesp-regional-offer,
.hesp-popup-offer__regional {
	position: relative;
	margin: 14px 0 0 !important;
	padding: 18px 14px 12px;
	border-radius: 16px;
	background: #f4efe6;
	color: #082e4e;
	box-sizing: border-box;
	text-align: left;
	box-shadow: 0 10px 24px rgba(16, 32, 47, 0.12);
}

@media (min-width: 720px) {
	.hesp-popup-offer.has-regional .hesp-popup-offer__box {
		margin-right: 8px;
	}

	.hesp-popup-offer .hesp-regional-offer {
		position: absolute;
		top: 0;
		right: 0;
		width: min(220px, 46%);
		margin: 0 !important;
		z-index: 2;
		transform: translate(8px, -12px);
	}

	.hesp-popup-offer.has-regional .hesp-popup-offer__box {
		padding-right: 36%;
	}
}

.hesp-popup-offer .hesp-regional-offer__ribbon,
.hesp-popup-offer__regional span {
	position: absolute;
	top: -8px;
	left: 12px;
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 4px 10px;
	border-radius: 4px 4px 4px 0;
	background: #c62828;
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.2;
}

.hesp-popup-offer .hesp-regional-offer__region,
.hesp-popup-offer__regional em {
	display: block;
	margin: 6px 0 0;
	font-style: normal;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.35;
	color: #5a6a7a;
}

.hesp-popup-offer .hesp-regional-offer__validity,
.hesp-popup-offer__regional-validity {
	display: block;
	margin: 4px 0 0 !important;
	font-size: 11px !important;
	font-weight: 600;
	line-height: 1.35;
	color: #5a6a7a !important;
}

.hesp-popup-offer .hesp-regional-offer__price,
.hesp-popup-offer__regional strong {
	margin: 8px 0 0;
	display: flex;
	align-items: baseline;
	gap: 6px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
	color: #082e4e;
}

.hesp-popup-offer .hesp-regional-offer__price span {
	position: static;
	background: none;
	color: #5a6a7a;
	padding: 0;
	font-size: 12px;
	letter-spacing: 0;
	text-transform: none;
}

.hesp-popup-offer .hesp-regional-offer__omnibus,
.hesp-popup-offer__regional-omnibus {
	margin: 8px 0 0 !important;
	font-size: 11px !important;
	line-height: 1.35;
	color: #5a6a7a !important;
}

.hesp-popup-audit__cta {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin: 12px 0 0;
	padding: 14px 20px;
	border-radius: 12px;
	background: #d4af37;
	color: #1a365d !important;
	font-family: var(--hesp-font);
	font-size: 15px;
	font-weight: var(--hesp-font-bold);
	text-decoration: none !important;
	box-sizing: border-box;
	transition: opacity 0.2s ease, transform 0.15s ease;
}

.hesp-popup-audit__cta:hover {
	opacity: 0.92;
	transform: translateY(-1px);
	color: #1a365d !important;
}

.hesp-popup-audit__footer {
	margin: 10px 0 0 !important;
	text-align: center;
	font-size: 12px !important;
	color: #8a96a3 !important;
	line-height: 1.4;
}

@media (max-width: 820px) {
	.hesp-popup-audit__columns {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}

@media (max-width: 600px) {
	.hesp-popup-root {
		padding: 12px 12px 16px;
		align-items: flex-end;
	}

	.hesp-popup-modal {
		max-width: none !important;
		max-height: min(78svh, calc(100svh - 28px));
		border-radius: 18px !important;
	}

	.hesp-popup-root--audit .hesp-popup-scroll,
	.hesp-popup-modal:has(.hesp-popup-audit) .hesp-popup-scroll {
		overflow-y: auto;
	}

	.hesp-popup-root--audit .hesp-popup-close,
	.hesp-popup-modal:has(.hesp-popup-audit) .hesp-popup-close {
		top: auto;
		bottom: auto;
		right: 10px;
		top: 10px;
	}

	.hesp-popup-content h2 {
		max-width: none;
		font-size: 24px;
	}

	.hesp-popup-stats .wp-block-column {
		flex: 1 1 calc(50% - 6px);
		min-width: calc(50% - 6px);
	}

	.hesp-popup-stats .wp-block-column:last-child {
		flex: 1 1 100%;
		min-width: 100%;
	}

	.hesp-popup-button {
		width: 100%;
	}

	.hesp-popup-audit__header {
		padding: 28px 52px 20px 20px;
	}

	.hesp-popup-audit__body {
		padding: 16px 16px 12px;
	}

	.hesp-popup-audit .hesp-popup-stats {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.hesp-popup-cert {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.hesp-popup-audit__cta {
		margin-top: 12px;
	}
}
