/* Planificador 3D · FactoryOficina
   Colores y tipografías alineados con el tema de la tienda (Inter / Manrope, azul marino y rojo). */
.fo3d {
  --fo3d-navy: #0a1e3a;
  --fo3d-red: #e30613;
  --fo3d-red-hover: #c9000b;
  --fo3d-green: #2e7d32;
  --fo3d-green-hover: #1b5e20;
  --fo3d-blue: #0b69f6;
  --fo3d-bg: #f6f7f8;
  --fo3d-surface: #ffffff;
  --fo3d-border: #e3e6e9;
  --fo3d-text: #1d2733;
  --fo3d-muted: #68717b;
  --fo3d-warn-bg: #fff4e5;
  --fo3d-warn: #9a4b00;
  --fo3d-r-sm: 7px;
  --fo3d-r-md: 12px;
  --fo3d-r-lg: 16px;
  --fo3d-shadow: 0 8px 28px rgba(10, 30, 58, 0.14);
  --fo3d-font: var(--fo-font-body, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --fo3d-font-head: var(--fo-font-heading, "Manrope Variable", "Manrope", "Inter", system-ui, sans-serif);
  --fo3d-side-w: 360px;

  position: relative;
  display: grid;
  grid-template-columns: var(--fo3d-side-w) minmax(0, 1fr);
  grid-template-rows: 56px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 560px;
  overflow: hidden;
  background: var(--fo3d-bg);
  color: var(--fo3d-text);
  font: 14px/1.45 var(--fo3d-font);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}
.fo3d *, .fo3d *::before, .fo3d *::after { box-sizing: border-box; }
.fo3d [hidden] { display: none !important; }
.fo3d :where(button, input, select, textarea) { font: inherit; color: inherit; }
.fo3d :where(h2, h3, h4) { font-family: var(--fo3d-font-head); margin: 0; }
.fo3d :where(img) { max-width: 100%; }

/* Barra superior */
.fo3d-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  background: var(--fo3d-surface);
  border-bottom: 1px solid var(--fo3d-border);
  z-index: 5;
}
.fo3d-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fo3d-brand strong { display: block; font-family: var(--fo3d-font-head); font-size: 16px; line-height: 1.1; color: var(--fo3d-navy); }
.fo3d-brand small { display: block; color: var(--fo3d-muted); font-size: 12px; }
.fo3d-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--fo3d-navy); color: #fff; }
.fo3d-top-actions { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.fo3d-sep { width: 1px; height: 22px; background: var(--fo3d-border); margin: 0 6px; }
.fo3d-saved { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; color: var(--fo3d-muted); font-size: 12px; opacity: 0.75; }
.fo3d-saved.is-flash { animation: fo3d-flash 1.2s ease; }
@keyframes fo3d-flash { 0% { color: var(--fo3d-green); opacity: 1; } 100% { color: var(--fo3d-muted); opacity: 0.75; } }

/* Botones */
.fo3d-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--fo3d-border);
  border-radius: var(--fo3d-r-sm);
  background: var(--fo3d-surface);
  color: var(--fo3d-text);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.fo3d-btn:hover { border-color: #c9ced4; background: #f9fafb; }
.fo3d-btn:focus-visible, .fo3d-input:focus-visible, .fo3d-tab:focus-visible, .fo3d-swatch:focus-visible, .fo3d-product:focus-visible { outline: 2px solid var(--fo3d-blue); outline-offset: 2px; }
.fo3d-btn:disabled { opacity: 0.45; cursor: default; }
.fo3d-btn-icon { width: 36px; padding: 0; border-color: transparent; background: transparent; }
.fo3d-btn-icon:hover { background: var(--fo3d-bg); border-color: transparent; }
.fo3d-btn-primary { background: var(--fo3d-navy); border-color: var(--fo3d-navy); color: #fff; }
.fo3d-btn-primary:hover { background: #142f57; border-color: #142f57; }
.fo3d-btn-cta { background: var(--fo3d-green); border-color: var(--fo3d-green); color: #fff; font-weight: 600; }
.fo3d-btn-cta:hover { background: var(--fo3d-green-hover); border-color: var(--fo3d-green-hover); }
.fo3d-btn-ghost { border-color: transparent; color: var(--fo3d-muted); }
.fo3d-btn-danger:hover { color: var(--fo3d-red); }
.fo3d-btn-block { width: 100%; }
.fo3d-btn-small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.fo3d-btn.is-loading { pointer-events: none; opacity: 0.7; }
.fo3d-ico { display: inline-flex; flex: none; }

.fo3d-seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--fo3d-bg); border: 1px solid var(--fo3d-border); }
.fo3d-seg-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; color: var(--fo3d-muted); font-weight: 500; }
.fo3d-seg-btn.is-active { background: var(--fo3d-surface); color: var(--fo3d-navy); box-shadow: 0 1px 3px rgba(10, 30, 58, 0.14); }
.fo3d-seg-small { margin: 8px 0 4px; }
.fo3d-seg-small .fo3d-seg-btn { min-height: 26px; font-size: 12.5px; }

/* Lateral */
.fo3d-side { grid-row: 2; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--fo3d-surface); border-right: 1px solid var(--fo3d-border); z-index: 4; }
.fo3d-tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--fo3d-border); }
.fo3d-tab { position: relative; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--fo3d-muted); cursor: pointer; font-weight: 600; font-size: 13.5px; }
.fo3d-tab.is-active { color: var(--fo3d-navy); border-bottom-color: var(--fo3d-red); }
.fo3d-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--fo3d-red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.fo3d-panels { flex: 1; min-height: 0; overflow: hidden; }
.fo3d-panel { height: 100%; overflow-y: auto; padding: 14px 16px 28px; overscroll-behavior: contain; }
.fo3d-h { margin: 18px 0 8px; font-size: 13px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--fo3d-muted); }
.fo3d-panel > .fo3d-h:first-child { margin-top: 2px; }
.fo3d-muted { color: var(--fo3d-muted); font-size: 12.5px; }
.fo3d-note { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: var(--fo3d-r-sm); background: var(--fo3d-bg); font-size: 13px; }
.fo3d-warn { display: flex; align-items: flex-start; gap: 6px; margin: 8px 0; padding: 8px 10px; border-radius: var(--fo3d-r-sm); background: var(--fo3d-warn-bg); color: var(--fo3d-warn); font-size: 13px; }
.fo3d-danger { color: var(--fo3d-red); }
.fo3d-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 10px; color: var(--fo3d-muted); text-align: center; }
.fo3d-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.fo3d-row > .fo3d-btn { flex: 1; }
.fo3d-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.fo3d-ml-auto { margin-left: auto; }
.fo3d-area { margin-top: 18px; color: var(--fo3d-muted); font-size: 13px; }

