
/* ═══════════════════════════════════════════════════
   LCEM WIDGET — Maison Montagut Edition v1.2.0
   Identité visuelle : Marine · Écru · Or Montagut
   ═══════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── ARMURE CSS : neutralise l'override du thème Prestashop ──
   Scopé à .lcem-overlay + .lcem-trigger pour ne rien casser ailleurs */
.lcem-overlay, .lcem-overlay *, .lcem-overlay *::before, .lcem-overlay *::after {
  box-sizing: border-box !important;
}
.lcem-overlay img {
  max-width: 100% !important;
  height: auto;
}
.lcem-overlay .size-cta-btn,
.lcem-overlay .btn-product-page,
.lcem-overlay .btn-download-result,
.lcem-overlay .lcem-btn-next,
.lcem-overlay .lcem-btn-back {
  display: block !important;
  width: 100% !important;
  float: none !important;
  box-sizing: border-box !important;
}
.lcem-overlay .result-image-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}
.lcem-overlay .result-image {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 60vh !important;
  object-fit: contain !important;
  display: block !important;
}
.lcem-overlay .lcem-modal {
  max-width: 620px !important;           /* cohérent avec la règle de base ligne 120 */
  width: 100% !important;
  overflow-x: hidden !important;
}
@media (max-width: 680px) {
  .lcem-overlay .lcem-modal { max-width: 100vw !important; }
}
.lcem-overlay .lcem-content,
.lcem-overlay .result-container {
  max-width: 100% !important;
  overflow-x: hidden !important;
}
.lcem-overlay .size-cta-wrap,
.lcem-overlay .result-actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
  width: 100% !important;
}

:root {
  --lcem-bg:           #0c1825;
  --lcem-bg2:          #101f30;
  --lcem-surface:      #14263c;
  --lcem-border:       rgba(184,149,90,0.15);
  --lcem-border2:      rgba(244,237,224,0.08);
  --lcem-accent:       #b8955a;
  --lcem-accent-light: #d4b07a;
  --lcem-text:         #f4ede0;
  --lcem-text-muted:   #8a9ba8;
  --lcem-success:      #5ebd85;
  --lcem-error:        #e05555;
  --lcem-font-serif:   'Cormorant Garamond', Georgia, serif;
  --lcem-font-ui:      'Inter', system-ui, -apple-system, sans-serif;
}

/* ── TRIGGER BUTTON ── */
.lcem-trigger {
  width: 100%;
  background: transparent;
  color: var(--lcem-accent);
  border: 0.5px solid var(--lcem-accent);
  padding: 0.9rem 1.5rem;
  border-radius: 0;
  font-family: var(--lcem-font-ui);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  transition: all 0.3s ease;
}
.lcem-trigger:hover {
  background: var(--lcem-accent);
  color: #0c1825;
}
.lcem-trigger svg { width: 16px; height: 16px; }

/* ── OVERLAY + MODAL ── */
.lcem-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(10, 18, 30, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.lcem-overlay.active { display: flex; }

/* Modal : flexbox column — header+steps fixes, content scroll interne */
.lcem-modal {
  position: relative;
  background: var(--lcem-bg);
  border: 0.5px solid rgba(184,149,90,0.25);
  border-radius: 0;
  width: 100%;
  max-width: 620px;                  /* légèrement plus large */
  height: min(88vh, 720px);          /* hauteur fixe — tient dans la zone de flottaison */
  display: flex;
  flex-direction: column;
  overflow: hidden;                  /* le scroll est dans .lcem-content uniquement */
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
}

/* ── MODAL HEADER ── */
.lcem-header {
  padding: 1rem 1.8rem 0.9rem;
  border-bottom: 0.5px solid var(--lcem-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;           /* ne se compresse pas */
  background: var(--lcem-bg);
  z-index: 10;
}
.lcem-brand {
  font-family: var(--lcem-font-ui);
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--lcem-accent);
}
.lcem-close {
  background: none; border: none; cursor: pointer;
  color: var(--lcem-text-muted);
  width: 30px; height: 30px;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s;
}
.lcem-close:hover { color: var(--lcem-text); }

/* ── STEP INDICATOR ── */
.lcem-steps {
  display: flex;
  padding: 0.7rem 1.8rem;
  border-bottom: 0.5px solid var(--lcem-border);
  flex-shrink: 0;
}
.lcem-step-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  position: relative;
}
.lcem-step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(50% + 14px);
  right: calc(-50% + 14px);
  height: 0.5px;
  background: var(--lcem-border2);
  z-index: 0;
}
.lcem-step-item.done:not(:last-child)::after { background: var(--lcem-accent); }

