/**
 * web51net Cookie Manager â€“ Banner styles
 * Philosophy: light, fluid, non-invasive.
 */

/* â”€â”€â”€ Design tokens â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
:root {
	--hccm-primary:          #1a73e8;
	--hccm-bg:               #ffffff;
	--hccm-text:             #1f1f1f;
	--hccm-overlay:          rgba(0, 0, 0, 0); /* always transparent â€” no dimming */
	--hccm-radius:           12px;
	--hccm-shadow:           0 8px 32px rgba(0, 0, 0, 0.18);
	--hccm-z:                2147483000;
	--hccm-banner-max-width: 600px;
	/* private â€“ not overridden by admin inline style */
	--hccm-text-muted:   #666;
	--hccm-border:       rgba(0, 0, 0, 0.08);
	--hccm-toggle-off:   #c8d0da;
	--hccm-toggle-thumb: #ffffff;
}

/* â”€â”€â”€ Dark mode â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   Scoped to banner elements: admin :root colors stay intact for the page,
   the banner itself auto-adapts to the OS colour scheme.               */
@media (prefers-color-scheme: dark) {
	.hccm-banner,
	.hccm-manage-btn {
		--hccm-bg:           #1e1e2e;
		--hccm-text:         #e8e8f4;
		--hccm-text-muted:   #9ca3af;
		--hccm-border:       rgba(255, 255, 255, 0.09);
		--hccm-toggle-off:   #4b5563;
		--hccm-toggle-thumb: #f9fafb;
		--hccm-shadow:       0 8px 32px rgba(0, 0, 0, 0.55);
	}
}

/* â”€â”€â”€ Utility â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.hccm-hidden { display: none !important; }

/* â”€â”€â”€ Stack & overlay â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.hccm-stack {
	position: fixed;
	inset: 0;
	z-index: var(--hccm-z);
	pointer-events: none;
}

.hccm-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.18);
	z-index: 0;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.55s ease;
}

.hccm-overlay--visible {
	opacity: 1;
}

/* â”€â”€â”€ Banner shell â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.hccm-banner {
	position: fixed;
	z-index: 1;
	padding: 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: var(--hccm-text);
	pointer-events: none;
	box-sizing: border-box;
	transform: translateY(0);
	/* Slide-only transition â€” no opacity, zero "lights on/off" effect */
	transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Entry: slide in from off-screen edge when banner first appears.
   @starting-style fires on the transition from display:none â†’ visible.
   Chrome 117+, Firefox 129+, Safari 17.5+; instant appear on older browsers. */
@starting-style {
	.hccm-banner.hccm-y-bottom { transform: translateY(110%); }
	.hccm-banner.hccm-y-top    { transform: translateY(-110%); }
}

/* Dismiss: slide back to off-screen edge */
.hccm-banner.hccm-y-bottom.hccm-banner--closing { transform: translateY(110%); }
.hccm-banner.hccm-y-top.hccm-banner--closing    { transform: translateY(-110%); }

/* â”€â”€â”€ Position helpers â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.hccm-y-top    { top: 0;    bottom: auto; }
.hccm-y-bottom { bottom: 0; top: auto; }

.hccm-x-center { left: 0; right: 0; }

.hccm-x-left {
	left: 0; right: auto;
	width:     min(var(--hccm-banner-max-width), calc(100% - 32px));
	max-width: min(var(--hccm-banner-max-width), calc(100% - 32px));
}

.hccm-x-right {
	right: 0; left: auto;
	width:     min(var(--hccm-banner-max-width), calc(100% - 32px));
	max-width: min(var(--hccm-banner-max-width), calc(100% - 32px));
}

/* â”€â”€â”€ Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.hccm-banner__inner {
	position: relative;
	width: 100%;
	margin: 0 auto;
	background: var(--hccm-bg);
	color: var(--hccm-text);
	border-radius: var(--hccm-radius);
	box-shadow: var(--hccm-shadow);
	border: 1px solid var(--hccm-border);
	padding: 24px;
	z-index: 1;
	box-sizing: border-box;
	pointer-events: auto;
}

.hccm-x-center .hccm-banner__inner { max-width: var(--hccm-banner-max-width); }
.hccm-x-left  .hccm-banner__inner,
.hccm-x-right .hccm-banner__inner  { max-width: none; margin: 0; }

/* â”€â”€â”€ View switching (main â†” preferences) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.hccm-banner__main,
.hccm-banner__preferences {
	min-width: 0;
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.hccm-view-hidden {
	position: absolute;
	top: 0; left: 0; right: 0;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	pointer-events: none;
}

/* Preferences open: flex column so "Salva" is always anchored at the bottom.
   Categories get the scrollable area; actions never scroll off screen.    */
