/* Droo Tracking & Consent: banner. Colours come from --droo-c-* (settings). */

.droo-consent[hidden],
.droo-consent [hidden] {
	display: none !important;
}

.droo-consent {
	position: fixed;
	z-index: 2147483000;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--droo-c-text);

	/* Hover colours, derived from the settings colours so every brand gets
	   them: the filled button goes a clear step darker (and lifts), outline
	   buttons fill with the accent, switches and the close button take a tint. */
	--droo-c-accent-hover: color-mix(in srgb, var(--droo-c-accent) 75%, #000);
	--droo-c-tint: color-mix(in srgb, var(--droo-c-accent) 12%, transparent);
}

/* ─── Positions ─── */

/* Cards along the bottom: centre (default), left or right. The wrapper spans
   the screen but lets clicks through to the page around the card. */
.droo-consent--bottom,
.droo-consent--bottom-left,
.droo-consent--bottom-right {
	left: 0;
	right: 0;
	bottom: 0;
	padding: 16px;
	pointer-events: none;
}

.droo-consent--bottom-left .droo-consent__box,
.droo-consent--bottom-right .droo-consent__box {
	max-width: 420px;
}

.droo-consent--bottom-left .droo-consent__box {
	margin: 0 auto 0 0;
}

.droo-consent--bottom-right .droo-consent__box {
	margin: 0 0 0 auto;
}

/* Full-width bar fixed to the bottom edge. */
.droo-consent--bar {
	left: 0;
	right: 0;
	bottom: 0;
}

.droo-consent--bar .droo-consent__box {
	max-width: none;
	max-height: 85vh;
	padding: 20px 24px;
	border-radius: 0;
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
}

.droo-consent--bar .droo-consent__view {
	max-width: 1200px;
	margin: 0 auto;
}

.droo-consent--bar [data-droo-view="prefs"] {
	max-width: 720px;
}

@media (min-width: 900px) {
	/* Text on the left, buttons on the right. */
	.droo-consent--bar [data-droo-view="notice"] {
		display: grid;
		grid-template-columns: 1fr auto;
		column-gap: 32px;
		align-items: center;
	}
	.droo-consent--bar [data-droo-view="notice"] .droo-consent__title,
	.droo-consent--bar [data-droo-view="notice"] .droo-consent__message {
		grid-column: 1;
	}
	.droo-consent--bar [data-droo-view="notice"] .droo-consent__message {
		margin-bottom: 0;
	}
	.droo-consent--bar [data-droo-view="notice"] .droo-consent__actions {
		grid-column: 2;
		grid-row: 1 / span 2;
		flex-wrap: nowrap;
	}
	.droo-consent--bar [data-droo-view="notice"] .droo-consent__btn {
		flex: 0 0 auto;
		min-width: 150px;
	}
	.droo-consent--bar [data-droo-view="notice"] .droo-consent__link {
		flex: 0 0 auto;
	}
}

/* Centred over a dimmed page. */
.droo-consent--center {
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.55);
}

/* ─── Box and text ─── */

.droo-consent__box {
	box-sizing: border-box;
	max-width: 640px;
	max-height: calc(100vh - 32px);
	margin: 0 auto;
	padding: 24px;
	overflow-y: auto;
	pointer-events: auto;
	background: var(--droo-c-bg);
	border-radius: 14px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.droo-consent__title {
	margin: 0 0 8px;
	font-size: 1.15em;
	font-weight: 700;
}

.droo-consent__message {
	margin: 0 0 16px;
}

.droo-consent a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: color 0.15s;
}

.droo-consent a:hover {
	color: var(--droo-c-accent);
	text-decoration-thickness: 2px;
}

/* ─── Buttons ─── */

