
/* =====================================================
   COLOR DRAWER — right side panel
   ===================================================== */

/* --- Wrapper: always in DOM, covers screen when visible --- */
html body .fh-color-drawer[data-fh-color-drawer] {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: visibility 0s linear 0.3s !important;
}
html body .fh-color-drawer.is-visible[data-fh-color-drawer] {
  visibility: visible !important;
  pointer-events: auto !important;
  transition: visibility 0s linear 0s !important;
}

/* --- Overlay --- */
html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,0.12) !important;
  backdrop-filter: none !important;
  z-index: 1 !important;
  pointer-events: auto !important;
  cursor: default !important;
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
}
html body .fh-color-drawer.is-visible[data-fh-color-drawer] .fh-color-drawer__overlay {
  opacity: 1 !important;
}

/* --- Drawer panel --- */
html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__content {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  width: 620px !important;
  max-width: 92vw !important;
  background: #FAF8F6 !important;
  border-radius: 0 !important;
  border: none !important;
  border-left: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: -4px 0 25px rgba(0,0,0,0.12) !important;
  padding: 0 !important;
  z-index: 2 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  transform: translateX(100%) !important;
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) !important;
  will-change: transform !important;
  -webkit-backface-visibility: hidden !important;
  backface-visibility: hidden !important;
}
html body .fh-color-drawer.is-visible[data-fh-color-drawer] .fh-color-drawer__content {
  transform: translateX(0) !important;
}

/* --- Header area --- */
html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__header-area {
  flex-shrink: 0 !important;
  padding: 24px 24px 16px 24px !important;
  display: block !important;
}

html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__title-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 14px !important;
}

html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__select-title {
  font-family: "Sainte Colombe", serif !important;
  font-size: 24px !important;
  font-weight: 300 !important;
  letter-spacing: 0 !important;
  color: #111 !important;
}

html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__close {
  background: none !important;
  border: 1px solid rgba(0,0,0,0.25) !important;
  border-radius: 50% !important;
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 20px !important;
  cursor: pointer !important;
  opacity: 0.55 !important;
  line-height: 1 !important;
  padding: 0 !important;
  color: #111 !important;
  position: relative !important;
  top: -6px !important;
  transition: opacity 0.2s, border-color 0.2s !important;
}
html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__close:hover {
  opacity: 1 !important;
  border-color: rgba(0,0,0,0.45) !important;
}

/* --- Category nav pills --- */
html body .fh-color-drawer[data-fh-color-drawer] .fh-color-cats,
html body .fh-color-drawer[data-fh-color-drawer] [data-fh-color-cats],
html body .fh-color-cats[data-fh-color-cats] {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
}

/* Pill spacing fallback via margin */
html body .fh-color-cat-btn + .fh-color-cat-btn {
  margin-left: 0 !important;
}
html body .fh-color-cat-btn {
  margin: 0 4px 4px 0 !important;
}

html body .fh-color-cat-btn {
  display: inline-flex !important;
  align-items: center !important;
  padding: 4px 11px !important;
  font-size: 11px !important;
  font-family: inherit !important;
  letter-spacing: 0.01em !important;
  border: 1px solid rgba(0,0,0,0.18) !important;
  border-radius: 3px !important;
  background: transparent !important;
  color: #444 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: background 0.15s, color 0.15s, border-color 0.15s !important;
  line-height: 1.5 !important;
  text-transform: none !important;
}
html body .fh-color-cat-btn:hover {
  border-color: rgba(0,0,0,0.40) !important;
}
html body .fh-color-cat-btn.is-active {
  background: #2a2a2a !important;
  color: #fff !important;
  border-color: #2a2a2a !important;
}

/* --- Divider --- */
html body .fh-color-drawer__grid-divider {
  flex-shrink: 0 !important;
  height: 1px !important;
  background: rgba(0,0,0,0.10) !important;
  margin: 0 !important;
  display: block !important;
}

