.ajax-basket-button-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    position: relative;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.quantity-button {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
}

.quantity-selector input {
    width: 40px;
    text-align: center;
    border: none;
    -moz-appearance: textfield;
}

.quantity-selector input::-webkit-outer-spin-button,
.quantity-selector input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.add-to-basket-button {
    flex-grow: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
}

.add-to-basket-button.loading {
    opacity: 0.7;
    cursor: wait;
    position: relative;
}

.add-to-basket-button.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s infinite linear;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.error-message {
    color: #cc1818;
    font-size: 0.875em;
    margin-top: 8px;
    padding: 8px;
    background-color: #ffd2d2;
    border-radius: 4px;
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    text-align: center;
}

.soulcountry-ajax-basket {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.soulcountry-ajax-basket .quantity {
    display: flex;
    align-items: center;
    border: 2px solid #ddd;
    border-radius: 4px;
    line-height: 1;
    height: 44px;
    box-sizing: border-box;
}

.soulcountry-ajax-basket .quantity input {
    width: 3em;
    text-align: center;
    border: none;
    padding: 0;
    line-height: 1;
    font-size: inherit;
    height: 100%;
    box-sizing: border-box;
    -moz-appearance: textfield;
}

.soulcountry-ajax-basket .quantity input::-webkit-outer-spin-button,
.soulcountry-ajax-basket .quantity input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.soulcountry-ajax-basket .quantity-button {
    background: white;
    border: none;
    padding: 0 1em;
    cursor: pointer;
    color: #515151;
    line-height: 1;
    font-size: inherit;
    height: 100%;
    box-sizing: border-box;
}

.soulcountry-ajax-basket .quantity-button:hover {
    background-color: white;
}

/* Default styling when no custom colors are set */
.soulcountry-ajax-basket .add_to_cart_button {
    position: relative;
    background-color: #99C3B9;
    color: #3C4B75;
    border: none;
    padding: 0 1.5em;
    border-radius: 0;
    cursor: pointer;
    text-transform: uppercase;
    line-height: 44px;
    height: 44px;
    box-sizing: border-box;
    font-size: 1.2rem;
    width: 100%;
    font-family: "PT Mono", monospace;
}

.soulcountry-ajax-basket .add_to_cart_button:hover {
    opacity: 0.9;
}

.soulcountry-ajax-basket .add_to_cart_button.loading {
    opacity: 0.25;
    pointer-events: none;
}

.soulcountry-ajax-basket .add_to_cart_button.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(0,0,0,0.25);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Out of stock styling */
.soulcountry-ajax-basket.out-of-stock {
    opacity: 0.6;
}

.soulcountry-ajax-basket .quantity.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.soulcountry-ajax-basket .quantity-button:disabled,
.soulcountry-ajax-basket .qty:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.soulcountry-ajax-basket .add_to_cart_button.disabled,
.soulcountry-ajax-basket .add_to_cart_button.out-of-stock {
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

.soulcountry-ajax-basket .add_to_cart_button.disabled:hover,
.soulcountry-ajax-basket .add_to_cart_button.out-of-stock:hover {
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.7 !important;
}