/* Congo-Shop - Commande WhatsApp
 * Styles du modal. Tout est prefixe .cswa- pour ne rien heurter dans WoodMart
 * ou Elementor. Les couleurs sont regroupees ici, en haut, pour etre modifiees
 * facilement.
 */

.cswa-overlay {
	--cswa-green: #1fa855;
	--cswa-green-dark: #178c46;
	--cswa-ink: #14181f;
	--cswa-muted: #63707f;
	--cswa-line: #e2e7ee;
	--cswa-bg: #ffffff;
	--cswa-soft: #f5f7fa;
	--cswa-danger: #c0392b;
	--cswa-radius: 14px;
	--cswa-wa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm5.3 14.1c-.2.6-1.3 1.2-1.8 1.2-.5 0-1.1 0-1.9-.3a10 10 0 0 1-4.2-3 8 8 0 0 1-1.6-3c-.1-.6.3-1.3.6-1.6.3-.3.5-.3.7-.3h.5c.2 0 .4 0 .6.4l.8 1.9c0 .2 0 .3-.1.5l-.4.5c-.1.2-.3.3-.1.6a8 8 0 0 0 3.7 3c.3.1.5.1.7-.1l.8-1c.2-.2.4-.1.6 0l1.8.9c.4.2.4.3.4.5s0 .8-.1 1.4z'/%3E%3C/svg%3E");

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	background: rgba(12, 16, 22, 0.55);
	backdrop-filter: blur(2px);
	opacity: 0;
	transition: opacity 0.22s ease;
	overscroll-behavior: contain;
}

.cswa-overlay[hidden] {
	display: none;
}

.cswa-overlay.is-open {
	opacity: 1;
}

.cswa-sheet {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	background: var(--cswa-bg);
	color: var(--cswa-ink);
	border-radius: var(--cswa-radius) var(--cswa-radius) 0 0;
	box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
	transform: translateY(24px);
	transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
	font-size: 15px;
	line-height: 1.45;
}

.cswa-overlay.is-open .cswa-sheet {
	transform: translateY(0);
}

@media (min-width: 720px) {
	.cswa-overlay {
		align-items: center;
	}
	.cswa-sheet {
		border-radius: var(--cswa-radius);
		max-height: 88vh;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cswa-overlay,
	.cswa-sheet {
		transition: none;
	}
}

/* En-tete */

.cswa-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px;
	border-bottom: 1px solid var(--cswa-line);
	flex: 0 0 auto;
}

.cswa-head-text {
	min-width: 0;
}

.cswa-title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.2;
}

/* Fil d'etapes : rend la bascule formulaire / envoi explicite */

.cswa-progress {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 7px 0 0;
	font-size: 12px;
	color: var(--cswa-muted);
}

.cswa-dot {
	white-space: nowrap;
	transition: color 0.2s ease;
}

.cswa-dot.is-current {
	color: var(--cswa-green-dark);
	font-weight: 700;
}

.cswa-dot.is-done {
	color: var(--cswa-green);
}

.cswa-dot.is-done::before {
	content: "\2713";
	margin-right: 3px;
}

.cswa-dot-sep {
	flex: 1;
	min-width: 14px;
	height: 1px;
	background: var(--cswa-line);
}

.cswa-close {
	appearance: none;
	border: 0;
	background: var(--cswa-soft);
	color: var(--cswa-muted);
	width: 34px;
	height: 34px;
	border-radius: 50%;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	flex: 0 0 auto;
}

.cswa-close:hover {
	background: #eceff4;
	color: var(--cswa-ink);
}

/* Corps */

.cswa-body {
	padding: 16px 18px 22px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	flex: 1 1 auto;
}

.cswa-recap {
	background: var(--cswa-soft);
	border: 1px solid var(--cswa-line);
	border-radius: 10px;
	padding: 12px 14px;
	margin-bottom: 18px;
}

.cswa-recap-name {
	font-weight: 600;
	margin: 0 0 4px;
}

.cswa-recap-meta {
	margin: 0;
	color: var(--cswa-muted);
	font-size: 13.5px;
}

.cswa-recap-total {
	margin: 8px 0 0;
	font-weight: 700;
	font-size: 16px;
}

