/* ══════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: #f0f2f5; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ══════════════════════════════════════════
   HEADER & LAYOUT
══════════════════════════════════════════ */
header { background: #ffffff; border-bottom: 1px solid #e0e0e0; padding: 0 24px; height: 50px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; box-shadow: 0 1px 4px rgba(0,0,0,0.06); z-index: 10; }
.logo { font-size: 1.1rem; font-weight: 700; color: #2563eb; letter-spacing: -0.5px; }
.logo span { color: #111; }
.main { display: flex; flex: 1; overflow: hidden; }

/* ══════════════════════════════════════════
   CANVAS AREA & MARCA D'ÁGUA
══════════════════════════════════════════ */
.canvas-wrapper { flex: 1; display: flex; align-items: center; justify-content: center; background: #e8eaf0; position: relative; }
.canvas-container { position: relative; width: 800px; height: 500px; border-radius: 8px; box-shadow: 0 4px 24px rgba(0,0,0,0.12); overflow: hidden; background: #6b2b8e; }
#canvas3d { display: block; background: transparent; cursor: grab; width: 100% !important; height: 100% !important; }
#canvas3d:active { cursor: grabbing; }
.watermark-logo { position: absolute; top: 24px; left: 24px; width: 130px; opacity: 0.65; pointer-events: none; z-index: 5; }

/* ══════════════════════════════════════════
   SIDEBAR & BOTÕES
══════════════════════════════════════════ */
.sidebar {
  width: 300px;
  background: #ffffff;
  border-left: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  /* ✅ Solução 1: sidebar rola sozinha, página não */
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

/* ✅ Solução 2: seções mais compactas */
.sidebar-section { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; }
.sidebar-section:last-child { border-bottom: none; }
.section-title { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #9ca3af; margin-bottom: 10px; }

/* --- BOTÕES DE PRODUTO FIXOS (3 botões) --- */
.product-selector { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.prod-btn { flex: auto; padding: 7px 4px; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 0.7rem; font-weight: 700; color: #475569; cursor: pointer; transition: all 0.2s; }
.prod-btn:hover { background: #e2e8f0; }
.prod-btn.active { background: #2563eb; color: #ffffff; border-color: #2563eb; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3); }

/* --- SELECT DROPDOWN OUTROS PRODUTOS --- */
#productSelectExtra {
  width: 100%;
  padding: 8px 36px 8px 12px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background-color: #f8fafc;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: all 0.2s;
}
#productSelectExtra:hover { background-color: #e2e8f0; border-color: #94a3b8; }
#productSelectExtra:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2); }
#productSelectExtra option { background-color: #ffffff; color: #475569; font-weight: 600; }

/* --- BOTÃO UPLOAD & EXPORT --- */
.btn-upload, .btn-export { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 9px; color: #fff; border: none; border-radius: 7px; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-upload { background: #2563eb; margin-bottom: 8px; }
.btn-upload:hover { background: #1d4ed8; }
.btn-export { background: #16a34a; }
.btn-export:hover { background: #15803d; }

/* ══════════════════════════════════════════
   SLIDERS / CONTROLES
══════════════════════════════════════════ */
.control-label { display: flex; justify-content: space-between; font-size: 0.72rem; color: #374151; font-weight: 500; margin-top: 8px; }
input[type="range"] { width: 100%; accent-color: #2563eb; margin-top: 4px; cursor: pointer; }

/* ══════════════════════════════════════════
   LISTA DE CORES
══════════════════════════════════════════ */
#productColors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 6px; }
#productColors .color-dot { display: flex; align-items: center; gap: 6px; cursor: pointer; transition: transform 0.2s; }
#productColors .color-dot:hover { transform: translateX(3px); }
#productColors .color-dot .circle { width: 20px; height: 20px; border-radius: 50%; border: 1px solid #cbd5e1; flex-shrink: 0; transition: all 0.2s; }
#productColors .color-dot.active .circle { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #3b82f6; border-color: transparent; }
#productColors .color-dot span { font-size: 11px; color: #475569; font-weight: 600; line-height: 1.1; }
.paleta-circle { background: conic-gradient(from 90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000); display: flex; align-items: center; justify-content: center; position: relative; }

/* ══════════════════════════════════════════
   SCROLLBAR SIDEBAR
══════════════════════════════════════════ */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 4px; }

/* ══════════════════════════════════════════
   TOAST
══════════════════════════════════════════ */
.toast { position: fixed; bottom: 24px; right: 24px; background: #111827; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 0.78rem; font-weight: 500; opacity: 0; transform: translateY(10px); transition: all 0.3s; pointer-events: none; z-index: 999; }
.toast.show { opacity: 1; transform: translateY(0); }

/* ══════════════════════════════════════════
   RESPONSIVIDADE
══════════════════════════════════════════ */
@media (max-width: 768px) {
  body { overflow-y: auto; height: auto; }
  .main { flex-direction: column; overflow: visible; }
  .sidebar { width: 100%; height: auto; border-left: none; border-top: 1px solid #e0e0e0; overflow-y: visible; }
  .canvas-wrapper { padding: 0; }
  .canvas-container { border-radius: 0; max-width: 100%; height: 350px; }
  #productSelectExtra { font-size: 0.85rem; padding: 10px 36px 10px 12px; }
}