.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 0.5px solid rgba(244,237,224,0.15);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--lcem-font-ui);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--lcem-text-muted);
  position: relative; z-index: 1;
  transition: all 0.3s;
}
.lcem-step-item.active .step-dot {
  border-color: var(--lcem-accent);
  background: var(--lcem-accent);
  color: var(--lcem-bg);
}
.lcem-step-item.done .step-dot {
  border-color: var(--lcem-accent);
  color: var(--lcem-accent);
}
.step-label {
  font-family: var(--lcem-font-ui);
  font-size: 0.48rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lcem-text-muted);
  transition: color 0.3s;
}
.lcem-step-item.active .step-label { color: var(--lcem-accent); }
.lcem-step-item.done .step-label { color: var(--lcem-accent); opacity: 0.6; }

/* ── QUOTA BADGE ── */
.lcem-quota {
  text-align: right;
  padding: 0.35rem 1.8rem;
  font-family: var(--lcem-font-ui);
  font-size: 0.58rem;
  color: var(--lcem-text-muted);
  border-bottom: 0.5px solid var(--lcem-border);
  flex-shrink: 0;
}
.lcem-quota span { color: var(--lcem-accent); font-weight: 600; }

/* ── CONTENT AREA — scroll interne uniquement ── */
.lcem-content {
  padding: 1.2rem 1.8rem;
  flex: 1;              /* prend tout l'espace restant */
  overflow-y: auto;     /* scroll ici, pas sur le modal entier */
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(184,149,90,0.2) transparent;
}
.lcem-content::-webkit-scrollbar { width: 3px; }
.lcem-content::-webkit-scrollbar-thumb { background: rgba(184,149,90,0.2); border-radius: 2px; }

/* ── STEP 1: POSE ── */
.step-title {
  font-family: var(--lcem-font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  font-style: italic;
  color: var(--lcem-text);
  letter-spacing: 0.02em;
  margin-bottom: 0.2rem;
}
.step-sub {
  font-family: var(--lcem-font-ui);
  font-size: 0.65rem;
  color: var(--lcem-text-muted);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}
.pose-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);  /* 4 colonnes sur desktop = beaucoup moins de hauteur */
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.pose-card {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  cursor: pointer;
  border: 0.5px solid var(--lcem-border2);
  background: var(--lcem-surface);
  transition: border-color 0.2s;
}
.pose-card:hover { border-color: rgba(184,149,90,0.5); }
.pose-card.selected { border-color: var(--lcem-accent); }
.pose-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.pose-card:hover img { transform: scale(1.03); }
.pose-check {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--lcem-accent);
  display: none;
  align-items: center; justify-content: center;
}
.pose-card.selected .pose-check { display: flex; }
.pose-check svg { width: 11px; height: 11px; color: var(--lcem-bg); }

/* ── STEP 2: PHOTO ── */
.upload-zone {
  border: 0.5px dashed rgba(184,149,90,0.3);
  padding: 1.6rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.2rem;
  background: var(--lcem-surface);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--lcem-accent);
  background: rgba(184,149,90,0.04);
}
.upload-zone.has-file {
  border-color: rgba(94,189,133,0.4);
  background: rgba(94,189,133,0.03);
  border-style: solid;
}
.upload-icon {
  width: 44px; height: 44px;
  margin: 0 auto 0.8rem;
  opacity: 0.45;
}
.upload-preview {
  width: 110px; height: 148px;
  object-fit: cover;
  margin: 0 auto 0.8rem;
  display: none;
  border: 0.5px solid rgba(184,149,90,0.3);
}
.upload-zone.has-file .upload-preview { display: block; }
.upload-zone.has-file .upload-icon { display: none; }
.upload-title {
  font-family: var(--lcem-font-ui);
  font-size: 0.75rem;
  color: var(--lcem-text);
  margin-bottom: 0.3rem;
  letter-spacing: 0.03em;
}
.upload-hint {
  font-family: var(--lcem-font-serif);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--lcem-text-muted);
}
.upload-specs {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.7rem;
}
.spec-tag {
  font-family: var(--lcem-font-ui);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  background: transparent;
  color: var(--lcem-text-muted);
  border: 0.5px solid var(--lcem-border2);
  padding: 0.2rem 0.6rem;
}
#lcemFileInput { display: none; }

