/* ====== Icône loupe – masque le texte "Recherche" en desktop ====== */
@media (min-width: 769px) {

	.pr-search-menu > a.elementor-item {
		font-size: 0 !important;       /* masque le texte */
		padding-left: 12px !important;
		padding-right: 4px !important;
		width: 42px;
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		cursor: pointer;
	}

	/* Icône en background sur le <a> — évite les conflits avec ::before/::after Elementor */
	.pr-search-menu > a.elementor-item {
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23074382' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") !important;
		background-repeat: no-repeat !important;
		background-size: 22px 22px !important;
		background-position: center !important;
		background-color: transparent !important;
		transition: background-image 0.15s ease !important;
	}

	.pr-search-menu > a.elementor-item:hover {
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ECA401' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") !important;
		background-color: transparent !important;
	}

	/* Neutralise totalement ::before et ::after gérés par Elementor */
	.pr-search-menu > a.elementor-item::before,
	.pr-search-menu > a.elementor-item::after {
		display: none !important;
	}
}

/* ====== Mobile ====== */
@media (max-width: 768px) {

	/* Barre desktop masquée sur mobile */
	.pr-search-bar {
		display: none !important;
	}

	/* Overlay fixe — apparaît sous le header après fermeture du menu burger */
	.pr-mobile-overlay {
		position: fixed;
		top: 0;         /* valeur recalculée en JS selon le header */
		left: 0;
		right: 0;
		background: #ffffff;
		box-shadow: 0 4px 16px rgba(7, 67, 130, 0.18);
		z-index: 99995;
		opacity: 0;
		pointer-events: none;
		transform: translateY(-8px);
		transition: opacity 0.22s ease, transform 0.22s ease;
	}

	.pr-mobile-overlay.pr-mobile-overlay--open {
		opacity: 1;
		pointer-events: all;
		transform: translateY(0);
	}

	.pr-mobile-overlay-bar {
		display: flex;
		align-items: center;
		gap: 8px;
		padding: 14px 16px;
		padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
	}

	.pr-mobile-input {
		flex: 1;
		border: none;
		border-bottom: 2px solid #074382;
		background: transparent;
		font-size: 16px;
		color: #074382;
		padding: 6px 4px;
		outline: none;
		min-width: 0;
		transition: border-color 0.2s ease;
	}

	.pr-mobile-input:focus {
		border-color: #ECA401;
	}

	.pr-mobile-input::placeholder {
		color: rgba(7, 67, 130, 0.45);
	}

	.pr-mobile-submit,
	.pr-mobile-close {
		background: none;
		border: none;
		cursor: pointer;
		padding: 4px;
		color: #074382;
		display: flex;
		align-items: center;
		flex-shrink: 0;
	}

	.pr-mobile-submit svg,
	.pr-mobile-close svg {
		width: 22px;
		height: 22px;
		display: block;
	}
}

/* ====== Barre de recherche inline – desktop ====== */
@media (min-width: 769px) {

	/* L'overlay mobile est injecté dans le DOM par JS quel que soit l'écran — on le masque ici */
	.pr-mobile-overlay {
		display: none !important;
	}


	/* Ancre pour l'overlay absolu */
	.elementor-widget-nav-menu {
		position: relative;
	}

	/* Nav desktop : transition opacity */
	.elementor-nav-menu--main {
		transition: opacity 0.22s ease;
	}

	.pr-search-open .elementor-nav-menu--main {
		opacity: 0;
		pointer-events: none;
	}

	/* Barre injectée */
	.pr-search-bar {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		display: flex;
		align-items: center;
		gap: 8px;
		padding: 0 8px;

		opacity: 0;
		pointer-events: none;
		transform: translateY(-6px);
		transition: opacity 0.25s ease, transform 0.25s ease;
		z-index: 10;
	}

	.pr-search-open .pr-search-bar {
		opacity: 1;
		pointer-events: all;
		transform: translateY(0);
	}

	/* Input */
	.pr-search-input {
		flex: 1;
		border: none;
		border-bottom: 2px solid #074382;
		background: transparent;
		font-size: 15px;
		color: #074382;
		padding: 6px 4px;
		outline: none;
		transition: border-color 0.2s ease;
		min-width: 0;
	}

	.pr-search-input:focus {
		border-color: #ECA401;
	}

	.pr-search-input::placeholder {
		color: rgba(7, 67, 130, 0.5);
	}

	/* Bouton submit */
	.pr-search-submit,
	.pr-search-close {
		background: none;
		border: none;
		cursor: pointer;
		padding: 4px;
		color: #074382;
		display: flex;
		align-items: center;
		flex-shrink: 0;
		transition: color 0.2s ease;
	}

	.pr-search-submit:hover,
	.pr-search-close:hover {
		color: #ECA401;
	}

	.pr-search-submit svg,
	.pr-search-close svg {
		width: 20px;
		height: 20px;
		display: block;
	}
}
