/**
 * DTF Customizer CSS v6.8.0
 * Layout full-screen inspire CustomInk
 */

#bcs-dtf-app {
  position: fixed;
  inset: 0;
  top: 32px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  background: white;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── TOPBAR ──────────────────────────────────────────── */

.bcs-topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
  z-index: 100;
  background: white;
}

.bcs-topbar-logo {
  font-size: 18px;
  font-weight: 700;
  color: #E8593C;
  letter-spacing: -.02em;
}

.bcs-topbar-center {
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bcs-badge-dtf {
  background: #E8593C;
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: .05em;
}

.bcs-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bcs-topbar-actions button {
  padding: 6px 12px;
  border: 1px solid #eee;
  border-radius: 6px;
  background: white;
  font-size: 13px;
  cursor: pointer;
  color: #555;
  transition: all .1s;
}
.bcs-topbar-actions button:hover { background: #f5f5f5; }

/* ── BUTTONS ─────────────────────────────────────────── */

.bcs-btn-primary {
  background: #E8593C;
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.bcs-btn-primary:hover { background: #C04828; }
.bcs-btn-primary:disabled {
  background: #ddd; color: #999; cursor: not-allowed;
}

/* ── MAIN LAYOUT ─────────────────────────────────────── */

.bcs-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

/* ── TOOLBAR GAUCHE ──────────────────────────────────── */

.bcs-toolbar {
  width: 64px;
  flex: 0 0 64px;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
  gap: 4px;
  background: white;
}

.bcs-tool {
  width: 52px;
  padding: 10px 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 18px;
  color: #888;
  transition: all .15s;
  border-right: 3px solid transparent;
}
.bcs-tool span {
  font-size: 10px;
  color: #aaa;
}
.bcs-tool:hover { background: #f5f5f5; }
.bcs-tool.active {
  background: #fff3f0;
  color: #E8593C;
  border-right-color: #E8593C;
}
.bcs-tool.active span { color: #E8593C; }

/* ── PANEL GAUCHE ────────────────────────────────────── */

.bcs-panel {
  width: 320px;
  flex: 0 0 320px;
  border-right: 1px solid #eee;
  background: white;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.bcs-pane {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}
.bcs-pane.active { display: flex; }

.bcs-pane-header {
  padding: 14px 16px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid #f5f5f5;
}

/* ── DROP ZONE ───────────────────────────────────────── */

.bcs-drop-zone {
  margin: 16px;
  border: 2px dashed #ddd;
  border-radius: 10px;
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  font-size: 13px;
  color: #aaa;
  line-height: 1.6;
}
.bcs-drop-zone:hover,
.bcs-drop-zone.drag-over {
  border-color: #E8593C;
  background: rgba(232,89,60,.04);
  color: #E8593C;
}

/* ── PANEL ROWS ──────────────────────────────────────── */

.bcs-panel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: background .1s;
}
.bcs-panel-row:hover { background: #fafafa; }
.bcs-panel-row-value {
  color: #999;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── ACTION GRID ─────────────────────────────────────── */

.bcs-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 16px;
}
.bcs-action-grid button {
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: white;
  font-size: 12px;
  cursor: pointer;
  color: #555;
  transition: all .1s;
}
.bcs-action-grid button:hover { background: #f5f5f5; }

/* ── SOUS-PANNEAUX ───────────────────────────────────── */

.bcs-subpanel {
  position: absolute;
  top: 0;
  left: 100%;
  width: 280px;
  height: 100%;
  background: white;
  border-left: 1px solid #eee;
  z-index: 50;
  overflow-y: auto;
  transform: translateX(0);
  transition: transform .2s ease;
  pointer-events: none;
  opacity: 0;
}
.bcs-subpanel.open {
  opacity: 1;
  pointer-events: all;
}

.bcs-subpanel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: white;
  font-size: 14px;
  font-weight: 500;
}
.bcs-back {
  background: none;
  border: none;
  color: #E8593C;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.bcs-subpanel-body { padding: 16px; }

/* ── FONTS ───────────────────────────────────────────── */

.bcs-font-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 15px;
  border-bottom: 1px solid #f5f5f5;
  transition: background .1s;
}
.bcs-font-item:hover { background: #fafafa; }
.bcs-font-item.active {
  background: #fff3f0;
  color: #E8593C;
}
.bcs-font-item span { font-size: 13px; color: #ccc; }
.bcs-font-group-label {
  padding: 8px 16px 4px;
  font-size: 10px;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: .1em;
}

/* ── COLORS ──────────────────────────────────────────── */

.bcs-color-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 12px 16px;
}
.bcs-color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .1s;
  box-shadow: 0 0 0 1px rgba(0,0,0,.1);
}
.bcs-color-swatch:hover { transform: scale(1.2); }
.bcs-color-swatch.active {
  border-color: #E8593C;
  transform: scale(1.2);
}
.bcs-color-custom {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
  align-items: center;
}
.bcs-color-custom input[type=color] {
  width: 40px;
  height: 36px;
  border: 1px solid #eee;
  border-radius: 6px;
  cursor: pointer;
  padding: 2px;
}
.bcs-color-custom input[type=text] {
  flex: 1;
  padding: 8px;
  border: 1px solid #eee;
  border-radius: 6px;
  font-size: 13px;
  font-family: monospace;
}

.bcs-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0,0,0,.1);
}

/* ── SLIDERS ─────────────────────────────────────────── */

.bcs-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.bcs-slider-row input[type=range] { flex: 1; }
.bcs-slider-row span {
  font-size: 13px;
  color: #666;
  min-width: 36px;
  text-align: right;
}

/* ── SHAPES ──────────────────────────────────────────── */

.bcs-shape-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
}
.bcs-shape-card {
  border: 1.5px solid #eee;
  border-radius: 8px;
  padding: 10px 6px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}
.bcs-shape-card:hover { border-color: #E8593C; background: #fff5f3; }
.bcs-shape-card.active { border-color: #E8593C; background: #fff5f3; border-width: 2px; }
.bcs-shape-preview {
  font-size: 11px;
  font-weight: 700;
  color: #333;
  font-family: Impact, sans-serif;
  margin-bottom: 4px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bcs-shape-label { font-size: 10px; color: #999; }

/* ── ROTATION PRESETS ────────────────────────────────── */

.bcs-preset-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.bcs-rot-preset {
  padding: 5px 10px;
  border: 1px solid #eee;
  border-radius: 5px;
  background: white;
  font-size: 12px;
  cursor: pointer;
}

/* ── CANVAS AREA ─────────────────────────────────────── */

.bcs-canvas-area {
  flex: 1 1 0%;
  min-width: 0;
  position: relative;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#bcs-product-img {
  max-height: calc(100vh - 220px);
  max-width: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
}

#bcs-canvas {
  position: absolute;
  top: 0; left: 0;
  pointer-events: all;
  cursor: default;
}

#bcs-print-zone {
  position: absolute;
  border: 2px dashed rgba(232,89,60,.6);
  background: rgba(232,89,60,.05);
  border-radius: 4px;
  pointer-events: none;
}

/* ── FLOAT BAR ───────────────────────────────────────── */

#bcs-float-bar {
  position: absolute;
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  display: flex;
  gap: 2px;
  padding: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
  z-index: 10;
}
#bcs-float-bar button {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 5px;
  font-size: 14px;
  color: #555;
}
#bcs-float-bar button:hover { background: #f5f5f5; }
#bcs-float-delete { color: #e44; }

/* ── LAYERS OVERLAY ──────────────────────────────────── */

#bcs-layers-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: white;
  border-top: 1px solid #eee;
  max-height: 200px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}
.bcs-layers-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  border-bottom: 1px solid #f5f5f5;
  position: sticky;
  top: 0;
  background: white;
}
.bcs-layer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #f5f5f5;
  transition: background .1s;
}
.bcs-layer-item:hover { background: #fafafa; }
.bcs-layer-item.selected {
  background: #fff3f0;
  border-left: 3px solid #E8593C;
}
.bcs-layer-thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: #333;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.bcs-layer-name {
  flex: 1;
  font-size: 13px;
  color: #333;
}
.bcs-layer-actions button {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 14px;
  padding: 2px 4px;
}

/* ── VIEWS BAR ───────────────────────────────────────── */

.bcs-views-bar {
  height: 56px;
  border-top: 1px solid #eee;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-shrink: 0;
}
.bcs-view-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 8px;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  opacity: .6;
}
.bcs-view-thumb.active {
  border-bottom-color: #E8593C;
  opacity: 1;
}
.bcs-view-thumb img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 3px;
}
.bcs-view-thumb span { font-size: 11px; color: #666; }

/* ── BOTTOM BAR ──────────────────────────────────────── */

.bcs-bottom-bar {
  height: 48px;
  border-top: 1px solid #eee;
  background: white;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  font-size: 13px;
  flex-shrink: 0;
  color: #555;
}
.bcs-bottom-bar select {
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 12px;
}
.bcs-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.bcs-badge-small { background: #e8f4fc; color: #1a6a9a; }
.bcs-badge-large { background: #fff0ec; color: #C04828; }
.bcs-technique { margin-left: auto; color: #aaa; font-size: 12px; }

/* ── TEXT INPUT ───────────────────────────────────────── */

.bcs-text-add-mode {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bcs-text-add-mode input {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
}
.bcs-text-add-mode input:focus { border-color: #E8593C; }

#bcs-text-edit-input {
  margin: 12px 16px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  width: calc(100% - 32px);
  box-sizing: border-box;
  outline: none;
}
#bcs-text-edit-input:focus { border-color: #E8593C; }

/* ── DPI BADGES ──────────────────────────────────────── */

#bcs-dpi-badge {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
}
.bcs-dpi-good { color: #2a7a3b; background: #e8f8ed; }
.bcs-dpi-warn { color: #a67a00; background: #fff8e0; }
.bcs-dpi-bad  { color: #c04828; background: #fff0ec; }

#bcs-vectorize-banner {
  padding: 12px 16px;
  background: #fff8e0;
  border-bottom: 1px solid #f0e8c0;
  font-size: 13px;
  color: #8a6d00;
}
#bcs-vectorize-banner button {
  display: block;
  margin-top: 8px;
  padding: 6px 14px;
  border: 1px solid #E8593C;
  border-radius: 6px;
  background: white;
  color: #E8593C;
  font-size: 12px;
  cursor: pointer;
}

/* ── TAGS IA ─────────────────────────────────────────── */

.bcs-style-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
}
.bcs-tag {
  padding: 5px 12px;
  border: 1px solid #ddd;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all .1s;
  color: #555;
}
.bcs-tag.active {
  background: #E8593C;
  color: white;
  border-color: #E8593C;
}

/* ── AI CARDS ────────────────────────────────────────── */

.bcs-ai-card {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 16px;
  margin: 8px 16px;
  cursor: pointer;
  transition: all .15s;
}
.bcs-ai-card:hover { border-color: #E8593C; background: #fff5f3; }
.bcs-ai-card-preview {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  min-height: 32px;
}
.bcs-ai-card-meta { font-size: 12px; color: #aaa; }
.bcs-ai-card button {
  margin-top: 10px;
  padding: 6px 14px;
  border: 1px solid #E8593C;
  border-radius: 6px;
  background: white;
  color: #E8593C;
  font-size: 12px;
  cursor: pointer;
}

/* ── MISC ────────────────────────────────────────────── */

.bcs-dtf-hint {
  font-size: 11px;
  color: #aaa;
  padding: 4px 0;
  margin: 0;
}

#bcs-undo:disabled, #bcs-redo:disabled { opacity: .35; }

#bcs-ai-description {
  margin: 12px 16px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  resize: vertical;
  min-height: 80px;
  width: calc(100% - 32px);
  box-sizing: border-box;
  outline: none;
  font-family: inherit;
}
#bcs-ai-description:focus { border-color: #E8593C; }

#bcs-browse-btn {
  display: block;
  margin: 0 16px 16px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  width: calc(100% - 32px);
}
#bcs-browse-btn:hover { background: #f5f5f5; }

/* ── MODAL ───────────────────────────────────────────── */

.bcs-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bcs-modal-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  width: 380px;
  max-width: 90vw;
  position: relative;
}
.bcs-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #999;
}

#bcs-vote-url {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  margin: 8px 0;
  box-sizing: border-box;
}

#bcs-collection-list {
  padding: 12px 16px;
  max-height: 300px;
  overflow-y: auto;
}
.bcs-collection-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
}
.bcs-collection-item input[type=checkbox] {
  accent-color: #E8593C;
}
.bcs-collection-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
}

