/* =============================================================================
 * ZIC Landing — MultiShop : popup « Nouveau produit physique » (préfixe mpp-)
 * PORT de zic_admin static/css/admin-multishop-physical-modal.css — seule
 * divergence : la couche. Pile landing : overlay MultiShop+ 1500 (sélecteur
 * de type dessous) < popup 4000 < toasts 5000 < modale de connexion 9999
 * (le visiteur invité qui ajoute une photo voit la connexion AU-DESSUS du
 * popup, formulaire gardé). Jetons --aw-* absents sur la landing : replis
 * clairs de l'admin (même rendu). Sous 768 px : feuille plein écran, pied
 * collant avec la zone de sécurité.
 * ============================================================================= */

html.mpp-lock,
html.mpp-lock body { overflow: hidden; }

.mpp-overlay {
  --mpp-purple: var(--aw-brand, #7b3ff2);
  --mpp-purple-dk: var(--aw-brand-dk, #5b1fcf);
  --mpp-text: var(--aw-text, #1f1340);
  --mpp-muted: var(--aw-sb-muted, #6b6383);
  --mpp-border: #e4e1ec;
  --mpp-card: #ffffff;
  --mpp-card2: #f8f7fb;
  --mpp-red: #dc2626;
  --mpp-red-soft: #fef2f2;
  --mpp-green: #16a34a;
  position: fixed;
  inset: 0;
  z-index: 4000;   /* LANDING : pile landing (admin : 280) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--mpp-text);
}
.mpp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 7, 34, .66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.mpp-card {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: min(92vh, 900px);
  max-height: min(92dvh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--mpp-card);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
  overflow: hidden;
}
.mpp-form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.mpp-form[hidden], .mpp-success[hidden] { display: none; }

.mpp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--mpp-border);
  flex: 0 0 auto;
}
.mpp-title {
  margin: 0;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.2px;
  color: var(--mpp-text);
  min-width: 0;
}
.mpp-close {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid var(--mpp-border);
  background: var(--aw-bg, #f4f3fb);
  color: var(--mpp-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.mpp-close svg { width: 16px; height: 16px; }
.mpp-close:hover, .mpp-close:focus-visible { border-color: var(--mpp-purple); outline: none; }

.mpp-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  flex: 1 1 auto;
}
.mpp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mpp-fieldset { border: none; margin: 0; padding: 0; }
/* .mpp-field (display:flex) l'emporte sur [hidden] : choix de devise verrouillé. */
.mpp-field[hidden] { display: none; }
.mpp-label {
  display: block;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--mpp-muted);
  margin-bottom: 0;
}
.mpp-fieldset .mpp-label { margin-bottom: 6px; }
.mpp-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--mpp-border);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: var(--mpp-text);
  outline: none;
}
.mpp-input:focus { border-color: var(--mpp-purple); box-shadow: 0 0 0 3px rgba(123, 63, 242, .15); }
.mpp-field.is-invalid .mpp-input,
.mpp-field.is-invalid .mpp-money { border-color: var(--mpp-red); }
.mpp-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.mpp-money {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--mpp-border);
  border-radius: 10px;
  padding-right: 12px;
  background: #fff;
  min-width: 0;
}
.mpp-money:focus-within { border-color: var(--mpp-purple); box-shadow: 0 0 0 3px rgba(123, 63, 242, .15); }
.mpp-input--money {
  border: none;
  box-shadow: none !important;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-weight: 800;
  min-width: 0;
}
.mpp-money-cur { color: var(--mpp-muted); font-weight: 700; font-size: 13px; white-space: nowrap; }
.mpp-price-hint { margin: -6px 0 0; font-size: 12px; color: var(--mpp-muted); line-height: 1.45; }
.mpp-price-hint a { color: var(--mpp-purple); font-weight: 700; }
/* Aide du choix de devise (1er produit, sans boutique) : sous les puces. */
.mpp-currency-help { margin-top: 8px; }

.mpp-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.mpp-chip { position: relative; display: inline-flex; cursor: pointer; }
.mpp-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mpp-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 9px;
  border: 1px solid var(--mpp-border);
  background: #fafafb;
  color: var(--mpp-text);
  font-size: 13px;
  font-weight: 700;
  transition: background .12s, color .12s, border-color .12s;
}
.mpp-chip:hover span { border-color: #c4b5fd; }
.mpp-chip input:checked + span { background: var(--mpp-purple); border-color: var(--mpp-purple); color: #fff; }
.mpp-chip input:focus-visible + span { outline: 2px solid var(--mpp-purple); outline-offset: 2px; }

.mpp-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 14px;
  background: var(--mpp-card2);
  border: 1px solid var(--mpp-border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
}
.mpp-check input { width: 18px; height: 18px; accent-color: var(--mpp-purple); margin: 0; flex: 0 0 auto; cursor: pointer; }
.mpp-check:has(input:checked) { border-color: #c4b5fd; background: #fbf9ff; }
.mpp-variants { display: flex; flex-direction: column; gap: 8px; margin-top: -6px; }
.mpp-variants[hidden] { display: none; }
.mpp-note { margin: 0; font-size: 12px; color: var(--mpp-muted); line-height: 1.45; }
.mpp-note--warn {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-weight: 600;
}

.mpp-alert {
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--mpp-red-soft);
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}
.mpp-alert[hidden] { display: none; }
.mpp-alert p { margin: 0; }
.mpp-alert-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mpp-alert-actions[hidden] { display: none; }

.mpp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--mpp-border);
  background: var(--mpp-card);
  flex: 0 0 auto;
}
.mpp-foot-right { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }

