/**
 * Cookie banner and settings dialog: template-parts/ui/cookie-consent.php
 * (not designed, built from the tokens and components).
 *
 * Banner: non-blocking, fixed at the bottom. Below 768 it spans the page
 * between the 20px gutters; from 768 it is at most 520px wide on the content
 * edge (--bleed), bottom left. White with the panel shadow, so it stands
 * out over the green hero, the cream pages and the deep green footer; ink text,
 * Heading H4 title, Body/S text, three Dark pills (no arrow) of the same size: "Reject
 * all" and "Accept all" side by side, "Settings" under them on phones and
 * next to them from 768. Under the mini cart (z-index 100), over the header.
 *
 * Dialog: the mini cart's dimmed page, a cream card as the age gate's
 * (radius 28 / 40, 20px side padding below 768), the checkbox component per
 * category, three Dark pills without arrows.
 */

.cookie-banner {
	position: fixed;
	z-index: 90;
	right: var(--container-gutter);
	bottom: 20px;
	left: var(--container-gutter);
	box-sizing: border-box;
	padding: 20px;
	border-radius: var(--radius-lg);
	background: var(--color-white);
	box-shadow: var(--shadow-panel);
	color: var(--color-ink);
}

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

.cookie-banner__title {
	margin: 0;
	color: var(--color-black);
	font-family: var(--font-display);
	font-size: var(--text-h4);
	font-weight: var(--weight-bold);
	letter-spacing: var(--tracking-h4);
	line-height: var(--leading-h4);
}

.cookie-banner__text {
	margin: var(--space-xs) 0 0;
	font-size: var(--text-body-s);
	line-height: var(--leading-body-s);
}

.cookie-banner__text a {
	color: inherit;
	text-decoration: underline;
}

.cookie-banner__text a:hover {
	color: var(--color-orange);
}

.cookie-banner__actions,
.consent-dialog__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-xs);
	margin-top: var(--space-sm);
}

.cookie-banner__actions .btn,
.consent-dialog__actions .btn {
	padding-inline: var(--space-sm);
}

.cookie-banner__settings,
.consent-dialog__actions .btn[type="submit"] {
	grid-column: 1 / -1;
}

@media (min-width: 768px) {
	.cookie-banner {
		right: auto;
		bottom: var(--space-md);
		left: var(--bleed);
		width: min(520px, calc(100% - 2 * var(--bleed)));
		padding: var(--space-md);
	}

	.cookie-banner__actions,
	.consent-dialog__actions {
		grid-template-columns: repeat(3, 1fr);
	}

	.cookie-banner__settings,
	.consent-dialog__actions .btn[type="submit"] {
		grid-column: auto;
	}
}

/* Settings dialog. */

.consent-dialog {
	position: fixed;
	z-index: 250;
	inset: 0;
	display: flex;
	overflow-y: auto;
	overscroll-behavior: contain;
	box-sizing: border-box;
	padding: var(--space-md) var(--container-gutter);
}

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

.consent-dialog__dim {
	position: fixed;
	inset: 0;
	background: var(--color-dim);
}

.consent-dialog__panel {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 600px;
	margin: auto;
	padding: var(--space-md) 20px;
	border-radius: var(--radius-section);
	background: var(--color-cream);
	box-shadow: var(--shadow-panel);
	color: var(--color-ink);
}

.consent-dialog__head {
	display: flex;
	gap: var(--space-sm);
	align-items: center;
	justify-content: space-between;
}

.consent-dialog__title {
	margin: 0;
	color: var(--color-black);
	font-family: var(--font-display);
	font-size: var(--text-h3);
	font-weight: var(--weight-bold);
	letter-spacing: var(--tracking-h3);
	line-height: var(--leading-h3);
}

.consent-dialog__form {
	margin: 0;
}

.consent-dialog__list {
	margin: var(--space-sm) 0 0;
	padding: 0;
	list-style: none;
}

.consent-dialog__item {
	padding: var(--space-sm) 0;
	border-bottom: 1px solid var(--color-line);
}

.consent-dialog__check .check__box:disabled {
	cursor: default;
}

.consent-dialog__item:has(.check__box:disabled) .consent-dialog__check {
	cursor: default;
}

.consent-dialog__label {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.consent-dialog__name {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-xs);
	align-items: baseline;
	font-weight: var(--weight-semibold);
}

.consent-dialog__always {
	color: var(--color-green);
	font-size: var(--text-label-s);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--tracking-label-s);
	line-height: var(--leading-label-s);
	text-transform: uppercase;
}

.consent-dialog__desc {
	font-size: var(--text-body-s);
	line-height: var(--leading-body-s);
}

.consent-dialog__actions {
	margin-top: var(--space-md);
}

.consent-dialog__policy {
	margin: var(--space-sm) 0 0;
	font-size: var(--text-body-s);
	line-height: var(--leading-body-s);
	text-align: center;
}

.consent-dialog__policy a {
	color: var(--color-ink);
	text-decoration: underline;
}

.consent-dialog__policy a:hover {
	color: var(--color-orange);
}

/* The page behind the open dialog does not scroll. On <html> only, so the
 * sticky header stays (see mobile-menu.css). */
.is-consent-open {
	overflow: hidden;
}

@media (min-width: 768px) {
	.consent-dialog__panel {
		padding: var(--space-lg);
	}
}
