.jkcs-wrap {
  --jkcs-size: 30px;
  --jkcs-radius: 50%;
  --jkcs-accent: #111827;
  --jkcs-muted: #6b7280;
  --jkcs-border: rgba(17, 24, 39, 0.14);
  --jkcs-shadow: 0 12px 26px rgba(17, 24, 39, 0.12);
  --jkcs-size-button-min-width: 44px;
  --jkcs-size-button-height: 34px;
  --jkcs-size-button-radius: 999px;
  width: 100%;
}

.jkcs-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.jkcs-heading {
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.jkcs-selected {
  color: var(--jkcs-muted);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.jkcs-selected.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.jkcs-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.jkcs-swatch {
  position: relative;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transform: translateY(0) scale(1);
  transition: transform 220ms cubic-bezier(.2,.85,.25,1.2), opacity 180ms ease, border-color 180ms ease, color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.jkcs-swatch:hover,
.jkcs-swatch:focus-visible {
  outline: none;
  transform: translateY(-2px) scale(1.04);
}

.jkcs-swatch.is-active {
  background: transparent;
  box-shadow: none;
  transform: translateY(-1px) scale(1.16);
}

.jkcs-color-button {
  width: calc(var(--jkcs-size) + 8px);
  height: calc(var(--jkcs-size) + 8px);
  padding: 4px;
  border-radius: calc(var(--jkcs-radius) + 8px);
}

.jkcs-color {
  position: relative;
  display: block;
  width: var(--jkcs-size);
  height: var(--jkcs-size);
  border-radius: var(--jkcs-radius);
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.14);
  transition: transform 220ms cubic-bezier(.2,.85,.25,1.2), border-color 180ms ease;
}

.jkcs-swatch.is-light .jkcs-color {
  border-color: rgba(17, 24, 39, 0.24);
}

.jkcs-size-button {
  min-width: var(--jkcs-size-button-min-width);
  height: var(--jkcs-size-button-height);
  padding: 0 14px;
  border: 1px solid rgba(17, 24, 39, 0.18);
  border-radius: var(--jkcs-size-button-radius);
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
  background: transparent;
}

.jkcs-size-button:hover,
.jkcs-size-button:focus-visible {
  border-color: rgba(17, 24, 39, 0.34);
}

.jkcs-size-button.is-active {
  background: transparent;
  color: #111827;
  border-color: rgba(17, 24, 39, 0.34);
}

.jkcs-size-label {
  display: block;
  transform: translateY(0);
}

.jkcs-swatch.is-disabled {
  cursor: not-allowed;
  opacity: 0.34;
  filter: grayscale(0.45);
  transform: none;
  box-shadow: none;
}

.jkcs-color-button.is-disabled .jkcs-color::before,
.jkcs-size-button.is-disabled::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 12%;
  right: 12%;
  height: 2px;
  background: rgba(17, 24, 39, 0.55);
  transform: rotate(-35deg);
  z-index: 2;
}

.jkcs-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  z-index: 5;
  padding: 7px 9px;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(17, 24, 39, .22);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(6px) scale(.96);
  transition: opacity 180ms ease, transform 180ms ease;
}

.jkcs-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: inherit;
  transform: translate(-50%, -50%) rotate(45deg);
}

.jkcs-swatch:hover .jkcs-tooltip,
.jkcs-swatch:focus-visible .jkcs-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.jkcs-empty {
  margin-top: 8px;
  color: var(--jkcs-muted);
  font-size: 13px;
}

.jkcs-original-hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .jkcs-swatch,
  .jkcs-selected,
  .jkcs-tooltip,
  .jkcs-color {
    transition: none;
  }
}

/* Elementor Loop Grid / product-card swatches. These are display-only and do not require a variation form. */
.jkcs-loop-wrap {
  width: auto;
}

.jkcs-loop-topline {
  margin-bottom: 8px;
}

.jkcs-loop-swatches {
  gap: var(--jkcs-loop-gap, 6px);
}

.jkcs-loop-swatch {
  cursor: default;
}

.jkcs-loop-swatch:hover,
.jkcs-loop-swatch:focus-visible {
  transform: translateY(-1px) scale(1.04);
}

.jkcs-loop-wrap .jkcs-color-button {
  width: calc(var(--jkcs-size) + 6px);
  height: calc(var(--jkcs-size) + 6px);
  padding: 3px;
}
