/**
 * Collabable Pre-launch — CNIL-compliant cookie banner.
 *
 * Design: bottom-anchored bar (not a blocking modal), dark theme matching
 * the landing palette (#191919). Three buttons of identical weight at the
 * first level — Accept / Refuse / Customise — per CNIL délib. 2020-091
 * jurisprudence (Google 150M€, Facebook 60M€, Amazon 35M€ all sanctioned
 * for asymmetric Refuse buttons).
 *
 * Class prefix: .cprl-cookie__  (matches landing namespace cprl__).
 * Hidden by default; JS adds .is-visible when no valid consent cookie is found.
 *
 * @package Collabable_Prelaunch
 * @since   3.0.46
 */

/* ─────────────────────────────────────────────────────────────────
   BOTTOM BAR — first level
   ───────────────────────────────────────────────────────────────── */

.cprl-cookie {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2147483000; /* sit above v3 modal + Astra footer + WPFastestCache placeholders */
	display: none;
	background: #191919;
	color: #ffffff;
	border-top: 1px solid #2a2a2a;
	box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	padding: 18px 20px;
}

.cprl-cookie.is-visible {
	display: block;
}

.cprl-cookie__inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 18px 24px;
}

.cprl-cookie__text {
	flex: 1 1 320px;
	min-width: 0;
}

.cprl-cookie__text p {
	margin: 0;
	color: #f2f2f2;
}

.cprl-cookie__text a {
	color: #ffffff;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cprl-cookie__text a:hover,
.cprl-cookie__text a:focus {
	color: #ffd5d5;
}

/* ─────────────────────────────────────────────────────────────────
   ACTION BUTTONS — CNIL: same size, same weight, same position
   ───────────────────────────────────────────────────────────────── */

.cprl-cookie__actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	flex: 0 0 auto;
}

.cprl-cookie__row {
	display: flex;
	gap: 10px;
}

/* The two primary buttons MUST be visually equivalent to comply with
   CNIL délib. 2020-091. Identical font-size, padding, min-width, font-weight,
   border-radius and visual prominence — only the background colour differs
   to communicate the intent. Astra resets padding via .cprl-cookie__btn
   { padding: 0 22px } to defeat .button { padding: 20px 40px } override. */
.cprl-cookie__btn {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 140px;
	height: 42px;
	padding: 0 22px;
	margin: 0;
	border: 1px solid transparent;
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.01em;
	color: #ffffff;
	background: #3a3a3a;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
	text-decoration: none;
}

