/**
 * Concept Cookie Consent — stiluri frontend.
 *
 * Toate regulile sunt prefixate .ccc- și folosesc valori explicite, ca să nu
 * moștenească nimic din tema gazdă (temele exportate din Muse au reguli
 * agresive pe elemente generice).
 */

/**
 * Paletă implicită. Fiecare valoare poate fi suprascrisă din
 * Setări → Cookie Consent → Design; suprascrierile sunt emise inline,
 * pe .ccc-root, deci au prioritate față de acest bloc.
 */
.ccc-root {
	--ccc-accent: #0b7285;
	--ccc-accent-hover: #095c6b;
	--ccc-soft: #eef6f8;
	--ccc-soft-border: #cfe6ec;
	--ccc-bg: #ffffff;
	--ccc-surface: #f8fbfc;
	--ccc-heading: #14282e;
	--ccc-text: #4a585c;
	--ccc-muted: #7d9198;
	--ccc-border: #e8eef1;
	--ccc-border-strong: #cfdde1;
	--ccc-switch-off: #c6d5d9;
	--ccc-overlay: rgba(12, 30, 36, .55);
	--ccc-radius: 12px;
	--ccc-btn-radius: 8px;
}

.ccc-root,
.ccc-root * {
	box-sizing: border-box;
}

.ccc-root {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.55;
	color: var(--ccc-text);
}

.ccc-root [hidden] {
	display: none !important;
}

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

.ccc-banner {
	position: fixed;
	z-index: 999998;
	background: var(--ccc-bg);
	border: 1px solid var(--ccc-border);
	border-radius: var(--ccc-radius);
	box-shadow: 0 12px 40px rgba(15, 40, 50, .18);
	padding: 20px 22px;
	animation: ccc-in .28s ease-out;
}

.ccc-pos-corner .ccc-banner {
	bottom: 20px;
	right: 20px;
	width: 380px;
	max-width: calc(100vw - 40px);
}

.ccc-pos-bottom .ccc-banner {
	bottom: 0;
	left: 0;
	right: 0;
	width: 100%;
	border-radius: 0;
	border-left: 0;
	border-right: 0;
	border-bottom: 0;
	padding: 18px 24px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 24px;
}

.ccc-pos-bottom .ccc-banner-text {
	flex: 1 1 380px;
}

.ccc-pos-bottom .ccc-banner-title {
	flex-basis: 100%;
}

@keyframes ccc-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

.ccc-banner-title {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 700;
	color: var(--ccc-heading);
}

.ccc-banner-text {
	margin: 0 0 10px;
	font-size: 13.5px;
	color: var(--ccc-text);
}

.ccc-banner-links {
	margin: 0 0 14px;
	font-size: 12.5px;
}

.ccc-banner-links a {
	color: var(--ccc-accent);
	text-decoration: underline;
}

.ccc-banner-links span {
	color: var(--ccc-muted);
	margin: 0 4px;
}

.ccc-banner-actions {
	display: flex;
	gap: 8px;
}

.ccc-pos-corner .ccc-banner-actions .ccc-btn {
	flex: 1 1 0;
}

/* ---------- Butoane ---------- */

.ccc-btn {
	display: inline-block;
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.2;
	padding: 10px 16px;
	border-radius: var(--ccc-btn-radius);
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
	white-space: nowrap;
	text-align: center;
}

.ccc-btn-primary {
	background: var(--ccc-accent);
	border: 1px solid var(--ccc-accent);
	color: var(--ccc-bg);
}

.ccc-btn-primary:hover {
	background: var(--ccc-accent-hover);
	border-color: var(--ccc-accent-hover);
	color: var(--ccc-bg);
}

.ccc-btn-ghost {
	background: var(--ccc-bg);
	border: 1px solid var(--ccc-border-strong);
	color: var(--ccc-text);
}

.ccc-btn-ghost:hover {
	border-color: var(--ccc-accent);
	color: var(--ccc-accent);
}

.ccc-link-btn {
	display: block;
	width: 100%;
	margin-top: 10px;
	padding: 4px;
	background: none;
	border: 0;
	font: inherit;
	font-size: 12.5px;
	color: var(--ccc-accent);
	text-decoration: underline;
	cursor: pointer;
	text-align: center;
}