.droo-consent__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.droo-consent__btn {
	flex: 1 1 140px;
	min-height: 46px;
	padding: 10px 18px;
	font: inherit;
	font-weight: 600;
	border-radius: 8px;
	border: 2px solid var(--droo-c-accent);
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.droo-consent__btn:active {
	transform: none;
	box-shadow: none;
}

.droo-consent__btn--primary {
	background: var(--droo-c-accent);
	color: var(--droo-c-accent-txt);
}

.droo-consent__btn--primary:hover {
	background: var(--droo-c-accent-hover);
	border-color: var(--droo-c-accent-hover);
	color: var(--droo-c-accent-txt);
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

/* Outline style: same size as the primary button, so Reject all is just as
   easy to find (ICO: rejecting must be as easy as accepting). */
.droo-consent__btn--secondary {
	background: transparent;
	color: var(--droo-c-accent);
}

/* On hover the outline fills in: accent background, button-text colour. */
.droo-consent__btn--secondary:hover {
	background: var(--droo-c-accent);
	color: var(--droo-c-accent-txt);
}

.droo-consent__btn:focus-visible,
.droo-consent__link:focus-visible,
.droo-consent__close:focus-visible,
.droo-consent a:focus-visible,
.droo-consent__toggle input:focus-visible + .droo-consent__switch {
	outline: 3px solid var(--droo-c-accent);
	outline-offset: 2px;
}

/* "Customise" as a text link under the buttons. */
.droo-consent__link {
	flex: 1 0 100%;
	padding: 6px 10px;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	background: none;
	border: 0;
	cursor: pointer;
	transition: color 0.15s;
}

/* Same hover as the policy links. */
.droo-consent__link:hover {
	color: var(--droo-c-accent);
	text-decoration-thickness: 2px;
}

.droo-consent__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
}

.droo-consent__close {
	width: 32px;
	height: 32px;
	padding: 0;
	font-size: 26px;
	line-height: 1;
	color: inherit;
	background: none;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: color 0.15s, background-color 0.15s;
}

.droo-consent__close:hover {
	color: var(--droo-c-accent);
	background: var(--droo-c-tint);
}

/* ─── Categories ─── */

.droo-consent__cats {
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.droo-consent__cat {
	padding: 12px 0;
	border-top: 1px solid rgba(127, 127, 127, 0.25);
}

.droo-consent__toggle {
	display: flex;
	align-items: center;
	gap: 12px;
	font-weight: 600;
	cursor: pointer;
}

.droo-consent__toggle:has(input:disabled) {
	cursor: default;
}

.droo-consent__toggle input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.droo-consent__switch {
	position: relative;
	flex: 0 0 auto;
	width: 42px;
	height: 24px;
	background: rgba(127, 127, 127, 0.45);
	border-radius: 12px;
	transition: background-color 0.15s, box-shadow 0.15s;
}

.droo-consent__switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.15s;
}

.droo-consent__toggle input:checked + .droo-consent__switch {
	background: var(--droo-c-accent);
}

.droo-consent__toggle:hover input:not(:disabled) + .droo-consent__switch {
	background: rgba(127, 127, 127, 0.65);
	box-shadow: 0 0 0 4px var(--droo-c-tint);
}

.droo-consent__toggle:hover input:checked:not(:disabled) + .droo-consent__switch {
	background: var(--droo-c-accent-hover);
}

.droo-consent__toggle:hover input:not(:disabled) ~ .droo-consent__cat-label {
	color: var(--droo-c-accent);
}

.droo-consent__toggle input:checked + .droo-consent__switch::after {
	transform: translateX(18px);
}

.droo-consent__toggle input:disabled + .droo-consent__switch {
	opacity: 0.6;
}

.droo-consent__cat-label {
	transition: color 0.15s;
}

.droo-consent__cat-desc {
	margin: 4px 0 0 54px;
	font-size: 0.9em;
	opacity: 0.85;
}

.droo-consent__policy {
	margin: 12px 0 0;
	font-size: 0.9em;
}

/* ─── Small screens: every card goes full width, buttons stack ─── */

@media (max-width: 480px) {
	.droo-consent__box,
	.droo-consent--bottom-left .droo-consent__box,
	.droo-consent--bottom-right .droo-consent__box {
		max-width: none;
		margin: 0;
		padding: 18px;
	}
	.droo-consent__btn {
		flex-basis: 100%;
	}
}