.cswa-recap-total small {
	display: block;
	font-weight: 400;
	font-size: 12.5px;
	color: var(--cswa-muted);
}

/* Champs */

.cswa-field {
	margin-bottom: 14px;
}

.cswa-field label,
.cswa-modes legend {
	display: block;
	font-size: 13.5px;
	font-weight: 600;
	margin-bottom: 5px;
}

.cswa-field label small {
	font-weight: 400;
	color: var(--cswa-muted);
}

.cswa-field input[type="text"],
.cswa-field input[type="tel"],
.cswa-field input[type="email"],
.cswa-field select {
	width: 100%;
	box-sizing: border-box;
	padding: 11px 12px;
	border: 1px solid var(--cswa-line);
	border-radius: 9px;
	background: #fff;
	font: inherit;
	color: var(--cswa-ink);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Le chevron est redessine : les themes WooCommerce masquent souvent
   celui du navigateur sur les champs select. */
.cswa-field select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 36px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2363707f' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 13px center;
	cursor: pointer;
}

/* Le champ libre « Autre commune » suit immediatement le selecteur. */
#cswa-commune_other {
	margin-top: 8px;
}

#cswa-commune_other[hidden] {
	display: none;
}

.cswa-field input:focus,
.cswa-field select:focus {
	outline: none;
	border-color: var(--cswa-green);
	box-shadow: 0 0 0 3px rgba(31, 168, 85, 0.16);
}

.cswa-field.has-error input,
.cswa-field.has-error select {
	border-color: var(--cswa-danger);
}

.cswa-error {
	margin: 5px 0 0;
	font-size: 12.5px;
	color: var(--cswa-danger);
	display: none;
}

.cswa-error.is-visible {
	display: block;
}

.cswa-error-global {
	margin: 0 0 12px;
	padding: 10px 12px;
	background: #fdeceb;
	border-radius: 8px;
}

.cswa-section-label {
	margin: 18px 0 10px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--cswa-muted);
}

.cswa-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 12px;
}

.cswa-grid .cswa-col-2 {
	grid-column: 1 / -1;
}

@media (max-width: 420px) {
	.cswa-grid {
		grid-template-columns: 1fr;
	}
}

/* Mode livraison / retrait */

.cswa-modes {
	border: 0;
	padding: 0;
	margin: 0 0 14px;
}

.cswa-mode-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.cswa-mode input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.cswa-mode-box {
	display: block;
	padding: 11px 12px;
	border: 1.5px solid var(--cswa-line);
	border-radius: 10px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.cswa-mode-box strong {
	display: block;
	font-size: 14px;
}

.cswa-mode-box small {
	display: block;
	color: var(--cswa-muted);
	font-size: 12px;
	margin-top: 2px;
}

.cswa-mode input:checked + .cswa-mode-box {
	border-color: var(--cswa-green);
	background: rgba(31, 168, 85, 0.07);
}

.cswa-mode input:focus-visible + .cswa-mode-box {
	box-shadow: 0 0 0 3px rgba(31, 168, 85, 0.2);
}

.cswa-hint {
	margin: 10px 0 0;
	font-size: 12.5px;
	color: var(--cswa-muted);
	background: var(--cswa-soft);
	border-radius: 8px;
	padding: 9px 11px;
}

.cswa-privacy {
	margin: 4px 0 16px;
	font-size: 12px;
	color: var(--cswa-muted);
}

/* Piege a robots */

.cswa-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Boutons */

/* Le lien WhatsApp est devenu le bouton principal et unique du formulaire. */

.cswa-whatsapp {
	margin-top: 4px;
}

.cswa-whatsapp::before {
	content: "";
	width: 19px;
	height: 19px;
	flex: 0 0 auto;
	background: #fff;
	-webkit-mask: var(--cswa-wa-icon) center / contain no-repeat;
	mask: var(--cswa-wa-icon) center / contain no-repeat;
}

.cswa-submit,
.cswa-whatsapp {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	box-sizing: border-box;
	padding: 14px 18px;
	border: 0;
	border-radius: 10px;
	background: var(--cswa-green);
	color: #fff;
	font: inherit;
	font-weight: 700;
	font-size: 15.5px;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
}

.cswa-submit:hover,
.cswa-whatsapp:hover {
	background: var(--cswa-green-dark);
	color: #fff;
}

.cswa-submit:active {
	transform: scale(0.99);
}

.cswa-submit[disabled] {
	opacity: 0.65;
	cursor: not-allowed;
}

.cswa-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: cswa-spin 0.7s linear infinite;
}

