/**
 * Asfar WooCommerce Quantity Steppers - Styles
 * Modern, clean, accessible UI for quantity controls.
 */

/* Hide native browser spin buttons */
.woocommerce .quantity input[type="number"]::-webkit-inner-spin-button,
.woocommerce .quantity input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.woocommerce .quantity input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* Quantity Container */
.woocommerce .quantity {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    position: relative !important;
    background-color: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 3px !important;
    gap: 2px !important;
    box-sizing: border-box !important;
    width: auto !important;
    height: 48px !important;
    direction: ltr !important; /* LTR inside box: [-] [val] [+] */
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    user-select: none !important;
}

.woocommerce .quantity:hover {
    border-color: #cbd5e1 !important;
}

.woocommerce .quantity:focus-within {
    border-color: #009245 !important;
    box-shadow: 0 0 0 3px rgba(0, 146, 69, 0.15) !important;
    background-color: #ffffff !important;
}

/* Stepper Buttons */
.woocommerce .quantity .asfar-qty-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.woocommerce .quantity .asfar-qty-btn svg {
    width: 12px !important;
    height: 12px !important;
    pointer-events: none !important;
}

.woocommerce .quantity .asfar-qty-btn svg path {
    stroke: #1e293b !important;
    transition: stroke 0.15s ease !important;
}

.woocommerce .quantity .asfar-qty-btn:hover:not(:disabled) {
    background-color: #009245 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 146, 69, 0.25) !important;
    transform: translateY(-1px) !important;
}

.woocommerce .quantity .asfar-qty-btn:hover:not(:disabled) svg path {
    stroke: #ffffff !important;
}

.woocommerce .quantity .asfar-qty-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.95) !important;
    background-color: #007a37 !important;
}

.woocommerce .quantity .asfar-qty-btn:disabled,
.woocommerce .quantity .asfar-qty-btn.is-disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    background-color: #f1f5f9 !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
    transform: none !important;
}

.woocommerce .quantity .asfar-qty-btn:disabled svg path,
.woocommerce .quantity .asfar-qty-btn.is-disabled svg path {
    stroke: #94a3b8 !important;
}

/* Quantity Input Field */
.woocommerce .quantity input.qty,
.woocommerce .quantity input[type="number"].qty {
    width: 52px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 4px !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    text-align: center !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    box-shadow: none !important;
    outline: none !important;
    font-family: inherit !important;
    line-height: 40px !important;
}

.woocommerce .quantity input.qty:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
}

/* Elementor Single Product Add to Cart Form Alignment */
.woocommerce div.product form.cart,
.elementor-widget-woocommerce-product-add-to-cart form.cart {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
}

.woocommerce div.product form.cart .quantity,
.elementor-widget-woocommerce-product-add-to-cart form.cart .quantity {
    margin: 0 !important;
    float: none !important;
}

/* Screen reader text positioning */
.woocommerce .quantity .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