.mpp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.mpp-btn svg { width: 16px; height: 16px; }
.mpp-btn--sm { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.mpp-btn--primary { background: var(--mpp-purple); color: #fff; box-shadow: 0 8px 20px rgba(123, 63, 242, .28); }
.mpp-btn--primary:hover { background: var(--mpp-purple-dk); }
.mpp-btn--ghost { background: var(--aw-bg, #f4f3fb); color: var(--mpp-text); }
.mpp-btn--ghost:hover { background: #ece9f5; }
.mpp-btn--link { background: transparent; color: var(--mpp-purple); padding-left: 10px; padding-right: 10px; }
.mpp-btn--link:hover { background: #f3eeff; }
.mpp-btn:focus-visible { outline: 2px solid var(--mpp-purple); outline-offset: 2px; }
.mpp-btn:disabled,
.mpp-btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; box-shadow: none; }
.mpp-spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  animation: mpp-spin .7s linear infinite;
}
.mpp-spinner[hidden] { display: none; }
@keyframes mpp-spin { to { transform: rotate(360deg); } }

.mpp-success {
  padding: 40px 28px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  overflow-y: auto;
}
.mpp-success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--mpp-purple);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 36px rgba(123, 63, 242, .35);
}
.mpp-success-icon--draft { background: #6b6383; box-shadow: none; }
.mpp-success-icon svg { width: 34px; height: 34px; }
.mpp-success-title {
  margin: 6px 0 0;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-size: 22px;
  font-weight: 800;
  outline: none;
}
.mpp-success-body { margin: 0; max-width: 360px; font-size: 13.5px; color: var(--mpp-muted); line-height: 1.5; }
.mpp-success-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }

/* ----------------------------------------------- Mobile : feuille du bas */
@media (max-width: 767px) {
  .mpp-overlay { padding: 0; align-items: flex-end; }
  .mpp-card {
    max-width: none;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  .mpp-head { padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
  .mpp-body { padding: 16px; }
  .mpp-foot {
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    flex-wrap: wrap;
  }
  .mpp-foot > .mpp-btn--ghost { order: 2; }
  .mpp-foot-right { order: 1; width: 100%; flex-wrap: nowrap; }
  .mpp-foot-right .mpp-btn--primary { flex: 1 1 auto; }
  .mpp-foot > .mpp-btn--ghost { width: 100%; }
}
@media (max-width: 380px) {
  .mpp-row { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .mpp-spinner { animation-duration: 2s; }
}

/* ------------------------------ Mode intégré (activation, option container) */
/* Le formulaire devient le contenu de la carte de l'étape : dans le flux,
   pleine largeur, sans fond, ombre ni z-index, sans hauteur max ni
   défilement interne (la page défile), pied dans le flux. Préfixe
   .mpp-overlay.is-embedded : plus spécifique que la feuille du bas mobile
   ci-dessus, qui ne s'applique donc pas. */
.mpp-overlay.is-embedded {
  position: static;
  inset: auto;
  z-index: auto;
  display: block;
  padding: 0;
}
.mpp-overlay.is-embedded[hidden] { display: none; }
.mpp-overlay.is-embedded .mpp-card {
  max-width: none;
  max-height: none;
  height: auto;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.mpp-overlay.is-embedded .mpp-body { overflow: visible; overscroll-behavior: auto; }
.mpp-overlay.is-embedded .mpp-foot { background: transparent; }
@media (max-width: 767px) {
  /* Pas de plein écran : les zones de sécurité ne concernent pas la carte. */
  .mpp-overlay.is-embedded .mpp-head { padding-top: 12px; }
  .mpp-overlay.is-embedded .mpp-foot { padding-bottom: 12px; }
}