.hccm-banner--preferences-open .hccm-banner__inner {
	display: flex;
	flex-direction: column;
	max-height: min(85vh, 640px);
	overflow: hidden;
}

.hccm-banner--preferences-open .hccm-banner__preferences {
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

.hccm-banner--preferences-open .hccm-categories {
	flex: 1;
	overflow-y: auto;
	min-height: 0;   /* critical: allows flex child to shrink below content height */
	max-height: none;
	/* Keep the same padding-right as base so toggle â†’ scrollbar gap is consistent */
	padding-right: 14px;
}

.hccm-banner--preferences-open .hccm-banner__preferences .hccm-banner__actions {
	flex-shrink: 0;
	padding-top: 12px;
	margin-top: 8px;
	border-top: 1px solid var(--hccm-border);
}

/* â”€â”€â”€ Content â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/*
 * Explicit color on every text element: theme h2/p/label rules are "direct"
 * and beat inherited values. Explicit class selectors win over bare element
 * selectors (0-1-0 > 0-0-1), so we lock in our palette regardless of theme.
 */
.hccm-banner__title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 600;
	color: var(--hccm-text);
}

.hccm-banner__description {
	margin: 0 0 12px;
	color: var(--hccm-text-muted, #666);
}

.hccm-banner__links {
	margin: 0 0 16px;
	font-size: 13px;
}

.hccm-banner__links a {
	color: var(--hccm-primary);
	margin-right: 16px;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* â”€â”€â”€ Action row â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.hccm-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	position: relative;
	z-index: 2;
}

/* â”€â”€â”€ Buttons â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.hccm-btn {
	border: none;
	border-radius: 8px;
	padding: 10px 18px;
	min-height: 44px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer !important;
	transition:
		background-color 0.18s ease,
		border-color     0.18s ease,
		color            0.18s ease,
		box-shadow       0.18s ease,
		transform        0.12s ease,
		opacity          0.18s ease;
	pointer-events: auto !important;
	position: relative;
	z-index: 5;
	-webkit-appearance: none;
	appearance: none;
	touch-action: manipulation;
	user-select: none;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.hccm-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.hccm-btn:active,
.hccm-btn.hccm-btn--pressed {
	transform: translateY(0) scale(0.98);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	transition-duration: 0.08s;
}

.hccm-btn--primary {
	background: var(--hccm-primary);
	color: #fff;
}

.hccm-btn--secondary {
	background: transparent;
	color: var(--hccm-text);
	border: 1px solid var(--hccm-border, rgba(0, 0, 0, 0.2));
}

.hccm-btn--secondary:hover {
	color: var(--hccm-primary);
	border-color: var(--hccm-primary);
	box-shadow: none;
}

.hccm-btn--text {
	background: transparent;
	color: var(--hccm-text);
	padding: 10px 12px;
	text-decoration: underline;
	text-underline-offset: 2px;
	box-shadow: none;
}

.hccm-btn--text:hover {
	box-shadow: none;
	transform: none;
	opacity: 0.85;
}

.hccm-btn--text:active,
.hccm-btn--text.hccm-btn--pressed {
	transform: scale(0.98);
	opacity: 0.75;
	box-shadow: none;
}

/* â”€â”€â”€ Preferences panel â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.hccm-banner__subtitle {
	margin: 0 0 16px;
	font-size: 16px;
	color: var(--hccm-text);
}

.hccm-categories {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 16px;
	max-height: 40vh;
	overflow-y: auto;
	/* Right padding leaves room for the scrollbar thumb so it never overlaps toggles */
	padding-right: 14px;
	/* Thin, unobtrusive custom scrollbar */
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

.hccm-categories::-webkit-scrollbar {
	width: 4px;
}

.hccm-categories::-webkit-scrollbar-track {
	background: transparent;
	margin: 4px 0;
}

.hccm-categories::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.18);
	border-radius: 2px;
}

@media (prefers-color-scheme: dark) {
	.hccm-categories {
		scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
	}

	.hccm-categories::-webkit-scrollbar-thumb {
		background: rgba(255, 255, 255, 0.22);
	}
}

.hccm-category__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.hccm-category__label { font-weight: 600; color: var(--hccm-text); }

