/**
 * WC Quick Order Archive Add to Cart Styles
 *
 * Styles for quantity input field on archive pages
 *
 * @package WC_Quick_Order
 */

/* Wrapper for quantity input and add to cart button */
.wc-quick-order-archive-add-to-cart-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

/* Quantity input wrapper */
.wc-quick-order-archive-quantity-wrapper {
    display: flex;
    align-items: stretch;
    width: auto;
    align-self: flex-start;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background-color: #fff;
}

/* Quantity input field */
.wc-quick-order-archive-quantity-input {
    width: 60px;
    min-width: 60px;
    padding: 8px 10px;
    text-align: center;
    border: none;
    border-right: 1px solid #ddd;
    border-radius: 0;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.5;
    background-color: #fff;
    color: #333;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

/* Quantity buttons container */
.wc-quick-order-quantity-buttons {
    display: flex;
    flex-direction: column;
    border-left: none;
}

/* Increment/Decrement buttons */
.wc-quick-order-quantity-increment,
.wc-quick-order-quantity-decrement {
    width: 30px;
    height: 50%;
    min-height: 20px;
    padding: 0;
    border: none;
    border-left: 1px solid #ddd;
    border-radius: 0;
    background-color: #fff;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.wc-quick-order-quantity-increment {
    border-bottom: 1px solid #ddd;
}

.wc-quick-order-quantity-increment:hover,
.wc-quick-order-quantity-decrement:hover {
    background-color: #f5f5f5;
}

.wc-quick-order-quantity-increment:active,
.wc-quick-order-quantity-decrement:active {
    background-color: #e5e5e5;
}

.wc-quick-order-quantity-increment:focus,
.wc-quick-order-quantity-decrement:focus {
    outline: none;
    background-color: #f5f5f5;
}

.wc-quick-order-quantity-increment:disabled,
.wc-quick-order-quantity-decrement:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.wc-quick-order-quantity-increment:disabled:hover,
.wc-quick-order-quantity-decrement:disabled:hover {
    background-color: #f5f5f5;
}

/* Remove spinner arrows in some browsers */
.wc-quick-order-archive-quantity-input::-webkit-outer-spin-button,
.wc-quick-order-archive-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Focus state */
.wc-quick-order-archive-quantity-input:focus {
    outline: none;
    box-shadow: inset 0 0 0 1px #7ba39f;
}

/* Disabled state */
.wc-quick-order-archive-quantity-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Screen reader text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wc-quick-order-archive-add-to-cart-wrapper .add_to_cart_button {
        width: 100%;
    }
}

/* Ensure button styling is maintained */
.wc-quick-order-archive-add-to-cart-wrapper .add_to_cart_button {
    width: 100%;
}

/* Loading state for button */
.wc-quick-order-archive-add-to-cart-wrapper .add_to_cart_button.loading {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}

/* Ensure proper spacing in product loop */
.woocommerce ul.products li.product .wc-quick-order-archive-add-to-cart-wrapper {
    margin-top: 10px;
}

/* Align with product price and other elements */
.woocommerce ul.products li.product .wc-quick-order-archive-add-to-cart-wrapper {
    clear: both;
}