.upload-tips {
  background: var(--lcem-surface);
  border: 0.5px solid var(--lcem-border);
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
}
.tip-title {
  font-family: var(--lcem-font-ui);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lcem-text-muted);
  margin-bottom: 0.8rem;
}
.tips-row { display: flex; gap: 0.8rem; }
.tip-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 0.4rem;
  text-align: center;
}
.tip-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--lcem-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.tip-text {
  font-family: var(--lcem-font-ui);
  font-size: 0.6rem;
  color: var(--lcem-text-muted);
  line-height: 1.45;
}

/* ── STEP 3: GÉNÉRATION ── */
.gen-container { text-align: center; padding: 1.2rem 0; }
.gen-animation {
  width: 90px; height: 144px;
  margin: 0 auto 1.5rem;
  position: relative;
}
.body-outline { width: 100%; height: 100%; }
.body-outline path {
  stroke: var(--lcem-accent);
  stroke-width: 1;
  fill: none;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: drawBody 3s ease forwards;
}
@keyframes drawBody { to { stroke-dashoffset: 0; } }
.body-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(184,149,90,0.1) 0%, transparent 70%);
  animation: glowPulse 2s ease-in-out infinite;
}
@keyframes glowPulse { 0%,100%{opacity:0.3} 50%{opacity:1} }

.gen-message {
  font-family: var(--lcem-font-serif);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--lcem-text-muted);
  margin-bottom: 2rem;
  line-height: 1.7;
  min-height: 3rem;
}
.gen-progress {
  display: flex; justify-content: center;
  gap: 2.5rem; margin-bottom: 1.8rem;
}
.gen-step {
  display: flex; flex-direction: column;
  align-items: center; gap: 0.4rem;
  opacity: 0.25; transition: opacity 0.5s;
}
.gen-step.active { opacity: 1; }
.gen-step.done   { opacity: 0.5; }
.gen-step-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--lcem-text-muted);
  transition: background 0.5s;
}
.gen-step.active .gen-step-dot {
  background: var(--lcem-accent);
  box-shadow: 0 0 8px var(--lcem-accent);
  animation: dotPulse 1s ease-in-out infinite;
}
.gen-step.done .gen-step-dot { background: var(--lcem-accent); }
@keyframes dotPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.5)} }
.gen-step-label {
  font-family: var(--lcem-font-ui);
  font-size: 0.5rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--lcem-text-muted);
}
.gen-step.active .gen-step-label { color: var(--lcem-accent); }

.gen-timer {
  font-family: var(--lcem-font-serif);
  font-size: 2.2rem; font-weight: 300;
  color: var(--lcem-text);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}
.gen-timer-label {
  font-family: var(--lcem-font-ui);
  font-size: 0.58rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--lcem-text-muted);
  margin-top: 0.3rem;
}
.gen-progress-bar {
  width: 100%; height: 1px;
  background: var(--lcem-border2);
  margin-top: 2rem; overflow: hidden;
}
.gen-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--lcem-accent), var(--lcem-accent-light));
  width: 0%; transition: width 0.5s ease;
}

/* ── STEP 4: RÉSULTAT ── */
.result-container { text-align: center; }
.result-image-wrap {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.2rem;
  background: var(--lcem-surface);
  border: 0.5px solid var(--lcem-border);
}
.result-image {
  width: 100%; max-height: 420px;
  object-fit: contain; display: block;
}
.result-badge {
  position: absolute;
  bottom: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(12,24,37,0.88);
  backdrop-filter: blur(8px);
  border: 0.5px solid rgba(184,149,90,0.35);
  padding: 0.3rem 1rem;
  font-family: var(--lcem-font-ui);
  font-size: 0.48rem; font-weight: 600;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--lcem-accent); white-space: nowrap;
}
.result-disclaimer {
  font-family: var(--lcem-font-serif);
  font-size: 0.72rem; font-style: italic;
  color: var(--lcem-text-muted);
  margin-bottom: 1.4rem; line-height: 1.6;
}

