/* Convert the variations table to flex layout */
table.variations {
    display: block;
    width: 100%;
}

table.variations tbody {
    display: flex;
    flex-direction: column;
    width: 100%;
}

table.variations tr {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 15px;
}

/* Style the label to appear above variations */
table.variations th.label {
    display: block;
    width: 100%;
    text-align: left;
    padding-bottom: 8px;
}

table.variations td.value {
    display: block;
    width: 100%;
    padding: 0;
}

/* Style the variation buttons group */
.variation-buttons-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Style the individual variation buttons */
.variation-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border: 2px solid #ddd;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.variation-button:hover {
    border-color: #999;
}

.variation-button.selected {
    border-color: #000;
}

.variation-button input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.variation-button img {
    max-width: 60px;
    height: auto;
    margin-bottom: 5px;
}

.variation-name {
    font-size: 0.9em;
    text-align: center;
}

/* Hide the reset variations link until needed */
.reset_variations {
    display: inline-block;
    margin-top: 10px;
}