/**
 * DBS Cookie Notice – front-end styles.
 * All colours/sizes come from CSS custom properties set inline from the settings.
 */

#dbs-cn-root {
	--dbs-cn-bg: #ffffff;
	--dbs-cn-text: #1e1e1e;
	--dbs-cn-accent: #2563eb;
	--dbs-cn-accent-text: #ffffff;
	--dbs-cn-secondary-bg: #f0f0f1;
	--dbs-cn-secondary-text: #1e1e1e;
	--dbs-cn-radius: 10px;
	--dbs-cn-max-width: 460px;

	position: fixed;
	z-index: 999999;
	box-sizing: border-box;
	color: var(--dbs-cn-text);
	font-size: 14px;
	line-height: 1.55;
}

#dbs-cn-root *,
#dbs-cn-root *::before,
#dbs-cn-root *::after {
	box-sizing: border-box;
}

#dbs-cn-root[hidden] {
	display: none;
}

/* ---------- Overlay (modal layout) ---------- */
.dbs-cn-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

/* ---------- Panel ---------- */
.dbs-cn-panel {
	position: relative;
	background: var(--dbs-cn-bg);
	color: var(--dbs-cn-text);
	border-radius: var(--dbs-cn-radius);
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
	padding: 20px;
	max-height: 85vh;
	overflow-y: auto;
}

.dbs-cn-message > *:first-child {
	margin-top: 0;
}
.dbs-cn-message > *:last-child {
	margin-bottom: 0;
}
.dbs-cn-message h2 {
	font-size: 1.15em;
	margin: 0 0 0.4em;
}
.dbs-cn-message p {
	margin: 0 0 0.6em;
}
.dbs-cn-message a {
	color: var(--dbs-cn-accent);
}
.dbs-cn-pp {
	font-size: 0.92em;
}

/* ---------- Position variants ---------- */
.dbs-cn--bottom-bar,
.dbs-cn--top-bar {
	left: 0;
	right: 0;
}
.dbs-cn--bottom-bar {
	bottom: 0;
}
.dbs-cn--top-bar {
	top: 0;
}
.dbs-cn--bottom-bar .dbs-cn-panel,
.dbs-cn--top-bar .dbs-cn-panel {
	border-radius: 0;
	margin: 0 auto;
	max-width: 1100px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 24px;
}
.dbs-cn--bottom-bar .dbs-cn-body,
.dbs-cn--top-bar .dbs-cn-body {
	flex: 1 1 420px;
	min-width: 0;
}

.dbs-cn--bottom-left,
.dbs-cn--bottom-right {
	bottom: 20px;
}
.dbs-cn--bottom-left {
	left: 20px;
}
.dbs-cn--bottom-right {
	right: 20px;
}
.dbs-cn--bottom-left .dbs-cn-panel,
.dbs-cn--bottom-right .dbs-cn-panel {
	width: min(92vw, var(--dbs-cn-max-width));
}

.dbs-cn--center {
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.dbs-cn--center .dbs-cn-panel {
	width: min(94vw, var(--dbs-cn-max-width));
}

/* ---------- Categories ---------- */
.dbs-cn-categories {
	margin-top: 14px;
	border-top: 1px solid rgba(0, 0, 0, 0.12);
	padding-top: 10px;
}
.dbs-cn-cat {
	padding: 8px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.dbs-cn-cat:last-child {
	border-bottom: 0;
}
.dbs-cn-cat-head {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
	cursor: pointer;
}
.dbs-cn-cat-label {
	flex: 1 1 auto;
}
.dbs-cn-cat-head input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: var(--dbs-cn-accent);
}
.dbs-cn-always {
	font-size: 0.8em;
	font-weight: 500;
	opacity: 0.7;
}
.dbs-cn-cat-desc {
	margin: 4px 0 0;
	font-size: 0.9em;
	font-weight: 400;
	opacity: 0.85;
}

/* ---------- Actions ---------- */
.dbs-cn-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 16px;
}
.dbs-cn--bottom-bar .dbs-cn-actions,
.dbs-cn--top-bar .dbs-cn-actions {
	margin-top: 0;
	flex: 0 0 auto;
}
.dbs-cn-actions-main {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-left: auto;
}

