/* Universal variation swatches */

/* Disabled state */
.sf-disabled-swatches {
  opacity: 0.5;
  pointer-events: none;
}

.sf-variation-swatches {
  width:100%;
  margin: 0;
  order:1;
}
.reset_variations {

  position:absolute;
  bottom:1px;
  right:0;


  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:flex-start;
  gap:1px;
  margin:0;
  order:2;
}
.reset_variations::before {
  content: "x";
  font-size:0.9em;
  color:inherit;
  margin-right:5px;
}

/* ── Panel rich swatch items ─────────────────────────────── */

.sf-panel-colors__swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 2 columns on mobile, 3 on desktop */
  gap: 8px;
}
@media  screen and (max-width:480px) {
  .sf-panel-colors__swatches {
    grid-template-columns: repeat(2, minmax(50%, 1fr)); /* 2 columns on mobile */
    gap:4;
  }
}

.sf-panel-color-item {
  display: flex;
  flex-direction:column;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}

.sf-panel-color-item:hover {
  border-color: rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.03);
}

.sf-panel-color-item.is-active {
  border-color: #111;
  background: rgba(0, 0, 0, 0.04);
}

.sf-panel-color-item__swatch {
  flex-shrink: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 200/120;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.sf-panel-color-item__swatch img,
.sf-panel-color-item__swatch span {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sf-panel-color-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-inline-start:12px;
}
@media screen and (max-width: 480px) {
  .sf-panel-color-item__info {
    padding-inline-start:0;
  }
}

.sf-panel-color-item__name {
  font-weight: 600;
  font-size: 0.9em;
}

.sf-panel-color-item__description,
.sf-panel-color-item__hex,
.sf-panel-color-item__code,
.sf-panel-color-item__slug {
  font-size: 0.8em;
  color: rgba(0, 0, 0, 0.55);
}

/* ──────────────────────────────────────────────────────────── */

/* Prevent flash of default Woo select for swatch-enabled attributes */
form.variations_form select[name^="attribute_pa_"] {
  visibility: hidden;
}

.sf-variation-swatches__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom:10px;
}

.sf-variation-swatches a {
  text-decoration: none;
  color: inherit;
  cursor:pointer;
  font-size:0.9em;
}
.sf-variation-swatches a:hover {
  color:var(--theme-palette-color-2);
}

/* swatch button */
.sf-variation-swatch {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  padding: 0;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.sf-variation-swatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}

.sf-variation-swatch.is-active {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.sf-variation-swatch.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sf-variation-swatch.is-disabled::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 4px;
  background: linear-gradient(
    45deg,
    transparent 47%,
    rgba(0, 0, 0, 0.45) 48%,
    rgba(0, 0, 0, 0.45) 52%,
    transparent 53%
  );
}
