/*
 * Bannerul de cookie-uri.
 *
 * Culorile sunt luate din tema cand exista, cu rezerva scrisa dupa, ca sa
 * arate corect si daca pluginul ajunge pe alta tema.
 */

.bx-ck {
	--bx-ck-text: var(--wp--preset--color--text, #1a1c1e);
	--bx-ck-sters: var(--wp--preset--color--text-secundar, #4b5563);
	--bx-ck-fundal: var(--wp--preset--color--alb, #ffffff);
	--bx-ck-margine: #d8dbe0;
	--bx-ck-albastru: var(--wp--preset--color--albastru, #2d5bd7);
	--bx-ck-albastru-apasat: var(--wp--preset--color--albastru-apasat, #1e3fa0);
	--bx-ck-raza: 12px;

	font-size: 15px;
	line-height: 1.6;
	color: var(--bx-ck-text);
}

/*
 * Atributul hidden ascunde un element pentru ca foaia de stil a navigatorului
 * ii pune display:none, dar regula aceea are specificitate zero. Orice regula
 * proprie care pune un display, cum e flex-ul barei de mai jos, o invinge si
 * elementul ramane vizibil desi scrie hidden. De aceea ascunderea se scrie
 * explicit aici, pentru componenta intreaga.
 */
.bx-ck[hidden],
.bx-ck [hidden] {
	display: none !important;
}

/* ---------- bara de jos ---------- */

.bx-ck__bara {
	position: fixed;
	z-index: 99998;
	left: 1rem;
	right: 1rem;
	bottom: 1rem;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.5rem;
	align-items: center;
	justify-content: space-between;
	max-width: 70rem;
	margin: 0 auto;
	padding: 1.25rem 1.5rem;
	background: var(--bx-ck-fundal);
	border: 1px solid var(--bx-ck-margine);
	border-radius: var(--bx-ck-raza);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

.bx-ck__continut {
	flex: 1 1 26rem;
	min-width: 0;
}

.bx-ck__titlu {
	margin: 0 0 0.35rem;
	font-size: 1.05rem;
	line-height: 1.3;
	font-weight: 700;
}

.bx-ck__text {
	margin: 0;
	color: var(--bx-ck-sters);
}

.bx-ck__text a {
	color: inherit;
	text-underline-offset: 2px;
}

/* ---------- butoane ---------- */

.bx-ck__butoane {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

/*
 * Refuzul si acceptul au aceeasi marime, acelasi contur si acelasi contrast.
 * Un refuz scris mai mic sau mai sters decat acceptul nu e alegere libera,
 * iar autoritatile europene trateaza asta ca lipsa de consimtamant.
 */
.bx-ck .bx-ck__buton {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.6rem 1.15rem;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	border-radius: 8px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

/*
 * Fundalul e albastrul apasat, nu cel obisnuit. Alb pe #3388eb da un contrast
 * de 3,6:1, sub pragul de 4,5:1 cerut de WCAG 2.2 AA pentru text de marimea
 * asta; alb pe #1f6fd0 da 4,9:1 si trece.
 */
.bx-ck .bx-ck__buton--principal {
	background: var(--bx-ck-albastru-apasat);
	border-color: var(--bx-ck-albastru-apasat);
	color: #fff;
}

.bx-ck .bx-ck__buton--principal:hover {
	background: #18549f;
	border-color: #18549f;
}

.bx-ck .bx-ck__buton--secundar {
	background: var(--bx-ck-fundal);
	border-color: var(--bx-ck-albastru);
	color: var(--bx-ck-albastru-apasat);
}

.bx-ck .bx-ck__buton--secundar:hover {
	background: rgba(45, 91, 215, 0.08);
}

.bx-ck .bx-ck__buton--text {
	background: transparent;
	border-color: transparent;
	color: var(--bx-ck-text);
	text-decoration: underline;
	text-underline-offset: 3px;
	padding-inline: 0.5rem;
}

.bx-ck .bx-ck__buton--text:hover {
	background: rgba(0, 0, 0, 0.05);
}

.bx-ck :focus-visible {
	outline: 2px solid var(--bx-ck-albastru-apasat);
	outline-offset: 2px;
}

/* ---------- panoul de categorii ---------- */

.bx-ck__fundal {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(15, 18, 23, 0.55);
}

.bx-ck__panou {
	position: fixed;
	z-index: 99999;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(38rem, calc(100vw - 2rem));
	max-height: min(85vh, 44rem);
	overflow-y: auto;
	padding: 1.5rem;
	background: var(--bx-ck-fundal);
	border-radius: var(--bx-ck-raza);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.bx-ck__panou-cap {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}

.bx-ck .bx-ck__inchide {
	appearance: none;
	background: none;
	border: 0;
	font-size: 1.6rem;
	line-height: 1;
	min-width: 44px;
	min-height: 44px;
	cursor: pointer;
	color: var(--bx-ck-sters);
	border-radius: 8px;
}

.bx-ck__lista {
	display: grid;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.bx-ck__categorie {
	padding: 1rem;
	border: 1px solid var(--bx-ck-margine);
	border-radius: 10px;
}

.bx-ck__categorie-cap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.4rem;
}

.bx-ck__categorie-nume {
	font-weight: 700;
}

.bx-ck__categorie-text {
	margin: 0;
	color: var(--bx-ck-sters);
	font-size: 0.94rem;
}

.bx-ck__eticheta {
	flex: none;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--bx-ck-sters);
	white-space: nowrap;
}

/* ---------- comutatorul ---------- */

.bx-ck__comutator {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	cursor: pointer;
}

.bx-ck__comutator input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.bx-ck__comutator-urma {
	flex: none;
	width: 44px;
	height: 26px;
	border-radius: 13px;
	background: #9aa1ad;
	position: relative;
	transition: background-color 0.15s ease;
}

.bx-ck__comutator-urma::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.15s ease;
}

.bx-ck__comutator input:checked + .bx-ck__comutator-urma {
	background: var(--bx-ck-albastru);
}

.bx-ck__comutator input:checked + .bx-ck__comutator-urma::after {
	transform: translateX(18px);
}

/*
 * Categoria obligatorie ramane pornita si se vede ca atare. Nu i se scade
 * opacitatea: o stare care nu se poate schimba trebuie sa ramana citibila,
 * conform cerintei de contrast din WCAG 2.2.
 */
.bx-ck__comutator input:disabled + .bx-ck__comutator-urma {
	background: #6b7280;
}

.bx-ck__comutator input:disabled {
	cursor: default;
}

.bx-ck__comutator input:focus-visible + .bx-ck__comutator-urma {
	outline: 2px solid var(--bx-ck-albastru-apasat);
	outline-offset: 2px;
}

/* ---------- legatura de redeschidere ---------- */

button.bx-ck__legatura {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

/* ---------- telefon ---------- */

@media (max-width: 640px) {
	.bx-ck__bara {
		left: 0.5rem;
		right: 0.5rem;
		bottom: 0.5rem;
		padding: 1rem;
	}

	.bx-ck__butoane {
		width: 100%;
	}

	.bx-ck__butoane .bx-ck__buton {
		flex: 1 1 auto;
	}

	.bx-ck__buton--text {
		flex-basis: 100%;
		order: 3;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bx-ck__buton,
	.bx-ck__comutator-urma,
	.bx-ck__comutator-urma::after {
		transition: none;
	}
}

/* ---------- nota din panou si starea din subsol ---------- */

/*
 * Nota trimite la lista completa. Panoul spune ce categorii exista; lista cu
 * fiecare cookie si durata lui sta in pagina de politica, fiindca intr-o caseta
 * de 400 de pixeli nu incape si nici nu se citeste.
 */
.bx-ck__panou-nota {
	margin: 0 0 1rem;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: #565c64;
}

.bx-ck__stare {
	display: inline;
	color: inherit;
}

/* ---------- tabelul din pagina de politica ---------- */

/*
 * Tabelul nu poarta clasa .bx-ck, fiindca nu e parte din caseta: sta in continutul
 * paginii si trebuie sa mosteneasca tipografia temei, nu pe a casetei.
 */
.bx-ck-tabel__titlu {
	margin-top: 2.5rem;
}

.bx-ck-tabel__intro {
	margin-top: 0.5rem;
	color: var(--wp--preset--color--text-secundar, #565c64);
}

.bx-ck-tabel {
	width: 100%;
	border-collapse: collapse;
	margin-top: 1rem;
	font-size: 0.9375rem;
}

.bx-ck-tabel th,
.bx-ck-tabel td {
	padding: 0.75rem 1rem 0.75rem 0;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--wp--preset--color--linie, #e6e6e4);
}

.bx-ck-tabel thead th {
	font-size: 0.8125rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--text-stins, #696f78);
}

.bx-ck-tabel code {
	font-size: 0.875em;
	word-break: break-word;
}

/*
 * Pe telefon patru coloane nu incap, iar derularea pe orizontala ascunde tocmai
 * coloana cu scopul. Randurile devin fise, cu eticheta coloanei inaintea valorii.
 */
@media (max-width: 720px) {
	.bx-ck-tabel thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.bx-ck-tabel tr {
		display: block;
		padding: 1rem 0;
		border-bottom: 1px solid var(--wp--preset--color--linie, #e6e6e4);
	}

	.bx-ck-tabel td {
		display: grid;
		grid-template-columns: 8.5rem 1fr;
		gap: 0.75rem;
		padding: 0.25rem 0;
		border: 0;
	}

	.bx-ck-tabel td::before {
		content: attr(data-eticheta);
		font-size: 0.8125rem;
		font-weight: 600;
		color: var(--wp--preset--color--text-stins, #696f78);
	}
}
