/* Cookie consent UI. Loaded only when its two safety gates pass.
   B86 + B91 (her 4 + 5 Nov): a smaller, plainer banner (no cookie mark, no gold
   edge), "Accept all" and "Reject all" equally clear, and preferences compact
   enough that every category and Save choices fit on one iPhone screen. */
.oc-cookie-ui {
	--oc-cookie-wine: var(--oc-burgundy, #6e0f2c);
	--oc-cookie-wine-dark: var(--oc-burgundy-dark, #4a0a1e);
	--oc-cookie-gold: var(--oc-gold, #c9a961);
	--oc-cookie-cream: var(--oc-cream, #faf7f2);
	--oc-cookie-ink: var(--oc-ink, #1f1b1a);
	--oc-cookie-stone: var(--oc-stone, #6b6361);
	--oc-cookie-border: var(--oc-border, #e4ddd2);
	--oc-cookie-white: #fff;
	position: fixed;
	inset: 0 auto auto 0;
	width: 100vw;
	height: var(--oc-cookie-viewport-height, 100dvh);
	transform: translateZ(0);
	overflow: hidden;
	z-index: 2147483000;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--oc-cookie-ink);
	font-size: 16px;
	line-height: 1.5;
}

.oc-cookie-ui[hidden],
.oc-cookie-ui [hidden] { display: none !important; }

body.oc-cookie-ui-open { overflow: hidden !important; }

.oc-cookie-ui *,
.oc-cookie-ui *::before,
.oc-cookie-ui *::after { box-sizing: border-box; }

.oc-cookie-ui .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.oc-cookie-ui__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(24, 14, 17, .5);
	-webkit-backdrop-filter: blur(5px);
	backdrop-filter: blur(5px);
}

.oc-cookie-banner,
.oc-cookie-preferences {
	position: absolute;
	z-index: 1;
	background: var(--oc-cookie-white);
	border: 1px solid var(--oc-cookie-border);
	box-shadow: 0 20px 60px rgba(31, 8, 16, .26), 0 2px 10px rgba(31, 8, 16, .10);
	outline: 0;
}

/* ---- Banner ---- */
.oc-cookie-banner {
	left: 50%;
	bottom: max(20px, env(safe-area-inset-bottom));
	transform: translateX(-50%);
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 24px;
	width: min(900px, calc(100vw - 48px));
	padding: 18px 22px;
	border-radius: 16px;
	animation: oc-cookie-rise .3s cubic-bezier(.2, .8, .2, 1) both;
}

.oc-cookie-ui__eyebrow {
	margin: 0 0 4px;
	color: var(--oc-cookie-wine);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .14em;
	line-height: 1.3;
	text-transform: uppercase;
}

.oc-cookie-banner h2,
.oc-cookie-preferences h2 {
	margin: 0;
	color: var(--oc-cookie-wine-dark);
	font-family: "Playfair Display", Georgia, serif;
	font-weight: 600;
	letter-spacing: -.01em;
	line-height: 1.2;
}

.oc-cookie-banner h2 { font-size: 19px; }
.oc-cookie-preferences h2 { font-size: 22px; }

.oc-cookie-banner__copy > p:not(.oc-cookie-ui__eyebrow) {
	max-width: 560px;
	margin: 5px 0 0;
	color: var(--oc-cookie-stone);
	font-size: 14.5px;
	line-height: 1.5;
}

.oc-cookie-ui__policy {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 4px;
	color: var(--oc-cookie-wine);
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: underline;
	text-decoration-color: rgba(110,15,44,.35);
	text-underline-offset: 3px;
}

.oc-cookie-ui__policy:hover { color: var(--oc-cookie-wine-dark); text-decoration-color: currentColor; }

/* Accept all and Reject all side by side, the same size and style (B91);
   Customise as a quieter text link underneath. */
.oc-cookie-banner__actions {
	display: grid;
	grid-template-columns: repeat(2, minmax(124px, 1fr));
	gap: 8px;
}
.oc-cookie-banner__actions .oc-cookie-ui__button--text { grid-column: 1 / -1; }

.oc-cookie-ui__button,
.oc-cookie-preferences__close {
	min-height: 44px;
	border: 1px solid transparent;
	border-radius: 10px;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease;
}

.oc-cookie-ui__button { padding: 11px 16px; }
.oc-cookie-ui__button:hover { transform: translateY(-1px); }
.oc-cookie-ui__button:active { transform: translateY(0); }

.oc-cookie-ui__button--primary {
	background: var(--oc-cookie-wine);
	border-color: var(--oc-cookie-wine);
	color: #fff;
}
.oc-cookie-ui__button--primary:hover { background: var(--oc-cookie-wine-dark); border-color: var(--oc-cookie-wine-dark); }

.oc-cookie-ui__button--outline {
	background: #fff;
	border-color: rgba(110, 15, 44, .4);
	color: var(--oc-cookie-wine);
}
.oc-cookie-ui__button--outline:hover { border-color: var(--oc-cookie-wine); background: var(--oc-cookie-cream); }

.oc-cookie-ui__button--text {
	min-height: 36px;
	padding-block: 6px;
	background: transparent;
	border-color: transparent;
	color: var(--oc-cookie-wine);
	font-size: 14px;
	text-decoration: underline;
	text-decoration-color: rgba(110,15,44,.35);
	text-underline-offset: 3px;
}
.oc-cookie-ui__button--text:hover { text-decoration-color: currentColor; transform: none; }

.oc-cookie-ui :is(button, a, input):focus-visible {
	outline: 3px solid var(--oc-cookie-gold);
	outline-offset: 3px;
}

/* ---- Preferences ---- */
.oc-cookie-preferences {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	width: min(620px, calc(100vw - 40px));
	max-height: min(720px, calc(100dvh - 40px));
	border-radius: 18px;
	overflow: hidden;
	animation: oc-cookie-modal .26s cubic-bezier(.2, .8, .2, 1) both;
}

.oc-cookie-preferences__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 18px 12px 20px;
	border-bottom: 1px solid var(--oc-cookie-border);
}

.oc-cookie-preferences__close {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 44px;
	min-height: 44px;
	padding: 0 0 3px;
	background: #fff;
	border-color: var(--oc-cookie-border);
	color: var(--oc-cookie-wine);
	font-size: 28px;
	font-weight: 400;
}
.oc-cookie-preferences__close:hover { border-color: var(--oc-cookie-wine); background: var(--oc-cookie-cream); }

.oc-cookie-preferences__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 12px 18px 14px;
	overscroll-behavior: contain;
}

.oc-cookie-ui__notice {
	margin: 0 0 10px;
	padding: 10px 12px;
	border: 1px solid rgba(201, 169, 97, .56);
	border-radius: 10px;
	background: #fffaf0;
	color: #5b4521;
	font-size: 13.5px;
}

.oc-cookie-preferences__list {
	display: grid;
	gap: 8px;
}

/* The switch (or "Always active") sits on the title line and the description
   runs the full width beneath, so no row wraps into a narrow column. */
.oc-cookie-category {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas: "title control" "desc desc";
	align-items: center;
	column-gap: 14px;
	row-gap: 0;
	padding: 10px 14px;
	border: 1px solid var(--oc-cookie-border);
	border-radius: 12px;
	background: #fff;
	transition: border-color .16s ease, box-shadow .16s ease;
}
.oc-cookie-category:focus-within { border-color: var(--oc-cookie-gold); box-shadow: 0 0 0 3px rgba(201,169,97,.18); }
.oc-cookie-category--required { background: #fcfaf6; }

.oc-cookie-category__copy { display: contents; }
.oc-cookie-category h3 { grid-area: title; }
.oc-cookie-category p { grid-area: desc; }
.oc-cookie-category__always,
.oc-cookie-category .oc-cookie-switch { grid-area: control; justify-self: end; }
.oc-cookie-category h3 {
	margin: 0;
	color: var(--oc-cookie-ink);
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}
.oc-cookie-category p { margin: 2px 0 0; color: var(--oc-cookie-stone); font-size: 13px; line-height: 1.45; }

/* B86: the required row says so in words, where the switches sit. */
.oc-cookie-category__always {
	padding: 5px 10px;
	border-radius: 999px;
	background: rgba(201,169,97,.19);
	color: #5e4614;
	font-size: 12.5px;
	font-weight: 700;
	white-space: nowrap;
}

.oc-cookie-switch { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 36px; cursor: pointer; }
.oc-cookie-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.oc-cookie-switch__track {
	position: relative;
	display: block;
	width: 48px;
	height: 28px;
	border: 1px solid #bbb2ae;
	border-radius: 999px;
	background: #d8d3d0;
	transition: background-color .18s ease, border-color .18s ease;
}
.oc-cookie-switch__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 5px rgba(31,27,26,.25);
	transition: transform .18s ease;
}
.oc-cookie-switch input:checked + .oc-cookie-switch__track { background: var(--oc-cookie-wine); border-color: var(--oc-cookie-wine); }
.oc-cookie-switch input:checked + .oc-cookie-switch__track::after { transform: translateX(20px); }
.oc-cookie-switch input:focus-visible + .oc-cookie-switch__track { outline: 3px solid var(--oc-cookie-gold); outline-offset: 3px; }

.oc-cookie-preferences__footer {
	display: grid;
	grid-template-columns: auto auto;
	justify-content: end;
	gap: 10px;
	padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--oc-cookie-border);
	background: #fff;
}

@keyframes oc-cookie-rise {
	from { opacity: 0; transform: translate(-50%, 20px) scale(.985); }
	to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes oc-cookie-modal {
	from { opacity: 0; transform: translate(-50%, -47%) scale(.98); }
	to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (max-width: 820px) {
	.oc-cookie-banner {
		grid-template-columns: minmax(0, 1fr);
		gap: 14px;
		padding: 18px;
	}
}

@media (max-width: 520px) {
	.oc-cookie-ui { font-size: 16px; }
	.oc-cookie-ui__backdrop { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
	.oc-cookie-banner {
		left: 12px;
		right: 12px;
		bottom: max(12px, env(safe-area-inset-bottom));
		transform: none;
		width: auto;
		max-height: calc(100dvh - 24px);
		overflow-y: auto;
		gap: 12px;
		padding: 16px;
		border-radius: 14px;
		animation-name: oc-cookie-rise-mobile;
	}
	.oc-cookie-banner h2 { font-size: 18px; }
	.oc-cookie-banner__copy > p:not(.oc-cookie-ui__eyebrow) { font-size: 14px; }
	.oc-cookie-banner__actions { grid-template-columns: 1fr 1fr; gap: 8px; }
	.oc-cookie-ui__button { width: 100%; padding-inline: 10px; }

	/* A bottom sheet only as tall as its content (Fahad, 8 Nov: on a tall phone the
	   full-height sheet left an empty white block under the buttons). On a short
	   phone it stops 8px below the top and the list scrolls; the buttons stay put. */
	.oc-cookie-preferences {
		position: absolute;
		top: auto;
		bottom: 0;
		left: 0;
		transform: none;
		width: 100%;
		height: auto;
		max-height: calc(var(--oc-cookie-viewport-height, 100dvh) - 8px);
		border-width: 1px 0 0;
		border-radius: 18px 18px 0 0;
		animation-name: oc-cookie-sheet;
	}
	.oc-cookie-preferences__header { padding: 6px 8px 6px 16px; }
	.oc-cookie-preferences h2 { font-size: 19px; }
	.oc-cookie-preferences__close { width: 40px; min-height: 40px; font-size: 26px; }
	.oc-cookie-preferences__body { padding: 8px 10px 10px; }
	.oc-cookie-preferences__list { gap: 6px; }
	.oc-cookie-category { column-gap: 10px; padding: 7px 12px 8px; }
	.oc-cookie-category h3 { font-size: 14.5px; }
	.oc-cookie-category p { margin-top: 1px; font-size: 12.5px; line-height: 1.4; }
	.oc-cookie-category__always { padding: 3px 9px; font-size: 12px; }
	.oc-cookie-switch { min-height: 28px; }
	.oc-cookie-switch__track { width: 42px; height: 24px; }
	.oc-cookie-switch__track::after { width: 18px; height: 18px; top: 2px; left: 2px; }
	.oc-cookie-switch input:checked + .oc-cookie-switch__track::after { transform: translateX(18px); }
	.oc-cookie-preferences__footer {
		grid-template-columns: 1fr 1fr;
		justify-content: stretch;
		padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
	}
}

@keyframes oc-cookie-rise-mobile {
	from { opacity: 0; transform: translateY(20px) scale(.985); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes oc-cookie-sheet {
	from { opacity: 0; transform: translateY(28px); }
	to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.oc-cookie-ui *,
	.oc-cookie-ui *::before,
	.oc-cookie-ui *::after {
		scroll-behavior: auto !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}

@media (forced-colors: active) {
	.oc-cookie-banner,
	.oc-cookie-preferences,
	.oc-cookie-category,
	.oc-cookie-ui__button,
	.oc-cookie-preferences__close { border: 1px solid CanvasText; }
	.oc-cookie-switch__track { border: 2px solid CanvasText; }
}
