/* Product variant controls; native selects remain available without JavaScript. */
.variant-choice-native, .variant-choice-native-label { display: none !important; }
.variant-choice { margin: 0 0 18px; }
.variant-choice-label { margin: 0 0 9px; color: #333; font-size: 15px; font-weight: 600; }
.variant-choice-current { font-weight: 400; }
.variant-choice-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; max-width: 340px; }
.variant-choice-options > .variant-choice-button { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.variant-choice-options > .variant-choice-swatch { justify-self: center; }
.variant-choice-button { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid #d8d8d8; border-radius: 6px; background: #fff; color: #292929; font: inherit; line-height: 1.2; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.variant-choice-button:hover { border-color: #aa8c00; }
.variant-choice-button.is-selected { border: 2px solid #d3ab00; padding: 7px 11px; background: #fffbe8; box-shadow: 0 0 0 1px #ffdf48; }
.variant-choice-button:focus-visible { outline: 3px solid #376d9c; outline-offset: 3px; }
.variant-choice-button:disabled { opacity: .4; cursor: not-allowed; background: #f2f2f2; text-decoration: line-through; box-shadow: none; }
.variant-choice-button.variant-choice-swatch { width: 46px; height: 46px; min-width: 46px; padding: 4px; border-radius: 50%; }
.variant-choice-swatch-fill { display: block; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); }
.variant-choice-swatch-fill.is-transparent { background: conic-gradient(#d4d8da 25%, #fff 0 50%, #d4d8da 0 75%, #fff 0); background-size: 18px 18px; }
.variant-choice-static { cursor: default; }
@media (max-width: 768px) { .variant-choice-options { gap: 9px; } .variant-choice { margin-bottom: 17px; } }

@media (max-width: 340px) { .variant-choice-options { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Compact variant controls: the five-column grid matches the width of the cart and quick-order buttons. */
.js_shop_id .variant-choice .variant-choice-options { gap: 6px; max-width: 262px; }
.js_shop_id .variant-choice .variant-choice-button { min-width: 0; min-height: 38px; padding: 4px 2px; font-size: 14px; border-radius: 5px; }
.js_shop_id .variant-choice .variant-choice-button.is-selected { padding: 3px 1px; }
.js_shop_id .variant-choice .variant-choice-button.variant-choice-swatch { width: 38px; height: 38px; min-width: 38px; min-height: 38px; padding: 3px; border-radius: 50%; }
.js_shop_id .variant-choice .variant-choice-button.variant-choice-swatch.is-selected { padding: 2px; }
.js_shop_id .variant-choice .variant-choice-swatch-fill { width: 28px; height: 28px; flex-basis: 28px; }
.js_shop_id .variant-choice .variant-choice-swatch-fill.is-transparent { background-size: 14px 14px; }
.js_shop_id .variant-choice .variant-choice-label { margin-bottom: 7px; }
.js_shop_id .variant-choice { margin-bottom: 14px; }

/* Text values on one line: equal cells sized by the longest value (shop-variant-controls.js sets --cell/--cols). */
.js_shop_id .variant-choice .variant-choice-options.is-measure { display: flex; flex-wrap: wrap; }
.js_shop_id .variant-choice .variant-choice-options.is-measure > .variant-choice-button { width: auto; white-space: nowrap; padding: 4px 12px; }
.js_shop_id .variant-choice .variant-choice-options.is-text { grid-template-columns: repeat(var(--cols, 2), var(--cell, auto)); }
.js_shop_id .variant-choice .variant-choice-options.is-text > .variant-choice-button { white-space: nowrap; overflow-wrap: normal; padding-left: 10px; padding-right: 10px; }

/* Colour name pops up on hover, no permanent label. */
/* Color name above a circle: on hover with a mouse, after a tap on touch screens (.is-tip from shop-variant-controls.js). */
.js_shop_id .variant-choice-swatch { position: relative; overflow: visible; }
.js_shop_id .variant-choice-swatch::after,
.js_shop_id .variant-choice-swatch::before { position: absolute; left: 50%; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s; z-index: 30; }
.js_shop_id .variant-choice-swatch::after { content: attr(aria-label); bottom: calc(100% + 8px); transform: translateX(-50%); padding: 4px 8px; border-radius: 4px; background: #333; color: #fff; font-size: 12px; line-height: 1.3; font-weight: 400; white-space: nowrap; text-decoration: none; }
.js_shop_id .variant-choice-swatch::before { content: ""; bottom: calc(100% + 3px); transform: translateX(-50%); border: 5px solid transparent; border-bottom: 0; border-top-color: #333; }
.js_shop_id .variant-choice-swatch.is-tip::after, .js_shop_id .variant-choice-swatch.is-tip::before { opacity: 1; visibility: visible; }
.js_shop_id .variant-choice-swatch.tip-start::after { left: -4px; transform: none; }
.js_shop_id .variant-choice-swatch.tip-end::after { left: auto; right: -4px; transform: none; }
@media (hover: hover) {
    .js_shop_id .variant-choice-swatch:hover::after, .js_shop_id .variant-choice-swatch:hover::before,
    .js_shop_id .variant-choice-swatch:focus-visible::after, .js_shop_id .variant-choice-swatch:focus-visible::before { opacity: 1; visibility: visible; }
}

/* Links to separate goods (shop.view.modifications.php): look like the variant buttons. */
.variant-choice-options > a.variant-choice-button, .variant-choice-options > a.variant-choice-button:hover, .variant-choice-options > a.variant-choice-button:focus { color: #292929; text-decoration: none; }
.variant-choice-links .variant-choice-button.is-selected { cursor: default; }
.variant-choice-button.is-missing { opacity: .4; cursor: not-allowed; background: #f2f2f2; box-shadow: none; }
.variant-choice-button.is-missing:hover { border-color: #d8d8d8; }
