/* FenliComposer — styles du module/modal (préfixe .fc-) — v1.
   Charte Fenli : interactif #0092C7, accents #00C7FF, vitrage #EAF7FF,
   traits #0B0C0F, Inter, boutons style m.css (radius, press scale .97).
   Aucun style inline hors SVG — tout le module vit ici. */

.fc-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000; /* au-dessus du composer m/ (40) et des sheets */
  display: flex;
  flex-direction: column;
  background: var(--bg, #F3F5F7);
  color: var(--ink, #0B0C0F);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  padding-top: env(safe-area-inset-top, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
}
.fc-overlay[hidden] { display: none; }
html.fc-open, html.fc-open body { overflow: hidden; }

.fc-overlay button {
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.fc-overlay button:active:not(:disabled) { transform: scale(.97); } /* press feedback m.css */

/* ── Barre du haut ── */
.fc-top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 16px;
  background: var(--paper, #FEFEFE);
  border-bottom: 1px solid var(--border, #E8EBEF);
  position: relative;
  z-index: 45; /* au-dessus de .fc-rotate (40) : « Fermer » reste accessible en portrait */
}
.fc-title {
  flex: 1;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-close {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border, #DADFE6);
  border-radius: 12px;
  background: var(--paper, #FEFEFE);
  color: var(--text-2, #6D7481);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.fc-close:hover { border-color: #0092C7; color: var(--ink, #0B0C0F); }

/* ── Scène (SVG du composeur) ── */
.fc-stage {
  flex: 1;
  position: relative;
  min-height: 0;
  padding: 2px 4px;
}
.fc-svg {
  display: block;
  width: 100%;
  height: 100%;
}
@media (hover: hover) {
  .fc-btn:hover circle { stroke: #0092C7; }
  .fc-btn:hover text { fill: #0092C7; }
  .fc-hit:hover rect { stroke: #0092C7; }
}

/* ── Palette des types (popover dans la scène) ── */
.fc-palette {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  width: min(430px, calc(100% - 20px));
  padding: 10px 12px 12px;
  background: var(--paper, #FEFEFE);
  border: 1px solid var(--border, #E8EBEF);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(11, 12, 15, .20);
}
.fc-palette[hidden] { display: none; }
.fc-palette-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 8px;
  font-size: 13px;
  font-weight: 700;
}
.fc-palette-x {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border, #DADFE6);
  border-radius: 50%;
  background: var(--paper, #FEFEFE);
  color: var(--text-2, #6D7481);
  font-size: 13px;
}
.fc-palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.fc-palette-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 3px 6px;
  border: 1px solid var(--border, #E8EBEF);
  border-radius: 12px; /* radius tuiles m.css */
  background: var(--paper, #FEFEFE);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink, #0B0C0F);
  line-height: 1.2;
  text-align: center;
}
.fc-palette-item:hover { border-color: #00C7FF; background: var(--fenli-50, #EAFAFF); }
.fc-palette-item svg { width: 46px; height: 35px; }
@media (max-height: 420px) {
  .fc-palette-grid { grid-template-columns: repeat(5, 1fr); }
  .fc-palette-item svg { width: 40px; height: 30px; }
}

/* ── Bandeau de prix (bas) ── */
.fc-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--paper, #FEFEFE);
  border-top: 1px solid var(--border, #E8EBEF);
}
.fc-foot-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.fc-pricewrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.fc-price {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink, #0B0C0F);
  white-space: nowrap;
}
.fc-state {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2, #6D7481);
  overflow-wrap: anywhere;
}
.fc-state.fc-err { color: #C24E42; font-weight: 600; } /* rouge doux (message 422 tel quel) */
.fc-dims {
  font-size: 11.5px;
  color: var(--text-2, #6D7481);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-add {
  flex: none;
  min-height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: 16px;
  background: var(--fenli-gradient, linear-gradient(135deg, #00C7FF, #0092C7));
  color: var(--navy, #04121A);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 146, 199, .28);
}
.fc-add:disabled {
  background: var(--grey-soft, #E4E7EB);
  color: #A7AEB8;
  box-shadow: none;
  cursor: default;
}

/* ── Modales internes (saisie numérique + confirmation) ── */
.fc-dim-modal, .fc-confirm {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(11, 12, 15, .40); /* scrim */
}
.fc-dim-modal[hidden], .fc-confirm[hidden] { display: none; }
.fc-card {
  width: min(340px, 100%);
  padding: 18px 18px 16px;
  background: var(--paper, #FEFEFE);
  border: 1px solid var(--border, #E8EBEF);
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(11, 12, 15, .24);
}
.fc-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}
.fc-dim-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--border, #DADFE6);
  border-radius: 14px; /* radius champ m.css */
  background: var(--paper, #FEFEFE);
}
.fc-dim-row:focus-within { border-color: #0092C7; box-shadow: 0 0 0 1px #0092C7; }
.fc-dim-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink, #0B0C0F);
}
.fc-dim-unit { font-size: 13px; font-weight: 600; color: var(--text-2, #6D7481); }
.fc-dim-error {
  margin: 10px 2px 0;
  font-size: 12.5px;
  font-weight: 600;
  color: #C24E42;
}
.fc-dim-error[hidden] { display: none; }
.fc-confirm-sub {
  margin: -4px 0 12px;
  font-size: 13px;
  color: var(--text-2, #6D7481);
}
.fc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.fc-actions button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
}
.fc-btn-ghost {
  border: 1px solid var(--border, #DADFE6);
  background: var(--paper, #FEFEFE);
  color: var(--text-2, #6D7481);
}
.fc-btn-ghost:hover { border-color: #0092C7; color: var(--ink, #0B0C0F); }
.fc-dim-ok {
  border: none;
  background: var(--ink, #0B0C0F);
  color: #fff;
}
.fc-confirm-ok {
  border: none;
  background: #C24E42;
  color: #fff;
}

/* ── Overlay « Tournez votre téléphone » (portrait, petit écran) ── */
.fc-rotate {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px;
  text-align: center;
  background: rgba(11, 12, 15, .93);
  color: #fff;
}
.fc-rotate[hidden] { display: none; }
.fc-rotate svg {
  width: 64px;
  height: 64px;
  margin-bottom: 10px;
  color: #00C7FF;
  animation: fcRotate 2s ease-in-out infinite;
}
@keyframes fcRotate {
  0%, 18%  { transform: rotate(0deg); }
  55%, 82% { transform: rotate(90deg); }
  100%     { transform: rotate(90deg); }
}
.fc-rotate-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.fc-rotate-sub {
  margin: 0;
  font-size: 13px;
  color: #B9C1CC;
}

/* ── Paysage téléphone : chrome compact, place au dessin ── */
@media (max-height: 480px) {
  .fc-top { min-height: 44px; padding: 4px 12px; }
  .fc-title { font-size: 14px; }
  .fc-close { min-height: 34px; padding: 0 10px; font-size: 12px; }
  .fc-foot { padding: 6px 12px; gap: 10px; }
  .fc-price { font-size: 20px; }
  .fc-dims { font-size: 10.5px; }
  .fc-add { min-height: 42px; padding: 0 16px; font-size: 14px; border-radius: 14px; }
}

.fc-fix { cursor: pointer; text-decoration: underline; }
