/* Luna Core — baner zgód cookie (Consent Mode v2). */
.luna-consent {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 99999;
	padding: 14px;
	pointer-events: none;
	font-family: inherit;
}

.luna-consent[hidden] {
	display: none;
}

.luna-consent__box {
	pointer-events: auto;
	max-width: 640px;
	margin: 0 auto;
	background: #fff;
	color: #1f1f1f;
	border-radius: 0;
	border: var(--wp--custom--shaded-style--border--width, 2px) solid var(--wp--preset--color--foreground, #352F45);
	box-shadow: var(--wp--custom--shaded-style--box-shadow--x, 4px) var(--wp--custom--shaded-style--box-shadow--y, 4px) 0 var(--wp--preset--color--foreground, #352F45);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
	padding: 22px 24px;
	font-size: 14px;
	line-height: 1.55;
	animation: luna-consent-in 0.35s ease-out;
}

@keyframes luna-consent-in {
	from { transform: translateY(24px); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

.luna-consent__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.luna-consent__icon {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 0;
	background: #EDE9F2;
	color: #352F45;
	flex: 0 0 auto;
}

.luna-consent__title {
	font-size: 16px;
	font-weight: 700;
}

.luna-consent__text {
	margin: 0 0 14px;
	color: #555;
}

.luna-consent__text a {
	color: #352F45;
	text-decoration: none;
}

/* Panel opcji — domyślnie zwinięty; steruje klasa .is-open (nie [hidden]). */
.luna-consent__options {
	display: none;
	border-top: 1px solid #eee;
	border-bottom: 1px solid #eee;
	margin: 0 0 14px;
	padding: 6px 0;
}

.luna-consent.is-open .luna-consent__options {
	display: block;
}

.luna-consent__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 9px 0;
	cursor: pointer;
}

.luna-consent__option + .luna-consent__option {
	border-top: 1px solid #f3f3f3;
}

.luna-consent__option-label {
	display: block;
	font-weight: 600;
}

.luna-consent__option-desc {
	display: block;
	font-size: 12.5px;
	color: #777;
}

/* Przełącznik (switch) */
.luna-consent__switch {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.luna-consent__slider {
	flex: 0 0 44px;
	width: 44px;
	height: 24px;
	border-radius: 0;
	background: #d4d4d4;
	position: relative;
	transition: background 0.2s;
}

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

.luna-consent__switch:checked + .luna-consent__slider {
	background: #352F45;
}

.luna-consent__switch:checked + .luna-consent__slider::after {
	transform: translateX(20px);
}

.luna-consent__switch:disabled + .luna-consent__slider {
	background: #F0A9A9;
	cursor: not-allowed;
}

.luna-consent__switch:focus-visible + .luna-consent__slider {
	outline: 2px solid #352F45;
	outline-offset: 2px;
}

/* Przyciski */
.luna-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.luna-consent__btn {
	border: var(--wp--custom--shaded-style--border--width, 2px) solid currentColor !important;
	border-radius: 0 !important;
	padding: 12px 22px;
	text-decoration: none;
	box-shadow: var(--wp--custom--shaded-style--box-shadow--x, 4px) var(--wp--custom--shaded-style--box-shadow--y, 4px) 0 currentColor;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: filter 0.15s, background 0.15s;
}

.luna-consent__btn--primary {
	background: var(--wp--preset--color--primary, #E89CB5);
	color: var(--wp--preset--color--foreground, #352F45);
}

.luna-consent__btn--primary:hover {
	box-shadow: none;
	transform: translate(2px, 2px);
}

.luna-consent__btn--secondary {
	background: #fff;
	color: var(--wp--preset--color--foreground, #352F45);
}

.luna-consent__btn--secondary:hover {
	box-shadow: none;
	transform: translate(2px, 2px);
}

.luna-consent__btn--ghost {
	background: none;
	border-color: transparent;
	box-shadow: none;
	color: #666;
	text-decoration: none;
	padding-inline: 8px;
}

/* "Zapisz mój wybór" widoczny tylko po rozwinięciu opcji. */
.luna-consent [data-action="save"] {
	display: none;
}

.luna-consent.is-open [data-action="save"] {
	display: inline-block;
}

.luna-consent.is-open [data-action="settings"] {
	display: none;
}

/* Pływający przycisk ponownego otwarcia. */
.luna-consent-reopen {
	position: fixed;
	left: 14px;
	bottom: 14px;
	z-index: 99998;
	width: 48px !important;
	height: 48px !important;
	min-width: 0;
	padding: 0 !important;
	display: grid;
	place-items: center;
	border: var(--wp--custom--shaded-style--border--width, 2px) solid currentColor !important;
	border-radius: 0 !important;
	background: #fff;
	color: var(--wp--preset--color--foreground, #352F45);
	box-shadow: var(--wp--custom--shaded-style--box-shadow--x, 4px) var(--wp--custom--shaded-style--box-shadow--y, 4px) 0 currentColor;
	cursor: pointer;
	transition: transform 0.15s;
}

.luna-consent-reopen:hover {
	transform: scale(1.08);
	color: #352F45;
}

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

@media (max-width: 640px) {
	.luna-consent {
		padding: 8px;
	}

	.luna-consent__box {
		padding: 18px;
		border-radius: 0;
	}

	.luna-consent__btn--primary,
	.luna-consent__btn--secondary {
		flex: 1 1 100%;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.luna-consent__box {
		animation: none;
	}
}
