/* ============================================================
   Hornik Solutions - Cookie Consent UI
   Banner (bottom bar) + Preferences Modal
   Styled to the theme design tokens (see style.css :root).
   ============================================================ */

/* -- Shared button styles (mirror .btn in style.css) -------- */
.hs-cb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 22px;
	border-radius: var(--r-md, 6px);
	font-family: inherit;
	font-size: 14px;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
	white-space: nowrap;
	border: 1px solid transparent;
}

.hs-cb-btn--primary {
	background: var(--accent, #8eb102);
	color: #fff;
	border-color: var(--accent, #8eb102);
}

.hs-cb-btn--primary:hover {
	background: var(--accent-hover, #749102);
	border-color: var(--accent-hover, #749102);
}

.hs-cb-btn--outline {
	background: transparent;
	color: var(--ink, #15150e);
	border-color: var(--line, #cbcbbd);
}

.hs-cb-btn--outline:hover {
	border-color: var(--accent, #8eb102);
	color: var(--accent, #8eb102);
}

/* -- Cookie Banner ------------------------------------------ */
#hs-cookie-banner {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 99999;
	background: var(--paper, #ffffff);
	border-top: 3px solid var(--accent, #8eb102);
	box-shadow: 0 -8px 32px rgba(17, 19, 24, 0.12);
	padding: 24px 32px;
	transform: translateY(100%);
	transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#hs-cookie-banner.hs-cookie-banner--visible {
	transform: translateY(0);
}

#hs-cookie-banner.hs-cookie-banner--hidden {
	transform: translateY(100%);
}

.hs-cb-inner {
	max-width: var(--max, 1300px);
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 40px;
	flex-wrap: wrap;
}

.hs-cb-text {
	flex: 1 1 480px;
}

.hs-cb-text strong {
	display: block;
	color: var(--ink, #15150e);
	font-size: 1.125rem;
	font-weight: 800;
	margin-bottom: 6px;
}

.hs-cb-text p {
	color: var(--ink-soft, #4b4b3f);
	font-size: 0.95rem;
	margin: 0;
	line-height: 1.6;
}

.hs-cb-actions {
	display: flex;
	gap: 24px;
	flex-shrink: 0;
	flex-wrap: wrap;
	align-items: center;
}

.hs-cb-link {
	color: var(--muted, #6f7061);
	text-decoration: underline;
	font-size: 0.9rem;
	font-weight: 500;
	transition: color 160ms ease;
	background: transparent;
	padding: 0;
	border: none;
	cursor: pointer;
}

.hs-cb-link:hover {
	color: var(--ink, #15150e);
}

/* -- Cookie Modal ------------------------------------------- */
#hs-cookie-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.25s ease;
}

#hs-cookie-modal.hs-cookie-modal--visible {
	opacity: 1;
}

#hs-cookie-modal.hs-cookie-modal--hidden {
	opacity: 0;
	pointer-events: none;
}

.hs-cm-overlay {
	position: absolute;
	inset: 0;
	background: rgba(17, 19, 24, 0.55);
	backdrop-filter: blur(3px);
}

.hs-cm-panel {
	position: relative;
	z-index: 1;
	background: var(--paper, #ffffff);
	border: 1px solid var(--line, #cbcbbd);
	border-radius: var(--r-md, 6px);
	padding: 32px;
	width: min(520px, calc(100vw - 32px));
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 24px 60px rgba(17, 19, 24, 0.25);
}

.hs-cm-title {
	font-size: 1.25rem;
	font-weight: 800;
	color: var(--ink, #15150e);
	margin: 0 0 8px;
}

.hs-cm-intro {
	font-size: 0.9rem;
	color: var(--muted, #6f7061);
	margin: 0 0 24px;
	line-height: 1.6;
}

/* -- Category rows ------------------------------------------ */
.hs-cm-category {
	border-top: 1px solid var(--line, #cbcbbd);
	padding: 16px 0;
}

.hs-cm-category:last-of-type {
	border-bottom: 1px solid var(--line, #cbcbbd);
}

.hs-cm-cat-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.hs-cm-cat-header > div {
	flex: 1;
}

.hs-cm-cat-header strong {
	display: block;
	color: var(--ink, #15150e);
	font-size: 0.95rem;
	font-weight: 700;
	margin-bottom: 4px;
}

.hs-cm-cat-header p {
	color: var(--muted, #6f7061);
	font-size: 0.825rem;
	margin: 0;
	line-height: 1.5;
}

.hs-cm-always-on {
	font-size: 0.75rem;
	color: var(--accent-deep, #5e760c);
	font-weight: 700;
	margin-top: 2px;
	white-space: nowrap;
	flex-shrink: 0;
}

/* -- Toggle switch ------------------------------------------ */
.hs-cm-toggle {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex-shrink: 0;
	margin-top: 2px;
	cursor: pointer;
}

.hs-cm-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.hs-cm-toggle-slider {
	position: absolute;
	inset: 0;
	background: var(--surface, #f4f5ed);
	border-radius: 24px;
	transition: background 160ms ease, border-color 160ms ease;
	border: 1px solid var(--line, #cbcbbd);
}

.hs-cm-toggle-slider::before {
	content: '';
	position: absolute;
	width: 18px;
	height: 18px;
	left: 2px;
	top: 50%;
	transform: translateY(-50%);
	background: var(--muted, #6f7061);
	border-radius: 50%;
	transition: transform 160ms ease, background 160ms ease;
}

.hs-cm-toggle input:checked + .hs-cm-toggle-slider {
	background: rgba(142, 177, 2, 0.15);
	border-color: var(--accent, #8eb102);
}

.hs-cm-toggle input:checked + .hs-cm-toggle-slider::before {
	transform: translate(20px, -50%);
	background: var(--accent, #8eb102);
}

.hs-cm-toggle input:focus-visible + .hs-cm-toggle-slider {
	outline: 2px solid var(--accent, #8eb102);
	outline-offset: 2px;
}

/* -- Modal footer ------------------------------------------- */
.hs-cm-footer {
	display: flex;
	gap: 12px;
	justify-content: flex-end;
	margin-top: 24px;
	flex-wrap: wrap;
}

/* -- Responsive --------------------------------------------- */
@media (max-width: 600px) {
	#hs-cookie-banner {
		padding: 16px;
	}

	.hs-cb-inner {
		gap: 14px;
	}

	.hs-cb-actions {
		width: 100%;
		gap: 18px;
		justify-content: center;
		flex-direction: column;
	}

	.hs-cb-btn {
		width: 100%;
		text-align: center;
	}

	.hs-cb-link {
		margin: 6px 0;
	}

	.hs-cm-panel {
		padding: 24px 20px;
	}

	.hs-cm-footer {
		flex-direction: column;
	}

	.hs-cm-footer .hs-cb-btn {
		width: 100%;
	}
}
