/**
 * Quantity counters — RTL order fix + Mahyar default-style parity.
 * Minus left, plus right. Colors from htmlcss/assets/css/default-style.css
 */

.bootstrap-touchspin,
.counter .bootstrap-touchspin,
.product-quantity .bootstrap-touchspin,
.quantity .bootstrap-touchspin {
    direction: ltr;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    flex-wrap: nowrap;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.bootstrap-touchspin .input-group-prepend,
.bootstrap-touchspin > .input-group-btn.input-group-prepend,
.bootstrap-touchspin .bootstrap-touchspin-down {
    order: 1;
}

.bootstrap-touchspin input.form-control,
.bootstrap-touchspin input.qty,
.bootstrap-touchspin input.counter {
    order: 2;
    flex: 0 0 auto;
}

.bootstrap-touchspin .input-group-append,
.bootstrap-touchspin > .input-group-btn.input-group-append,
.bootstrap-touchspin .bootstrap-touchspin-up {
    order: 3;
}

/* Buttons — main-color-one (HTML default-style) */
.bootstrap-touchspin .bootstrap-touchspin-down,
.bootstrap-touchspin .bootstrap-touchspin-up,
.bootstrap-touchspin .btn-counter {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border: 0;
    outline: none;
    font-weight: bold;
    background: var(--main-color-one);
    box-shadow: var(--shadow-box);
    color: #fff;
    border-radius: 5px;
    line-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bootstrap-touchspin .bootstrap-touchspin-up {
    margin-right: 7px;
}

.bootstrap-touchspin .bootstrap-touchspin-down {
    margin-left: 7px;
}

.bootstrap-touchspin .bootstrap-touchspin-down:hover,
.bootstrap-touchspin .bootstrap-touchspin-up:hover,
.bootstrap-touchspin .btn-counter:hover {
    background: var(--main-color-one);
    color: #fff;
    filter: brightness(0.92);
}

/* Input — form-counter (HTML default-style), wide enough for typed qty */
.bootstrap-touchspin input.form-control,
.bootstrap-touchspin input.qty,
.bootstrap-touchspin input.counter {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 96px !important;
    height: 40px !important;
    margin-left: 5px !important;
    margin-right: 5px !important;
    padding: 0 4px;
    text-align: center;
    font-weight: bold;
    font-size: 15px;
    line-height: 40px;
    background: #fff;
    box-shadow: var(--shadow-box);
    border-radius: 5px !important;
    border: 1px solid #eee !important;
    box-sizing: border-box;
    overflow: visible;
}

.bootstrap-touchspin input.form-control:focus,
.bootstrap-touchspin input.qty:focus,
.bootstrap-touchspin input.counter:focus {
    border: 1px solid #eee !important;
    outline: none;
    box-shadow: var(--shadow-box);
}

.counter .input-group,
.product-quantity .input-group {
    align-items: center;
}

.quantity:not(:has(.bootstrap-touchspin)) {
    direction: ltr;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
}

.quantity:not(:has(.bootstrap-touchspin)) .qty {
    order: 2;
    text-align: center;
}
