/* Commandes en ligne fermées : fenêtre et encadré « Me prévenir de l'ouverture », pages Panier et Commande, ligne « En attendant » de la fiche, panier et quantité masqués. */

/* Pas de panier ni de paiement express tant que les commandes sont fermées. */
.commandes-fermees .savonnerie-header__icones .lien-panier,
.commandes-fermees #wc-stripe-express-checkout-element,
.commandes-fermees .wc-stripe-express-checkout-button-separator,
.commandes-fermees #wc-stripe-payment-request-wrapper,
body.commandes-fermees .fiche .fiche-achat .quantity {
	display: none;
}

/* Encadré d'inscription (fenêtre et page Panier). */
.ouverture,
.ouverture * {
	box-sizing: border-box;
}

.ouverture {
	display: flex;
	flex-direction: column;
	gap: 14px;
	color: var(--wp--preset--color--texte);
	font-family: var(--wp--preset--font-family--dm-sans);
}

.ouverture * {
	margin-block: 0;
}

.ouverture .ouverture__titre {
	padding-right: 40px;
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: clamp(26px, 1.4vw + 20px, 34px);
	font-weight: 400;
	font-variation-settings: "SOFT" 100;
	line-height: 1.1;
	text-wrap: balance;
}

.ouverture__texte {
	color: var(--wp--preset--color--texte-secondaire);
	font-size: var(--wp--preset--font-size--moyen);
	line-height: 1.55;
}

.ouverture__formulaire {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px !important;
}

.ouverture__etiquette {
	font-size: var(--wp--preset--font-size--discret);
	font-weight: 600;
}

.ouverture__ligne {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ouverture__champ {
	width: 100%;
	height: 54px;
	padding: 0 18px;
	border: 1.5px solid var(--wp--custom--couleur--bordure);
	border-radius: var(--wp--preset--border-radius--pilule);
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--texte);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--moyen);
	outline: none;
}

.ouverture__champ:focus {
	border-color: var(--wp--preset--color--bleu);
	box-shadow: 0 0 0 3px var(--wp--preset--color--pastel-bleu);
}

.ouverture__champ[aria-invalid="true"] {
	border-color: var(--wp--custom--couleur--erreur-newsletter);
}

.ouverture__bouton {
	flex: none;
	height: 54px;
	padding: 0 26px;
	border: 0;
	cursor: pointer;
}

.ouverture__bouton[aria-busy="true"] {
	opacity: 0.6;
	cursor: progress;
}

.ouverture__piege {
	position: absolute;
	left: -9999px;
}

.ouverture__erreur {
	color: var(--wp--custom--couleur--erreur-newsletter);
	font-size: 13px;
}

.ouverture__erreur[hidden],
.ouverture__merci[hidden],
.ouverture__formulaire[hidden] {
	display: none;
}

.ouverture__mention {
	color: var(--wp--preset--color--texte-secondaire);
	font-size: 12.5px;
	line-height: 1.5;
}

