/**
 * Nexera Cookie Consent - Cookiebot-stílusú megjelenés.
 *
 * Vanilla CSS, build nélkül él. Színek a --ncc-* CSS változókból (PHP inline).
 *
 * @package Karmalink / Nexera
 */

/* Alapok, izoláció a téma stílusaitól */
.ncc-root,
.ncc-root *,
.ncc-reopen,
.ncc-reopen * {
	box-sizing: border-box;
}

.ncc-root {
	position: fixed;
	z-index: 999999;
	inset: 0;
	pointer-events: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: var(--ncc-text, #2b2f38);
}

.ncc-root[hidden] {
	display: none;
}

/* -------------------------------------------------------------------------
 * Overlay (csak modal layoutnál látszik, illetve amikor a prefs panel nyitva)
 * ---------------------------------------------------------------------- */
.ncc-overlay {
	position: absolute;
	inset: 0;
	background: var(--ncc-overlay, rgba(15, 23, 42, 0.45));
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
}

.ncc-layout-modal .ncc-overlay {
	opacity: 1;
	pointer-events: auto;
}

/* Ha a prefs panel nyitva, mindig sötét háttér */
.ncc-root:has(.ncc-prefs:not([hidden])) .ncc-overlay {
	opacity: 1;
	pointer-events: auto;
}

/* -------------------------------------------------------------------------
 * Banner sáv
 * ---------------------------------------------------------------------- */
.ncc-banner {
	position: absolute;
	width: 420px;
	max-width: calc(100vw - 40px);
	background: var(--ncc-bg, #fff);
	border: 1px solid var(--ncc-border, #e4e7ec);
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
	pointer-events: auto;
	overflow: hidden;
	animation: ncc-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.ncc-pos-bottom-left .ncc-banner {
	left: 20px;
	bottom: 20px;
}

.ncc-pos-bottom-right .ncc-banner {
	right: 20px;
	bottom: 20px;
}

/* Teljes szélességű alsó sáv */
.ncc-pos-bottom-bar .ncc-banner {
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: 100%;
	max-width: none;
	border-radius: 0;
	border-left: 0;
	border-right: 0;
	border-bottom: 0;
}

/* Modal layout: középre */
.ncc-layout-modal .ncc-banner {
	left: 50%;
	top: 50%;
	bottom: auto;
	transform: translate(-50%, -50%);
	width: 460px;
}

.ncc-banner__inner {
	padding: 22px 22px 18px;
}

.ncc-pos-bottom-bar .ncc-banner__inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 18px 24px;
}

.ncc-banner__title {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
	color: var(--ncc-text, #2b2f38);
}

.ncc-banner__body {
	margin: 0;
	font-size: 13.5px;
	color: var(--ncc-muted, #5b6270);
}

.ncc-pos-bottom-bar .ncc-banner__text {
	flex: 1;
}

.ncc-link {
	color: var(--ncc-accent, #2f6df6);
	text-decoration: underline;
	white-space: nowrap;
}

.ncc-link:hover {
	text-decoration: none;
}

.ncc-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}

.ncc-pos-bottom-bar .ncc-banner__actions {
	margin-top: 0;
	flex-wrap: nowrap;
}

/* -------------------------------------------------------------------------
 * Gombok
 * ---------------------------------------------------------------------- */
.ncc-btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 9px 16px;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
	font-family: inherit;
}

.ncc-btn:focus-visible {
	outline: 2px solid var(--ncc-accent, #2f6df6);
	outline-offset: 2px;
}

.ncc-btn--primary {
	background: var(--ncc-accent, #2f6df6);
	color: var(--ncc-accent-text, #fff);
	flex: 1;
	min-width: 130px;
}

.ncc-btn--primary:hover {
	filter: brightness(0.94);
}

.ncc-btn--secondary {
	background: transparent;
	color: var(--ncc-text, #2b2f38);
	border-color: var(--ncc-border, #e4e7ec);
	flex: 1;
	min-width: 110px;
}

.ncc-btn--secondary:hover {
	background: rgba(15, 23, 42, 0.04);
}

.ncc-btn--ghost {
	background: transparent;
	color: var(--ncc-muted, #5b6270);
	padding: 9px 8px;
}

.ncc-btn--ghost:hover {
	color: var(--ncc-accent, #2f6df6);
	text-decoration: underline;
}

/* -------------------------------------------------------------------------
 * Beállítás panel (kategóriák) - középre igazított modal
 * ---------------------------------------------------------------------- */
.ncc-prefs {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	pointer-events: none;
}

.ncc-prefs[hidden] {
	display: none;
}

.ncc-prefs__panel {
	position: relative;
	width: 560px;
	max-width: 100%;
	max-height: 85vh;
	overflow-y: auto;
	background: var(--ncc-bg, #fff);
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
	padding: 24px;
	pointer-events: auto;
	animation: ncc-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.ncc-prefs__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}

.ncc-prefs__title {
	margin: 0;
	font-size: 19px;
	font-weight: 700;
}

.ncc-prefs__close {
	appearance: none;
	background: transparent;
	border: 0;
	font-size: 26px;
	line-height: 1;
	color: var(--ncc-muted, #5b6270);
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 8px;
}

.ncc-prefs__close:hover {
	background: rgba(15, 23, 42, 0.06);
	color: var(--ncc-text, #2b2f38);
}

.ncc-prefs__intro {
	margin: 0 0 18px;
	font-size: 13.5px;
	color: var(--ncc-muted, #5b6270);
}

.ncc-prefs__list {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

/* -------------------------------------------------------------------------
 * Kategória sor
 * ---------------------------------------------------------------------- */
.ncc-cat {
	padding: 16px 0;
	border-top: 1px solid var(--ncc-border, #e4e7ec);
}

.ncc-cat:first-child {
	border-top: 0;
}

.ncc-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 6px;
}

.ncc-cat__label {
	font-size: 15px;
	font-weight: 600;
	color: var(--ncc-text, #2b2f38);
}

.ncc-cat__desc {
	margin: 0;
	font-size: 13px;
	color: var(--ncc-muted, #5b6270);
}

/* -------------------------------------------------------------------------
 * Toggle switch
 * ---------------------------------------------------------------------- */
.ncc-switch {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	position: relative;
	cursor: pointer;
	flex-shrink: 0;
}

.ncc-switch__input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.ncc-switch__slider {
	position: relative;
	display: inline-block;
	width: 42px;
	height: 24px;
	background: #cfd4dc;
	border-radius: 999px;
	transition: background 0.2s ease;
	flex-shrink: 0;
}

.ncc-switch__slider::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	transition: transform 0.2s ease;
}

.ncc-switch__input:checked + .ncc-switch__slider {
	background: var(--ncc-accent, #2f6df6);
}

.ncc-switch__input:checked + .ncc-switch__slider::after {
	transform: translateX(18px);
}

.ncc-switch__input:focus-visible + .ncc-switch__slider {
	outline: 2px solid var(--ncc-accent, #2f6df6);
	outline-offset: 2px;
}

.ncc-switch__text {
	font-size: 12px;
	color: var(--ncc-muted, #5b6270);
	white-space: nowrap;
}

/* Zárolt (kötelező) kapcsoló */
.ncc-switch--locked {
	cursor: not-allowed;
}

.ncc-switch--locked .ncc-switch__slider {
	opacity: 0.7;
}

.ncc-prefs__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--ncc-border, #e4e7ec);
}

.ncc-prefs__actions .ncc-btn {
	flex: 1;
	min-width: 120px;
}

/* -------------------------------------------------------------------------
 * Újranyitó lebegő gomb
 * ---------------------------------------------------------------------- */
.ncc-reopen {
	position: fixed;
	left: 18px;
	bottom: 18px;
	z-index: 999998;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--ncc-bg, #fff);
	color: var(--ncc-text, #2b2f38);
	border: 1px solid var(--ncc-border, #e4e7ec);
	border-radius: 999px;
	padding: 9px 14px;
	font-size: 13px;
	font-weight: 600;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ncc-reopen[hidden] {
	display: none;
}

.ncc-reopen:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.2);
}

.ncc-reopen__icon {
	display: inline-flex;
	color: var(--ncc-accent, #2f6df6);
}

@keyframes ncc-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Modal / bottom-bar animáció ne csússzon el a transform-központozás miatt */
.ncc-layout-modal .ncc-banner,
.ncc-pos-bottom-bar .ncc-banner {
	animation: ncc-fade 0.28s ease;
}

@keyframes ncc-fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* -------------------------------------------------------------------------
 * Reszponzív
 * ---------------------------------------------------------------------- */
@media (max-width: 640px) {
	.ncc-pos-bottom-left .ncc-banner,
	.ncc-pos-bottom-right .ncc-banner {
		left: 12px;
		right: 12px;
		bottom: 12px;
		width: auto;
		max-width: none;
	}

	.ncc-pos-bottom-bar .ncc-banner__inner {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
	}

	.ncc-pos-bottom-bar .ncc-banner__actions {
		flex-wrap: wrap;
	}

	.ncc-banner__actions .ncc-btn--ghost {
		order: 3;
		flex-basis: 100%;
	}

	.ncc-reopen__text {
		display: none;
	}

	.ncc-reopen {
		padding: 10px;
	}

	.ncc-prefs__actions {
		flex-direction: column;
	}
}

/* Csökkentett mozgás preferencia */
@media (prefers-reduced-motion: reduce) {
	.ncc-banner,
	.ncc-prefs__panel,
	.ncc-reopen {
		animation: none;
		transition: none;
	}
}

/* -------------------------------------------------------------------------
 * Lábléc "Süti beállítások" link (a lebegő gomb alternatívája)
 * ---------------------------------------------------------------------- */
.nx-footer__cookie-settings {
	appearance: none;
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
	opacity: 0.9;
}

.nx-footer__cookie-settings:hover {
	opacity: 1;
	text-decoration: none;
}
