/**
 * Global Quantity Control Styles
 * Matches PDP page quantity control styling
 */

/* Quantity Control Wrapper */
.qty-control-wrapper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
}

/* Quantity Control Buttons */
.qty-control-btn {
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.qty-control-btn:hover {
    background: #193A43;
    color: #fff;
}

.qty-control-btn:active {
    transform: scale(0.95);
}

.qty-control-btn:focus {
    outline: none;
}

.qty-control-btn.qty-minus {
    border-right: 1px solid #e0e0e0;
    border-radius: 5px 0 0 5px;
}

.qty-control-btn.qty-plus {
    border-left: 1px solid #e0e0e0;
    border-radius: 0 5px 5px 0;
}

/* Quantity Input inside wrapper */
.qty-control-wrapper input[type="number"],
.qty-control-wrapper input.qty,
.qty-control-wrapper input.item-qty,
.qty-control-wrapper input.cart-item-qty {
    width: 50px;
    height: 36px;
    text-align: center;
    border: none !important;
    font-size: 16px;
    font-weight: 500;
    color: #000;
    background: #fff !important;
    -moz-appearance: textfield;
    appearance: textfield;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.qty-control-wrapper input[type="number"]::-webkit-outer-spin-button,
.qty-control-wrapper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.qty-control-wrapper input[type="number"]:focus {
    outline: none;
    box-shadow: none !important;
}

/* Minicart specific adjustments */
.minicart-items .qty-control-wrapper,
.block-minicart .qty-control-wrapper {
    margin-top: 5px;
}

.minicart-items .qty-control-btn,
.block-minicart .qty-control-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
}

.minicart-items .qty-control-wrapper input,
.block-minicart .qty-control-wrapper input {
    width: 40px;
    height: 28px;
    font-size: 14px;
}

/* Cart Page specific adjustments */
.checkout-cart-index .qty-control-wrapper {
    justify-content: center;
}

/* Checkout page adjustments */
.checkout-index-index .qty-control-wrapper {
    margin-top: 5px;
}

.checkout-index-index .qty-control-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
}

.checkout-index-index .qty-control-wrapper input {
    width: 40px;
    height: 28px;
    font-size: 14px;
}

/* Wishlist page adjustments */
.wishlist-index-index .qty-control-wrapper {
    margin-bottom: 10px;
}

/* Hide Magento's default update qty button when inside our wrapper */
.qty-control-wrapper+.update-cart-item,
.qty-control-wrapper~.update-cart-item {
    display: none !important;
}

/* Details qty label alignment */
.details-qty {
    display: flex;
    align-items: center;
    gap: 10px;
}

.details-qty .label {
    margin-right: 10px;
    font-weight: 500;
    color: #333;
}

/* Mobile Responsive */
@media only screen and (max-width: 767px) {
    .qty-control-wrapper {
        display: inline-flex;
    }

    .qty-control-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .qty-control-wrapper input {
        width: 40px !important;
        height: 32px !important;
        font-size: 14px !important;
    }

    .minicart-items .qty-control-btn,
    .block-minicart .qty-control-btn {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }

    .minicart-items .qty-control-wrapper input,
    .block-minicart .qty-control-wrapper input {
        width: 35px !important;
        height: 26px !important;
        font-size: 12px !important;
    }
}

/* RTL Support */
.rtl-layout .qty-control-btn.qty-minus {
    border-right: none;
    border-left: 1px solid #e0e0e0;
    border-radius: 0 5px 5px 0;
}

.rtl-layout .qty-control-btn.qty-plus {
    border-left: none;
    border-right: 1px solid #e0e0e0;
    border-radius: 5px 0 0 5px;
}

.rtl-layout .qty-control-wrapper {
    flex-direction: row-reverse;
}