/* =====================================================================
   NEXIS — ajustements responsive transverses (tous écrans)
   ===================================================================== */

/* Garde-fou : aucun défilement horizontal parasite */
html, body { overflow-x: clip; }
img, svg, video, iframe { max-width: 100%; }
:where(h1, h2, h3, .nexis-section-title) { overflow-wrap: break-word; }

/* Barre d'action mobile (masquée par défaut) */
.nexis-mobilebar { display: none; }

@media (max-width: 600px) {
	/* En-tête : logo + menu ; le CTA passe dans la barre du bas */
	.nexis-header .nexis-header__ctas { display: none !important; }
	.nexis-header .alignwide { gap: 0.75rem !important; }
	.nexis-whatsapp { display: none !important; }

	.nexis-mobilebar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 90;
		display: flex;
		gap: 0.6rem;
		padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom));
		border-top: 1px solid rgba(255, 255, 255, 0.08);
		background: rgba(11, 31, 51, 0.97);
		-webkit-backdrop-filter: blur(8px);
		backdrop-filter: blur(8px);
		box-shadow: 0 -6px 20px rgba(11, 31, 51, 0.18);
	}
	.nexis-mobilebar a {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 0.45rem;
		min-height: 2.9rem;
		border-radius: 4px;
		font-family: var(--wp--preset--font-family--heading);
		font-size: 0.8125rem;
		font-weight: 700;
		letter-spacing: 0.04em;
		text-transform: uppercase;
		text-decoration: none;
	}
	.nexis-mobilebar__main { flex: 1; background: var(--wp--preset--color--copper); color: var(--wp--preset--color--navy); }
	.nexis-mobilebar__alt { flex: none; padding: 0 1rem; border: 1px solid rgba(255, 255, 255, 0.25); color: #fff; }
	.nexis-mobilebar__alt svg { color: var(--wp--preset--color--copper); }
	body { padding-bottom: calc(4.1rem + env(safe-area-inset-bottom)); }

	/* Le menu mobile ouvert passe au-dessus de la barre */
	.has-modal-open .nexis-mobilebar { display: none; }
}
@media (max-width: 360px) {
	.nexis-mobilebar__alt span { display: none; }
	.nexis-mobilebar__alt { padding: 0 0.85rem; }
	.nexis-header .nexis-logo__img { height: 30px; }
}
@media print { .nexis-mobilebar, .nexis-whatsapp { display: none !important; } }

/* Formulaires : le champ pièce jointe ne dépasse jamais l'écran */
.forminator-ui input[type="file"] { max-width: 100%; min-width: 0; width: 100%; }
.forminator-ui .forminator-field, .forminator-ui .forminator-col { min-width: 0; }

/* Grands titres sur petit écran : taille proportionnelle à la largeur, coupure syllabique propre */
:where(h1, h2) { hyphens: manual; }
@media (max-width: 480px) {
	.nexis-hero h1,
	.nexis-hero .wp-block-post-title,
	.nexis-hero-trade h1 { font-size: clamp(1.5rem, 7.4vw, 2.1rem) !important; line-height: 1.15; hyphens: auto; }
	.nexis-section-title,
	.wp-block-post-content h2 { font-size: clamp(1.3rem, 6.2vw, 1.75rem) !important; hyphens: auto; }
}

/* Bandeau des 5 services entre 1100 et 1360 px : icône au-dessus du titre pour éviter les coupures */
@media (min-width: 1101px) and (max-width: 1360px) {
	.nexis-strip__head { flex-direction: column; align-items: flex-start !important; gap: 0.6rem !important; }
	.nexis-strip__item { padding: 0 1.1rem; }
}

/* Barre du haut : sous 1200 px, l'adresse laisse la place au téléphone (une seule ligne) */
@media (max-width: 1199px) {
	.nexis-topbar__address { display: none !important; }
}

/* =====================================================================
   Hero de l'accueil sur tablette et mobile : le diaporama passe DERRIÈRE le texte,
   avec un voile navy pour la lisibilité (au lieu d'être empilé dessous).
   ===================================================================== */
@media (max-width: 1079px) {
	body:not(.editor-styles-wrapper) .nexis-hero-trade {
		justify-content: flex-end;
		min-height: clamp(34rem, 120vw, 44rem);
		padding-top: var(--wp--preset--spacing--50) !important;
		padding-bottom: var(--wp--preset--spacing--50) !important;
		background: var(--wp--preset--color--navy);
	}
	body:not(.editor-styles-wrapper) .nexis-hero-trade__media,
	body:not(.editor-styles-wrapper) .nexis-hero-trade__media.nexis-slider {
		position: absolute !important;
		inset: 0;
		z-index: 0;
		width: auto;
		height: auto;
		aspect-ratio: auto;
		margin: 0 !important;
	}
	body:not(.editor-styles-wrapper) .nexis-hero-trade__media::after {
		/* voile : plus dense en bas, là où se trouve le texte */
		content: "";
		position: absolute;
		inset: 0;
		z-index: 3;
		background: linear-gradient(180deg, rgba(11, 31, 51, 0.35) 0%, rgba(11, 31, 51, 0.72) 40%, rgba(11, 31, 51, 0.94) 100%);
		pointer-events: none;
	}
	/* Légendes du diaporama masquées : le texte du hero occupe la place */
	body:not(.editor-styles-wrapper) .nexis-hero-trade .nexis-slide__label,
	body:not(.editor-styles-wrapper) .nexis-hero-trade .nexis-slide__text,
	body:not(.editor-styles-wrapper) .nexis-hero-trade .nexis-slider__progress { display: none; }

	body:not(.editor-styles-wrapper) .nexis-hero-trade__content { position: relative; z-index: 2; }
	body:not(.editor-styles-wrapper) .nexis-hero-trade__title { color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25); }
	body:not(.editor-styles-wrapper) .nexis-hero-trade .nexis-accent { color: var(--wp--preset--color--copper); }
	body:not(.editor-styles-wrapper) .nexis-hero-trade__lead { color: rgba(255, 255, 255, 0.88); }
	/* Boutons adaptés au fond sombre : principal cuivre, secondaire contour blanc */
	body:not(.editor-styles-wrapper) .nexis-hero-trade .wp-block-button:not(.is-style-outline) .wp-block-button__link {
		background: var(--wp--preset--color--copper) !important;
		border-color: var(--wp--preset--color--copper) !important;
		color: var(--wp--preset--color--navy) !important;
	}
	body:not(.editor-styles-wrapper) .nexis-hero-trade .is-style-outline .wp-block-button__link {
		border-color: rgba(255, 255, 255, 0.7) !important;
		background: transparent !important;
		color: #fff !important;
	}
}

/* Barre du haut : adresse, téléphone et email sur une seule ligne sur ordinateur */
@media (min-width: 1200px) {
	.nexis-topbar__contacts { column-gap: 1.75rem !important; flex-wrap: nowrap !important; min-width: 0; }
	.nexis-topbar__contacts > p { white-space: nowrap; }
}
/* Écrans moyens : l'adresse complète laisse la place au téléphone et à l'email */
@media (min-width: 1200px) and (max-width: 1360px) {
	.nexis-topbar__address { display: none !important; }
}
