/* =========================================================
   DecalPro CSS — Flexbox layout (no CSS Grid)
   Copy & paste this whole file
========================================================= */

:root{
  --dp-dock-h: 88px; /* height reserved for bottom dock */
}

/* ===== Layout (Flex) ===== */
.dp-layout{
  display:flex;
  width:100%;
  flex-wrap:nowrap;
  gap:16px;
  height:100vh;
  box-sizing:border-box;
  padding:16px;
  align-items:stretch;
}

/* Give the page some breathing room so content isn't hidden behind the fixed dock */
.dp-layout-parent{
  padding-bottom: calc(var(--dp-dock-h) + 16px);
}
@supports (padding: max(0px)) {
  .dp-layout-parent{
    padding-bottom: calc(var(--dp-dock-h) + env(safe-area-inset-bottom) + 16px);
  }
}

/* Left column */
.dp-sidebar,
.dp-left,
#decalpro-designer{
  flex:0 0 320px;
  width:320px;
  max-width:320px;
  overflow:auto;
  padding-right:4px;
  float:none;
}

/* Right column (designer area container) */
.dp-canvas-area,
.dp-right,
#decalpro-canvas-wrapper{
  position:relative;
  flex:1 1 auto;
  min-width:0;
  background:#f6f7f9;
  border-radius:16px;
  padding:12px;
  display:flex;
  min-height:0;
  float:none;
}

/* Canvas frame */
.dp-canvas-frame{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  flex:1 1 auto;
  min-height:0;
  position:relative;
  width:100%;
  height:60vh;                 /* visible height; adjust if needed */
}

/* Canvas sizing */
#van-canvas,
.dp-canvas-frame{
  width:100%;
  height:100%;
  display:block;
}

/* ===== Boxes ===== */
.dp-box{
  background:#ffffff;
  border:1px solid #e5e7eb;
  border-radius:16px;
  padding:14px;
  margin-bottom:14px;
  box-shadow:0 1px 2px rgba(0,0,0,0.04);
}
.dp-box-title{
  margin:0 0 10px;
  font-size:16px;
  font-weight:700;
}

/* ===== Controls ===== */
.dp-label{
  display:block;
  margin:10px 0 6px;
  font-size:12px;
  color:#555;
  text-transform:uppercase;
  letter-spacing:.02em;
}
.dp-select,
.dp-input{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid #d1d5db;
  font-size:14px;
  background:#fff;
  color:#000;                 /* ensure text is black */
}
.dp-color{
  width:100%;
  height:44px;
  border-radius:12px;
  border:1px solid #d1d5db;
  padding:4px;
  background:#fff;
}

