/* MonPatch Configurator — popup de personnalisation
   Palette : navy #1a2a4a · rouge #e63030 · or #f0b800 */

.monpatch-overlay{
	position:fixed; inset:0; z-index:99999;
	display:none; align-items:flex-start; justify-content:center;
	background:rgba(15,26,48,.62); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px);
	padding:28px 16px; overflow-y:auto;
}
.monpatch-overlay.is-open{ display:flex; }

.monpatch-dialog{
	position:relative; width:100%; max-width:var(--mp-w,560px); margin:auto;
	background:#fff; border-radius:18px;
	box-shadow:0 24px 70px rgba(15,26,48,.35);
	font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
	color:#1a2a4a; animation:monpatch-pop .22s ease;
}
@keyframes monpatch-pop{ from{ opacity:0; transform:translateY(12px) scale(.98);} to{ opacity:1; transform:none; } }

.monpatch-close{
	position:absolute; top:16px; right:16px; width:34px; height:34px;
	border:none; border-radius:9px; background:#f1f3f8; color:#5a6478;
	font-size:22px; line-height:1; cursor:pointer; transition:background .15s,color .15s;
}
.monpatch-close:hover{ background:#e63030; color:#fff; }

.monpatch-head{ padding:26px 28px 6px; }
.monpatch-eyebrow{
	display:inline-flex; align-items:center; gap:7px;
	color:#e63030; font-size:11px; font-weight:800; letter-spacing:1.4px; margin-bottom:8px;
}
.monpatch-head h2{
	font-family:'Bricolage Grotesque',system-ui,sans-serif;
	font-size:27px; font-weight:800; letter-spacing:-.4px; margin:0 0 7px; color:#1a2a4a;
}
.monpatch-head p{ font-size:14px; line-height:1.5; color:#5a6478; margin:0; }

.monpatch-body{ padding:14px 26px 24px; }
.monpatch-shell{ display:flex; align-items:stretch; justify-content:center; gap:22px; margin:auto; }
.monpatch-col{ display:flex; flex-direction:column; align-items:center; margin:auto; }
.monpatch-float{ flex:0 0 auto; width:360px; }
.monpatch-preview-sticky{ position:sticky; top:20px; display:flex; flex-direction:column; align-items:center; gap:8px; }
.monpatch-aside-label{ font-size:12px; color:#8a94a8; font-weight:600; }

.monpatch-step{
	font-size:12px; font-weight:800; letter-spacing:.6px; color:#1a2a4a;
	margin:16px 0 10px; text-transform:uppercase;
}
.monpatch-step:first-child{ margin-top:6px; }

/* Logo + aperçu */
.monpatch-logo-row{ display:flex; gap:16px; align-items:stretch; }
.monpatch-drop{
	width:100%; box-sizing:border-box; display:flex; align-items:center; justify-content:center;
	border:2px dashed #cdd4e3; border-radius:14px; padding:22px 16px; text-align:center; cursor:pointer;
	transition:border-color .15s, background .15s;
}
.monpatch-drop:hover,.monpatch-drop.is-drag{ border-color:#e63030; background:rgba(230,48,48,.04); }
.monpatch-drop.is-error{ border-color:#e63030; background:rgba(230,48,48,.06); }
.monpatch-drop-inner{ display:flex; flex-direction:column; align-items:center; gap:5px; }
.monpatch-up-icon{
	width:44px; height:44px; border-radius:11px; background:#eef1f8; color:#1a2a4a;
	display:flex; align-items:center; justify-content:center; font-size:21px; margin-bottom:3px;
}
.monpatch-drop strong{ font-size:14px; color:#1a2a4a; font-weight:700; }
.monpatch-drop small{ font-size:12px; color:#8a94a8; }
.monpatch-file-ok{
	margin-top:10px; font-size:12.5px; font-weight:700; color:#2a8c3c;
	background:rgba(42,140,60,.08); border-radius:9px; padding:8px 11px; width:100%;
}

.monpatch-preview-wrap{ width:140px; flex-shrink:0; display:flex; align-items:center; justify-content:center; }
.monpatch-preview{
	width:132px; height:132px; background:#f4f6fb;
	display:flex; align-items:center; justify-content:center; overflow:hidden; position:relative;
	transition:border-radius .2s, clip-path .2s;
}
.monpatch-preview.shape-rond{ border-radius:50%; border:2px dashed rgba(230,48,48,.4); }
.monpatch-preview.shape-carre{ border-radius:14px; border:2px dashed rgba(230,48,48,.4); }
.monpatch-preview.shape-libre{ border-radius:46% 54% 43% 57% / 52% 44% 56% 48%; border:2px dashed rgba(230,48,48,.4); }
.monpatch-preview.shape-ecusson{ clip-path:polygon(0 0,100% 0,100% 68%,50% 100%,0 68%); box-shadow:inset 0 0 0 2px rgba(230,48,48,.3); }
.monpatch-preview.shape-triangle{ clip-path:polygon(50% 4%,96% 92%,4% 92%); }
.monpatch-preview.shape-rectangle{ clip-path:polygon(3% 24%,97% 24%,97% 76%,3% 76%); }
.monpatch-preview img{ width:100%; height:100%; object-fit:contain; padding:0; }
.monpatch-preview-ph{ color:#8a94a8; font-size:12px; font-weight:600; }

/* Options */
.monpatch-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px 22px; align-items:start; }
.monpatch-field > label{ display:block; font-size:13px; font-weight:600; color:#5a6478; margin-bottom:7px; }
.monpatch-pills{ display:flex; flex-wrap:wrap; gap:9px; }
.monpatch-pill{
	flex:1 1 88px; justify-content:center; text-align:center;
	border:1.5px solid #e1e5ef; background:#fff; color:#1a2a4a;
	border-radius:10px; padding:9px 14px; font-size:13.5px; font-weight:600;
	font-family:inherit; cursor:pointer; transition:all .14s; display:inline-flex; align-items:center; gap:6px;
}
.monpatch-pill:hover{ border-color:#bcc4d8; }
.monpatch-pill.is-active{ border-color:#e63030; color:#e63030; background:rgba(230,48,48,.07); box-shadow:0 0 0 1px #e63030 inset; }
.monpatch-plus{ font-size:11px; font-weight:700; color:#e63030; opacity:.85; }
.monpatch-pill.is-active .monpatch-plus{ opacity:1; }

.monpatch-customqty{ margin-top:11px; }
.monpatch-customqty label{ font-size:12px; color:#8a94a8; display:block; margin-bottom:5px; }
.monpatch-customqty input{
	width:100%; border:1.5px solid #e1e5ef; border-radius:10px; padding:10px 12px;
	font-size:14px; font-family:inherit; color:#1a2a4a;
}
.monpatch-customqty input:focus{ outline:none; border-color:#e63030; }

/* Résumé */
.monpatch-summary{ margin-top:24px; background:#f8f9fb; border:1px solid #eef0f6; border-radius:14px; padding:18px 20px; }
.monpatch-row{ display:flex; justify-content:space-between; align-items:baseline; font-size:14px; color:#5a6478; margin-bottom:9px; }
.monpatch-row span:last-child{ color:#1a2a4a; font-weight:700; }
.monpatch-row-opt span:last-child{ color:#e63030; }
.monpatch-total{ border-top:1px solid #e6e9f2; padding-top:13px; margin-top:13px; margin-bottom:6px; }
.monpatch-total span:first-child{ font-size:15px; font-weight:700; color:#1a2a4a; }
.monpatch-total span:last-child{ font-size:24px; font-weight:800; color:#e63030; }
.monpatch-summary small{ font-size:11.5px; color:#8a94a8; }

.monpatch-error{
	margin-top:16px; font-size:13px; font-weight:600; color:#b3261e;
	background:rgba(230,48,48,.08); border-radius:9px; padding:11px 14px;
}

/* CTA */
.monpatch-add{
	width:100%; margin-top:18px; border:none; border-radius:11px;
	background:#e63030; color:#fff; font-family:inherit; font-size:15.5px; font-weight:700;
	padding:15px 20px; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:9px;
	transition:background .15s, transform .12s, box-shadow .15s;
}
.monpatch-add:hover{ background:#cf2424; transform:translateY(-1px); box-shadow:0 10px 24px rgba(230,48,48,.34); }
.monpatch-add:disabled{ opacity:.6; cursor:default; transform:none; box-shadow:none; }

.monpatch-cta-inline{
	display:inline-flex; align-items:center; gap:8px; border:none; border-radius:7px;
	background:#e63030; color:#fff; font-weight:700; font-size:14px; padding:12px 20px;
	cursor:pointer; transition:background .15s, transform .12s;
}
.monpatch-cta-inline:hover{ background:#cf2424; transform:translateY(-1px); }

.monpatch-qty-locked{ font-weight:600; color:#1a2a4a; white-space:nowrap; }
.monpatch-scissors{ font-size:1.05em; line-height:1; }

/* Type d'écusson (pleine largeur) */
.monpatch-types{ margin-bottom:4px; }
.monpatch-types .monpatch-pill{ flex:1 1 auto; justify-content:center; min-width:120px; }

/* Option indisponible (règle de compatibilité) */
.monpatch-pill.is-disabled{
	opacity:.38; cursor:not-allowed; text-decoration:line-through;
	pointer-events:none; background:#f6f7fa; border-color:#e8eaf1; box-shadow:none; color:#9aa3b5;
}

/* Champs devis */
.monpatch-devis{ margin-top:4px; }
.monpatch-dims{ display:flex; gap:14px; }
.monpatch-dims label{ flex:1; display:flex; flex-direction:column; gap:6px; font-size:12.5px; color:#5a6478; font-weight:600; }
.monpatch-dims input{ border:1.5px solid #e1e5ef; border-radius:10px; padding:10px 12px; font-size:14px; font-family:inherit; color:#1a2a4a; }
.monpatch-contact{ display:flex; flex-direction:column; gap:10px; }
.monpatch-contact input,.monpatch-contact textarea{
	border:1.5px solid #e1e5ef; border-radius:10px; padding:11px 13px; font-size:14px; font-family:inherit; color:#1a2a4a; width:100%;
}
.monpatch-contact textarea{ min-height:72px; resize:vertical; }
.monpatch-dims input:focus,.monpatch-contact input:focus,.monpatch-contact textarea:focus{ outline:none; border-color:#e63030; }

/* Deux boutons d'action */
.monpatch-actions{ display:flex; gap:12px; margin-top:18px; }
.monpatch-actions .monpatch-add{ margin-top:0; flex:1; }
.monpatch-add-secondary{ background:#fff; color:#1a2a4a; border:1.5px solid #d5dae6; }
.monpatch-add-secondary:hover{ background:#f5f7fb; color:#1a2a4a; box-shadow:none; transform:translateY(-1px); border-color:#c2cadb; }

/* Contour du logo (Forme du design) */
.monpatch-preview.has-trace{ border-color:transparent !important; box-shadow:none !important; }
.monpatch-preview.no-border{ border-color:transparent !important; box-shadow:none !important; }
.monpatch-preview.has-stitch{ border-color:transparent !important; box-shadow:none !important; }

/* Curseur de remplissage */
.monpatch-fill{ margin-top:14px; }
.monpatch-fill label{ display:flex; justify-content:space-between; font-size:13px; font-weight:600; color:#5a6478; margin-bottom:7px; }
.monpatch-fill #monpatch-fill-val{ color:#e63030; }
.monpatch-fill input[type=range]{ width:100%; accent-color:#e63030; }

/* Image / couleur sur les produits */
.monpatch-pill-img{ flex-direction:column; align-items:center; gap:5px; padding:10px 14px; }
.monpatch-acc-img{ width:46px; height:46px; object-fit:contain; display:block; }
.monpatch-acc-swatch{ border-radius:50%; border:1px solid rgba(0,0,0,.14); }

/* Étape produit : couleur + position en pleine largeur */
.monpatch-prodrow{ width:100%; margin-top:14px; }
.monpatch-prodrow > label{ display:block; font-size:13px; font-weight:600; color:#5a6478; margin-bottom:9px; }

/* Scène d'aperçu : produit + patch posé dessus */
.monpatch-stage{ position:relative; width:100%; display:flex; align-items:center; justify-content:center; }
.monpatch-stage.has-product{ display:block; width:100%; max-width:280px; margin:0 auto; aspect-ratio:1/1; background:#f6f7fb; border-radius:16px; }
.monpatch-stage-product{ position:absolute; inset:0; width:100%; height:100%; object-fit:contain; border-radius:16px; }
.monpatch-stage-color{ position:absolute; inset:0; border-radius:16px; }
.monpatch-stage.has-product .monpatch-preview{ aspect-ratio:1/1; z-index:2; box-shadow:0 3px 12px rgba(15,26,48,.32); }

/* Icône sur les options */
.monpatch-pill-hasicon{ flex-direction:column; align-items:center; gap:5px; padding:10px 14px; }
.monpatch-pill-icon{ width:40px; height:40px; object-fit:contain; display:block; }
.monpatch-pill-icon, .monpatch-acc-img{ transition:transform .18s ease; transform-origin:center; }
.monpatch-pill.is-active .monpatch-pill-icon{ transform:scale(1.7); }
.monpatch-pill.is-active .monpatch-acc-img{ transform:scale(1.5); }

/* Carte d'aperçu (colonne de droite) */
.monpatch-aside-card{ background:#fff; border:1px solid #eef0f6; border-radius:16px; box-shadow:0 8px 24px rgba(15,26,48,.08); padding:16px 14px; display:flex; flex-direction:column; align-items:center; gap:10px; width:100%; box-sizing:border-box; }
.monpatch-aside-title{ font-size:13px; font-weight:700; color:#1a2a4a; text-align:center; }
.monpatch-aside-card .monpatch-summary{ width:100%; margin-top:4px; }
.monpatch-aside-card .monpatch-error{ width:100%; margin-top:10px; }
.monpatch-aside-card .monpatch-actions{ width:100%; margin-top:12px; gap:10px; }
.monpatch-aside-card .monpatch-add{ font-size:13.5px; padding:13px 10px; white-space:nowrap; }
.monpatch-aside-card .monpatch-add-label,
.monpatch-aside-card .monpatch-quote-label{ white-space:nowrap; }
.monpatch-aside-card .monpatch-success{ margin-top:6px; }
.monpatch-aside-card .monpatch-devis{ width:100%; margin-top:10px; text-align:left; }

/* Génération IA */
.monpatch-ai{ width:100%; display:flex; flex-direction:column; gap:8px; margin-top:6px; }
.monpatch-ai input{ border:1.5px solid #e1e5ef; border-radius:10px; padding:10px 12px; font-size:13px; font-family:inherit; color:#1a2a4a; }
.monpatch-ai input:focus{ outline:none; border-color:#e63030; }
.monpatch-ai-btn{ border:none; border-radius:10px; background:#1a2a4a; color:#fff; font-family:inherit; font-size:13.5px; font-weight:700; padding:11px 14px; cursor:pointer; transition:background .15s; }
.monpatch-ai-btn:hover{ background:#12203b; }
.monpatch-ai-btn:disabled{ opacity:.6; cursor:default; }
.monpatch-ai-note{ font-size:11px; color:#8a94a8; text-align:center; }
.monpatch-preview.is-loading::after{ content:''; position:absolute; inset:0; border-radius:inherit; background:rgba(255,255,255,.6); z-index:1; }
.monpatch-preview.is-loading::before{ content:''; position:absolute; left:50%; top:50%; width:26px; height:26px; margin:-13px 0 0 -13px; border:3px solid #e1e5ef; border-top-color:#e63030; border-radius:50%; animation:monpatch-spin .8s linear infinite; z-index:2; }
@keyframes monpatch-spin{ to{ transform:rotate(360deg); } }

/* Lightbox aperçu */
.monpatch-lightbox{ position:fixed; inset:0; z-index:100001; display:none; align-items:center; justify-content:center; background:rgba(15,26,48,.82); cursor:zoom-out; padding:24px; }
.monpatch-lightbox.is-open{ display:flex; }
.monpatch-lightbox img{ max-width:90vw; max-height:90vh; border-radius:14px; box-shadow:0 24px 70px rgba(0,0,0,.45); background:#fff; }
.monpatch-aside-card .monpatch-devis .monpatch-step{ margin:12px 0 8px; }

/* Champ pleine largeur (ex. Finition avant) */
.monpatch-field-full{ grid-column:1 / -1; }

/* Formulaire intégré (shortcode) */
.monpatch-inline{ display:flex; align-items:stretch; justify-content:center; gap:22px; margin:0 auto; }
.monpatch-reassure{ width:100%; margin-top:22px; padding-top:18px; border-top:1px solid #eef0f6; box-sizing:border-box; }
.monpatch-reassure-features{ display:flex; flex-wrap:wrap; gap:14px; justify-content:space-around; border:1px solid #eef0f6; border-radius:14px; padding:15px 18px; background:#fff; }
.monpatch-reassure-trust{ display:flex; flex-wrap:wrap; gap:12px 26px; justify-content:space-around; align-items:center; padding:16px 6px 2px; }
.monpatch-reassure-item{ display:flex; align-items:center; gap:11px; }
.monpatch-reassure-icon{ display:inline-flex; align-items:center; justify-content:center; color:#e63030; flex-shrink:0; }
.monpatch-reassure-trust .monpatch-reassure-icon{ color:#1a2a4a; }
.monpatch-reassure-txt{ display:flex; flex-direction:column; line-height:1.25; }
.monpatch-reassure-txt strong{ font-size:13px; font-weight:700; color:#1a2a4a; letter-spacing:.2px; }
.monpatch-reassure-txt small{ font-size:12px; color:#8a94a8; }
@media (max-width:640px){
	.monpatch-reassure-features, .monpatch-reassure-trust{ flex-direction:column; align-items:flex-start; }
}
.monpatch-inline .monpatch-dialog{ max-width:var(--mp-w,900px); box-shadow:0 6px 24px rgba(15,26,48,.10); animation:none; }
.monpatch-inline .monpatch-close{ display:none; }

/* Personnalisation avancée */
.monpatch-adv-toggle{ display:inline-block; margin-top:12px; background:none; border:none; padding:2px 0; color:#8a94a8; font-family:inherit; font-size:12.5px; font-weight:600; cursor:pointer; text-decoration:underline; }
.monpatch-adv-toggle:hover{ color:#e63030; }
.monpatch-advanced{ margin-top:12px; padding:16px 18px; border:1px solid #eef0f6; border-radius:12px; background:#fbfcfe; }
.monpatch-bg{ margin-top:16px; }
.monpatch-bg > label{ display:block; font-size:13px; font-weight:600; color:#5a6478; margin-bottom:9px; }
.monpatch-swatches{ display:flex; flex-wrap:wrap; gap:9px; align-items:center; }
.monpatch-swatch{ width:30px; height:30px; border-radius:50%; border:2px solid #e1e5ef; cursor:pointer; padding:0; box-shadow:0 0 0 2px #fff inset; transition:transform .12s, box-shadow .12s; }
.monpatch-swatch:hover{ transform:scale(1.08); }
.monpatch-swatch.is-active{ border-color:#e63030; box-shadow:0 0 0 2px #fff inset, 0 0 0 2px #e63030; }
.monpatch-swatch.is-none{ width:auto; height:30px; border-radius:16px; padding:0 12px; font-size:12px; font-weight:600; color:#5a6478; background:#fff; }
.monpatch-swatch.is-none.is-active{ color:#e63030; border-color:#e63030; box-shadow:none; }
.monpatch-swatch-custom{ padding:0; overflow:hidden; position:relative; border:2px solid #e1e5ef; background:conic-gradient(from 0deg,#ff0000,#ff9900,#ffee00,#33cc33,#00cccc,#3366ff,#cc33ff,#ff0000); }
.monpatch-swatch-custom input[type=color]{ position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; border:none; padding:0; margin:0; }

/* Aperçu à droite : empilé sous ~680px */
@media (max-width:1024px){
	.monpatch-shell, .monpatch-inline{ flex-direction:column; align-items:center; }
	.monpatch-float{ order:-1; width:100%; max-width:400px; }
	.monpatch-preview-sticky{ position:static; }
}

/* Écran de confirmation devis */
.monpatch-success{ text-align:center; padding:26px 10px 8px; }
.monpatch-success-icon{
	width:54px; height:54px; border-radius:50%; background:#2a8c3c; color:#fff;
	display:flex; align-items:center; justify-content:center; font-size:28px; margin:0 auto 14px;
}
.monpatch-success h3{ font-family:'Bricolage Grotesque',system-ui,sans-serif; font-size:21px; color:#1a2a4a; margin:0 0 8px; }
.monpatch-success p{ font-size:14px; color:#5a6478; line-height:1.55; margin:0; max-width:380px; margin-inline:auto; }

@media (max-width:560px){
	.monpatch-grid{ grid-template-columns:1fr; gap:18px; }
	.monpatch-head h2{ font-size:23px; }
	.monpatch-body{ padding:16px 20px 22px; }
	.monpatch-head{ padding:22px 20px 4px; }
	.monpatch-logo-row{ flex-direction:column; }
	.monpatch-preview-wrap{ width:100%; }
	.monpatch-types .monpatch-pill{ flex:1 1 100%; }
}