/* Campos */
.fo3d-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin: 10px 0; }
.fo3d-fields-3 { grid-template-columns: 1fr 1fr 1fr; }
.fo3d-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--fo3d-muted); }
.fo3d-field-wide { grid-column: 1 / -1; margin: 8px 0; }
.fo3d-field strong { color: var(--fo3d-text); font-size: 14px; }
.fo3d-input { width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--fo3d-border); border-radius: var(--fo3d-r-sm); background: var(--fo3d-surface); color: var(--fo3d-text); font-size: 14px; }
.fo3d-quote-text { display: block; min-height: 190px; margin-top: 4px; resize: vertical; font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; }
.fo3d-input-small { width: 64px; min-height: 32px; padding: 4px 6px; text-align: right; }
.fo3d-input-wrap { position: relative; display: flex; align-items: center; }
.fo3d-input-wrap .fo3d-input { padding-right: 32px; }
.fo3d-input-wrap em { position: absolute; right: 10px; color: var(--fo3d-muted); font-style: normal; font-size: 12px; pointer-events: none; }
.fo3d-range-wrap { display: flex; align-items: center; gap: 10px; }
.fo3d-range { flex: 1; accent-color: var(--fo3d-navy); }
.fo3d-range-wrap output { min-width: 58px; text-align: right; color: var(--fo3d-text); font-variant-numeric: tabular-nums; }