/* ----- Tablet-friendly number steppers ----- */
input[type="number"].dp-input{ -moz-appearance:textfield; }
input[type="number"].dp-input::-webkit-outer-spin-button,
input[type="number"].dp-input::-webkit-inner-spin-button{
  -webkit-appearance:none; margin:0;
}
.dp-stepper{ display:flex; align-items:center; gap:8px; }
.dp-stepper .dp-input{ flex:1 1 0; min-width:0; text-align:center; }
.dp-step{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:44px; height:44px; padding:0 12px;
  border-radius:10px; border:1px solid #d1d5db;
  background:#f9fafb; font-weight:700; font-size:18px; line-height:1;
  cursor:pointer; color:#000; user-select:none; touch-action:manipulation;
}
.dp-step:hover{ background:#f3f4f6; }
.dp-step:active{ transform:translateY(1px); }
.dp-step[disabled]{ opacity:.5; cursor:not-allowed; }

/* ===== Buttons ===== */
.dp-btn{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid #d1d5db;
  background:#f9fafb;
  font-size:15px;
  cursor:pointer;
  margin-top:10px;
  color:#000;                 /* button text black */
}
.dp-btn:hover{ background:#f3f4f6; }
.dp-btn-primary{
  background:#e5e7eb;
  color:#000;
  border-color:#d1d5db;
}
.dp-btn-primary:hover{ background:#dfe3e8; }
.dp-btn-danger{
  background:#fee2e2;
  border-color:#fecaca;
  color:#000;
}

/* Small pill buttons (image/text bars) */
.dp-image-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:36px; height:36px; padding:0 12px;
  border-radius:10px; border:1px solid #d1d5db;
  background:#f9fafb; font-weight:600; cursor:pointer; color:#000;
}
.dp-image-btn:hover{ background:#f3f4f6; }
.dp-image-btn.dp-danger { background:#fee2e2; border-color:#fecaca; color:#000; }
.dp-image-btn.dp-danger:hover { background:#fecaca; color:#000; }

/* ===== Collapsible "Choose your van" box ===== */
#van-chooser-box .dp-van-summary{
  display:none;
  align-items:center;
  gap:12px;
  justify-content:space-between;
}
#van-chooser-box .dp-summary-title{
  margin:0 0 6px;
  font-weight:700;
}
#van-chooser-box .dp-summary-meta{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  font-size:13px;
  color:#555;
}
.dp-color-dot{
  width:18px; height:18px; border-radius:50%; border:1px solid #d1d5db;
  display:inline-block; vertical-align:middle;
}
#van-chooser-box.is-collapsed .dp-van-form{ display:none; }
#van-chooser-box.is-collapsed .dp-van-summary{ display:flex; }
#van-chooser-box.is-collapsed{ padding:12px 14px; }

/* ===== Floating toolbars (default styles) ===== */
.dp-text-floating{
  position:absolute;
  top:58px; left:10px;
  z-index:21;
  display:flex; flex-direction:column; gap:8px;
  width:420px; max-width:calc(100% - 20px);
  padding:10px; background:rgba(255,255,255,0.96);
  border:1px solid #e5e7eb; border-radius:12px;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
}
.dp-text-floating .df-row{ display:flex; gap:8px; }
.dp-text-floating .df-row > *{ flex:1 1 0; min-width:0; }
.dp-toggle{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:40px; height:36px; padding:0 10px;
  border-radius:10px; border:1px solid #d1d5db; background:#f9fafb;
  cursor:pointer; font-weight:700; color:#000;
}
.dp-toggle:hover{ background:#f3f4f6; }
.dp-toggle.active{ background:#e5e7eb; color:#000; border-color:#9ca3af; }
.dp-text-floating.is-disabled .dp-input,
.dp-text-floating.is-disabled .dp-select,
.dp-text-floating.is-disabled .dp-toggle,
.dp-text-floating.is-disabled [data-align],
.dp-text-floating.is-disabled #add-line{
  opacity:.5; pointer-events:none;
}

.dp-image-floating{
  position:absolute;
  top:10px; left:10px;
  z-index:21;
  display:flex; gap:8px; padding:6px;
  background:rgba(255,255,255,0.96);
  border:1px solid #e5e7eb; border-radius:999px;
  box-shadow:0 6px 20px rgba(0,0,0,0.12);
}
.dp-zoom-floating{
  position:absolute;
  top:10px; right:10px;
  z-index:20;
  display:flex; gap:8px; padding:6px;
  background:rgba(255,255,255,0.96);
  border:1px solid #e5e7eb; border-radius:999px;
  box-shadow:0 6px 20px rgba(0,0,0,0.12);
}
.dp-zoom-btn{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:36px; height:36px; padding:0 12px;
  border-radius:10px; border:1px solid #d1d5db;
  background:#f9fafb; font-weight:600; cursor:pointer; color:#000;
}
.dp-zoom-btn:hover{ background:#f3f4f6; }
.dp-zoom-btn:focus{ outline:2px solid #111827; outline-offset:2px; }
#dp-hand-toggle.is-active{ background:#e5e7eb; color:#000; border-color:#9ca3af; }

/* =========================================================
   POINT 2: Bottom dock container (image + text to the LEFT, zoom on RIGHT)
   Works with JS that wraps the toolbars into #dp-bottom-dock .dp-dock-inner
========================================================= */
#dp-bottom-dock{
  position:fixed;
  left:10px; right:10px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index:1000;
  height:auto;
  padding:8px;
  border-radius:12px;
  background:rgba(255,255,255,0.96);
  border:1px solid #e5e7eb;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
}

/* Flex row: image tools, then text tools grow, zoom sticks to right */
#dp-bottom-dock .dp-dock-inner{
  display:flex;
  align-items:center;
  gap:10px;
}

/* When inside the dock, let the toolbars flow (no fixed/absolute) */
#dp-bottom-dock #dp-image-floating,
#dp-bottom-dock #dp-text-floating,
#dp-bottom-dock .dp-zoom-floating{
  position:static !important;
  top:auto !important; left:auto !important; right:auto !important; bottom:auto !important;
  box-shadow:none;                 /* dock provides the chrome */
  background:transparent;          /* dock background handles it */
  border:0;
  border-radius:10px;
  padding:0;                       /* use each child’s own padding if needed */
}

/* Sizing/ordering in dock */
#dp-bottom-dock #dp-image-floating{ flex:0 0 auto; }
#dp-bottom-dock #dp-text-floating{ flex:1 1 480px; min-width:200px; }
#dp-bottom-dock .dp-zoom-floating{ flex:0 0 auto; margin-left:auto; }

/* Keep content comfortable in the docked text panel */
#dp-bottom-dock #dp-text-floating .df-row{ gap:8px; }

/* Fallback if JS dock isn’t present: pin each bar separately to bottom */
#dp-image-floating,
#dp-text-floating,
.dp-zoom-floating{
  position:fixed !important;
  top:auto !important;
  left:10px; right:10px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  border-radius:12px;
}
/* Left/right anchoring for fallback */
#dp-image-floating{ width:auto; left:10px; right:auto; }
.dp-zoom-floating{ width:auto; right:10px; left:auto; }
/* In fallback, keep text from overlapping the sides */
#dp-text-floating{ margin:0 142px; }

/* ===== Responsive adjustments for smaller screens ===== */
@media (max-width:900px){
  .dp-layout{ flex-direction:column; height:auto; }
  .dp-sidebar,
  .dp-left,
  #decalpro-designer{ flex:0 0 auto; width:auto; max-width:none; padding-right:0; }
  .dp-canvas-area,
  .dp-right,
  #decalpro-canvas-wrapper{ min-height:70vh; }

  :root{ --dp-dock-h: 112px; }

  /* In dock: stack text under image when tight */
  #dp-bottom-dock .dp-dock-inner{
    flex-wrap:wrap;
  }
  #dp-bottom-dock #dp-image-floating{ order:1; }
  #dp-bottom-dock #dp-text-floating{ order:2; flex:1 1 100%; }
  #dp-bottom-dock .dp-zoom-floating{ order:3; margin-left:auto; }

  /* Fallback: let text expand fully */
  #dp-text-floating{ margin:0 8px; }
}

/* ===== Hard overrides to beat opinionated themes ===== */
#decalpro-app{ display:flex !important; width:100% !important; max-width:none !important; }
#decalpro-designer{ display:block !important; }
#decalpro-canvas-wrapper{ display:flex !important; width:auto !important; max-width:none !important; }
