.cv-variation-buttons {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 15px 0;
    align-items: stretch;
}

/* Remove the old full-width styling */
/* .cv-variation-button-wrapper:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.cv-variation-button-wrapper:last-child:nth-child(odd) .cv-variation-button {
    max-width: 100%;
} */

/* Add new styling for odd variations */
.cv-variation-buttons.has-odd-variations .cv-variation-button-wrapper:last-child {
    grid-column: 1;
}

.cv-variation-button-wrapper {
    position: relative;
    padding-bottom: 14.4px;
    padding-top: 14.4px;
}

.cv-variation-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 5px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 160px;
    margin: 0 auto;
    position: relative;
    height: 100%;
}

.cv-variation-button:hover {
    border-color: #2271b1;
}

.cv-variation-button.selected {
    border-color: #2271b1;
}

.cv-variation-button.selected::after {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #2271b1;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    background-image: url('data:image/svg+xml;utf8,<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 7.5L6.5 10L10 4" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
}

.cv-variation-name {
    font-weight: 600;
    font-size: 14px;
    margin-top: 8px;
    margin-bottom: 8px;
    text-align: center;
}

.cv-variation-price {
    font-size: 0.9em;
    color: #666;
}

.cv-variation-price.popular {
    color: #04d664;
    font-weight: 700;
}

.cv-popular-badge {
    position: absolute;
    left: 50%;
    bottom: -11px;
    top: auto;
    transform: translateX(-50%);
    background: #04d664;
    color: #fff;
    padding: 2.4px 12.8px 2.4px 12.8px;
    border-radius: 12.8px;
    font-size: 0.76em;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    white-space: nowrap;
    z-index: 2;
}

.cv-price-badge-top {
    position: absolute;
    left: 50%;
    top: -11px;
    transform: translateX(-50%);
    background: #2271b1;
    color: #fff;
    padding: 2.4px 12.8px 2.4px 12.8px;
    border-radius: 12.8px;
    font-size: 0.76em;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    white-space: nowrap;
    z-index: 2;
}

.cv-variation-button.out-of-stock {
    opacity: 0.4;
    cursor: not-allowed;
}

.cv-stock-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.cv-stock-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.cv-variation-button.out-of-stock:hover .cv-stock-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design */
@media (max-width: 600px) {
    .cv-variation-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
    .cv-variation-button {
        min-width: 0;
        font-size: 0.85em;
        padding: 6px 1px;
    }
    .cv-variation-image {
        width: 32px !important;
        height: 32px !important;
    }
    .cv-variation-name {
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    .cv-variation-buttons {
        gap: 5px;
    }

    .cv-variation-button {
        padding: 6px 12px;
        min-width: 80px;
        font-size: 0.8em;
    }
}

.cv-discount-label {
    display: block;
    color: #04d664;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 2px;
    margin-top: 4px;
}

.cv-variation-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 1.08em;
    color: #222;
}

.variations_form label[for^="attribute_"],
.variations_form .label[for^="attribute_"] {
    display: none !important;
}

.variations tr > th.label { display: none !important; }
.variations tr > td.value { width: 100%; }

.cv-variation-name-with-image {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    margin-bottom: 4px;
    width: 100%;
} 