/* assets/simulator.css - Simulador de Alta Decoração Essenza Interiores */

.sim-engine-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0.5rem 0.5rem 2.5rem 0.5rem;
  animation: simEngineFade 0.25s ease-out;
}

@keyframes simEngineFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── TOPO DO SIMULADOR ─── */
.sim-top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  background: #141a26;
  border: 1.5px solid #233044;
  border-radius: 16px;
  padding: 0.85rem 1.25rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.sim-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sim-logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #3730a3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  flex-shrink: 0;
}

.sim-main-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
  letter-spacing: -0.01em;
}

.sim-sub-title {
  font-size: 0.76rem;
  color: #94a3b8;
  margin: 2px 0 0 0;
}

.sim-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-sim-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.btn-sim-action.primary {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.btn-sim-action.primary:active {
  transform: scale(0.96);
  background: #1d4ed8;
}

.btn-sim-action.whatsapp {
  background: #065f46;
  color: #34d399;
  border-color: #059669;
}
.btn-sim-action.whatsapp:active {
  transform: scale(0.96);
  background: #047857;
  color: #ffffff;
}

.btn-sim-action.neutral {
  background: #1e2738;
  color: #cbd5e1;
  border-color: #2d3e56;
}
.btn-sim-action.neutral:active, .btn-sim-action.neutral.active {
  background: #334460;
  color: #ffffff;
  border-color: #38bdf8;
}

/* ─── GRID PRINCIPAL DO SIMULADOR (PALCO + CONTROLES) ─── */
.sim-viewport-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 960px) {
  .sim-viewport-grid {
    grid-template-columns: 360px 1fr;
  }
}

@media (min-width: 1200px) {
  .sim-viewport-grid {
    grid-template-columns: 390px 1fr;
  }
}

/* ─── PAINEL LATERAL DE CONTROLES TOUCH ─── */
.sim-controls-panel {
  background: #141a26;
  border: 1.5px solid #233044;
  border-radius: 18px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

/* Abas de Navegação Touch */
.sim-tabs-header {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #0e131d;
  border: 1px solid #1f2a3c;
  border-radius: 12px;
  padding: 4px;
}

.sim-tab-pill {
  padding: 0.65rem 0.5rem;
  border-radius: 9px;
  background: transparent;
  border: none;
  color: #8492a6;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.sim-tab-pill svg {
  width: 18px;
  height: 18px;
}

.sim-tab-pill.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* Conteúdo da Aba */
.sim-tab-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sim-tab-pane {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.sim-tab-pane.active {
  display: flex;
}

/* Campos e Sliders Touch */
.sim-field-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sim-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sim-field-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.sim-field-val {
  font-size: 0.82rem;
  font-weight: 800;
  color: #38bdf8;
}

.sim-range-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #232d3f;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.sim-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: grab;
}

/* Caixa de Upload do Papel / Foto */
.sim-upload-dropzone {
  border: 2px dashed #334460;
  background: #101622;
  border-radius: 12px;
  padding: 1.1rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: #94a3b8;
  transition: all 0.15s ease;
}

.sim-upload-dropzone:hover {
  border-color: #38bdf8;
  background: #141c2c;
  color: #f8fafc;
}

.sim-upload-dropzone strong {
  font-size: 0.88rem;
  color: #f8fafc;
}

.sim-upload-dropzone span {
  font-size: 0.72rem;
  color: #64748b;
}

/* Catálogo de Papéis (Grade Touch) */
.sim-catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.sim-catalog-thumb {
  position: relative;
  height: 65px;
  border-radius: 10px;
  border: 2px solid #233044;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  transition: all 0.15s ease;
  overflow: hidden;
}

.sim-catalog-thumb.active {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.4);
  transform: scale(0.96);
}

.sim-catalog-name-overlay {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  background: rgba(10, 15, 25, 0.85);
  font-size: 0.6rem;
  font-weight: 700;
  color: #f8fafc;
  padding: 2px 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Seletor de Ambientes */
.sim-rooms-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sim-room-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #101622;
  border: 1.5px solid #233044;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sim-room-card.active {
  border-color: #38bdf8;
  background: #172235;
}

.sim-room-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #233044;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  flex-shrink: 0;
}

