/*
 * Quantity Button Styles
 * Additive styles on top of WooCommerce's .quantity wrapper.
 * We only style what we add — the input inherits theme defaults.
 */

:root {
    --wc-moq-border: #d1d5db;
    --wc-moq-border-hover: #9ca3af;
    --wc-moq-border-focus: #6b7280;
    --wc-moq-accent: #ED2024;
    --wc-moq-btn-color: #6b7280;
    --wc-moq-btn-hover-bg: #f3f4f6;
    --wc-moq-btn-active-bg: #e5e7eb;
    --wc-moq-radius: 8px;
    --wc-moq-height: 48px;
    --wc-moq-btn-width: 48px;
}

/* Make the .quantity wrapper a flex row with a shared border */
.quantity:has(.wc-moq-qty__btn) {
    display: inline-flex;
    align-items: stretch !important;
    border: 1px solid var(--wc-moq-border);
    border-radius: var(--wc-moq-radius);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.quantity:has(.wc-moq-qty__btn):hover {
    border-color: var(--wc-moq-border-hover);
}

.quantity:has(.wc-moq-qty__btn):focus-within {
    border-color: var(--wc-moq-border-focus);
}

/* The input — only override what's needed for the layout */
.quantity:has(.wc-moq-qty__btn) input.qty {
    width: 56px;
    min-height: var(--wc-moq-height);
    text-align: center;
    border: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

/* Hide native number spinners */
.quantity:has(.wc-moq-qty__btn) input[type="number"]::-webkit-outer-spin-button,
.quantity:has(.wc-moq-qty__btn) input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/*
 * +/- buttons
 * Elementor/themes target `.cart button` with high-specificity ID selectors,
 * so we use !important only on the properties they typically override:
 * background, padding, border-radius, color.
 */
.quantity:has(.wc-moq-qty__btn) .wc-moq-qty__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--wc-moq-btn-width);
    min-height: var(--wc-moq-height);
    padding: 0 !important;
    margin: 0;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--wc-moq-btn-color) !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.quantity:has(.wc-moq-qty__btn) .wc-moq-qty__btn:hover {
    background: var(--wc-moq-btn-hover-bg) !important;
    color: var(--wc-moq-accent) !important;
}

.quantity:has(.wc-moq-qty__btn) .wc-moq-qty__btn:active {
    background: var(--wc-moq-btn-active-bg) !important;
}

.quantity:has(.wc-moq-qty__btn) .wc-moq-qty__btn:focus {
    outline: none;
}

.quantity:has(.wc-moq-qty__btn) .wc-moq-qty__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.quantity:has(.wc-moq-qty__btn) .wc-moq-qty__icon {
    width: 20px;
    height: 20px;
    display: block;
}

/* Remove float that WooCommerce sets on form.cart .quantity */
form.cart .quantity:has(.wc-moq-qty__btn) {
    float: none;
}
