/*
 * Bannière de téléchargement de l'application YEP'S.
 *
 * Styles de base + différentiels portés par les media queries dynamiques de
 * Yeps_DS_Responsive_CSS (visibilité par device, hauteur mobile/desktop,
 * offset du widget chat pour ne jamais le recouvrir).
 *
 * Priorité des classes body (du plus fort au plus faible) :
 *  1. yeps-app-banner-dismissed       → jamais affichée (localStorage)
 *  2. yeps-app-banner-hidden-by-legal → masquée même au scroll dépassé
 *  3. yeps-app-banner-visible         → affichée (scroll ≥ seuil)
 *
 * Le rendu de base part en mode mobile : 2 rangées (texte court + ligne stores
 * + close), pas de bord arrondi. Le différentiel desktop (hauteur réduite à 64,
 * layout 1 ligne, texte long) est piloté par les media queries dynamiques.
 */

.yeps-app-banner {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 70;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 10px;
	min-height: 56px;
	/* Padding standard + safe-area iOS : la bannière étend son fond jusqu'au
	   bord physique de l'écran (avec viewport-fit=cover, cf. yeps.php) et
	   pousse son contenu au-dessus de la home indicator iPhone. */
	padding: 0 12px;
	padding-bottom: env(safe-area-inset-bottom, 0px);
	background: var(--yeps-dark, #1A1A2E);
	color: #fff;
	font-family: var(--wp--preset--font-family--futura, var(--wp--preset--font-family--sans, inherit));
	border-radius: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	/* Pas d'ombre par défaut : à l'état caché (translateY(100%)), une box-shadow
	   projetée vers le haut resterait visible sur le bord bas de l'écran. */
	box-shadow: 0 0 0 0 transparent;
	transform: translateY(100%);
	transition:
		transform 360ms cubic-bezier(0.2, 0.7, 0.1, 1),
		box-shadow 240ms cubic-bezier(0.2, 0.7, 0.1, 1);
	will-change: transform;
	pointer-events: none;
}

body.yeps-app-banner-visible:not(.yeps-app-banner-dismissed):not(.yeps-app-banner-hidden-by-legal) .yeps-app-banner {
	transform: translateY(0);
	pointer-events: auto;
	box-shadow: 0 -8px 24px rgba(11, 11, 20, 0.28);
}

/* Quand la bannière est dismissée OU masquée par le footer-legal, on coupe
   net l'ombre — pas de transition résiduelle qui laisserait un halo visible
   en bord bas d'écran. La règle gagne en spécificité sur le rule "visible". */
body.yeps-app-banner-dismissed .yeps-app-banner,
body.yeps-app-banner-hidden-by-legal .yeps-app-banner {
	box-shadow: 0 0 0 0 transparent !important;
	transition: transform 360ms cubic-bezier(0.2, 0.7, 0.1, 1);
}

body.yeps-app-banner-dismissed .yeps-app-banner {
	pointer-events: none;
}

/* ─── Textes ────────────────────────────────────────────────────────── */

.yeps-app-banner__text {
	margin: 0;
	color: #fff;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.25;
	text-wrap: pretty;
	font-size: 14px;
}

/* Long : utilisé en tablette portrait + desktop (cf. responsive-css).
   Sur ces formats, prend tout l'espace disponible entre les bords et les stores. */
.yeps-app-banner__text--long {
	flex: 1 1 auto;
	min-width: 0;
	text-align: left;
}

/* Short : mobile uniquement. Première rangée, full width centré. */
.yeps-app-banner__text--short {
	flex: 1 1 100%;
	min-width: 0;
	text-align: center;
	font-weight: 700;
}

.yeps-app-banner__text strong {
	font-weight: 700;
}

.yeps-app-banner__text .accent {
	color: var(--wp--preset--color--jaune-yeps, var(--yeps-yellow, #FFD100));
	font-weight: 700;
}

/* ─── Conteneur stores (rangée) ──────────────────────────────────────── */

.yeps-app-banner__stores {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 0;
}

/* ─── Bouton store : style aligné sur .footer-store-btn du bloc footer ── */

.yeps-app-banner__store {
	align-items: center;
	background: #000;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 12px;
	color: #fff;
	display: inline-flex;
	gap: 10px;
	padding: 8px 14px 8px 12px;
	text-decoration: none;
	transition:
		transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
		border-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
		background 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.yeps-app-banner__store:hover,
.yeps-app-banner__store:focus-visible {
	background: #111;
	border-color: var(--wp--preset--color--jaune-yeps, #FFD100);
	transform: translateY(-1px);
	outline: none;
}

.yeps-app-banner__store:active {
	transform: translateY(0) scale(0.98);
}

.yeps-app-banner__store .yeps-app-banner__glyph {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
}

.yeps-app-banner__store-label {
	display: flex;
	flex-direction: column;
	line-height: 1;
}

.yeps-app-banner__store-small {
	color: rgba(255, 255, 255, 0.7);
	font-size: 9px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-weight: 500;
}

.yeps-app-banner__store-big {
	font-size: 13px;
	font-weight: 600;
	margin-top: 3px;
}

/* ─── Bouton de fermeture ───────────────────────────────────────────── */

.yeps-app-banner__close {
	flex: 0 0 30px;
	width: 30px;
	height: 30px;
	padding: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	border: none;
	color: rgba(255, 255, 255, 0.78);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 180ms ease, color 180ms ease;
}

.yeps-app-banner__close:hover,
.yeps-app-banner__close:focus-visible {
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
	outline: none;
}

.yeps-app-banner__close svg {
	width: 14px;
	height: 14px;
}

/* ─── Décalage du widget chat lorsqu'on superpose la bannière ─────────── *
 * On pousse #yeps-chat-wrapper vers le haut quand la bannière est visible
 * pour qu'elle ne recouvre pas le toggle ni le panneau. Les valeurs exactes
 * (basées sur la hauteur réelle de la bannière par device) sont injectées
 * dynamiquement par class-responsive-css.php. Ici on règle juste la
 * transition pour qu'elle suive le mouvement de la bannière.
 */
#yeps-chat-wrapper {
	transition: bottom 360ms cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* ─── Reduced motion ────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.yeps-app-banner,
	.yeps-app-banner__store,
	.yeps-app-banner__close,
	#yeps-chat-wrapper {
		transition: none;
	}
	.yeps-app-banner__store:hover {
		transform: none;
	}
}