/* Bouton fiche produit — principal doré */
.result-actions { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1rem; }

.btn-product-page {
  background: var(--lcem-accent);
  color: var(--lcem-bg);
  padding: 0.9rem 1rem;
  border: none;
  font-family: var(--lcem-font-ui);
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  cursor: pointer; transition: all 0.3s;
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  text-decoration: none; width: 100%;
}
.btn-product-page:hover { background: var(--lcem-accent-light); }

.btn-download-result {
  background: transparent;
  color: var(--lcem-text);
  padding: 0.8rem 1rem;
  border: 0.5px solid rgba(244,237,224,0.2);
  font-family: var(--lcem-font-ui);
  font-size: 0.65rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
}
.btn-download-result:hover { border-color: var(--lcem-accent); color: var(--lcem-accent); }

.btn-row-result { display: flex; gap: 0.6rem; }
.btn-row-result > button { flex: 1; }

.btn-share-result {
  background: transparent;
  color: var(--lcem-text-muted);
  padding: 0.75rem 0.8rem;
  border: 0.5px solid var(--lcem-border2);
  font-family: var(--lcem-font-ui);
  font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-share-result:hover { border-color: var(--lcem-accent); color: var(--lcem-accent); }

.btn-retry-result {
  background: transparent;
  color: var(--lcem-text-muted);
  padding: 0.75rem 0.8rem;
  border: 0.5px solid var(--lcem-border2);
  font-family: var(--lcem-font-ui);
  font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-retry-result:hover { border-color: rgba(244,237,224,0.3); color: var(--lcem-text); }

/* ── SHARE MODAL ── */
.lcem-share-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(10,18,30,0.92);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 1.5rem;
}
.lcem-share-overlay.active { display: flex; }
.lcem-share-box {
  background: var(--lcem-bg);
  border: 0.5px solid rgba(184,149,90,0.3);
  width: 100%; max-width: 380px;
  padding: 2rem;
  position: relative;
}
.lcem-share-box::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--lcem-accent), transparent);
}
.lcem-share-title {
  font-family: var(--lcem-font-serif);
  font-size: 1.1rem; font-style: italic; font-weight: 400;
  color: var(--lcem-text);
  text-align: center; margin-bottom: 0.3rem;
}
.lcem-share-sub {
  font-family: var(--lcem-font-ui);
  font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--lcem-text-muted); text-align: center; margin-bottom: 2rem;
}
.lcem-share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}
.share-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1rem 0.5rem;
  background: var(--lcem-surface);
  border: 0.5px solid var(--lcem-border2);
  cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.share-btn:hover { border-color: var(--lcem-accent); background: rgba(184,149,90,0.06); }
.share-btn-icon { font-size: 1.4rem; line-height: 1; }
.share-btn-label {
  font-family: var(--lcem-font-ui);
  font-size: 0.52rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--lcem-text-muted);
}
.share-btn:hover .share-btn-label { color: var(--lcem-accent); }

.lcem-share-copy {
  width: 100%;
  background: transparent;
  border: 0.5px solid var(--lcem-border2);
  color: var(--lcem-text-muted);
  padding: 0.75rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  cursor: pointer; transition: border-color 0.2s;
  margin-bottom: 1.2rem;
}
.lcem-share-copy:hover { border-color: var(--lcem-accent); }
.lcem-share-copy-url {
  font-family: var(--lcem-font-ui);
  font-size: 0.6rem; color: var(--lcem-text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: left;
}
.lcem-share-copy-btn {
  font-family: var(--lcem-font-ui);
  font-size: 0.55rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--lcem-accent); white-space: nowrap; flex-shrink: 0;
}

.lcem-share-close-btn {
  width: 100%;
  background: none; border: 0.5px solid var(--lcem-border2);
  color: var(--lcem-text-muted);
  padding: 0.65rem; cursor: pointer;
  font-family: var(--lcem-font-ui);
  font-size: 0.58rem; letter-spacing: 0.18em; text-transform: uppercase;
  transition: all 0.2s;
}
.lcem-share-close-btn:hover { border-color: rgba(244,237,224,0.2); color: var(--lcem-text); }

