/* ==========================================================================
   EJART — Banner consenso cookie
   Stile coerente col resto del sito (usa i token --ej-*). Rosso brand #E4002B.
   ========================================================================== */

.ej-cc, .ej-cc *, .ej-cc-modal, .ej-cc-modal * { box-sizing: border-box; }

/* ---------------------------------------------------------------- Banner */
.ej-cc[hidden] { display: none; }
.ej-cc {
	position: fixed;
	left: 16px; right: 16px; bottom: 16px;
	z-index: 100000;
	background: var(--ej-paper);
	border: 1px solid var(--ej-line-2);
	border-top: 3px solid #E4002B;
	box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.ej-cc__inner {
	max-width: 1100px;
	margin: 0 auto;
	padding: 22px 26px;
	display: flex;
	align-items: center;
	gap: 28px;
	flex-wrap: wrap;
}
.ej-cc__body { flex: 1 1 420px; min-width: 0; }
.ej-cc__title {
	font-family: var(--ej-display);
	font-size: 16px; font-weight: 600; color: var(--ej-ink);
	margin: 0 0 6px;
}
.ej-cc__text {
	font-family: var(--ej-body);
	font-size: 13.5px; line-height: 1.55; color: var(--ej-mute-2);
	margin: 0;
}
.ej-cc__text a { color: var(--ej-ink); text-decoration: underline; }

.ej-cc__actions {
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
	flex: 0 0 auto;
}

/* pulsanti: "Accetta" e "Rifiuta" hanno pari evidenza (stessa dimensione) */
.ej-cc__btn {
	font-family: var(--ej-display);
	font-size: 13px; font-weight: 600; line-height: 1;
	padding: 13px 20px; border-radius: 0; cursor: pointer;
	border: 1px solid var(--ej-ink); background: var(--ej-paper); color: var(--ej-ink);
	transition: background .15s, color .15s;
	white-space: nowrap;
}
.ej-cc__btn:hover { background: var(--ej-panel); }
.ej-cc__btn--solid { background: var(--ej-ink); color: #fff; }
.ej-cc__btn--solid:hover { background: #000; }
.ej-cc__btn--link {
	border: 0; background: none; padding: 13px 8px;
	color: var(--ej-mute-2); text-decoration: underline; font-weight: 500;
}
.ej-cc__btn--link:hover { color: var(--ej-ink); background: none; }

@media (max-width: 720px) {
	.ej-cc { left: 0; right: 0; bottom: 0; border-left: 0; border-right: 0; }
	.ej-cc__inner { padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); gap: 16px; }
	.ej-cc__actions { width: 100%; }
	.ej-cc__actions .ej-cc__btn:not(.ej-cc__btn--link) { flex: 1 1 auto; text-align: center; }
}

/* ---------------------------------------------------------------- Modale preferenze */
.ej-cc-modal[hidden] { display: none; }
.ej-cc-modal {
	position: fixed; inset: 0; z-index: 100001;
	display: flex; align-items: center; justify-content: center;
	padding: 20px;
}
.ej-cc-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.ej-cc-modal__panel {
	position: relative;
	width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
	background: var(--ej-paper);
	border: 1px solid var(--ej-line-2);
	border-top: 3px solid #E4002B;
	padding: 30px 32px;
}
.ej-cc-modal__x {
	position: absolute; top: 14px; right: 16px;
	border: 0; background: none; cursor: pointer;
	font-size: 26px; line-height: 1; color: var(--ej-mute);
}
.ej-cc-modal__x:hover { color: var(--ej-ink); }
.ej-cc-modal__title {
	font-family: var(--ej-display);
	font-size: 22px; font-weight: 600; color: var(--ej-ink);
	margin: 0 0 10px;
}
.ej-cc-modal__intro {
	font-family: var(--ej-body); font-size: 13.5px; line-height: 1.55;
	color: var(--ej-mute-2); margin: 0 0 22px;
}
.ej-cc-modal__intro a { color: var(--ej-ink); text-decoration: underline; }

.ej-cc-cat { border-top: 1px solid var(--ej-line); padding: 18px 0; }
.ej-cc-cat__head {
	display: flex; align-items: center; justify-content: space-between; gap: 14px;
	margin-bottom: 6px;
}
.ej-cc-cat__name { font-family: var(--ej-display); font-size: 15px; font-weight: 600; color: var(--ej-ink); }
.ej-cc-cat__always {
	font-family: var(--ej-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
	color: var(--ej-signal); font-weight: 500;
}
.ej-cc-cat__desc { font-family: var(--ej-body); font-size: 13px; line-height: 1.5; color: var(--ej-mute-2); margin: 0; }

/* toggle switch */
.ej-cc-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.ej-cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ej-cc-switch__ui {
	position: absolute; inset: 0; border-radius: 999px; background: var(--ej-line-2);
	transition: background .18s;
}
.ej-cc-switch__ui::before {
	content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
	border-radius: 50%; background: #fff; transition: transform .18s;
}
.ej-cc-switch input:checked + .ej-cc-switch__ui { background: var(--ej-signal); }
.ej-cc-switch input:checked + .ej-cc-switch__ui::before { transform: translateX(20px); }
.ej-cc-switch input:disabled + .ej-cc-switch__ui { background: var(--ej-signal); opacity: .5; cursor: not-allowed; }
.ej-cc-switch input:focus-visible + .ej-cc-switch__ui { outline: 2px solid var(--ej-ink); outline-offset: 2px; }

.ej-cc-modal__actions {
	display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px;
	padding-top: 20px; border-top: 1px solid var(--ej-line);
}
.ej-cc-modal__actions .ej-cc__btn { flex: 1 1 auto; text-align: center; }

@media (max-width: 520px) {
	.ej-cc-modal__panel { padding: 26px 20px; }
	.ej-cc-modal__actions .ej-cc__btn { flex: 1 1 100%; }
}

body.ej-cc-modal-open { overflow: hidden; }

/* link "Gestisci cookie" nel footer */
.ej-footer .js-ej-cookie-settings { cursor: pointer; }