.ccc-pos-bottom .ccc-link-btn {
	width: auto;
	margin: 0;
}

.ccc-btn:focus-visible,
.ccc-link-btn:focus-visible,
.ccc-close:focus-visible,
.ccc-toggle-details:focus-visible {
	outline: 2px solid var(--ccc-accent);
	outline-offset: 2px;
}

/* ---------- Panou preferințe ---------- */

.ccc-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: var(--ccc-overlay);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	overflow-y: auto;
}

.ccc-panel {
	background: var(--ccc-bg);
	border-radius: calc(var(--ccc-radius) + 2px);
	width: 100%;
	max-width: 720px;
	max-height: calc(100vh - 40px);
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 60px rgba(10, 25, 30, .35);
	animation: ccc-in .22s ease-out;
}

.ccc-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 22px;
	border-bottom: 1px solid var(--ccc-border);
}

.ccc-panel-head h2 {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	color: var(--ccc-heading);
	line-height: 1.3;
}

.ccc-close {
	background: none;
	border: 0;
	font-size: 26px;
	line-height: 1;
	color: var(--ccc-muted);
	cursor: pointer;
	padding: 0 4px;
}

.ccc-close:hover {
	color: var(--ccc-heading);
}

.ccc-panel-body {
	padding: 6px 22px 14px;
	overflow-y: auto;
	flex: 1 1 auto;
}

.ccc-panel-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
	padding: 14px 22px;
	border-top: 1px solid var(--ccc-border);
	background: var(--ccc-surface);
	border-radius: 0 0 calc(var(--ccc-radius) + 2px) calc(var(--ccc-radius) + 2px);
}

/* ---------- Categorii ---------- */

.ccc-cat {
	padding: 16px 0;
	border-bottom: 1px solid var(--ccc-border);
}

.ccc-cat:last-child {
	border-bottom: 0;
}

.ccc-cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.ccc-cat-title {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.ccc-toggle-details {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	font-size: 14.5px;
	font-weight: 700;
	color: var(--ccc-heading);
	cursor: pointer;
	text-align: left;
}

.ccc-chevron {
	width: 0;
	height: 0;
	border-left: 5px solid var(--ccc-muted);
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	transition: transform .18s;
	flex: none;
}

.ccc-toggle-details[aria-expanded="true"] .ccc-chevron {
	transform: rotate(90deg);
}

.ccc-count {
	background: var(--ccc-soft);
	color: var(--ccc-accent);
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	padding: 1px 8px;
	flex: none;
}

.ccc-cat-desc {
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--ccc-muted);
	padding-left: 13px;
}

.ccc-always {
	font-size: 12px;
	font-weight: 700;
	color: var(--ccc-accent);
	background: var(--ccc-soft);
	border: 1px solid var(--ccc-soft-border);
	border-radius: 20px;
	padding: 3px 11px;
	white-space: nowrap;
	flex: none;
}

/* ---------- Comutator ---------- */

.ccc-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex: none;
	cursor: pointer;
}

.ccc-switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
	z-index: 2;
}

.ccc-slider {
	position: absolute;
	inset: 0;
	background: var(--ccc-switch-off);
	border-radius: 24px;
	transition: background-color .18s;
	pointer-events: none;
}

.ccc-slider::before {
	content: "";
	position: absolute;
	height: 18px;
	width: 18px;
	left: 3px;
	top: 3px;
	background: var(--ccc-bg);
	border-radius: 50%;
	transition: transform .18s;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

.ccc-switch input:checked + .ccc-slider {
	background: var(--ccc-accent);
}

.ccc-switch input:checked + .ccc-slider::before {
	transform: translateX(20px);
}

.ccc-switch input:focus-visible + .ccc-slider {
	outline: 2px solid var(--ccc-accent);
	outline-offset: 2px;
}

/* ---------- Tabel detalii ---------- */

.ccc-details {
	margin-top: 12px;
	margin-left: 13px;
	overflow-x: auto;
}

.ccc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12.5px;
	background: var(--ccc-surface);
}