.hccm-category__required {
	display: block;
	font-size: 12px;
	font-weight: 400;
	color: var(--hccm-text-muted, #666);
}

.hccm-category__desc {
	margin: 4px 0 0;
	font-size: 13px;
	color: var(--hccm-text-muted, #555);
}

/* â”€â”€â”€ Custom toggle switch â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* CSS-only pill toggle using appearance:none + ::after (no JS required).    */
.hccm-toggle {
	flex-shrink: 0;
	width: 44px;
	height: 24px;
	background: var(--hccm-toggle-off, #c8d0da);
	border-radius: 12px;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	margin: 0;
	outline-offset: 3px;
	transition: background 0.2s ease;
}

/* Thumb */
.hccm-toggle::after {
	content: '';
	position: absolute;
	width: 18px;
	height: 18px;
	background: var(--hccm-toggle-thumb, #fff);
	border-radius: 50%;
	top: 3px;
	left: 3px;
	/* Elastic spring feel on toggle */
	transition: left 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}

.hccm-toggle:checked          { background: var(--hccm-primary); }
.hccm-toggle:checked::after   { left: 23px; }

.hccm-toggle:disabled         { opacity: 0.55; cursor: not-allowed; }

.hccm-toggle:focus-visible    { outline: 2px solid var(--hccm-primary); }

/* â”€â”€â”€ Manage cookies button â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.hccm-manage-btn {
	position: fixed;
	bottom: 10px;
	left: 10px;
	z-index: var(--hccm-z);
	pointer-events: auto;
	background: var(--hccm-bg);
	color: var(--hccm-text);
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 20px;
	padding: 6px 12px;
	font-size: 12px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	line-height: 1.3;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition:
		background-color 0.18s ease,
		box-shadow       0.18s ease,
		transform        0.18s ease,
		opacity          0.22s ease,
		visibility       0.22s ease;
	touch-action: manipulation;
	user-select: none;
}

.hccm-manage-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.hccm-manage-btn:active { transform: translateY(0) scale(0.98); }

.hccm-manage-btn--scroll-gated {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(8px);
}

.hccm-manage-btn--scroll-gated.hccm-manage-btn--visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.hccm-manage-btn--scroll-gated.hccm-manage-btn--visible:hover {
	transform: translateY(-1px);
}

/* â”€â”€â”€ Cookie table (shortcode) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.hccm-cookie-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
	font-size: 14px;
}

.hccm-cookie-table th,
.hccm-cookie-table td {
	border: 1px solid #ddd;
	padding: 8px 12px;
	text-align: left;
}

.hccm-cookie-table th { background: #f5f5f5; }

/* â”€â”€â”€ Mobile â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* The banner is a floating card â€” it never covers the entire screen.        */
@media (max-width: 600px) {
	.hccm-banner {
		--hccm-mobile-gutter: 12px;
		left:      var(--hccm-mobile-gutter) !important;
		right:     var(--hccm-mobile-gutter) !important;
		width:     auto !important;
		max-width: none !important;
		padding:   0 !important;
	}

	.hccm-y-top {
		top: var(--hccm-mobile-gutter);
		padding-top: env(safe-area-inset-top, 0px);
	}

	.hccm-y-bottom {
		bottom: var(--hccm-mobile-gutter);
		padding-bottom: env(safe-area-inset-bottom, 0px);
	}

	/* Cap the main banner at ~50 % viewport so page content is visible behind */
	.hccm-banner__inner {
		width: 100%;
		max-width: none;
		margin: 0;
		max-height: min(52dvh, 400px);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding: 16px;
		border-radius: var(--hccm-radius);
		box-shadow: var(--hccm-shadow);
	}

	/* Preferences: more room; flex layout keeps Salva anchored at bottom */
	.hccm-banner--preferences-open .hccm-banner__inner {
		max-height: min(72dvh, 520px);
	}

	.hccm-x-left  .hccm-banner__inner,
	.hccm-x-right .hccm-banner__inner {
		max-width: var(--hccm-banner-max-width);
		max-height: min(55dvh, 420px);
	}

	.hccm-banner__title       { font-size: 16px; }
	.hccm-banner__description { font-size: 13px;  margin-bottom: 10px; }
	.hccm-banner__links       { margin-bottom: 12px; }

	.hccm-banner__actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 8px;
	}

	.hccm-banner__actions .hccm-btn--text { grid-column: 1 / -1; }

	.hccm-banner .hccm-btn {
		width: 100%;
		text-align: center;
		min-height: 40px;
		padding: 8px 12px;
		font-size: 13px;
	}

	.hccm-manage-btn {
		bottom: 8px;
		left: 8px;
		padding: 6px 12px;
		min-height: 36px;
		font-size: 12px;
		line-height: 1.3;
		box-sizing: border-box;
		max-width: calc(100% - 16px);
	}
}

/* Firefox mobile: safe-area padding on the bottom banner can jump on scroll */
@supports (-moz-appearance: none) {
	@media (max-width: 600px) {
		.hccm-y-bottom { padding-bottom: 0; }
	}
}
