/* CF GF Colour Picker field styles */

.ginput_container_colour_picker.cf-cp-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Prevent the container itself from stretching to full width */
  width: fit-content;
  /*max-width: 100%;*/
}

/* The native colour swatch.
   !important on width/height overrides GF's blanket `input { width: 100% }` rule. */
.cf-cp-swatch {
  -webkit-appearance: none;
  appearance: none;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  border: 1px solid #c4c4c4 !important;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.cf-cp-swatch::-webkit-color-swatch-wrapper {
  padding: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.cf-cp-swatch::-webkit-color-swatch {
  border: none;
  border-radius: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.cf-cp-swatch::-moz-color-swatch {
  border: none;
  border-radius: 0;
  width: 100%;
  height: 100%;
}

/* The hex text input */
.cf-cp-hex {
  width: 96px !important;
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border: 1px solid #c4c4c4;
  border-radius: 6px;
  line-height: 1;
}

.cf-cp-hex:focus {
  outline: 2px solid #2050ce;
  outline-offset: 1px;
  border-color: #2050ce;
}

/* Validation error state (GF adds gfield_error to the li wrapper) */
.gfield_error .cf-cp-swatch,
.gfield_error .cf-cp-hex {
  border-color: #c02b0a;
}
