/**
 * OS Cookie Consent — Styles
 * Conforme à la charte graphique oliviersauvage.com (B2Biz)
 */

:root {
	--os-cookie-primary-blue: #0691E2;
	--os-cookie-primary-purple: #9652DF;
	--os-cookie-gradient: linear-gradient(135deg, #0691E2 0%, #9652DF 100%);
	--os-cookie-pale-blue: #EAF7FE;
	--os-cookie-dark: #262626;
	--os-cookie-mid-grey: #5D6773;
	--os-cookie-light-grey: #F8FAFC;
	--os-cookie-border: #E2E8F0;
	--os-cookie-radius: 16px;
	--os-cookie-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.16), 0 2px 8px -2px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.04);
}

/* ==========================================================================
   Bannière / Carte en bas à droite (Desktop)
   ========================================================================== */
#os-cookie-banner.os-cookie-card {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 380px;
	max-width: calc(100vw - 32px);
	background: #FFFFFF;
	border: 1px solid var(--os-cookie-border);
	border-radius: var(--os-cookie-radius);
	box-shadow: var(--os-cookie-shadow);
	z-index: 999999;
	font-family: var(--wp--preset--font-family--body, 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	color: var(--os-cookie-dark);
	box-sizing: border-box;
	padding: 22px;
	opacity: 1;
	transform: translateY(0) scale(1);
	transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
	visibility: visible;
}

#os-cookie-banner.os-cookie-card *,
#os-cookie-banner.os-cookie-card *::before,
#os-cookie-banner.os-cookie-card *::after {
	box-sizing: border-box;
}

#os-cookie-banner.is-hidden {
	opacity: 0;
	transform: translateY(20px) scale(0.96);
	visibility: hidden;
	pointer-events: none;
}

/* En-tête */
.os-cookie-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.os-cookie-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: var(--os-cookie-pale-blue);
	color: var(--os-cookie-primary-blue);
	flex-shrink: 0;
}

.os-cookie-icon svg {
	width: 20px;
	height: 20px;
}

.os-cookie-title {
	font-family: var(--wp--preset--font-family--heading, 'Alumni Sans', sans-serif);
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0;
	color: var(--os-cookie-dark);
	line-height: 1.15;
	letter-spacing: -0.01em;
}

/* Bouton Retour dans la vue personnalisation */
.os-cookie-back-btn {
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--os-cookie-mid-grey);
	border-radius: 6px;
	transition: background-color 0.2s, color 0.2s;
}

.os-cookie-back-btn:hover {
	background: var(--os-cookie-light-grey);
	color: var(--os-cookie-dark);
}

.os-cookie-back-btn svg {
	width: 18px;
	height: 18px;
}

/* Corps du texte */
.os-cookie-body {
	font-size: 0.88rem;
	line-height: 1.5;
	color: var(--os-cookie-mid-grey);
	margin-bottom: 18px;
}

.os-cookie-body p {
	margin: 0 0 8px 0;
}

.os-cookie-privacy-link-wrap {
	margin-top: 6px !important;
	font-size: 0.82rem;
}

.os-cookie-link {
	color: var(--os-cookie-primary-blue);
	text-decoration: none;
	font-weight: 500;
	transition: color 0.2s;
}

.os-cookie-link:hover {
	text-decoration: underline;
	color: var(--os-cookie-primary-purple);
}

/* Boutons d'action */
.os-cookie-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.os-cookie-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 16px;
	font-size: 0.92rem;
	font-weight: 600;
	border-radius: 10px;
	cursor: pointer;
	border: none;
	transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
	width: 100%;
	text-align: center;
	text-decoration: none;
}

/* Tout accepter (Bouton Primaire charte OS : Dégradé Bleu / Violet) */
.os-cookie-btn-primary {
	background: var(--os-cookie-gradient);
	color: #FFFFFF;
	box-shadow: 0 3px 10px rgba(6, 145, 226, 0.25);
}

.os-cookie-btn-primary:hover {
	opacity: 0.94;
	transform: translateY(-1px);
	box-shadow: 0 5px 14px rgba(6, 145, 226, 0.35);
}