.ccc-table th,
.ccc-table td {
	border: 1px solid var(--ccc-border);
	padding: 7px 9px;
	text-align: left;
	vertical-align: top;
	color: var(--ccc-text);
}

.ccc-table th {
	background: var(--ccc-surface);
	font-weight: 700;
	color: var(--ccc-heading);
	white-space: nowrap;
}

.ccc-table code {
	background: var(--ccc-border);
	border-radius: 3px;
	padding: 1px 5px;
	font-size: 11.5px;
	color: var(--ccc-heading);
	word-break: break-word;
}

/* ---------- Buton redeschidere ---------- */

.ccc-reopen {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 999997;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--ccc-bg);
	border: 1px solid var(--ccc-border-strong);
	color: var(--ccc-accent);
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(15, 40, 50, .16);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s, border-color .15s;
	padding: 0;
}

.ccc-reopen:hover {
	transform: scale(1.06);
	border-color: var(--ccc-accent);
}

/* ---------- Buton shortcode inline ---------- */

.ccc-inline-btn {
	display: inline-block;
	background: var(--ccc-accent);
	color: var(--ccc-bg);
	border: 0;
	border-radius: 8px;
	padding: 9px 18px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.ccc-inline-btn:hover {
	background: var(--ccc-accent-hover);
	color: var(--ccc-bg);
}

/* ---------- Tabel declarație (shortcode) ---------- */

.ccc-declaration {
	margin: 0 0 24px;
}

.ccc-declaration h3 {
	font-size: 16px;
	font-weight: 700;
	color: var(--ccc-heading);
	margin: 22px 0 4px;
}

.ccc-declaration p {
	font-size: 13.5px;
	color: var(--ccc-muted);
	margin: 0 0 10px;
}

.ccc-declaration .ccc-table {
	background: var(--ccc-bg);
	font-size: 13px;
	margin-bottom: 6px;
}

/* ---------- Mobil ---------- */

@media (max-width: 600px) {
	.ccc-pos-corner .ccc-banner {
		left: 12px;
		right: 12px;
		bottom: 12px;
		width: auto;
		max-width: none;
		padding: 18px;
	}

	.ccc-pos-bottom .ccc-banner {
		padding: 16px;
	}

	.ccc-banner-actions {
		flex-direction: column;
	}

	.ccc-overlay {
		padding: 0;
		align-items: flex-end;
	}

	.ccc-panel {
		max-width: none;
		max-height: 92vh;
		border-radius: calc(var(--ccc-radius) + 2px) calc(var(--ccc-radius) + 2px) 0 0;
	}

	.ccc-panel-foot {
		border-radius: 0;
	}

	.ccc-panel-foot .ccc-btn {
		flex: 1 1 100%;
	}

	.ccc-cat-head {
		flex-wrap: wrap;
	}

	.ccc-reopen {
		width: 38px;
		height: 38px;
	}
}

/* Reduce mișcarea pentru utilizatorii care o solicită. */
@media (prefers-reduced-motion: reduce) {
	.ccc-banner,
	.ccc-panel {
		animation: none;
	}

	.ccc-slider,
	.ccc-slider::before,
	.ccc-chevron,
	.ccc-reopen {
		transition: none;
	}
}

/**
 * Tabelul din shortcode-ul [declaratie_cookie] este inserat în conținutul
 * paginii, unde stilurile documentului legal (.cc-legal table, th, td) au
 * aceeași specificitate și vin mai târziu în sursă. Ridicăm specificitatea
 * ca paleta configurată din admin să se aplice și acolo.
 */
.ccc-root.ccc-declaration .ccc-table,
.ccc-root.ccc-declaration .ccc-table th,
.ccc-root.ccc-declaration .ccc-table td {
	border-color: var(--ccc-border);
	color: var(--ccc-text);
}

.ccc-root.ccc-declaration .ccc-table thead th {
	background: var(--ccc-soft);
	color: var(--ccc-heading);
}

.ccc-root.ccc-declaration .ccc-table code {
	background: var(--ccc-soft);
	color: var(--ccc-accent);
}

.ccc-root.ccc-declaration h3 {
	color: var(--ccc-heading);
}
