/*
 * Cookie consent banner and Cookie settings dialog (template-parts/cookie-consent.php).
 * Figma: 2214:2214 (banner), 2214:2405 (modal). Below 768 our interpretation: the banner spans
 * the screen width at the bottom.
 */

/* Banner (2214:2382) */

.cookie-banner {
	position: fixed;
	bottom: 32px;
	left: 32px;
	z-index: 900;
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 440px;
	max-width: calc(100vw - 32px);
	padding: 24px;
	border-radius: var(--radius-card-lg);
	background: var(--bg);
	box-shadow: var(--shadow-dropdown);
}

.cookie-banner[hidden] {
	display: none;
}

.cookie-banner p {
	margin: 0;
}

.cookie-banner__head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.cookie-banner__icon {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: var(--radius-tile-sm);
	background: var(--plum-tint-chip);
}

.cookie-banner__title {
	flex: 1;
	margin: 0;
	color: var(--ink);
	font-size: var(--fs-h5-sm);
	line-height: normal;
	letter-spacing: -0.005em;
}

.cookie-banner__close,
.cookie-settings__close {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: -7px -7px -7px 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	cursor: pointer;
	transition: background-color var(--ease-hover);
}

.cookie-banner__close:hover,
.cookie-settings__close:hover {
	background: var(--hover);
}

.cookie-banner__text {
	color: var(--muted);
	font-size: var(--fs-body-sm);
	line-height: 1.6;
}

.cookie-banner__buttons {
	display: flex;
	gap: 10px;
}

.cookie-banner__buttons .button {
	flex: 1;
	padding: 11px 18px;
}

.cookie-banner__links {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.cookie-banner__link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--plum);
	font-family: var(--font-body);
	font-size: var(--fs-small);
	font-weight: var(--fw-semibold);
	line-height: normal;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.cookie-banner__link--muted {
	color: var(--muted-2);
}

.cookie-banner__link:hover {
	color: var(--ink);
}

/* Settings dialog (2214:2574) */

.cookie-settings {
	width: 560px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 32px);
	padding: 0;
	border: 0;
	border-radius: var(--radius-banner);
	background: var(--bg);
	box-shadow: var(--shadow-dropdown);
	color: var(--ink);
}

.cookie-settings::backdrop {
	background: var(--ink-55);
}

.cookie-settings__form {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 28px 32px;
}

.cookie-settings__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.cookie-settings__title {
	margin: 0;
	font-size: var(--fs-h4);
	line-height: normal;
	letter-spacing: var(--ls-h4);
}

.cookie-settings__text {
	margin: 0;
	color: var(--muted);
	font-size: var(--fs-body);
	line-height: 1.6;
}

.cookie-option {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 18px;
	border: 1px solid var(--border);
	border-radius: var(--radius-tile);
}

.cookie-option__copy {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.cookie-option__copy p {
	margin: 0;
}

.cookie-option__title {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	color: var(--ink);
	font-size: var(--fs-body);
	font-weight: var(--fw-semibold);
	line-height: normal;
}

.cookie-option__title label {
	cursor: pointer;
}

.cookie-option__badge {
	padding: 2px 8px;
	border-radius: var(--radius-pill);
	background: var(--cream-2);
	color: var(--muted);
	font-size: var(--fs-tiny);
	font-weight: var(--fw-semibold);
}

.cookie-option__text {
	color: var(--muted);
	font-size: var(--fs-small);
	line-height: 1.55;
}

/* Switch: a checkbox drawn as a 44 × 26 toggle. */
.cookie-switch {
	position: relative;
	flex-shrink: 0;
	width: 44px;
	height: 26px;
	margin: 0;
	border-radius: var(--radius-pill);
	background: var(--border-strong);
	cursor: pointer;
	appearance: none;
	transition: background-color var(--ease-hover);
}

.cookie-switch::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--bg);
	transition: transform var(--ease-hover);
}

.cookie-switch:checked {
	background: var(--plum);
}

.cookie-switch:checked::before {
	transform: translateX(18px);
}

/* Locked "always on" switch (Essential). */
.cookie-switch:disabled {
	background: var(--subtle);
	cursor: not-allowed;
}

.cookie-switch:focus-visible {
	outline: 2px solid var(--plum);
	outline-offset: 2px;
}

.cookie-settings__buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
}

.cookie-settings__buttons .button {
	padding: 11px 18px;
}

@media (max-width: 767px) {
	.cookie-banner {
		right: 16px;
		bottom: 16px;
		left: 16px;
		width: auto;
		max-width: none;
		padding: 20px;
	}

	.cookie-settings__form {
		padding: 24px 20px;
	}

	.cookie-settings__title {
		font-size: var(--fs-h5-sm);
	}

	.cookie-settings__buttons .button {
		flex: 1 1 auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cookie-switch,
	.cookie-switch::before {
		transition: none;
	}
}

@media print {
	.cookie-banner {
		display: none !important;
	}
}
