/* Default rendering: extra rows of table.variations with plain selects, styled by the theme like any attribute. */
.variations_form .echo-choice-replaced,
.variations_form tr.echo-choice-row[hidden],
.variations_form .echo-choice-group[hidden] {
    display: none !important;
}
/* Swatch-plugin controls drawn by Echo: the plugin's own CSS styles the buttons and tiles. */
.variations_form .echo-choice-control {
    overflow: visible;
}
.variations_form .echo-choice-control input.echo-choice-input {
    display: none;
}
.variations_form .echo-choice-tiles::after {
    content: "";
    display: table;
    clear: both;
}
.variations_form .echo-choice-tiles .echo-choice-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    font-size: 11px;
    text-align: center;
}
.variations_form .echo-choice-chosen {
    clear: both;
    padding-top: 4px;
}
.variations_form .echo-choice-chosen:empty {
    display: none;
}

/* Fallback when the native select is not in a table row: plain cards. */
.echo-conditional-choices .echo-choice-plain {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}
.echo-choice-plain + .echo-choice-plain legend {
    margin: 1em 0 .5em;
    font-weight: bold;
}
.echo-choice-plain .echo-choice-buttons, .echo-choice-plain .echo-choice-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.echo-choice-plain .echo-choice-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(118px, 100%), 1fr));
    max-height: 430px;
    overflow-y: auto;
    padding: 3px;
}
.variations_form .echo-choice-card {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin: 0;
    border: 1px solid #d8d8d8;
    background: #fff;
    color: #333;
    padding: 8px 14px;
    cursor: pointer;
    line-height: 1.25;
}
.echo-choice-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.echo-choice-plain .echo-choice-swatches .echo-choice-card {
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    font-size: 12px;
    text-align: center;
}
.echo-choice-card img {
    width: 88px;
    height: 88px;
    object-fit: cover;
}
.echo-choice-card:has(input:checked) {
    box-shadow: inset 0 0 0 2px #777;
}
.echo-choice-card:has(input:focus-visible) {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}
.echo-choice-card:has(input:disabled) {
    opacity: .5;
    cursor: default;
}
