/* One tappable preview row; the full palette is available on demand. */
.product-card:has(.card-color-menu[open]) { z-index: 4; }
.card-color-menu { position: relative; margin: 8px 0 0; border: 0; padding: 0; }
.card-color-menu > summary {
  display: flex; align-items: center; gap: 8px; width: fit-content;
  max-width: 100%; min-width: 44px; min-height: 44px; margin: 0;
  padding: 0 4px; border: 0; border-radius: 6px; list-style: none;
  color: var(--green); cursor: pointer; touch-action: manipulation;
}
.card-color-menu > summary::-webkit-details-marker { display: none; }
.card-color-menu > summary::after { content: none; }
.card-color-menu > summary:hover, .card-color-menu[open] > summary { background: var(--soft); }
.card-color-menu > summary:focus-visible, .card-color-options > a:focus-visible {
  outline: 2px solid var(--green); outline-offset: 3px;
}
.card-color-preview { display: flex; align-items: center; gap: 6px; }
.card-color-preview .color-dot { display: block; width: 18px; height: 18px; flex: 0 0 18px; }
.card-color-count { font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; }
.card-color-menu > .card-color-options {
  position: absolute; top: calc(100% + 4px); inset-inline: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 4px; max-height: 240px; overflow-y: auto; overscroll-behavior: contain;
  margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--studio-paper, #fff); box-shadow: 0 8px 24px var(--brand-shadow-20,#172b2520);
}
.card-color-menu:not([open]) > .card-color-options { display: none; }
.card-color-options > a {
  display: flex; justify-content: center; align-items: center;
  min-width: 44px; min-height: 44px; padding: 6px; gap: 0;
}
.card-color-options > a:hover { border-color: var(--green); }
.card-color-options .color-dot { width: 22px; height: 22px; }
