/* Size / colour pills for variable products (assets/variation-pills.js).
   The dropdown stays in the page for WooCommerce, visually hidden. */

table.variations.has-pvp,
table.variations.has-pvp tbody,
table.variations.has-pvp tr,
table.variations.has-pvp th,
table.variations.has-pvp td {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

table.variations.has-pvp {
  margin: 0 0 12px !important;
}

table.variations.has-pvp tr + tr {
  margin-top: 12px;
}

/* "Size: Medium" -- the label with the chosen value after it. */
table.variations.has-pvp th label {
  display: block;
  margin: 0 0 8px;
  color: #5b6b7f;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

table.variations.has-pvp th label.has-value::after {
  content: none;
}

.pvp-current:not(:empty)::before {
  content: ": ";
}

.pvp-current {
  color: #1b2735;
  font-weight: 700;
}

table.variations.has-pvp select.pvp-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}

/* Same family as the buy box's Add to cart: a full pill, 1.5px outline in
   the theme colour, bold label. */
.pvp {
  --pvp-c: var(--pdp-primary, var(--primary, #0F766E));
  gap: 8px;
}

/* Short labels (S, M, XL, 32): even columns, so 3 or 13 sizes stay tidy. */
.pvp--grid {
  display: grid;
  /* --pvp-min: set by the script from the longest label. */
  grid-template-columns: repeat(auto-fill, minmax(var(--pvp-min, 64px), 1fr));
}

.pvp--grid .pvp__opt,
.pvp--grid .pvp__more {
  padding: 0 8px;
}

/* Longer labels: each pill its own width, wrapping. */
.pvp--free {
  display: flex;
  flex-wrap: wrap;
}

.pvp__opt,
.pvp__more {
  min-width: 0;
  height: 38px;
  padding: 0 14px;
  overflow: hidden;
  border: 1.5px solid #d6e0ec;
  border-radius: 999px;
  background: #fff;
  color: #1b2735;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.pvp--free .pvp__opt {
  max-width: 100%;
}

.pvp__opt:hover,
.pvp__more:hover {
  border-color: var(--pvp-c);
}

.pvp__opt:focus-visible,
.pvp__more:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--pvp-c) 35%, transparent);
  outline-offset: 2px;
}

/* Chosen: the Add to cart outline, with a light tint so it reads as picked. */
.pvp__opt.is-picked {
  border-color: var(--pvp-c);
  background: color-mix(in srgb, var(--pvp-c) 9%, #fff);
  color: var(--pvp-c);
  box-shadow: inset 0 0 0 .5px var(--pvp-c);
}

/* Folded: options after the 10th wait behind "+N". */
.pvp.is-folded .pvp__extra:not(.is-shown) {
  display: none;
}

.pvp:not(.is-folded) .pvp__more {
  display: none;
}

.pvp__more {
  border-style: dashed;
  color: var(--pvp-c);
}

/* Not available with the other choices, or out of stock. */
.pvp__opt.is-off {
  border-style: dashed;
  background: #f6f8fb;
  color: #9aa7b6;
  text-decoration: line-through;
  cursor: not-allowed;
}

/* WooCommerce keeps a hidden "Clear" link and an empty variation box in the
   flow; together they left ~50px of blank space under the options. Tapping
   the chosen pill again clears it instead. */
table.variations.has-pvp .reset_variations {
  display: none !important;
}

.variations_form:has(table.has-pvp) .single_variation:empty,
.variations_form:has(table.has-pvp) .woocommerce-variation:empty {
  display: none;
}

.variations_form:has(table.has-pvp) .woocommerce-variation-price:empty,
.variations_form:has(table.has-pvp) .woocommerce-variation-description:empty,
.variations_form:has(table.has-pvp) .woocommerce-variation-availability:empty {
  display: none;
}

@media (max-width: 767.98px) {
  .pvp__opt,
  .pvp__more {
    height: 40px;
  }
}
