/* ============================================
   PERSONALIZADOR 2D — Fabric.js Editor
   ============================================ */

.cz-section {
  padding: 48px 0;
  background: var(--in-gray-50, #F9FAFB);
  border-top: 1px solid var(--in-gray-200, #E5E7EB);
  margin-top: 32px;
}
.cz-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
.cz-title {
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--in-gray-900, #111827);
  margin: 0 0 6px;
  text-align: center;
}
.cz-subtitle {
  font-size: 14px;
  color: var(--in-gray-500, #6B7280);
  margin: 0 0 32px;
  text-align: center;
}

/* Layout */
.cz-layout {
  display: grid;
  grid-template-columns: 200px 1fr 240px;
  gap: 20px;
  align-items: start;
}

/* Toolbar */
.cz-toolbar {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--in-gray-200, #E5E7EB);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.cz-tool-group h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--in-gray-400, #9CA3AF);
  margin: 0 0 10px;
}
.cz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  background: transparent;
  color: var(--in-gray-700, #374151);
}
.cz-btn--primary {
  background: var(--in-red, #DC2626);
  color: #fff;
}
.cz-btn--primary:hover {
  background: var(--in-red-dark, #B91C1C);
}
.cz-btn--secondary {
  background: var(--in-gray-100, #F3F4F6);
  color: var(--in-gray-800, #1F2937);
  border: 1px solid var(--in-gray-200, #E5E7EB);
}
.cz-btn--secondary:hover {
  background: var(--in-gray-200, #E5E7EB);
}
.cz-btn--ghost {
  background: transparent;
  color: var(--in-gray-600, #4B5563);
  border: 1px dashed var(--in-gray-300, #D1D5DB);
}
.cz-btn--ghost:hover {
  background: var(--in-gray-100, #F3F4F6);
  border-style: solid;
}
.cz-btn--danger {
  background: #FEF2F2;
  color: var(--in-red, #DC2626);
  border: 1px solid #FECACA;
}
.cz-btn--danger:hover {
  background: #FEE2E2;
}
.cz-btn--large {
  padding: 14px 20px;
  font-size: 14px;
}
.cz-btn svg {
  flex-shrink: 0;
}

/* Shapes */
.cz-shapes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.cz-shape-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--in-gray-200, #E5E7EB);
  background: #fff;
  color: var(--in-gray-600, #4B5563);
  cursor: pointer;
  transition: all 0.2s;
}
.cz-shape-btn:hover {
  border-color: var(--in-red, #DC2626);
  color: var(--in-red, #DC2626);
  background: var(--in-red-bg, #FEF2F2);
}

/* Properties */
.cz-tool-group label {
  display: block;
  font-size: 12px;
  color: var(--in-gray-600, #4B5563);
  margin-bottom: 4px;
}
.cz-tool-group input[type="color"] {
  width: 100%;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--in-gray-200, #E5E7EB);
  cursor: pointer;
  margin-bottom: 10px;
}
.cz-tool-group input[type="range"] {
  width: 100%;
  margin-bottom: 10px;
}

/* Canvas Area */
.cz-canvas-area {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.cz-canvas-wrap {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--in-gray-200, #E5E7EB);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
#cz-canvas {
  border-radius: 8px;
  background: #f8f8f8;
  background-image:
    linear-gradient(45deg, #e5e5e5 25%, transparent 25%),
    linear-gradient(-45deg, #e5e5e5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e5e5 75%),
    linear-gradient(-45deg, transparent 75%, #e5e5e5 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}
.cz-canvas-label {
  text-align: center;
  font-size: 11px;
  color: var(--in-gray-400, #9CA3AF);
  margin-top: 8px;
}

/* Sidebar */
.cz-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cz-preview-box {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--in-gray-200, #E5E7EB);
  padding: 16px;
  text-align: center;
}
.cz-preview-box h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--in-gray-700, #374151);
  margin: 0 0 12px;
}
#cz-preview-img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--in-gray-200, #E5E7EB);
}
#cz-preview-placeholder {
  padding: 32px 16px;
  color: var(--in-gray-400, #9CA3AF);
  font-size: 13px;
  border: 2px dashed var(--in-gray-200, #E5E7EB);
  border-radius: 8px;
}
.cz-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Info */
.cz-info {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--in-gray-200, #E5E7EB);
  padding: 16px;
}
.cz-info-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--in-gray-500, #6B7280);
  margin-bottom: 8px;
}
.cz-info-item svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--in-red, #DC2626);
}
.cz-info-item:last-child {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 1024px) {
  .cz-layout {
    grid-template-columns: 1fr;
  }
  .cz-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
  .cz-tool-group {
    flex: 1;
    min-width: 140px;
  }
}
@media (max-width: 640px) {
  .cz-canvas-wrap {
    padding: 8px;
  }
  #cz-canvas {
    max-width: 100%;
    height: auto;
  }
}

/* Fabric.js canvas container override */
.canvas-container {
  border-radius: 8px;
  overflow: hidden;
}
