/* ===== Layout principal ===== */
#pcb_editor_wrapper {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch;
  width: 100vw !important;
  max-width: 100% !important;
  gap: 0;
}

/* ===== Sidebar (menu de componentes) ===== */
#pcb_sidebar {
  width: 220px;
  padding: 20px;
  box-sizing: border-box;
  border-right: 1px solid #ddd;
  background-color: #f4f4f4;
  flex-shrink: 0;
  float: none !important;
}

/* Sidebar fixo dentro do wrapper */
#pcb_editor_wrapper > #pcb_sidebar {
  flex: 0 0 220px !important;
  width: 220px !important;
}

/* ===== Canvas (área de desenho) ===== */
#pcb_canvas_container {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  clear: none !important;
  float: none !important;
  position: relative;
  overflow: hidden;
  height: calc(100vh - 0px) !important;
  min-height: 600px;
}

canvas { display: block; }

/* ===== Elementos do menu ===== */
label { display: block; margin-top: 10px; }
small { color: #666; display: block; margin-top: 6px; line-height: 1.3; }

.component {
  cursor: pointer;
  margin-bottom: 10px;
  padding: 5px;
  border: 1px dashed #999;
  text-align: center;
  background-color: #f8f8f8;
}

/* Inputs numéricos */
#pcb_sidebar input[type="number"] {
  width: 100%;
  margin: 6px 0 8px;
  padding: 10px 12px;
  min-height: 40px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  background: #fff;
}

/* ===== Botões (azul) ===== */
#pcb_sidebar button {
  display: block;
  width: 100%;
  margin: 6px 0 12px; /* mais espaço depois do botão */
  padding: 10px 12px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  background-color: #0066cc;
  color: #fff;
  cursor: pointer;
  transition: background-color .2s ease, transform .1s ease, box-shadow .2s ease;
  box-sizing: border-box;
}

#pcb_sidebar button:hover { background-color: #004d99; }
#pcb_sidebar button:active { transform: scale(0.98); }
#pcb_sidebar button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,102,204,.3);
}

/* ===== Select (diferente do botão) ===== */
#pcb_sidebar select {
  display: block;
  width: 100%;
  margin: 6px 0 12px; /* mais espaço depois do select */
  padding: 8px 10px;
  min-height: 40px;
  line-height: 1.4;
  font-size: 12px; /* texto menor */
  font-weight: 500;
  color: #333;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg fill='%23666' height='24' viewBox='0 0 24 24' width='24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 34px;
}

#pcb_sidebar select option {
  font-size: 12px;
}

#pcb_sidebar select optgroup {
  font-size: 11px;
  font-weight: bold;
}

#pcb_sidebar select:hover { border-color: #999; }
#pcb_sidebar select:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0,102,204,.2);
}

/* ===== Espaçamento extra antes de títulos ===== */
#pcb_sidebar button + h3,
#pcb_sidebar select + h3,
#pcb_sidebar input + h3 {
  margin-top: 20px;
}

/* ===== Evita limites do Elementor ===== */
.elementor .elementor-section .elementor-container,
.elementor .elementor-container,
.elementor .elementor-column,
.elementor .elementor-widget-container {
  max-width: 100% !important;
}

/* Evita empilhamento forçado pelo tema */
#pcb_editor_wrapper > * {
  display: block !important;
  float: none !important;
  clear: none !important;
}

/* ===== Responsividade ===== */
@media (max-width: 768px) {
  #pcb_editor_wrapper { flex-direction: column !important; }
  #pcb_canvas_container {
    height: 60vh !important;
    min-height: 300px;
  }
}