/* ── FOOTER NAVIGATION ── */
.lcem-footer {
  padding: 0.9rem 1.8rem;
  border-top: 0.5px solid var(--lcem-border);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-shrink: 0;       /* reste toujours collé en bas du modal */
  background: var(--lcem-bg);
}
.lcem-footer .btn-back {
  background: none;
  border: 0.5px solid var(--lcem-border2);
  color: var(--lcem-text-muted);
  padding: 0.65rem 1.2rem;
  font-family: var(--lcem-font-ui);
  font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer; transition: all 0.2s;
}
.lcem-footer .btn-back:hover { border-color: var(--lcem-accent); color: var(--lcem-accent); }
.lcem-footer .btn-next {
  flex: 1;
  background: var(--lcem-accent);
  color: var(--lcem-bg);
  border: none;
  padding: 0.7rem 1.5rem;
  font-family: var(--lcem-font-ui);
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.lcem-footer .btn-next:hover { background: var(--lcem-accent-light); }
.lcem-footer .btn-next:disabled {
  background: var(--lcem-surface);
  color: var(--lcem-text-muted); cursor: not-allowed;
}

/* ── ERROR STATE ── */
.lcem-error {
  background: rgba(224,85,85,0.06);
  border: 0.5px solid rgba(224,85,85,0.25);
  padding: 0.7rem 1rem;
  font-family: var(--lcem-font-ui);
  font-size: 0.68rem; color: var(--lcem-error);
  margin-bottom: 1rem; display: none;
}
.lcem-error.show { display: block; }

/* ════════════════════════════════════════
   RESPONSIVE — Tablette / Mobile (≤ 640px)
   ════════════════════════════════════════ */
@media (max-width: 640px) {

  /* Overlay : bottom-sheet */
  .lcem-overlay {
    padding: 0;
    align-items: flex-end;
  }

  /* Modal : full width, ancrée en bas, hauteur max 92vh */
  .lcem-modal {
    max-width: 100%;
    width: 100%;
    height: min(92vh, 100%);
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top: 0.5px solid rgba(184,149,90,0.3);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -16px 60px rgba(0,0,0,0.6);
  }

  /* Grip handle */
  .lcem-modal::before {
    content: '';
    display: block;
    width: 36px; height: 3px;
    background: rgba(184,149,90,0.3);
    border-radius: 2px;
    margin: 0.6rem auto 0;
    flex-shrink: 0;
  }

  .lcem-header  { padding: 0.75rem 1.2rem; }
  .lcem-brand   { font-size: 0.45rem; letter-spacing: 0.22em; }
  .lcem-steps   { padding: 0.6rem 1.2rem; }
  .step-dot     { width: 22px; height: 22px; font-size: 0.52rem; }
  .step-label   { font-size: 0.4rem; letter-spacing: 0.1em; }
  .lcem-quota   { padding: 0.3rem 1.2rem; font-size: 0.53rem; }

  .lcem-content { padding: 1rem 1.2rem; }
  .step-title   { font-size: 0.95rem; }
  .step-sub     { font-size: 0.6rem; margin-bottom: 0.8rem; }

  /* Pose grid : 2 colonnes sur mobile */
  .pose-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem; margin-bottom: 0.8rem;
  }

  .upload-zone  { padding: 1.2rem 1rem; }
  .upload-tips  { padding: 0.6rem 0.8rem; margin-bottom: 0.8rem; }
  .tips-row     { gap: 0.4rem; }
  .tip-icon     { font-size: 1rem; }
  .tip-text     { font-size: 0.58rem; }

  .gen-container { padding: 1rem 0; }
  .gen-timer    { font-size: 1.6rem; }
  .gen-progress { gap: 0.8rem; }
  .body-outline { width: 60px; height: 95px; }

  .result-image-wrap { max-width: 200px; margin: 0 auto 0.8rem; }
  .result-actions    { gap: 0.5rem; }
  .btn-row-result    { flex-direction: row; gap: 0.4rem; }

  .lcem-footer  { padding: 0.75rem 1.2rem; gap: 0.6rem; }
  .lcem-footer .btn-back { font-size: 0.58rem; padding: 0.6rem 0.8rem; }
  .lcem-footer .btn-next { font-size: 0.58rem; padding: 0.65rem 1rem; }

  .lcem-share-box  { padding: 1.2rem 1rem; }
  .lcem-share-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .share-btn       { padding: 0.7rem 0.3rem; }
  .share-btn-icon  { font-size: 1.1rem; }
  .share-btn-label { font-size: 0.45rem; }
}

