/**
 * LOCATOUT COOKIES — styles frontend.
 * Utilise les variables CSS du thème (--color-primary, --smooth-ease) si
 * disponibles, avec des valeurs de repli sinon.
 */

.lc-consent {
	--lc-accent: var(--color-primary, #3b45c4);
	--lc-ease: var(--smooth-ease, cubic-bezier(0.16, 1, 0.3, 1));

	position: fixed;
	inset: 0;
	z-index: 999997;
	display: flex;
}

.lc-consent[hidden] {
	display: none !important;
}

.lc-consent__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 39, 0.35);
	opacity: 0;
	transition: opacity 0.3s var(--lc-ease);
	pointer-events: none;
}

.lc-consent.is-visible .lc-consent__backdrop {
	opacity: 1;
	pointer-events: auto;
}

.lc-consent__box {
	position: relative;
	z-index: 1;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 50px rgba(15, 23, 39, 0.2);
	padding: 24px 26px;
	max-width: 480px;
	width: calc(100% - 32px);
	margin: 16px;
	box-sizing: border-box;
	transform: translateY(30px);
	opacity: 0;
	transition: transform 0.4s var(--lc-ease), opacity 0.4s var(--lc-ease);
}

.lc-consent--bottom .lc-consent__box {
	margin-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.lc-consent.is-visible .lc-consent__box {
	transform: translateY(0);
	opacity: 1;
}

/* Positions */
.lc-consent--bottom { align-items: flex-end; justify-content: flex-start; }
.lc-consent--top { align-items: flex-start; justify-content: flex-start; }
.lc-consent--center { align-items: center; justify-content: center; }

.lc-consent--center .lc-consent__box {
	margin: auto;
}

.lc-consent__title {
	margin: 0 0 10px;
	font-size: 1.1rem;
	font-weight: 700;
}

.lc-consent__text {
	margin: 0 0 8px;
	font-size: 0.88rem;
	line-height: 1.55;
	opacity: 0.85;
}

.lc-consent__link {
	margin: 0 0 14px;
	font-size: 0.82rem;
}

.lc-consent__link a {
	color: var(--lc-accent);
}

.lc-consent__categories {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 6px 0 16px;
	padding: 14px;
	background: #f9fafb;
	border-radius: 10px;
	max-height: 260px;
	overflow-y: auto;
}

.lc-consent__categories[hidden] {
	display: none;
}

.lc-category__head {
	display: flex;
	align-items: center;
	gap: 10px;
}

.lc-category__desc {
	margin: 4px 0 0 46px;
	font-size: 0.78rem;
	opacity: 0.7;
	line-height: 1.4;
}

.lc-category__badge {
	margin-left: auto;
	font-size: 0.7rem;
	padding: 2px 8px;
	border-radius: 999px;
	background: rgba(21, 128, 61, 0.1);
	color: #15803d;
	font-weight: 600;
}

.lc-switch {
	position: relative;
	display: inline-block;
	width: 36px;
	height: 20px;
	flex-shrink: 0;
}

.lc-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.lc-switch__slider {
	position: absolute;
	inset: 0;
	background: #d1d5db;
	border-radius: 999px;
	transition: background-color 0.2s var(--lc-ease);
}

.lc-switch__slider::before {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	left: 2px;
	top: 2px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s var(--lc-ease);
}

.lc-switch input:checked + .lc-switch__slider {
	background: var(--lc-accent);
}

.lc-switch input:checked + .lc-switch__slider::before {
	transform: translateX(16px);
}

.lc-switch input:disabled + .lc-switch__slider {
	opacity: 0.6;
	cursor: not-allowed;
}

.lc-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.lc-consent__actions--save[hidden] {
	display: none;
}

.lc-btn {
	flex: 1;
	min-width: 110px;
	border: none;
	border-radius: 9999px;
	padding: 10px 16px;
	font-size: 0.82rem;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.2s var(--lc-ease), opacity 0.2s var(--lc-ease);
}

.lc-btn:hover {
	transform: translateY(-1px);
}

.lc-btn--primary {
	background: var(--lc-accent);
	color: #fff;
}

.lc-btn--outline {
	background: #fff;
	color: #1a1d29;
	border: 1px solid rgba(0, 0, 0, 0.15);
}

.lc-btn--ghost {
	background: none;
	color: rgba(15, 23, 39, 0.6);
}

/* Lien "Gérer mes cookies" (shortcode [lc_manage_cookies], placement manuel) */
.lc-manage-link {
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
}

@media only screen and (max-width: 26em) {
	.lc-btn {
		min-width: 100%;
	}

	.lc-consent__box {
		width: calc(100% - 20px);
		margin: 10px;
		padding: 20px 18px;
		padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
		max-height: calc(100vh - 20px);
		overflow-y: auto;
	}
}
