/* QN Cookie Bar — Shadow Root Styles */
/* Loaded inside the banner's shadow root, so these selectors never reach the theme. */
*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:host {
	display: block;
}

/* Centred modal: the host is the full-screen backdrop, so the visible box is
   the panel itself. */
:host(.qn-position-center-modal) .qn-panel {
	max-width: 640px;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.qn-panel {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 0.875rem;
	line-height: 1.5;
	color: #333;
	background: #fff;
	overflow-x: hidden;
}

a {
	color: var(--qn-primary, #1a73e8);
	text-decoration: underline;
}

a:hover {
	text-decoration: none;
}

/* Banner View */
.qn-banner-content {
	padding: 20px 24px;
	max-width: 1200px;
	margin: 0 auto;
	border-top: 3px solid var(--qn-primary, #1a73e8);
	box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
}

.qn-banner-content h2 {
	font-size: 1.125rem;
	font-weight: 700;
	margin-bottom: 8px;
	color: #111;
}

.qn-banner-content p {
	margin-bottom: 16px;
	color: #555;
	max-width: 720px;
}

.qn-banner-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	align-items: center;
}

/* Buttons — GDPR: equal visual weight for Accept and Reject */
.qn-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 24px;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	border: 2px solid var(--qn-primary, #1a73e8);
	min-width: 160px;
	min-height: 44px;
	text-align: center;
	transition: background-color 0.15s, color 0.15s;
	line-height: 1.4;
	font-family: inherit;
}

.qn-btn:focus-visible {
	outline: 3px solid var(--qn-primary, #1a73e8);
	outline-offset: 2px;
}

.qn-btn-primary {
	background: var(--qn-primary, #1a73e8);
	color: #fff;
}

.qn-btn-primary:hover {
	opacity: 0.9;
}

.qn-btn-secondary {
	background: #fff;
	color: var(--qn-primary, #1a73e8);
}

.qn-btn-secondary:hover {
	background: #f5f5f5;
}

/* Preferences View */
.qn-prefs-content {
	padding: 20px 24px;
	max-width: 720px;
	margin: 0 auto;
}

.qn-prefs-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid #eee;
}

.qn-prefs-header h2 {
	font-size: 1.125rem;
	font-weight: 700;
	color: #111;
}

.qn-btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid #ddd;
	background: #fff;
	cursor: pointer;
	font-size: 1.125rem;
	color: #333;
	transition: background-color 0.15s;
	font-family: inherit;
	flex-shrink: 0;
}

.qn-btn-icon:hover {
	background: #f5f5f5;
}

.qn-btn-icon:focus-visible {
	outline: 3px solid var(--qn-primary, #1a73e8);
	outline-offset: 2px;
}

/* Category cards */
.qn-categories {
	margin-bottom: 20px;
}

.qn-category {
	padding: 16px 0;
	border-bottom: 1px solid #eee;
}

.qn-category:last-child {
	border-bottom: none;
}

.qn-category-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.qn-toggle-label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	cursor: pointer;
}

.qn-category-name {
	font-weight: 600;
	font-size: 0.9375rem;
	color: #111;
}

.qn-category-desc {
	margin-top: 6px;
	font-size: 0.8125rem;
	color: #666;
	line-height: 1.5;
}

.qn-category-services {
	margin-top: 4px;
	font-size: 0.75rem;
	color: #666;
}

.qn-always-on {
	font-size: 0.75rem;
	color: #888;
	font-style: italic;
	margin-right: 8px;
}

/* Toggle switch */
.qn-toggle-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.qn-toggle {
	-webkit-appearance: none;
	appearance: none;
	width: 44px;
	height: 24px;
	background: #ccc;
	border-radius: 12px;
	position: relative;
	cursor: pointer;
	transition: background-color 0.2s;
	border: none;
	outline: none;
	flex-shrink: 0;
}

/* Invisible 44x44 tap target without changing switch visuals */
.qn-toggle::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 44px;
	transform: translate(-50%, -50%);
}

.qn-toggle::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.qn-toggle:checked {
	background: var(--qn-primary, #1a73e8);
}

.qn-toggle:checked::after {
	transform: translateX(20px);
}

.qn-toggle:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.qn-toggle:focus-visible {
	outline: 3px solid var(--qn-primary, #1a73e8);
	outline-offset: 2px;
}

/* Preferences actions */
.qn-prefs-actions {
	display: flex;
	gap: 12px;
	padding-top: 16px;
	border-top: 1px solid #eee;
}

/* Slim bar layouts — slim + slim-standard share everything but button radius */
[class*="layout-slim"] #qn-banner-view .qn-banner-content {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 12px 20px;
	border-top: 3px solid var(--qn-primary, #1a73e8);
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
	background: #f5f5f5;
	max-width: none;
}

[class*="layout-slim"] #qn-banner-view h2 {
	display: none;
}

[class*="layout-slim"] #qn-banner-view p {
	margin-bottom: 0;
	font-size: 0.8125rem;
	color: #444;
}

[class*="layout-slim"] #qn-banner-view .qn-banner-actions {
	flex-shrink: 0;
	flex-wrap: nowrap;
	gap: 8px;
}

[class*="layout-slim"] #qn-banner-view .qn-btn {
	padding: 7px 18px;
	font-size: 0.8125rem;
	min-width: auto;
	min-height: 44px;
}

.layout-slim #qn-banner-view .qn-btn {
	border-radius: 20px;
}

@media (max-width: 700px) {
	[class*="layout-slim"] #qn-banner-view .qn-banner-content {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
}

/* Responsive */
@media (max-width: 600px) {
	.qn-banner-content,
	.qn-prefs-content {
		padding: 16px;
	}

	.qn-banner-actions {
		flex-direction: column;
		align-items: center;
	}

	.qn-btn {
		width: 100%;
		max-width: 320px;
		min-width: auto;
	}
}

/* Preferences intro */
.qn-prefs-intro {
	margin-bottom: 16px;
	color: #555;
}