.dbs-cn-btn {
	font: inherit;
	line-height: 1.2;
	padding: 10px 18px;
	border-radius: calc(var(--dbs-cn-radius) - 2px);
	border: 1px solid transparent;
	cursor: pointer;
	transition: filter 0.15s ease, background 0.15s ease;
}
.dbs-cn-btn:focus-visible {
	outline: 2px solid var(--dbs-cn-accent);
	outline-offset: 2px;
}
.dbs-cn-btn--primary {
	background: var(--dbs-cn-accent);
	color: var(--dbs-cn-accent-text);
}
.dbs-cn-btn--primary:hover {
	filter: brightness(0.93);
}
.dbs-cn-btn--secondary {
	background: var(--dbs-cn-secondary-bg);
	color: var(--dbs-cn-secondary-text);
	border-color: rgba(0, 0, 0, 0.15);
}
.dbs-cn-btn--secondary:hover {
	filter: brightness(0.96);
}
.dbs-cn-btn--link {
	background: transparent;
	color: var(--dbs-cn-accent);
	padding-left: 4px;
	padding-right: 4px;
	text-decoration: underline;
}

/* ---------- Reopen button ---------- */
.dbs-cn-reopen {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 999998;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font: inherit;
	font-size: 13px;
	padding: 8px 12px;
	border-radius: 999px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	background: #fff;
	color: #1e1e1e;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
	cursor: pointer;
}
.dbs-cn-reopen[hidden] {
	display: none;
}
.dbs-cn-reopen:hover {
	filter: brightness(0.97);
}
.dbs-cn-reopen:focus-visible {
	outline: 2px solid var(--dbs-cn-accent, #2563eb);
	outline-offset: 2px;
}
/* Block-editor content sits inside the pill; keep it tidy and let its own
   block styles (colours, backgrounds) layer on top. */
.dbs-cn-reopen > * {
	margin: 0;
}
.dbs-cn-reopen p {
	margin: 0;
}
.dbs-cn-reopen img {
	max-width: 180px;
	height: auto;
	display: block;
}
.dbs-cn-reopen :where(h1, h2, h3, h4, h5, h6) {
	font-size: 1em;
	margin: 0;
}
/* Clicks on any child still count as clicking the button. */
.dbs-cn-reopen a {
	pointer-events: none;
	color: inherit;
	text-decoration: none;
}

/* ---------- Reject disclaimer ---------- */
.dbs-cn-reject-info {
	margin-top: 12px;
}
.dbs-cn--bottom-bar .dbs-cn-reject-info,
.dbs-cn--top-bar .dbs-cn-reject-info {
	flex-basis: 100%;
	margin-top: 4px;
}
.dbs-cn-reject-info > .dbs-cn-btn--link {
	padding-left: 0;
}
.dbs-cn-disclaimer {
	margin-top: 8px;
	padding: 10px 12px;
	font-size: 0.9em;
	line-height: 1.5;
	background: rgba(0, 0, 0, 0.05);
	border-radius: calc(var(--dbs-cn-radius) - 4px);
}
.dbs-cn-disclaimer[hidden] {
	display: none;
}
.dbs-cn-disclaimer > *:first-child {
	margin-top: 0;
}
.dbs-cn-disclaimer > *:last-child {
	margin-bottom: 0;
}
.dbs-cn-disclaimer a {
	color: var(--dbs-cn-accent);
}

/* ---------- Post-reject toast ---------- */
.dbs-cn-toast {
	position: fixed;
	z-index: 999997;
	left: 50%;
	bottom: 20px;
	transform: translateX(-50%);
	width: min(92vw, 520px);
	background: var(--dbs-cn-bg, #ffffff);
	color: var(--dbs-cn-text, #1e1e1e);
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: var(--dbs-cn-radius, 10px);
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
	font-size: 13px;
	line-height: 1.5;
}
.dbs-cn-toast[hidden] {
	display: none;
}
.dbs-cn-toast-inner {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 12px 14px;
}
.dbs-cn-toast-text > *:first-child {
	margin-top: 0;
}
.dbs-cn-toast-text > *:last-child {
	margin-bottom: 0;
}
.dbs-cn-toast-text a {
	color: var(--dbs-cn-accent, #2563eb);
}
.dbs-cn-toast-close {
	flex: 0 0 auto;
	background: transparent;
	border: 0;
	font: inherit;
	font-size: 20px;
	line-height: 1;
	padding: 0 2px;
	cursor: pointer;
	color: inherit;
	opacity: 0.7;
}
.dbs-cn-toast-close:hover {
	opacity: 1;
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
	.dbs-cn--bottom-left,
	.dbs-cn--bottom-right {
		left: 0;
		right: 0;
		bottom: 0;
	}
	.dbs-cn--bottom-left .dbs-cn-panel,
	.dbs-cn--bottom-right .dbs-cn-panel {
		width: 100%;
		border-radius: 0;
	}
	.dbs-cn-actions-main {
		width: 100%;
	}
	.dbs-cn-actions-main .dbs-cn-btn {
		flex: 1 1 auto;
	}
	.dbs-cn-reopen-text {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dbs-cn-btn {
		transition: none;
	}
}
