.winery-age-gate {
	--winery-age-gate-bg: rgba(0, 0, 0, 0.72);
	--winery-age-gate-fg: #111827;
	--winery-age-gate-muted: #4b5563;
	--winery-age-gate-modal-bg: #ffffff;
	--winery-age-gate-confirm-bg: #111827;
	--winery-age-gate-confirm-fg: #ffffff;
	--winery-age-gate-decline-bg: #ffffff;
	--winery-age-gate-decline-fg: #111827;
	--winery-age-gate-border: #d1d5db;
	--winery-age-gate-focus: #2563eb;
	--winery-age-gate-radius: 8px;
	--winery-age-gate-spacing: 24px;
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 4vw, 40px);
	opacity: 0;
	pointer-events: none;
}

.winery-age-gate.is-active {
	display: flex;
	opacity: 1;
	pointer-events: auto;
	animation: wineryAgeGateFadeIn 100ms ease-out both;
}

/*
 * A confirmed visitor gets the same cached HTML as a new one; the prepaint
 * script marks <html> and this keeps the dialog from ever painting. The same
 * rule is printed inline before the root for placements whose stylesheet
 * loads after the markup.
 */
html.winery-age-gate-verified .winery-age-gate {
	display: none !important;
}

.winery-age-gate-backdrop {
	position: absolute;
	inset: 0;
	background: var(--winery-age-gate-bg);
	pointer-events: auto;
}

.winery-age-gate-modal {
	position: relative;
	z-index: 1;
	width: min(100%, 480px);
	max-height: calc(100vh - 32px);
	overflow: auto;
	padding: var(--winery-age-gate-spacing);
	border-radius: var(--winery-age-gate-radius);
	background: var(--winery-age-gate-modal-bg);
	color: var(--winery-age-gate-fg);
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.winery-age-gate-headline {
	margin: 0 0 12px;
	color: var(--winery-age-gate-fg);
	font-size: 1.5rem;
	line-height: 1.2;
	letter-spacing: 0;
}

.winery-age-gate-body {
	margin: 0;
	color: var(--winery-age-gate-muted);
	font-size: 1rem;
	line-height: 1.5;
	letter-spacing: 0;
}

.winery-age-gate-body p {
	margin: 0 0 1em;
}

.winery-age-gate-body p:last-child {
	margin-bottom: 0;
}

/*
 * Shown only with scripts off (it sits in <noscript>), where the buttons are
 * hidden. Colour inherits from the modal so a theme's restyle carries over.
 */
.winery-age-gate-noscript {
	margin: 16px 0 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0;
}

.winery-age-gate-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 24px;
}

.winery-age-gate-confirm,
.winery-age-gate-decline {
	min-height: 44px;
	padding: 10px 16px;
	border: 1px solid var(--winery-age-gate-border);
	border-radius: 6px;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0;
	cursor: pointer;
}

.winery-age-gate-confirm {
	border-color: var(--winery-age-gate-confirm-bg);
	background: var(--winery-age-gate-confirm-bg);
	color: var(--winery-age-gate-confirm-fg);
}

.winery-age-gate-decline {
	background: var(--winery-age-gate-decline-bg);
	color: var(--winery-age-gate-decline-fg);
}

.winery-age-gate-confirm:focus-visible,
.winery-age-gate-decline:focus-visible {
	outline: 3px solid var(--winery-age-gate-focus);
	outline-offset: 2px;
}

@keyframes wineryAgeGateFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.winery-age-gate.is-active {
		animation: none;
		transition: none;
	}
}
