.cqs-quantity-selector {
    margin-bottom: 20px;
    clear: both;
    width: 100%;
    display: block;
}

.cqs-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.cqs-buttons-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.cqs-qty-btn {
    min-width: 60px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    background-color: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.cqs-qty-btn:hover {
    background-color: #e8e8e8;
    border-color: #bbb;
    transform: translateY(-2px);
}

.cqs-qty-btn.cqs-active {
    background-color: #000;
    color: #fff;
    border-color: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cqs-qty-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
}

/* Hide default quantity input and controls but keep in DOM and accessible */
/* Keep the input field accessible for form submission */
form.cart input.qty,
form.cart input[name="quantity"],
.quantity input.qty,
input.qty {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide the wrapper elements visually */
.th-shop-mania-quantity,
form.cart .th-shop-mania-quantity,
div.th-shop-mania-quantity {
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
}

/* Hide plus/minus buttons */
.th-shop-mania-quantity button.minus,
.th-shop-mania-quantity button.plus {
    display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .cqs-buttons-wrapper {
        gap: 8px;
    }
    
    .cqs-qty-btn {
        min-width: 50px;
        padding: 10px 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .cqs-buttons-wrapper {
        gap: 6px;
    }
    
    .cqs-qty-btn {
        min-width: 45px;
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Discount badge */
.cqs-discount {
    font-size: 0.75em;
    color: #e74c3c;
    font-weight: 600;
    margin-left: 4px;
}

/* RTL Support */
.cqs-rtl .cqs-buttons-wrapper {
    direction: rtl;
}

.cqs-rtl .cqs-discount {
    margin-left: 0;
    margin-right: 4px;
}

/* Keyboard focus enhancement */
.cqs-qty-btn:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Responsive design */
@media (max-width: 768px) {
    .cqs-buttons-wrapper {
        gap: 8px;
    }
    
    .cqs-qty-btn {
        min-width: 50px;
        padding: 10px 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .cqs-buttons-wrapper {
        gap: 6px;
    }
    
    .cqs-qty-btn {
        min-width: 45px;
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Hide plus/minus buttons */
.th-shop-mania-quantity button.minus,
.th-shop-mania-quantity button.plus,
button.minus,
button.plus,
.quantity button,
.qty-btn {
    display: none !important;
}

/* Hide the separate price display if it exists */
.cqs-price-display {
    display: none !important;
}

/* Ensure add to cart button appears below */
form.cart .single_add_to_cart_button {
    margin-top: 15px;
}

