/* Shared colour picker (js/color-picker.js) — row of ready colours + "+" sheet.
   Loaded only by pages that use it. Prefix: w-cp- */

/* the native input stays in the page as the value holder, never shown
   (!important: tool code sets style.display='' on some of these inputs) */
.w-cp-native { display: none !important; }

/* a .wdt-group (draw toolbar) that holds a picker row takes the whole line */
.wdt-group.w-cp-host { flex: 1 1 100%; min-width: 0; }
/* Sticker Maker / Shape Frames brush row: the colours get their own centred line above Size/Opacity */
.sm-draw-row > .w-cp-row { flex: 1 1 100%; justify-content: center; }

.w-cp-row {
  display: flex;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
  min-width: 0;
  max-width: 100%;
  padding: 2px;
  scrollbar-width: none;            /* 6 dots fit; sideways swipe only as a safety on very narrow boxes */
}
.w-cp-row::-webkit-scrollbar { display: none; }
.w-cp-dot {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}
.w-cp-dot-in {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
  transition: width .12s, height .12s;
}
.w-cp-dot.active { border-color: #2c2c2c; }
.w-cp-dot.active .w-cp-dot-in { width: 22px; height: 22px; }
.w-cp-dot:focus-visible { outline: 2px solid #e6b800; outline-offset: 1px; }

.w-cp-rainbow .w-cp-dot-in {
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
  position: relative;
}
.w-cp-rainbow .w-cp-dot-in::after {
  content: '+';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font: 800 17px/1 'Nunito', sans-serif;
  text-shadow: 0 0 3px rgba(0, 0, 0, .55);
}

/* ── sheet ── */
.w-cp-back {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(0, 0, 0, .25);   /* light dim: the photo stays visible behind */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  touch-action: none;
}
.w-cp-sheet {
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  background: #fff;
  border: 3px solid #2c2c2c;
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Nunito', sans-serif;
  animation: w-cp-up .18s ease-out;
}
@keyframes w-cp-up { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.w-cp-grip { width: 40px; height: 4px; border-radius: 2px; background: #ddd; margin-bottom: 14px; }

.w-cp-top { display: flex; align-items: center; gap: 12px; width: 100%; }
.w-cp-pair { display: flex; border: 2px solid #2c2c2c; border-radius: 999px; overflow: hidden; flex: 0 0 auto; }
.w-cp-before { width: 36px; height: 32px; border: 0; padding: 0; cursor: pointer; }
.w-cp-after { width: 52px; height: 32px; display: block; }
.w-cp-hex {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 38px;
  padding: 0 12px;
  border: 2px solid #ddd;
  border-radius: 12px;
  background: #f9f9f9;
  color: #999;
  font: 800 15px 'Nunito', sans-serif;
}
.w-cp-hex:focus-within { border-color: #2c2c2c; }
.w-cp-hex input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: #2c2c2c;
  font: 800 16px 'Nunito', sans-serif;   /* 16px: iPhone zooms the page on smaller inputs */
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0;
}

.w-cp-wheel { margin: 18px 0 20px; touch-action: none; cursor: crosshair; }
.w-cp-bar { width: 100%; height: 30px; touch-action: none; cursor: pointer; }

.w-cp-label { width: 100%; margin: 16px 0 6px; font: 700 12px 'Nunito', sans-serif; color: #888; }
.w-cp-recent { width: 100%; }

.w-cp-btns { display: flex; gap: 12px; width: 100%; margin-top: 18px; }
.w-cp-btns button {
  flex: 1;
  height: 48px;
  border: 3px solid #2c2c2c;
  border-radius: 24px;
  font: 800 15px 'Nunito', sans-serif;
  color: #2c2c2c;
  cursor: pointer;
}
.w-cp-cancel { background: #fff; }
.w-cp-cancel:hover { background: #f5f5f5; }
.w-cp-done { background: #FFE566; box-shadow: 3px 3px 0 #2c2c2c; }
.w-cp-done:hover { background: #ffd93d; }
.w-cp-done:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #2c2c2c; }
