/**
 * Cookie Settings widget.
 */

.msd-cookie {
	--msd-cookie-on: var(--msd-green, #15803d);

	display: flex;
	flex-direction: column;
	gap: 14px;
	color: var(--msd-ink, #1e2a30);
}

.msd-cookie__rows {
	display: flex;
	flex-direction: column;
	margin-top: 8px;
	border-top: 1px solid var(--msd-line, #e6e0d5);
}

.msd-cookie__row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	padding: 22px 0;
	border-bottom: 1px solid var(--msd-line, #e6e0d5);
}

.msd-cookie__copy {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.msd-cookie__title {
	font-family: var(--msd-font-heading, "Bricolage Grotesque", system-ui, sans-serif);
	font-size: 19px;
	font-weight: 800;
	line-height: 1.3;
}

.msd-cookie__text {
	margin: 0;
	color: var(--msd-text-muted, #4c565d);
	font-size: 15.5px;
	line-height: 1.6;
}

/* Switch: grey when off (4.9:1 against white for the knob edge), green when on. */

.msd-cookie .msd-cookie__switch {
	position: relative;
	flex: none;
	width: 56px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background-color: #68727a;
	cursor: pointer;
	transition: background-color 0.2s;
}

.msd-cookie .msd-cookie__switch[aria-checked="true"] {
	background-color: var(--msd-cookie-on);
}

.msd-cookie .msd-cookie__switch:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.msd-cookie__knob {
	position: absolute;
	top: 4px;
	left: 4px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background-color: var(--msd-white, #fff);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: left 0.2s;
}

.msd-cookie__switch[aria-checked="true"] .msd-cookie__knob {
	left: 28px;
}

/* Buttons */

.msd-cookie__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 12px;
}

.msd-cookie .msd-cookie__button {
	min-height: 54px;
	padding: 0 24px;
	border: 1.5px solid var(--msd-field-border, #8f8674);
	border-radius: 999px;
	background-color: var(--msd-white, #fff);
	color: var(--msd-ink, #1e2a30);
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s;
}

.msd-cookie .msd-cookie__button:hover {
	border-color: var(--msd-ink, #1e2a30);
	background-color: var(--msd-cream, #f7f4ee);
}

.msd-cookie .msd-cookie__button--primary {
	border-color: var(--msd-espresso, #281616);
	background-color: var(--msd-espresso, #281616);
	color: var(--msd-white, #fff);
}

.msd-cookie .msd-cookie__button--primary:hover {
	border-color: var(--msd-espresso-hover, #3e2323);
	background-color: var(--msd-espresso-hover, #3e2323);
}

.msd-cookie .msd-cookie__saved {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 14px 16px;
	border-radius: 12px;
	background-color: #dcfce7;
	color: #14532d;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.5;
}

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

.msd-cookie__saved .msd-icon {
	color: var(--msd-green, #15803d);
	font-size: 20px;
}

@media (prefers-reduced-motion: reduce) {

	.msd-cookie .msd-cookie__switch,
	.msd-cookie__knob,
	.msd-cookie .msd-cookie__button {
		transition: none;
	}
}