@keyframes cswa-spin {
	to {
		transform: rotate(360deg);
	}
}

.cswa-back {
	display: block;
	width: 100%;
	margin-top: 10px;
	padding: 11px;
	background: none;
	border: 1px solid var(--cswa-line);
	border-radius: 10px;
	color: var(--cswa-muted);
	font: inherit;
	cursor: pointer;
}

.cswa-back:hover {
	color: var(--cswa-ink);
	border-color: #cfd6df;
}

/* Recapitulatif */

/* Chaque etape entre avec un leger glissement : le passage du formulaire
   au recapitulatif doit se voir, sinon on croit etre reste au meme endroit. */

.cswa-step.cswa-enter {
	animation: cswa-slide-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cswa-slide-in {
	from {
		opacity: 0;
		transform: translateX(14px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cswa-step.cswa-enter {
		animation: none;
	}
}

.cswa-success {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	padding: 13px 14px;
	margin-bottom: 16px;
	border-radius: 11px;
	background: rgba(31, 168, 85, 0.09);
	border: 1px solid rgba(31, 168, 85, 0.28);
}

.cswa-success-icon {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--cswa-green);
	color: #fff;
	font-size: 14px;
	line-height: 24px;
	text-align: center;
	font-weight: 700;
}

.cswa-success strong {
	display: block;
	font-size: 14.5px;
	color: var(--cswa-green-dark);
}

.cswa-success span {
	display: block;
	margin-top: 2px;
	font-size: 12.8px;
	color: var(--cswa-muted);
}

.cswa-badge {
	display: inline-block;
	padding: 5px 11px;
	border-radius: 100px;
	background: rgba(31, 168, 85, 0.12);
	color: var(--cswa-green-dark);
	font-size: 12.5px;
	font-weight: 700;
	margin-bottom: 14px;
}

.cswa-summary {
	border: 1px solid var(--cswa-line);
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 14px;
}

.cswa-summary-row {
	display: flex;
	gap: 12px;
	padding: 9px 12px;
	border-bottom: 1px solid var(--cswa-line);
	font-size: 13.8px;
}

.cswa-summary-row:last-child {
	border-bottom: 0;
}

.cswa-summary-row dt {
	flex: 0 0 38%;
	margin: 0;
	color: var(--cswa-muted);
}

.cswa-summary-row dd {
	flex: 1;
	margin: 0;
	font-weight: 600;
	word-break: break-word;
}

.cswa-summary-title {
	margin: 0;
	padding: 10px 12px;
	background: var(--cswa-soft);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--cswa-muted);
	border-bottom: 1px solid var(--cswa-line);
}

.cswa-notice {
	margin: 0 0 14px;
	padding: 11px 13px;
	background: #fff8e6;
	border: 1px solid #f2e0b0;
	border-radius: 9px;
	font-size: 13px;
	color: #6b5310;
}

.cswa-test-banner {
	margin: 0 0 12px;
	padding: 9px 12px;
	border-radius: 8px;
	background: #eef2ff;
	border: 1px dashed #9aa8e8;
	color: #34408a;
	font-size: 12.5px;
	font-weight: 600;
}

.cswa-message-preview {
	white-space: pre-wrap;
	background: var(--cswa-soft);
	border: 1px solid var(--cswa-line);
	border-radius: 9px;
	padding: 11px 12px;
	font-size: 12.5px;
	line-height: 1.5;
	max-height: 220px;
	overflow: auto;
	margin: 0 0 14px;
}

/* Bouton fourni par le shortcode */

.cswa-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 22px;
	border: 0;
	border-radius: 10px;
	background: #1fa855;
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
}

.cswa-button:hover {
	background: #178c46;
	color: #fff;
}

/* Verrouillage du defilement de la page */

body.cswa-locked {
	overflow: hidden;
}
