.brxe-block.card-product {
    display: grid;
    grid-template-rows: auto 1fr;
}

.card-product__image-wrapper {
    grid-row: 1;
}

.card-product__container-info {
    grid-row: 2;
    position: relative;
    overflow: visible;
}

/* Create a wrapper for the content that will be swapped */
.card-product__info-content-wrapper {
    position: relative;
    min-height: 200px;
    overflow: visible;
}

.card-product__row2,
.card-product__product-title,
.variants-content {
    transition: opacity 0.3s ease;
}

.card-product__variants {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    z-index: 10;
    padding: 1.5rem;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.08); /* Shadow only on top */
    height: auto;
}

.card-product.variants-active .card-product__variants {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.variants-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.variants-back {
    background: none;
    border: none;
    padding: 0;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.variants-back:hover {
    color: #333;
}

.variant-price {
    font-weight: bold;
    font-size: 1.2rem;
}

.variant-options {
    margin-bottom: 1rem;
}

.variant-select-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.variant-select-wrapper label {
    color: #666;
    font-size: 0.9rem;
}

.variant-options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.variant-option {
    width: 48px;
    height: 48px;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    user-select: none;
}

.variant-option:hover {
    border-color: #999;
}

.variant-option.selected {
    border-color: #4CAF50;
    background: #f0f9f0;
}

.variant-option-unit {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0;
}

.quantity-wrapper {
    margin-bottom: 1rem;
}

.quantity-wrapper label {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls button {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-controls input.qty {
    width: 48px;
    height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0;
}

.cart-form {
    display: flex;
    flex-direction: column;
}

.add-to-cart-variant {
    margin-top: auto;
}

/* Remove display: none/block toggling and keep content always in the DOM */
.variants-content {
    opacity: 1; /* Always visible when parent is visible */
}

/* Remove this as it's no longer needed */
.card-product.variants-active .variants-content {
    display: block;
} 

.variants-content .variants-header {
    height: 30px;
}

.variants-content .added_to_cart, .variants-content .woocommerce-notices-wrapper {
    display: none;
}

.add-to-cart-variant .loading {
    display: none;
}

.add-to-cart-variant.loading .loading {
    display: inline;
}

.add-to-cart-variant.loading .default {
    display: none;
}

/* Handle added to cart state */
.add-to-cart-variant.bricks-cart-added .default,
.add-to-cart-variant.added .default {
    display: inline;
}

.add-to-cart-variant.bricks-cart-added .loading,
.add-to-cart-variant.added .loading {
    display: none;
}