/* Cookie Consent Manager — front-end styles (ported from CCM plugin, accent tuned to simplework.bg) */

:root {
	--ccm-bg: #ffffff;
	--ccm-text: #10131C;
	--ccm-accent: #3654F0;
	--ccm-accept-bg: #3654F0;
	--ccm-accept-text: #ffffff;
	--ccm-reject-bg: #eef0f4;
	--ccm-reject-text: #10131C;
	--ccm-radius: 12px;
	--ccm-font-size: 15px;
	--ccm-font-family: "Manrope", system-ui, sans-serif;
	--ccm-shadow: 0 10px 40px rgba(15,23,42,0.16), 0 2px 8px rgba(15,23,42,0.08);
}

.ccm-root { font-family: var(--ccm-font-family); font-size: var(--ccm-font-size); color: var(--ccm-text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
.ccm-root[hidden] { display: none !important; }
.ccm-root * { box-sizing: border-box; }

.ccm-overlay { position: fixed; inset: 0; background: transparent; z-index: 2147483000; }
.ccm-overlay-dim { background: rgba(15,23,42,0.45); animation: ccm-fade-in 0.2s ease; }

html.ccm-scroll-lock,
html.ccm-scroll-lock body { overflow: hidden !important; }

/* ---------- Banner ---------- */

.ccm-banner {
	position: fixed;
	z-index: 2147483001;
	background: var(--ccm-bg);
	color: var(--ccm-text);
	box-shadow: var(--ccm-shadow);
	display: flex;
	gap: 20px;
	align-items: center;
	flex-wrap: wrap;
	padding: 20px 24px;
	animation: ccm-slide-up 0.35s ease;
}
.ccm-banner[hidden] { display: none !important; }

.ccm-layout-bar .ccm-banner { left: 0; right: 0; width: 100%; border-radius: 0; justify-content: space-between; }
.ccm-layout-bar.ccm-position-bottom .ccm-banner { bottom: 0; }
.ccm-layout-bar.ccm-position-top .ccm-banner { top: 0; animation-name: ccm-slide-down; }

.ccm-layout-box .ccm-banner { max-width: 420px; width: calc(100% - 32px); border-radius: var(--ccm-radius); flex-direction: column; align-items: stretch; }
.ccm-layout-box.ccm-position-bottom .ccm-banner,
.ccm-layout-box.ccm-position-bottom-right .ccm-banner { bottom: 16px; right: 16px; }
.ccm-layout-box.ccm-position-bottom-left .ccm-banner { bottom: 16px; left: 16px; }
.ccm-layout-box.ccm-position-top .ccm-banner { top: 16px; right: 16px; }

.ccm-layout-modal .ccm-banner { top: 50%; left: 50%; transform: translate(-50%,-50%); max-width: 520px; width: calc(100% - 32px); border-radius: var(--ccm-radius); flex-direction: column; align-items: stretch; }

.ccm-banner-body { flex: 1 1 320px; min-width: 220px; }
.ccm-layout-box .ccm-banner-body,
.ccm-layout-modal .ccm-banner-body { flex: none; min-width: 0; }

.ccm-title { margin: 0 0 6px; font-size: 1.1em; font-weight: 700; }
.ccm-message { margin: 0; font-size: 0.9em; opacity: 0.8; }
.ccm-policy-link { color: var(--ccm-accent); text-decoration: underline; margin-left: 4px; white-space: nowrap; }

.ccm-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.ccm-layout-box .ccm-banner-actions,
.ccm-layout-modal .ccm-banner-actions { margin-top: 12px; justify-content: flex-end; }
.ccm-layout-box .ccm-banner-actions .ccm-btn,
.ccm-layout-modal .ccm-banner-actions .ccm-btn { flex: 1 1 0; text-align: center; }

/* ---------- Buttons ---------- */

.ccm-btn {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	appearance: none;
	border: 1px solid transparent;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	font-size: 13px;
	padding: 9px 16px;
	border-radius: calc(var(--ccm-radius) * 0.55);
	transition: filter 0.15s ease, transform 0.05s ease;
	white-space: nowrap;
	text-align: center;
}
.ccm-btn:active { transform: scale(0.98); }
.ccm-btn:hover { filter: brightness(0.93); }
.ccm-btn:focus-visible { outline: 2px solid var(--ccm-accent); outline-offset: 2px; }

.ccm-btn-primary { background: var(--ccm-accept-bg); color: var(--ccm-accept-text); }
.ccm-btn-ghost { background: var(--ccm-reject-bg); color: var(--ccm-reject-text); }
.ccm-btn-outline { background: transparent; border-color: currentColor; color: var(--ccm-text); }
.ccm-btn-pill.ccm-btn, .ccm-btn-pill .ccm-btn { border-radius: 999px; }

/* ---------- Dark theme ---------- */

.ccm-theme-dark .ccm-banner,
.ccm-theme-dark .ccm-preferences-panel { background: #14161f; color: #f2f3f7; }
.ccm-theme-dark .ccm-category-description { color: #b7bacb; }
.ccm-theme-dark .ccm-category { border-color: rgba(255,255,255,0.08); }

/* ---------- Preferences modal ---------- */

.ccm-preferences { position: fixed; inset: 0; z-index: 2147483002; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15,23,42,0.45); }
.ccm-preferences[hidden] { display: none !important; }

.ccm-preferences-panel { background: var(--ccm-bg); color: var(--ccm-text); width: 100%; max-width: 560px; max-height: min(640px, 90vh); border-radius: var(--ccm-radius); box-shadow: var(--ccm-shadow); display: flex; flex-direction: column; animation: ccm-pop-in 0.2s ease; }

.ccm-preferences-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid rgba(0,0,0,0.08); }
.ccm-preferences-header h2 { margin: 0; font-size: 1.05em; }

.ccm-close { all: unset; box-sizing: border-box; cursor: pointer; color: inherit; opacity: 0.5; padding: 4px; font-size: 20px; line-height: 1; }
.ccm-close:hover { opacity: 1; }

.ccm-preferences-body { padding: 8px 24px; overflow-y: auto; }

.ccm-category { padding: 16px 0; border-bottom: 1px solid rgba(0,0,0,0.07); }
.ccm-category:last-child { border-bottom: none; }
.ccm-category-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ccm-category-label { font-weight: 600; font-size: 14px; }
.ccm-category-description { margin: 5px 0 0; font-size: 13px; opacity: 0.7; }

.ccm-preferences-footer { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid rgba(0,0,0,0.08); }

/* ---------- Toggle switch ---------- */

.ccm-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.ccm-switch input { opacity: 0; width: 0; height: 0; }
.ccm-slider { position: absolute; inset: 0; background: #cbd0dc; border-radius: 999px; cursor: pointer; transition: background 0.15s ease; }
.ccm-slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.15s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.ccm-switch input:checked + .ccm-slider { background: var(--ccm-accent); }
.ccm-switch input:checked + .ccm-slider::before { transform: translateX(18px); }
.ccm-switch input:disabled + .ccm-slider { opacity: 0.6; cursor: not-allowed; }
.ccm-switch input:focus-visible + .ccm-slider { outline: 2px solid var(--ccm-accent); outline-offset: 2px; }

/* ---------- Floating launcher ---------- */

.ccm-launcher {
	all: unset;
	box-sizing: border-box;
	position: fixed !important;
	bottom: 16px;
	left: 16px;
	z-index: 2147483001;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--ccm-accept-bg, #3654F0);
	color: var(--ccm-accept-text, #fff);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--ccm-shadow);
}
.ccm-launcher[hidden] { display: none !important; }
.ccm-launcher:hover { filter: brightness(0.93); }
.ccm-launcher svg { width: 22px; height: 22px; flex-shrink: 0; fill: currentColor; display: block; }

/* ---------- Animations ---------- */

@keyframes ccm-slide-up { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes ccm-slide-down { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes ccm-pop-in { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ccm-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
	.ccm-banner { padding: 16px; flex-direction: column; align-items: stretch; }
	.ccm-layout-box .ccm-banner { left: 8px; right: 8px; width: auto; bottom: 8px; max-width: none; }
	.ccm-layout-modal .ccm-banner { left: 8px; right: 8px; top: 50%; bottom: auto; width: auto; max-width: none; transform: translateY(-50%); max-height: calc(100vh - 32px); overflow-y: auto; }
	.ccm-banner-actions { justify-content: stretch; }
	.ccm-banner-actions .ccm-btn { flex: 1 1 auto; }
	.ccm-preferences-footer .ccm-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
	.ccm-banner, .ccm-overlay, .ccm-preferences-panel { animation: none !important; }
}
