/**
 * Eveneum overrides for Consent Magic Pro popup (theme-safe vs plugin updates).
 */

/* Main bar only: hide top-right close (keep settings modal close usable) */
.cs-info-bar.cs-public-cookie-popup.cs_popup > button.cs-modal-close[data-action="cs_close_consent"] {
	display: none !important;
}

/* Smaller logo + more space before/after relative to neighbouring content */
.cs-public-cookie-popup.cs_popup .cs-wrapper img {
	max-height: 28px;
	width: auto;
	max-width: 100%;
	height: auto;
	object-fit: contain;
	vertical-align: middle;
}

.cs-public-cookie-popup.cs_popup .cs-wrapper > div:first-child:has(img) {
	margin-bottom: 2rem !important;
}

.cs-public-cookie-popup.cs_popup .cs-wrapper > div:last-child:has(img) {
	margin-top: 2rem !important;
}

/* Policy link in line with description text */
.cs-public-cookie-popup .bar_description_text {
	display: inline;
	font-size: 12px !important;
	line-height: 1.45;
}

.cs-public-cookie-popup .bar_description_text p {
	display: inline;
	margin: 0;
	padding: 0;
}

.cs-public-cookie-popup .bar_description_text p:not(:last-child)::after {
	content: " ";
}

.cs-public-cookie-popup .policy_wrap {
	display: inline;
	margin: 0;
	margin-left: 0.35em;
	font-size: 12px !important;
	line-height: 1.45;
}

.cs-public-cookie-popup .policy_wrap a {
	white-space: nowrap;
	font-size: 12px !important;
}

/* Scroll long copy + policy (~100px + 30% ≈ 130px); padding so last line is not clipped */
.cs-public-cookie-popup.cs_popup .cs-wrapper > div:has(> .btns_column) > div:first-child {
	box-sizing: border-box;
	max-height: 130px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 6px;
}

/*
 * Consent Magic front uses .cs_preview_container; plugin sets .btn-row { margin-top: 50px }
 * on popup_small/large — that caused the large gap above „Przejdź do serwisu”.
 */
.cs_preview_container .cs-info-bar.popup_small .btn-row,
.cs_preview_container .cs-info-bar.popup_large .btn-row {
	margin-top: 0.5rem !important;
}

/* Stack buttons: Allow all first, then customize as underlined text-style control */
.cs-public-cookie-popup .btn-row {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.45rem;
}

/* Lower order = higher in column. Target: Allow all → optional deny/custom → Customize link */
.cs-public-cookie-popup .btn-row .allow_all_btn {
	order: 2;
	font-weight: 600 !important;
}

.cs-public-cookie-popup .btn-row .disable_all_btn {
	order: 3;
}

.cs-public-cookie-popup .btn-row .minimum_recommended_btn {
	order: 4;
}

.cs-public-cookie-popup .btn-row .options_btn {
	order: 5;
	align-self: center;
	width: auto;
	min-width: 0;
	margin-left: auto !important;
	margin-right: auto !important;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	padding: 0.35rem 0.5rem !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	text-decoration: underline;
	text-underline-offset: 0.15em;
	font-weight: 400 !important;
	font-size: inherit;
	line-height: 1.4;
	color: var(--cs-color-underline, #8b7355) !important;
	cursor: pointer;
}

.cs-public-cookie-popup .btn-row .options_btn:hover,
.cs-public-cookie-popup .btn-row .options_btn:focus {
	opacity: 0.85;
	text-decoration: underline;
}