#bcs-presets-list, #bcs-history-list {
  padding: 8px 16px;
}
.bcs-preset-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13px;
}
.bcs-preset-item button {
  background: none;
  border: none;
  color: #E8593C;
  cursor: pointer;
  font-size: 12px;
}

#bcs-save-preset-btn {
  display: block;
  margin: 8px 16px;
  padding: 8px;
  border: 1px dashed #ddd;
  border-radius: 8px;
  background: white;
  font-size: 13px;
  cursor: pointer;
  width: calc(100% - 32px);
  text-align: center;
}
#bcs-save-preset-btn:hover { border-color: #E8593C; color: #E8593C; }

/* ── RESPONSIVE ──────────────────────────────────────── */

@media (max-width: 768px) {
  .bcs-panel { width: 260px; flex: 0 0 260px; }
  .bcs-toolbar { width: 52px; flex: 0 0 52px; }
  .bcs-tool span { display: none; }
}

/* CTA bouton Personnaliser (panel produit) */
.bcs-customizer-cta {
    margin-bottom: 12px;
}
.bcs-btn-personnaliser {
    display: inline-block;
    width: 100%;
    padding: 14px 24px;
    background: #E8593C;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    border-radius: 50px;
    text-decoration: none;
    transition: background .2s;
}
.bcs-btn-personnaliser:hover {
    background: #c94a30;
    color: #fff;
}