/* ════════════════════════════════════════
   RESPONSIVE — Très petit (≤ 380px)
   ════════════════════════════════════════ */
@media (max-width: 380px) {
  .lcem-content { padding: 0.8rem 1rem; }
  .lcem-header, .lcem-footer { padding-left: 1rem; padding-right: 1rem; }
  .lcem-steps   { padding: 0.5rem 1rem; }
  .lcem-quota   { padding: 0.25rem 1rem; }
  .step-label   { display: none; }
  .gen-timer    { font-size: 1.3rem; }
  .btn-row-result { flex-direction: column; }
  .result-image-wrap { max-width: 180px; }
}

/* ════════════════════════════════════════
   SIZE CARD — Taille recommandée IA
   ════════════════════════════════════════ */

.lcem-size-card {
  width: 100%;
  background: linear-gradient(135deg, rgba(184,149,90,0.08) 0%, rgba(20,38,60,0.6) 100%);
  border: 1px solid rgba(184,149,90,0.25);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin: 0.7rem 0;
}

/* Loading state */
.size-card-loading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--lcem-text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.size-spinner {
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(184,149,90,0.25);
  border-top-color: var(--lcem-accent);
  border-radius: 50%;
  animation: lcemSpin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes lcemSpin {
  to { transform: rotate(360deg); }
}

/* Header */
.size-rec-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--lcem-accent);
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.size-rec-header svg {
  opacity: 0.7;
  flex-shrink: 0;
}

/* Body : badge + détails */
.size-rec-body {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.55rem;
}

.size-badge-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-shrink: 0;
}

.size-main-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 52px;
  background: var(--lcem-accent);
  color: var(--lcem-bg);
  font-family: var(--lcem-font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 8px;
  letter-spacing: 0.02em;
  padding: 0 0.4rem;
}

.size-alt-badge {
  font-size: 0.7rem;
  color: var(--lcem-text-muted);
  font-style: italic;
}

.size-rec-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.size-morpho {
  font-size: 0.72rem;
  color: var(--lcem-text);
  font-style: italic;
}

.size-confiance {
  font-size: 0.65rem;
  color: var(--lcem-text-muted);
  letter-spacing: 0.03em;
}

/* Conseil */
.size-conseil {
  font-size: 0.7rem;
  color: var(--lcem-text-muted);
  line-height: 1.45;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(184,149,90,0.1);
}

/* ── SIZE CTA — disponibilité stock ── */
.size-cta-wrap {
  margin-top: 0.7rem;
}
.size-cta-btn {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  font-family: var(--ff-u, sans-serif);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  margin-top: 0.5rem;
}
/* ✅ Disponible */
.size-cta-available {
  background: var(--lcem-accent);
  color: #0c1825;
}
.size-cta-available:hover {
  background: var(--lcem-accent-light);
}
/* ⚠️ Alternative disponible */
.size-cta-alt {
  background: rgba(184,149,90,0.12);
  color: var(--lcem-accent);
  border: 0.5px solid rgba(184,149,90,0.4);
}
.size-cta-alt:hover {
  background: var(--lcem-accent);
  color: #0c1825;
}
/* ❌ Indisponible — voir coloris */
.size-cta-unavailable {
  background: transparent;
  color: var(--lcem-text-muted);
  border: 0.5px solid rgba(244,237,224,0.15);
}
.size-cta-unavailable:hover {
  border-color: var(--lcem-accent);
  color: var(--lcem-accent);
}
/* Message d'indisponibilité */
.size-unavailable {
  font-size: 0.68rem;
  font-style: italic;
  color: rgba(224,85,85,0.75);
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* Bouton secondaire "Voir la fiche produit / Continuer mes achats" */
.size-cta-continue {
  display: block;
  width: 100%;
  padding: 0.55rem 1rem;
  font-family: var(--ff-u, sans-serif);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 0.4rem;
  background: transparent;
  color: var(--lcem-text-muted);
  border: 0.5px solid rgba(244,237,224,0.12);
}
.size-cta-continue:hover {
  border-color: var(--lcem-accent);
  color: var(--lcem-accent);
}

/* Confirmation ajout panier */
.size-cart-success {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lcem-success, #5ebd85);
  padding: 0.5rem 0;
  margin-bottom: 0.3rem;
}
