/*
 * Lobbit Cookie Consent - front end.
 * Every rule is scoped under .custcc and sets its own font, colors and box
 * model, so themes that style bare h2, p and button elements do not leak in.
 */

.custcc {
	--custcc-bg: #14181f;
	--custcc-text: #f5f6f8;
	--custcc-button: #f5f6f8;
	--custcc-button-text: #14181f;

	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 999990;
	box-sizing: border-box;
	width: 380px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 32px);
	margin: 0;
	padding: 18px;
	overflow: auto;
	color: var(--custcc-text);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	text-align: left;
	background: var(--custcc-bg);
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
	animation: custcc-in 0.25s ease-out;
}

.custcc[hidden],
.custcc [hidden] {
	display: none;
}

.custcc--bottom-left {
	right: auto;
	left: 16px;
}

.custcc--bottom-center {
	right: auto;
	left: 50%;
	margin-left: -190px;
}

.custcc *,
.custcc *::before,
.custcc *::after {
	box-sizing: border-box;
}

.custcc .custcc-title {
	margin: 0 28px 6px 0;
	padding: 0;
	color: inherit;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
}

.custcc .custcc-title:focus {
	outline: none;
}

.custcc .custcc-text,
.custcc .custcc-option-text,
.custcc .custcc-ref {
	margin: 0 0 12px;
	padding: 0;
	color: inherit;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
}

.custcc .custcc-link {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.custcc .custcc-x {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	color: inherit;
	background: transparent;
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	cursor: pointer;
}

.custcc .custcc-x:hover,
.custcc .custcc-x:focus-visible {
	color: inherit;
	background: rgba(128, 128, 128, 0.25);
}

.custcc .custcc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
}

/* Accept and Reject share this rule: same size, same colors, same weight. */
.custcc .custcc-btn {
	flex: 1 1 0;
	min-width: 0;
	min-height: 40px;
	margin: 0;
	padding: 8px 12px;
	color: var(--custcc-button-text);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	white-space: normal;
	background: var(--custcc-button);
	border: 1px solid var(--custcc-button);
	border-radius: 8px;
	box-shadow: none;
	cursor: pointer;
	transition: opacity 0.15s;
}

.custcc .custcc-btn:hover {
	color: var(--custcc-button-text);
	background: var(--custcc-button);
	opacity: 0.88;
}

.custcc .custcc-btn--wide {
	flex: 1 1 100%;
	width: 100%;
}

.custcc .custcc-btn--ghost,
.custcc .custcc-btn--ghost:hover {
	color: var(--custcc-text);
	background: transparent;
	border-color: currentColor;
}

.custcc .custcc-x:focus-visible,
.custcc .custcc-btn:focus-visible,
.custcc .custcc-link:focus-visible,
.custcc .custcc-check:focus-visible {
	outline: 2px solid var(--custcc-text);
	outline-offset: 2px;
}

.custcc .custcc-options {
	margin: 0 0 12px;
	padding: 12px 0 0;
	border-top: 1px solid rgba(128, 128, 128, 0.45);
}

.custcc .custcc-option {
	margin: 0 0 10px;
}

.custcc .custcc-option-label {
	display: flex;
	gap: 8px;
	align-items: center;
	margin: 0;
	color: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.custcc .custcc-check {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--custcc-button);
}

/* Smaller, never fainter: the contrast checked in the settings stays true. */
.custcc .custcc-option-text {
	margin: 2px 0 0 26px;
	font-size: 13px;
}

.custcc .custcc-ref {
	margin: 12px 0 0;
	font-size: 12px;
}

.custcc .custcc-ref code {
	padding: 0;
	color: inherit;
	font-size: 12px;
	word-break: break-all;
	background: transparent;
}

/*
 * Floating icon that reopens the panel. It sits outside .custcc, so it sets
 * everything it needs by itself. The selectors use the ID to stay above the
 * button rules of themes and of the Elementor kit, which are stronger than a
 * class. Colors and distance come from the settings as custom properties on
 * .custcc-fab: they are only read here, never set. --custcc-fab-lift is set by
 * the script when the icon has to go above another fixed element.
 */
#custcc-fab {
	position: fixed;
	bottom: calc(16px + var(--custcc-fab-offset, 0px) + var(--custcc-fab-lift, 0px) + env(safe-area-inset-bottom, 0px));
	left: 16px;
	z-index: 999989;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	color: var(--custcc-text, #f5f6f8);
	line-height: 1;
	background: var(--custcc-bg, #14181f);
	border: 0;
	border-radius: 50%;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
	cursor: pointer;
	transition: transform 0.15s;
}

#custcc-fab[hidden] {
	display: none;
}

#custcc-fab.custcc-fab--bottom-right {
	right: 16px;
	left: auto;
}

#custcc-fab:hover,
#custcc-fab:focus {
	color: var(--custcc-text, #f5f6f8);
	background: var(--custcc-bg, #14181f);
	transform: scale(1.08);
}

/* Two rings, so the focus shows on light and on dark pages. */
#custcc-fab:focus-visible {
	outline: 2px solid var(--custcc-text, #f5f6f8);
	outline-offset: 0;
	box-shadow: 0 0 0 4px var(--custcc-bg, #14181f), 0 4px 16px rgba(0, 0, 0, 0.28);
}

#custcc-fab svg {
	display: block;
	width: 26px;
	height: 26px;
	fill: currentColor;
}

/* Link printed at the end of the page: it takes the colors of the theme. */
.custcc-recall {
	margin: 0;
	padding: 12px 16px;
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
}

@keyframes custcc-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* Phones: full width, attached to the bottom edge. */
@media (max-width: 600px) {
	.custcc,
	.custcc--bottom-left,
	.custcc--bottom-center {
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		max-width: none;
		max-height: 85vh;
		margin: 0;
		padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
		border-radius: 12px 12px 0 0;
	}

	/* The icon has its own distance from the bottom on phones. */
	#custcc-fab {
		bottom: calc(16px + var(--custcc-fab-offset-mobile, 0px) + var(--custcc-fab-lift, 0px) + env(safe-area-inset-bottom, 0px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.custcc {
		animation: none;
	}

	.custcc .custcc-btn,
	#custcc-fab {
		transition: none;
	}

	#custcc-fab:hover,
	#custcc-fab:focus {
		transform: none;
	}
}

/* Cookie Policy and Privacy Policy links, side by side. */
.custcc .custcc-link + .custcc-link {
	margin-left: 0.6em;
}