.sim-room-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #f8fafc;
}

.sim-room-sub {
  font-size: 0.72rem;
  color: #8492a6;
}

/* Modelos de Persianas */
.sim-blinds-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sim-blind-pill {
  background: #101622;
  border: 1.5px solid #233044;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.sim-blind-pill.active {
  border-color: #10b981;
  background: #0f2420;
}

.sim-blind-pill-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #f8fafc;
  display: block;
}

.sim-blind-pill-sub {
  font-size: 0.65rem;
  color: #64748b;
  display: block;
  margin-top: 2px;
}

/* Paleta de Cores de Persianas */
.sim-color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sim-color-chip {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid #233044;
  cursor: pointer;
  transition: transform 0.15s;
}

.sim-color-chip.active {
  border-color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

/* ─── O PALCO DE VISUALIZAÇÃO FOTORREALISTA (STAGE) ─── */
.sim-stage-wrapper {
  position: relative;
  background: #090d16;
  border: 2px solid #233044;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .sim-stage-wrapper {
    min-height: 600px;
  }
}

/* O Canvas Principal de Renderização Fotorrealista */
#sim-canvas-viewport {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #090d16;
  flex: 1;
}

/* Overlay Interativo para os 4 Pontos de Perspectiva */
.sim-perspective-pins-layer {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: auto;
  z-index: 100;
}

.sim-perspective-pins-layer.active {
  display: block;
}

.sim-corner-pin {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #3b82f6;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7), 0 0 12px #3b82f6;
  cursor: grab;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  user-select: none;
  touch-action: none;
  z-index: 101;
}

.sim-corner-pin:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.25);
  background: #10b981;
}

.sim-perspective-guideline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* SLIDER DIVISOR ANTES / DEPOIS (SPLIT SCREEN) */
.sim-split-divider {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(0,0,0,0.8);
  cursor: ew-resize;
  z-index: 90;
  touch-action: none;
}

.sim-split-divider.active {
  display: block;
}

.sim-split-handle-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #0f172a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 900;
  color: #0f172a;
  cursor: ew-resize;
}

/* Carimbo da Loja no Canto do Stage */
.sim-stage-badge {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(14, 20, 32, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid #28374d;
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  z-index: 80;
}

.sim-stage-badge-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.5px;
}

.sim-stage-badge-sub {
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Barra Flutuante de Controle da Persiana no Stage */
.sim-stage-blind-controller {
  display: none;
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 20, 32, 0.92);
  backdrop-filter: blur(10px);
  border: 1.5px solid #28374d;
  border-radius: 30px;
  padding: 6px 16px;
  align-items: center;
  gap: 12px;
  z-index: 85;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

.sim-stage-blind-controller.active {
  display: flex;
}

.sim-blind-ctrl-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: #34d399;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.sim-blind-ctrl-slider {
  width: 140px;
  height: 6px;
  border-radius: 3px;
  accent-color: #10b981;
  cursor: pointer;
}

/* Caixa Interativa de Posicionamento e Redimensionamento da Persiana */
.sim-blind-interactive-box {
  display: none;
  position: absolute;
  border: 2px dashed rgba(16, 185, 129, 0.85);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), inset 0 0 16px rgba(16, 185, 129, 0.12);
  border-radius: 8px;
  pointer-events: none;
  z-index: 92;
  touch-action: none;
}

.sim-blind-interactive-box.active {
  display: block;
}

/* Alça de Movimentação no Topo */
.sim-blind-move-handle {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: #ffffff;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  pointer-events: auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  transition: transform 0.15s, background 0.15s;
}

.sim-blind-move-handle:active {
  cursor: grabbing;
  background: #059669;
  transform: translateX(-50%) scale(1.08);
}

/* Alça de Redimensionamento no Canto Inferior Direito */
.sim-blind-resize-handle {
  position: absolute;
  bottom: -12px;
  right: -12px;
  width: 28px;
  height: 28px;
  background: #10b981;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  cursor: nwse-resize;
  user-select: none;
  touch-action: none;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.65);
  transition: transform 0.15s, background 0.15s;
}

.sim-blind-resize-handle:active {
  transform: scale(1.25);
  background: #059669;
}