.ouverture a {
	color: var(--wp--preset--color--texte);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ouverture__merci {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px;
	border-radius: var(--wp--preset--border-radius--16);
	background: var(--wp--preset--color--pastel-vert);
	font-size: var(--wp--preset--font-size--base);
	line-height: 1.55;
}

.ouverture__merci-titre {
	font-weight: 700;
}

.ouverture__autres {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px !important;
	padding-top: 16px;
	border-top: 1px solid var(--wp--custom--couleur--separateur);
	color: var(--wp--preset--color--texte-secondaire);
	font-size: var(--wp--preset--font-size--discret);
	line-height: 1.55;
}

.ouverture__autres strong {
	color: var(--wp--preset--color--texte);
}

.ouverture__autres a[href^="tel:"] {
	white-space: nowrap;
}

/* Version légère (fenêtre) : titre plus petit, mention et téléphone discrets. */
.ouverture.est-leger {
	gap: 12px;
	align-items: center;
	text-align: center;
}

/* Titre centré : sur mobile, il commence sous le bouton de fermeture ; dès 600 px, la même marge des deux côtés. */
.ouverture.est-leger .ouverture__titre {
	padding: 24px 0 0;
	text-wrap: balance;
}

.ouverture.est-leger .ouverture__texte {
	max-width: 40ch;
}

.ouverture.est-leger .ouverture__formulaire,
.ouverture.est-leger .ouverture__merci {
	align-self: stretch;
}

.ouverture.est-leger .ouverture__champ {
	text-align: center;
}

.ouverture.est-leger .ouverture__titre {
	font-size: clamp(24px, 1vw + 20px, 30px);
}

.ouverture.est-leger .ouverture__texte {
	font-size: var(--wp--preset--font-size--base);
}

.ouverture .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.ouverture.est-leger .ouverture__mention {
	margin-top: 2px !important;
}

/* Fenêtre après l'inscription : seule la confirmation reste. */
.ouverture.est-leger.est-inscrit > :not(.ouverture__merci) {
	display: none;
}

.ouverture.est-leger.est-inscrit .ouverture__merci {
	position: relative;
	align-items: center;
	gap: 8px;
	padding: 4px 8px 6px;
	background: transparent;
}

/* Pastille verte et coche bleue au-dessus du message. */
.ouverture.est-leger.est-inscrit .ouverture__merci::before {
	content: "";
	width: 60px;
	height: 60px;
	margin-bottom: 8px;
	border-radius: 50%;
	background: var(--wp--preset--color--pastel-vert);
}

.ouverture.est-leger.est-inscrit .ouverture__merci::after {
	content: "";
	position: absolute;
	top: 20px;
	left: 50%;
	width: 28px;
	height: 28px;
	margin-left: -14px;
	background: var(--wp--preset--color--bleu);
	-webkit-mask: url(../images/icones/coche-epaisse.svg) center / contain no-repeat;
	mask: url(../images/icones/coche-epaisse.svg) center / contain no-repeat;
}

.ouverture.est-leger.est-inscrit .ouverture__merci-titre {
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: clamp(24px, 1vw + 20px, 30px);
	font-weight: 400;
	font-variation-settings: "SOFT" 100;
	line-height: 1.15;
}

.ouverture.est-leger.est-inscrit .ouverture__merci p:not(.ouverture__merci-titre) {
	max-width: 36ch;
	color: var(--wp--preset--color--texte-secondaire);
}

/* Fenêtre : carte arrondie posée en bas de l'écran sur mobile, centrée dès 600 px. */
.fenetre-ouverture {
	box-sizing: border-box;
	position: fixed;
	inset: auto 12px calc(12px + env(safe-area-inset-bottom));
	width: auto;
	max-width: none;
	max-height: calc(100dvh - 24px);
	margin: 0;
	padding: 28px 20px 22px;
	overflow-y: auto;
	border: 0;
	border-radius: var(--wp--preset--border-radius--24);
	background: var(--wp--preset--color--blanc);
	box-shadow: 0 -12px 40px -20px var(--wp--custom--couleur--voile-fenetre);
}

.fenetre-ouverture::backdrop {
	background: var(--wp--custom--couleur--voile-fenetre);
}

.fenetre-ouverture[open] {
	animation: fenetre-ouverture-entree var(--wp--custom--transition--douce);
}

@keyframes fenetre-ouverture-entree {
	from {
		transform: translateY(24px);
		opacity: 0;
	}
}

.fenetre-ouverture__fermer {
	position: absolute;
	top: 12px;
	right: 12px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}

.fenetre-ouverture__fermer::before {
	content: "";
	width: 16px;
	height: 16px;
	background: var(--wp--preset--color--texte);
	-webkit-mask: url(../images/icones/fermer.svg) center / contain no-repeat;
	mask: url(../images/icones/fermer.svg) center / contain no-repeat;
}

.fenetre-ouverture :focus-visible {
	outline: 2px solid var(--wp--preset--color--bleu);
	outline-offset: 3px;
}

/* Pages Panier et Commande. */
.panier-ferme {
	display: flex;
	flex-direction: column;
	gap: 24px;
	max-width: 640px;
	margin: 0 auto;
	padding: clamp(24px, 2vw + 16px, 40px);
	border-radius: var(--wp--preset--border-radius--24);
	background: var(--wp--preset--color--fond-clair);
}

.panier-ferme__retour {
	margin: 0;
}

/* Fiche produit : où trouver nos savons en attendant. */
.fiche-attente {
	margin-top: 12px !important;
	color: var(--wp--preset--color--texte-secondaire);
	font-size: var(--wp--preset--font-size--discret);
	line-height: 1.55;
}

.fiche-attente a {
	color: var(--wp--preset--color--texte);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (min-width: 600px) {
	.fenetre-ouverture {
		inset: 0;
		width: calc(100% - 48px);
		max-width: 560px;
		height: fit-content;
		margin: auto;
		padding: 36px 36px 32px;
		border-radius: var(--wp--preset--border-radius--24);
		box-shadow: 0 24px 60px -24px var(--wp--custom--couleur--voile-fenetre);
	}

	.ouverture__ligne {
		flex-direction: row;
	}

	.ouverture.est-leger .ouverture__titre {
		padding: 0 40px;
	}

	.ouverture__champ {
		flex: 1;
		min-width: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fenetre-ouverture[open] {
		animation: none;
	}
}