/* Plantillas de sala */
.fo3d-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.fo3d-preset { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; border: 1px solid var(--fo3d-border); border-radius: var(--fo3d-r-sm); background: var(--fo3d-surface); cursor: pointer; color: var(--fo3d-muted); font-size: 11px; line-height: 1.15; text-align: center; }
.fo3d-preset:hover { border-color: #c9ced4; }
.fo3d-preset.is-active { border-color: var(--fo3d-navy); color: var(--fo3d-navy); background: #f2f5f9; box-shadow: inset 0 0 0 1px var(--fo3d-navy); }
.fo3d-preset-ico svg { width: 40px; height: 36px; }

.fo3d-card { margin: 12px 0; padding: 12px; border: 1px solid var(--fo3d-border); border-radius: var(--fo3d-r-md); background: #fbfcfd; }
.fo3d-card-head { display: flex; align-items: center; justify-content: space-between; }
.fo3d-wall-card { border-color: #f3c27a; background: #fffaf1; }

.fo3d-openings { display: flex; flex-direction: column; gap: 8px; }
.fo3d-opening { padding: 8px 10px; border: 1px solid var(--fo3d-border); border-radius: var(--fo3d-r-sm); }
.fo3d-opening-title { display: flex; align-items: center; gap: 6px; }
.fo3d-opening .fo3d-fields { margin: 6px 0 0; }
.fo3d-opening.is-active { border-color: var(--fo3d-blue); box-shadow: 0 0 0 1px var(--fo3d-blue); }
.fo3d-opening-tip { margin: 8px 0 0; }
.fo3d-link { display: inline-flex; align-items: baseline; gap: 2px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.fo3d-link:hover strong { color: var(--fo3d-blue); }

.fo3d-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.fo3d-swatch { width: 34px; height: 34px; padding: 0; border: 1px solid rgba(10, 30, 58, 0.18); border-radius: 50%; cursor: pointer; background-size: cover; background-position: center; }
.fo3d-swatch.is-active { box-shadow: 0 0 0 2px var(--fo3d-surface), 0 0 0 4px var(--fo3d-navy); }
.fo3d-swatches-small { gap: 6px; }
.fo3d-swatches-small .fo3d-swatch { width: 28px; height: 28px; }

/* Catálogo */
.fo3d-search-wrap { position: relative; display: flex; align-items: center; }
.fo3d-search-wrap .fo3d-ico { position: absolute; left: 10px; color: var(--fo3d-muted); pointer-events: none; }
.fo3d-search { padding-left: 34px; min-height: 40px; border-radius: 10px; }
.fo3d-chips { display: flex; gap: 6px; margin: 10px -16px 0; padding: 0 16px 4px; overflow-x: auto; scrollbar-width: thin; }
.fo3d-chip { display: inline-flex; align-items: center; gap: 5px; flex: none; min-height: 30px; padding: 0 11px; border: 1px solid var(--fo3d-border); border-radius: 15px; background: var(--fo3d-surface); cursor: pointer; font-size: 12.5px; font-weight: 500; }
.fo3d-chip em { font-style: normal; color: var(--fo3d-muted); font-size: 11.5px; }
.fo3d-chip.is-active { background: var(--fo3d-navy); border-color: var(--fo3d-navy); color: #fff; }
.fo3d-chip.is-active em { color: rgba(255, 255, 255, 0.75); }
.fo3d-count { margin: 6px 0; }
.fo3d-products { display: flex; flex-direction: column; gap: 8px; }
.fo3d-product { display: flex; gap: 10px; padding: 8px; border: 1px solid var(--fo3d-border); border-radius: var(--fo3d-r-md); background: var(--fo3d-surface); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.fo3d-product:hover { border-color: #c9ced4; box-shadow: 0 2px 10px rgba(10, 30, 58, 0.06); }
.fo3d-thumb { position: relative; flex: none; display: grid; place-items: center; width: 84px; height: 84px; overflow: hidden; border-radius: 9px; background: #f1f3f5; color: var(--fo3d-muted); }
.fo3d-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fo3d-thumb-small { width: 46px; height: 46px; border-radius: 7px; }
.fo3d-tag { position: absolute; left: 4px; bottom: 4px; padding: 1px 5px; border-radius: 4px; background: rgba(46, 125, 50, 0.92); color: #fff; font-size: 10px; font-weight: 600; }
.fo3d-product-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fo3d-product h4 { font-family: var(--fo3d-font); font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fo3d-dims { margin: 3px 0 0; color: var(--fo3d-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.fo3d-approx { color: var(--fo3d-warn); }
.fo3d-product-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.fo3d-price { font-weight: 700; color: var(--fo3d-navy); font-variant-numeric: tabular-nums; }
.fo3d-price-big { font-size: 22px; margin: 0; }

/* Proyecto */
.fo3d-project-name { font-weight: 600; }
.fo3d-lines { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.fo3d-line { border: 1px solid var(--fo3d-border); border-radius: var(--fo3d-r-md); padding: 8px; background: var(--fo3d-surface); }
.fo3d-line.is-missing { border-style: dashed; }
.fo3d-line-main { display: flex; gap: 10px; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.fo3d-line-main strong { display: block; font-size: 13px; line-height: 1.3; }
.fo3d-line-main small { display: block; color: var(--fo3d-muted); font-size: 12px; }
.fo3d-line-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.fo3d-qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--fo3d-border); border-radius: 8px; }
.fo3d-qty .fo3d-btn-icon { width: 30px; min-height: 30px; }
.fo3d-qty span { min-width: 20px; text-align: center; font-weight: 600; }
.fo3d-total { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 0 4px; border-top: 2px solid var(--fo3d-navy); font-size: 15px; }
.fo3d-total strong { font-size: 20px; color: var(--fo3d-navy); }
.fo3d-actions-col { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }

/* Escenario */
.fo3d-stage { position: relative; grid-row: 2; min-width: 0; min-height: 0; overflow: hidden; touch-action: none; }
.fo3d-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; outline: none; }
.fo3d-labels { position: absolute; inset: 0; pointer-events: none; }
.fo3d-wall-label, .fo3d-dim-label, .fo3d-dist-label { padding: 2px 7px; border-radius: 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fo3d-wall-label { background: rgba(255, 255, 255, 0.92); color: var(--fo3d-navy); border: 1px solid var(--fo3d-border); }
.fo3d-dim-label { background: var(--fo3d-blue); color: #fff; box-shadow: 0 2px 6px rgba(11, 105, 246, 0.35); }
.fo3d-dim-label.is-danger { background: var(--fo3d-red); }
.fo3d-dist-label { background: rgba(10, 30, 58, 0.82); color: #fff; font-size: 11px; }
.fo3d-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: min(680px, calc(100% - 32px)); padding: 7px 14px; border-radius: 18px; background: rgba(10, 30, 58, 0.78); color: #fff; font-size: 12.5px; text-align: center; pointer-events: none; backdrop-filter: blur(4px); }
.fo3d-side-toggle { position: absolute; left: 10px; top: 10px; z-index: 3; display: none; width: 38px; height: 38px; border: 1px solid var(--fo3d-border); border-radius: 9px; background: var(--fo3d-surface); cursor: pointer; box-shadow: var(--fo3d-shadow); }

/* Inspector */
.fo3d-inspector { position: absolute; top: 12px; right: 12px; z-index: 3; width: 320px; max-height: calc(100% - 70px); overflow-y: auto; padding: 12px; border: 1px solid var(--fo3d-border); border-radius: var(--fo3d-r-lg); background: rgba(255, 255, 255, 0.97); box-shadow: var(--fo3d-shadow); }
.fo3d-insp-head { display: flex; align-items: flex-start; gap: 10px; }
.fo3d-insp-title { flex: 1; min-width: 0; }
.fo3d-insp-title strong { display: block; font-size: 13.5px; line-height: 1.3; }
.fo3d-insp-dims { display: flex; align-items: center; gap: 2px; margin: 10px 0 4px; font-weight: 600; color: var(--fo3d-navy); font-variant-numeric: tabular-nums; }
.fo3d-options { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.fo3d-option { display: flex; flex-direction: column; gap: 5px; }
.fo3d-option-label { font-size: 12.5px; color: var(--fo3d-muted); font-weight: 500; }
.fo3d-option-label em { font-style: normal; color: var(--fo3d-text); }
.fo3d-insp-actions { display: flex; align-items: center; gap: 2px; padding-top: 8px; border-top: 1px solid var(--fo3d-border); }
.fo3d-rot { display: inline-flex; align-items: center; gap: 2px; }
.fo3d-rot em { font-style: normal; color: var(--fo3d-muted); }

/* Avisos y ventanas */
.fo3d-toasts { position: absolute; top: 66px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.fo3d-toast { display: flex; align-items: center; gap: 12px; max-width: min(520px, 92vw); padding: 9px 14px; border-radius: 10px; background: var(--fo3d-navy); color: #fff; font-size: 13px; box-shadow: var(--fo3d-shadow); pointer-events: auto; animation: fo3d-in 0.2s ease; transition: opacity 0.3s, transform 0.3s; }
.fo3d-toast.is-error { background: var(--fo3d-red); }
.fo3d-toast.is-out { opacity: 0; transform: translateY(-6px); }
.fo3d-toast-action { border: 0; background: transparent; color: #9cc3ff; font-weight: 600; cursor: pointer; padding: 0; }
@keyframes fo3d-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.fo3d-modal-backdrop { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(10, 30, 58, 0.42); animation: fo3d-in 0.15s ease; }
.fo3d-modal { width: min(560px, 100%); max-height: calc(100% - 16px); display: flex; flex-direction: column; border-radius: var(--fo3d-r-lg); background: var(--fo3d-surface); box-shadow: 0 20px 60px rgba(10, 30, 58, 0.3); overflow: hidden; }
.fo3d-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 6px; }
.fo3d-modal-head h2 { font-size: 17px; color: var(--fo3d-navy); line-height: 1.3; }
.fo3d-modal-body { padding: 4px 16px 12px; overflow-y: auto; }
.fo3d-modal-body p { margin: 6px 0; }
.fo3d-modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--fo3d-border); background: #fbfcfd; }
.fo3d-detail { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; }
.fo3d-detail-img { border-radius: var(--fo3d-r-md); overflow: hidden; background: #f1f3f5; aspect-ratio: 1; }
.fo3d-detail-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fo3d-help ol, .fo3d-help ul { padding-left: 18px; margin: 4px 0 12px; }
.fo3d-help li { margin: 6px 0; }
.fo3d-keys { width: 100%; border-collapse: collapse; font-size: 13px; }
.fo3d-keys td { padding: 4px 6px; border-top: 1px solid var(--fo3d-border); }
.fo3d-keys kbd { display: inline-block; min-width: 26px; padding: 1px 6px; border: 1px solid var(--fo3d-border); border-bottom-width: 2px; border-radius: 5px; background: var(--fo3d-bg); font: 600 12px/1.5 var(--fo3d-font); text-align: center; }
.fo3d-nowebgl { padding: 40px 20px; text-align: center; }

/* Amueblado automático */
.fo3d-auto-cta { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 12px; padding: 12px 14px; border: 1px solid #cfe0fb; border-radius: var(--fo3d-r-md); background: linear-gradient(135deg, #eef5ff, #f7fbff); color: var(--fo3d-text); text-align: left; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.fo3d-auto-cta:hover { border-color: var(--fo3d-blue); box-shadow: 0 2px 10px rgba(11, 105, 246, 0.14); }
.fo3d-auto-cta strong { display: block; color: var(--fo3d-navy); font-size: 14px; }
.fo3d-auto-cta small { display: block; color: var(--fo3d-muted); font-size: 12px; line-height: 1.35; }
.fo3d-auto-ico { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--fo3d-blue); color: #fff; }
.fo3d-modal.fo3d-modal-wide { width: min(640px, 100%); }
/* Asistente para amueblar */
.fo3d-modal.fo3d-modal-wizard { width: min(1060px, 100%); }
.fo3d-wizard .fo3d-h:first-child { margin-top: 4px; }
.fo3d-wz-desc { margin: 2px 0 4px; padding: 12px; border: 1px solid #d9e2ee; border-radius: var(--fo3d-r-md); background: #f3f6fa; }
.fo3d-wz-desc-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 8px; color: var(--fo3d-navy); }
.fo3d-wz-desc-title .fo3d-muted { flex-basis: 100%; }
.fo3d-wz-text { display: block; min-height: 68px; resize: vertical; line-height: 1.45; }
.fo3d-wz-desc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fo3d-wz-mic.is-recording { background: var(--fo3d-red); border-color: var(--fo3d-red); color: #fff; animation: fo3d-pulse 1.2s ease-in-out infinite; }
@keyframes fo3d-pulse { 50% { box-shadow: 0 0 0 6px rgba(227, 6, 19, 0.18); } }
.fo3d-wz-micnote { margin: 8px 0 0; }
.fo3d-wz-heard { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.fo3d-wz-heard:empty { display: none; }
.fo3d-chip.fo3d-chip-static { min-height: 26px; cursor: default; background: var(--fo3d-surface); }
.fo3d-wz-cols { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 0 22px; }
.fo3d-wz-plan svg { display: block; width: 100%; height: auto; max-height: 230px; border: 1px solid var(--fo3d-border); border-radius: var(--fo3d-r-md); background: #fbfcfd; }
.fo3d-wz-roomline { margin: 8px 0 !important; font-size: 13px; }
.fo3d-wz-presets { margin: 4px 0 2px; }
.fo3d-wz-openings { display: flex; flex-direction: column; margin: 2px 0; }
.fo3d-wz-structs { margin: 8px 0 6px !important; }
.fo3d-wz-needs { display: flex; flex-direction: column; gap: 8px; }
.fo3d-wz-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--fo3d-border); }
.fo3d-wz-group { padding: 2px 10px; border: 1px solid var(--fo3d-border); border-radius: var(--fo3d-r-md); background: var(--fo3d-surface); }
.fo3d-wz-group > .fo3d-wz-row { border-bottom: 0; }
.fo3d-wz-group.is-on { padding-bottom: 10px; border-color: #c4d0e0; background: #fafcfe; }
.fo3d-wz-label { min-width: 0; }
.fo3d-wz-label strong { display: block; font-size: 14px; }
.fo3d-wz-label small { display: block; color: var(--fo3d-muted); font-size: 12px; }
.fo3d-wz-label-inline { display: flex; align-items: center; gap: 6px; color: var(--fo3d-navy); }
.fo3d-wz-val { min-width: 26px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.fo3d-wz-opt { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 10px; font-size: 12.5px; color: var(--fo3d-muted); }
.fo3d-wz-opt .fo3d-seg-small { margin: 4px 0; }
.fo3d-wz-optcheck { margin: 6px 0 2px; font-size: 12.5px; }
.fo3d-wz-pick { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; }
.fo3d-wz-pick:empty { display: none; }
.fo3d-wz-pick > img, .fo3d-wz-pick > .fo3d-ico { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 1px solid var(--fo3d-border); border-radius: 7px; background: #fff; object-fit: cover; color: var(--fo3d-muted); }
.fo3d-wz-pick .fo3d-warn { margin: 0; }
.fo3d-wz-pick-txt { min-width: 0; }
.fo3d-wz-pick-txt span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--fo3d-text); }
.fo3d-wz-pick-txt small { display: block; color: var(--fo3d-muted); }
.fo3d-wz-pick-note { display: flex; align-items: flex-start; gap: 5px; margin: 6px 0 0 !important; color: var(--fo3d-warn); font-size: 12px; }
.fo3d-check { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; font-size: 13.5px; cursor: pointer; }
.fo3d-check input { width: 17px; height: 17px; accent-color: var(--fo3d-blue); }
.fo3d-wz-est { margin: 6px 0 0; }
.fo3d-wz-styles { margin: 0; padding: 0 0 4px; }
.fo3d-wz-busy { padding: 6px 0 4px; }
.fo3d-wz-progress { height: 8px; border-radius: 4px; background: var(--fo3d-bg); overflow: hidden; }
.fo3d-wz-progress > span { display: block; width: 4%; height: 100%; border-radius: 4px; background: var(--fo3d-blue); transition: width 0.25s ease; }
.fo3d-wz-total { font-size: 15px; }
.fo3d-wz-lines { list-style: none; margin: 8px 0; padding: 0; max-height: 300px; overflow-y: auto; border-top: 1px solid var(--fo3d-border); }
.fo3d-wz-lines li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--fo3d-border); font-size: 13px; }
.fo3d-wz-line-name small { display: block; color: var(--fo3d-muted); font-size: 11.5px; }
.fo3d-wz-lines .fo3d-price { flex: none; }
@media (min-width: 821px) and (min-height: 860px) {
  /* El plano de la sala se queda a la vista mientras se eligen los muebles. */
  .fo3d-wz-col:first-child { position: sticky; top: 0; align-self: start; }
}
@media (max-width: 820px) {
  .fo3d-wz-cols { grid-template-columns: minmax(0, 1fr); }
}

/* Paseo en primera persona */
.fo3d-walk { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.fo3d-walk > * { pointer-events: auto; }
.fo3d-walk-exit { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); box-shadow: var(--fo3d-shadow); }
.fo3d-walk-map { position: absolute; top: 10px; right: 10px; width: 140px; height: 140px; border-radius: 12px; background: rgba(255, 255, 255, 0.78); box-shadow: var(--fo3d-shadow); pointer-events: none !important; }
.fo3d-joy { position: absolute; left: 18px; bottom: 18px; display: none; place-items: center; width: 124px; height: 124px; border: 2px solid rgba(255, 255, 255, 0.75); border-radius: 50%; background: rgba(10, 30, 58, 0.22); touch-action: none; }
.fo3d-walk.is-touch .fo3d-joy { display: grid; }
.fo3d-joy-knob { width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, 0.95); box-shadow: 0 2px 10px rgba(10, 30, 58, 0.35); pointer-events: none; }
.fo3d-walk.is-locked::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(255, 255, 255, 0.95); box-shadow: 0 0 0 1.5px rgba(10, 30, 58, 0.55); }
.fo3d.is-walking .fo3d-canvas { cursor: grab; }

/* Carga */
.fo3d:not(.is-ready) .fo3d-stage::after { content: "Cargando planificador…"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--fo3d-muted); background: var(--fo3d-bg); }

/* Plegar el lateral en pantallas medianas */
.fo3d.is-side-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.fo3d.is-side-collapsed .fo3d-side { visibility: hidden; }
@media (max-width: 1100px) {
  .fo3d { --fo3d-side-w: 320px; }
  .fo3d-side-toggle { display: grid; place-items: center; }
  .fo3d-saved { display: none; }
}

/* Móvil: el lateral pasa a ser una hoja inferior */
@media (max-width: 760px) {
  .fo3d { grid-template-columns: minmax(0, 1fr); grid-template-rows: 52px minmax(0, 1fr) auto; font-size: 14px; }
  .fo3d-top { padding: 0 6px; gap: 6px; min-width: 0; }
  .fo3d-brand { flex: none; }
  .fo3d-brand strong { font-size: 14px; }
  .fo3d-brand small, .fo3d-top .fo3d-sep, .fo3d-seg-btn > span:not(.fo3d-ico), .fo3d-top [title="Ayuda"] { display: none; }
  .fo3d-logo { width: 30px; height: 30px; }
  .fo3d-top-actions { gap: 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .fo3d-seg-btn { padding: 0 7px; }
  .fo3d-btn-icon { width: 34px; }
  .fo3d-stage { grid-row: 2; }
  .fo3d-side { grid-row: 3; height: 46vh; max-height: 46vh; border-right: 0; border-top: 1px solid var(--fo3d-border); box-shadow: 0 -6px 20px rgba(10, 30, 58, 0.1); }
  .fo3d.is-side-collapsed { grid-template-columns: minmax(0, 1fr); }
  .fo3d.is-side-collapsed .fo3d-side { visibility: visible; height: auto; max-height: none; }
  .fo3d.is-side-collapsed .fo3d-panels { display: none; }
  .fo3d-side-toggle { display: grid; place-items: center; left: 8px; top: 8px; }
  .fo3d-tabs { padding: 4px 6px 0; }
  .fo3d-tab { min-height: 40px; font-size: 13px; }
  .fo3d-panel { padding: 10px 12px 20px; }
  .fo3d-inspector { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; max-height: 52%; padding: 10px; }
  .fo3d-insp-dims { margin-top: 6px; }
  .fo3d-hint { display: none; }
  .fo3d-presets { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .fo3d-preset span:last-child { font-size: 10px; }
  .fo3d-detail { grid-template-columns: 1fr; }
  .fo3d-toasts { top: 58px; }
  .fo3d-walk-map { width: 104px; height: 104px; top: 8px; right: 8px; }
  .fo3d-walk-exit { top: 8px; }
}

/* FactoryPlanner3D 1.2.3: prices and real quote form. */
.fo3d-live-price-status {font-size:12px;line-height:1.4;margin:8px 0 4px;}
.fo3d-quote-form {display:grid;gap:10px;}
.fo3d-quote-form .fo3d-field {margin:0;}
.fo3d-quote-form .fo3d-quote-text {min-height:85px;}
.fo3d-quote-form .fo3d-privacy-check {display:flex;align-items:flex-start;gap:8px;font-size:12px;line-height:1.5;}
.fo3d-quote-form .fo3d-privacy-check input {width:16px;height:16px;flex-shrink:0;margin-top:1px;}
.fo3d-quote-form button[type=submit] {margin-top:6px;}

/* Version 1.2.4: authoritative B2B prices excluding VAT + tax summary. */
.fo3d-tax-breakdown { border-top: 1px solid rgba(125,137,149,.18); margin: 0 0 .55rem; padding: .38rem .25rem .22rem; }
.fo3d-tax-row { display:flex; align-items:center; justify-content:space-between; gap: .75rem; font-size:.88rem; padding:.17rem 0; }
.fo3d-tax-row strong { font-variant-numeric: tabular-nums; }
.fo3d-tax-gross { font-weight: 700; padding-top: .35rem; border-top: 1px solid rgba(125,137,149,.18); }
.fo3d-live-price-status { font-size: .79rem; line-height:1.45; }

.fo3d-net-notice { font-size:.84rem; font-weight:600; color:var(--fo3d-navy); margin:.35rem 0 .45rem; }

/* v1.2.5: VAT and grand total must align in two separate columns,
   even with Transformer Child styles or narrow mobile sidebars. */
#fo3d-planner .fo3d-tax-breakdown .fo3d-tax-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: baseline;
  column-gap: 12px;
  width: 100%;
  box-sizing: border-box;
}
#fo3d-planner .fo3d-tax-breakdown .fo3d-tax-row > strong {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#fo3d-planner .fo3d-tax-breakdown .fo3d-tax-row > span { min-width: 0; }

/* JL v1.2.7: full-bleed planner without changing global Hummingbird containers. */
body#module-jlfactoryplanner3d-planner { overflow-x: clip; }
.fo3d-fullbleed { position: relative; width: 100vw; max-width: none; left: 50%; transform: translateX(-50%); padding: 0 !important; margin: 0 !important; }
.fo3d-fullbleed #fo3d-planner { width: 100%; max-width: none; }
.fo3d-planner-viewport { height: clamp(630px, calc(100dvh - 180px), 1300px); min-height: 630px; border: 1px solid #e3e6e9; overflow: hidden; }
@media (max-width: 760px) {
  .fo3d-planner-viewport { height: calc(100dvh - 110px); min-height: 540px; }
}
.fo3d-tour { position: absolute; z-index: 55; top: 68px; right: 14px; width: min(345px, calc(100% - 28px)); background: #fff; border: 1px solid #dfe5ea; border-radius: 13px; box-shadow: 0 12px 35px rgba(10,30,58,.22); padding: 15px; color: #1d2733; line-height: 1.45; font-size: 13px; }
.fo3d-tour-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fo3d-tour-head strong { font-size: 15px; }
.fo3d-tour-close { border: 0; background: transparent; font-size: 23px; cursor: pointer; padding: 0 5px; }
.fo3d-tour p { margin: 10px 0; }
.fo3d-tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.fo3d-tour-actions button, .fo3d-tour-reopen { border: 1px solid #0a1e3a; background: #0a1e3a; color: #fff; padding: 7px 12px; border-radius: 7px; cursor: pointer; }
.fo3d-tour-reopen { position: absolute; z-index: 35; top: 65px; right: 12px; }
.fo3d-tour-actions .fo3d-tour-skip { background: #fff; color: #0a1e3a; }
@media (max-width: 760px) { .fo3d-tour { top: 55px; right: 8px; width: min(330px, calc(100% - 16px)); } .fo3d-tour-reopen { top: 56px; right: 8px; } }


/* FO 3D preference selector: first step, readable choices. */
.fo3d-wz-preference-top{padding:12px 14px;margin:0 0 16px;background:#f8fafc;border:1px solid #e1e7ed;border-radius:10px}
.fo3d-wz-preference-top .fo3d-h{margin:0 0 10px}
.fo3d-wz-preference{display:flex;flex-wrap:wrap;gap:8px;margin:0;padding:0;overflow:visible}
.fo3d-wz-preference .fo3d-chip{white-space:normal;text-align:center;flex:1 1 150px;min-width:0}
@media(max-width:600px){.fo3d-wz-preference-top{padding:12px}.fo3d-wz-preference .fo3d-chip{flex-basis:100%}}