.os-cookie-btn-primary:active {
	transform: translateY(0);
}

/* Tout refuser (Bouton Secondaire neutre et clair) */
.os-cookie-btn-secondary {
	background: var(--os-cookie-light-grey);
	color: var(--os-cookie-dark);
	border: 1px solid var(--os-cookie-border);
}

.os-cookie-btn-secondary:hover {
	background: #F1F5F9;
	border-color: #CBD5E1;
}

/* Personnaliser (Bouton Texte discret) */
.os-cookie-btn-text {
	background: transparent;
	border: none;
	color: var(--os-cookie-mid-grey);
	font-size: 0.84rem;
	font-weight: 500;
	padding: 6px;
	cursor: pointer;
	text-align: center;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.2s;
}

.os-cookie-btn-text:hover {
	color: var(--os-cookie-primary-blue);
}

/* ==========================================================================
   Vue Personnalisation / Catégories
   ========================================================================== */
.os-cookie-categories {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 18px;
	max-height: 260px;
	overflow-y: auto;
	padding-right: 4px;
}

.os-cookie-category {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 10px;
	background: var(--os-cookie-light-grey);
	border: 1px solid var(--os-cookie-border);
	border-radius: 10px;
}

.os-cookie-cat-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
}

.os-cookie-cat-name {
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--os-cookie-dark);
	cursor: pointer;
}

.os-cookie-cat-desc {
	font-size: 0.78rem;
	color: var(--os-cookie-mid-grey);
	line-height: 1.35;
}

.os-cookie-badge-always {
	display: inline-block;
	background: #E2E8F0;
	color: #475569;
	font-size: 0.72rem;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 6px;
	white-space: nowrap;
}

/* Switch Toggle Apple-style */
.os-switch {
	position: relative;
	display: inline-block;
	width: 38px;
	height: 22px;
	flex-shrink: 0;
	margin-top: 2px;
}

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

.os-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #CBD5E1;
	transition: .24s cubic-bezier(0.16, 1, 0.3, 1);
	border-radius: 22px;
}

.os-slider:before {
	position: absolute;
	content: "";
	height: 16px;
	width: 16px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: .24s cubic-bezier(0.16, 1, 0.3, 1);
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.os-switch input:checked + .os-slider {
	background: var(--os-cookie-gradient);
}

.os-switch input:focus + .os-slider {
	box-shadow: 0 0 0 2px rgba(6, 145, 226, 0.25);
}

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

/* ==========================================================================
   Bouton Flottant Déclencheur (Rouvrir à tout moment)
   ========================================================================== */
#os-cookie-trigger.os-cookie-trigger-btn {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 999998;
	background: #FFFFFF;
	border: 1px solid var(--os-cookie-border);
	border-radius: 30px;
	padding: 8px 14px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--os-cookie-dark);
	font-size: 0.82rem;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
	transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px) scale(0.9);
	font-family: inherit;
}

#os-cookie-trigger.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

#os-cookie-trigger.os-cookie-trigger-btn:hover {
	background: var(--os-cookie-pale-blue);
	border-color: rgba(6, 145, 226, 0.3);
	color: var(--os-cookie-primary-blue);
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(6, 145, 226, 0.18);
}

#os-cookie-trigger.os-cookie-trigger-btn svg {
	width: 17px;
	height: 17px;
	color: var(--os-cookie-primary-blue);
	flex-shrink: 0;
}

/* ==========================================================================
   Responsive Mobile
   ========================================================================== */
@media (max-width: 640px) {
	/* Dégagement pour ne pas chevaucher la barre mobile .os-mobile-bottom-nav */
	#os-cookie-banner.os-cookie-card {
		bottom: 76px;
		left: 14px;
		right: 14px;
		width: auto;
		max-width: 420px;
		margin: 0 auto;
		padding: 18px;
	}

	#os-cookie-trigger.os-cookie-trigger-btn {
		bottom: 76px;
		right: 14px;
		padding: 8px;
		border-radius: 50%;
		width: 40px;
		height: 40px;
		justify-content: center;
	}

	#os-cookie-trigger .os-cookie-trigger-label {
		display: none;
	}
}
