.root {
  position: relative;
  flex-shrink: 0;
}

.trigger {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 0 0 1px rgba(15, 23, 42, 0.12),
    0 1px 2px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}

.trigger:hover:not(:disabled) {
  transform: scale(1.04);
  box-shadow:
    inset 0 0 0 1px rgba(15, 23, 42, 0.16),
    0 2px 8px rgba(15, 23, 42, 0.12);
}

.trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 220px;
  padding: 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--glass-shadow);
  animation: panelIn 0.15s ease;
}

.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.1);
  transition: transform 0.15s, box-shadow 0.15s;
}

.swatch:hover {
  transform: scale(1.08);
}

.swatchSelected {
  box-shadow:
    inset 0 0 0 1px rgba(15, 23, 42, 0.16),
    0 0 0 2px var(--primary);
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .panel {
    left: auto;
    right: 0;
  }
}