.cprl-cookie__btn:hover { background: #4a4a4a; }
.cprl-cookie__btn:active { transform: translateY(1px); }
.cprl-cookie__btn:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

.cprl-cookie__btn--accept {
	background: #CF0000;
}
.cprl-cookie__btn--accept:hover {
	background: #A60000;
}

.cprl-cookie__btn--refuse {
	background: #3a3a3a;
}
.cprl-cookie__btn--refuse:hover {
	background: #4a4a4a;
}

/* "Customise" sits below the two primary buttons as a quieter link —
   allowed by CNIL guidance because Accept and Refuse already exist at
   parity on the same level. */
.cprl-cookie__customise {
	background: transparent;
	border: 0;
	padding: 4px 0;
	margin: 0;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	color: #d8d8d8;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	align-self: center;
}
.cprl-cookie__customise:hover,
.cprl-cookie__customise:focus { color: #ffffff; }

/* ─────────────────────────────────────────────────────────────────
   PERSONALISE PANEL — modal centered, category toggles
   ───────────────────────────────────────────────────────────────── */

.cprl-cookie-panel {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cprl-cookie-panel.is-visible {
	display: flex;
}

.cprl-cookie-panel__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
}

.cprl-cookie-panel__dialog {
	position: relative;
	width: 100%;
	max-width: 540px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: #191919;
	color: #ffffff;
	border-radius: 12px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
	padding: 24px;
}

.cprl-cookie-panel__title {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 700;
	color: #ffffff;
}

.cprl-cookie-panel__intro {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.5;
	color: #cccccc;
}

.cprl-cookie-panel__categories {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 18px;
}

.cprl-cookie-cat {
	border: 1px solid #2a2a2a;
	border-radius: 8px;
	padding: 14px 16px;
	background: #1f1f1f;
}

.cprl-cookie-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.cprl-cookie-cat__name {
	font-size: 14px;
	font-weight: 600;
	color: #ffffff;
}

.cprl-cookie-cat__desc {
	margin: 6px 0 0;
	font-size: 13px;
	line-height: 1.45;
	color: #b8b8b8;
}

.cprl-cookie-cat__locked {
	font-size: 12px;
	font-weight: 600;
	color: #888888;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Toggle switch (vanilla CSS, no framework). */
.cprl-cookie-toggle {
	position: relative;
	display: inline-block;
	width: 38px;
	height: 22px;
	flex-shrink: 0;
}
.cprl-cookie-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
}
.cprl-cookie-toggle__slider {
	position: absolute;
	cursor: pointer;
	inset: 0;
	background: #3a3a3a;
	border-radius: 22px;
	transition: background 0.15s ease;
}
.cprl-cookie-toggle__slider::before {
	content: "";
	position: absolute;
	height: 16px;
	width: 16px;
	left: 3px;
	top: 3px;
	background: #ffffff;
	border-radius: 50%;
	transition: transform 0.15s ease;
}
.cprl-cookie-toggle input:checked + .cprl-cookie-toggle__slider {
	background: #CF0000;
}
.cprl-cookie-toggle input:checked + .cprl-cookie-toggle__slider::before {
	transform: translateX(16px);
}
.cprl-cookie-toggle input:focus-visible + .cprl-cookie-toggle__slider {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}
.cprl-cookie-toggle--disabled .cprl-cookie-toggle__slider {
	cursor: not-allowed;
	opacity: 0.5;
}

.cprl-cookie-panel__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
}

.cprl-cookie-panel__footer .cprl-cookie__btn {
	min-width: 160px;
}

/* ─────────────────────────────────────────────────────────────────
   FLOATING RE-OPEN PILL — permanent access to revoke consent
   ───────────────────────────────────────────────────────────────── */

.cprl-cookie-reopen {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 2147482999;
	display: none;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 12px;
	font-weight: 600;
	color: #ffffff;
	background: rgba(25, 25, 25, 0.85);
	border: 1px solid #2a2a2a;
	border-radius: 999px;
	cursor: pointer;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transition: background 0.15s ease, border-color 0.15s ease;
}
.cprl-cookie-reopen.is-visible {
	display: inline-flex;
}
.cprl-cookie-reopen:hover {
	background: rgba(40, 40, 40, 0.95);
	border-color: #444444;
}
.cprl-cookie-reopen:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}
.cprl-cookie-reopen__icon {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────
   MOBILE — stack buttons full-width, keep parity
   ───────────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
	.cprl-cookie {
		padding: 16px;
	}
	.cprl-cookie__inner {
		gap: 14px;
	}
	.cprl-cookie__text {
		flex-basis: 100%;
	}
	.cprl-cookie__actions {
		width: 100%;
	}
	.cprl-cookie__row {
		width: 100%;
	}
	.cprl-cookie__row .cprl-cookie__btn {
		flex: 1 1 0;
		min-width: 0;
	}
	.cprl-cookie__customise {
		align-self: center;
	}
	.cprl-cookie-panel__dialog {
		padding: 20px;
	}
	.cprl-cookie-panel__footer .cprl-cookie__btn {
		flex: 1 1 0;
		min-width: 0;
	}
}

/* Reduce motion — disable button hover transforms for users who
   prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.cprl-cookie__btn,
	.cprl-cookie-toggle__slider,
	.cprl-cookie-toggle__slider::before,
	.cprl-cookie-reopen {
		transition: none;
	}
}