/* --- Scrollable color grid --- */
html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__grid {
  flex: 1 !important;
  overflow-y: auto !important;
  max-height: none !important;
  padding: 0 24px !important;
  margin: 0 !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(0,0,0,0.12) transparent !important;
}
html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__grid::-webkit-scrollbar {
  width: 5px !important;
  display: block !important;
}
html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__grid::-webkit-scrollbar-track {
  background: transparent !important;
}
html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__grid::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12) !important;
  border-radius: 3px !important;
}

/* --- Color grid list — 4 columns --- */
html body .fh-color-drawer[data-fh-color-drawer] .fh-color-grid-list {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  column-gap: 16px !important;
  row-gap: 10px !important;
  padding-bottom: 12px !important;
}

/* --- Group headings --- */
html body .fh-color-group-heading {
  grid-column: 1 / -1 !important;
  display: block !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  color: #888 !important;
  padding: 14px 0 !important;
  margin: 0 !important;
  border-top: 1px solid rgba(0,0,0,0.06) !important;
  border-bottom: none !important;
  background: transparent !important;
  width: 100% !important;
}
html body .fh-color-group-heading:first-child {
  padding-top: 14px !important;
  border-top: none !important;
}

/* --- Color chip --- */
html body .fh-color-drawer[data-fh-color-drawer] .fh-color-chip {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 3px 0 !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  font-size: 13px !important;
  text-align: left !important;
  font-family: inherit !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  outline: none !important;
  box-shadow: none !important;
}

html body .fh-color-drawer[data-fh-color-drawer] .fh-color-chip__circle {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  flex-shrink: 0 !important;
}

html body .fh-color-drawer[data-fh-color-drawer] .fh-color-chip__label {
  line-height: 1.2 !important;
  max-width: 90px !important;
  white-space: normal !important;
  word-break: break-word !important;
  color: #333 !important;
  font-size: 13px !important;
}

html body .fh-color-drawer[data-fh-color-drawer] .fh-color-chip:hover .fh-color-chip__circle {
  box-shadow: 0 0 0 2px rgba(0,0,0,0.06) !important;
}
html body .fh-color-drawer[data-fh-color-drawer] .fh-color-chip.is-selected .fh-color-chip__circle {
  border-color: #2a2a2a !important;
  box-shadow: 0 0 0 2px rgba(42,42,42,0.30) !important;
}

/* --- Custom HEX — sticky bottom --- */
html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__custom-hex {
  flex-shrink: 0 !important;
  border-top: 1px solid rgba(0,0,0,0.08) !important;
  padding: 14px 24px !important;
  margin: 0 !important;
  background: #FAF8F6 !important;
  display: block !important;
}

html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__custom-hex-label {
  font-size: 13px !important;
  margin-bottom: 8px !important;
  color: #555 !important;
}

html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__custom-hex-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__custom-hex-input {
  width: 110px !important;
  height: 34px !important;
  padding: 4px 8px !important;
  border-radius: 0 !important;
  border: 1px solid #ccc !important;
  font-size: 14px !important;
}

html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__custom-hex-apply {
  height: 34px !important;
  padding: 0 14px !important;
  border-radius: 0 !important;
  background: #2a2a2a !important;
  color: #fff !important;
  border: none !important;
  cursor: pointer !important;
  font-size: 13px !important;
}

/* --- Hide footer --- */
html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__footer {
  display: none !important;
}

/* --- Mobile: full width --- */
@media (max-width: 999px) {
  html body .fh-color-drawer[data-fh-color-drawer] .fh-color-drawer__content {
    width: 100vw !important;
    max-width: 100vw !important;
  }
  html body .fh-color-drawer[data-fh-color-drawer] .fh-color-grid-list {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* --- Body scroll lock --- */
body.fh-color-drawer-open,
body.js-drawer-open {
  overflow: hidden !important;
}
