/* Product add-to-cart minimum quantity layout */
#product .frn-add-to-cart {
    flex-wrap: wrap;
    row-gap: 8px;
}

/* Tighten vertical padding of the quantity / add-to-cart columns */
#product .frn-add-to-cart__left,
#product .frn-add-to-cart__right {
    padding-top: 5px;
    padding-bottom: 5px;
}

#product .frn-add-to-cart__minimal-quantity {
    flex: 0 0 100%;
    width: 100%;
    margin: 4px 0 0;
    padding: 12px 16px;
    border-radius: 6px;
    background-color: var(--bgcLight);
    color: var(--cText);
    font-size: var(--fz-14);
    height: 44px;
    text-align: left;
}

#product #quantity_wanted {
    background-image: none !important;
    padding: 0 !important;
    /* Drops the shared .frn-input__control bottom margin; TouchSpin's .input-group
       zeroes it after load, so without this the digit drops 2.5px on init. */
    margin: 0;
    text-align: center;
    border: none !important;
    background-color: transparent !important;
    flex: 1 1 auto !important;
    width: 1% !important;
    min-width: 30px !important;
    height: 48px !important;
    font-size: var(--fz-14);
    font-weight: 500;
    color: #1a1b1a;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
    order: 2;
    outline: none !important;
    box-shadow: none !important;
}

#product #quantity_wanted::-webkit-outer-spin-button,
#product #quantity_wanted::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#product .frn-add-to-cart__left .frn-input__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e5e5e5;
    background-color: #fafafa;
    border-radius: 24px;
    height: 48px;
    box-sizing: border-box;
    padding: 0 16px;
    gap: 12px;
    width: 100%;
    position: relative;
    z-index: 1;
}

#product .bootstrap-touchspin {
    display: contents !important;
}

#product .bootstrap-touchspin .input-group-btn-vertical {
    display: contents !important;
}

#product .bootstrap-touchspin .bootstrap-touchspin-down,
#product .bootstrap-touchspin .bootstrap-touchspin-up,
#product .frn-qty-placeholder {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    flex: 0 0 24px !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #888;
    cursor: pointer;
    box-shadow: none !important;
    outline: none !important;
    font-family: var(--ffPrimary), sans-serif !important;
    line-height: 1 !important;
    position: static !important;
    float: none !important;
    transition: color 0.2s ease;
}

#product .bootstrap-touchspin .bootstrap-touchspin-down:hover,
#product .bootstrap-touchspin .bootstrap-touchspin-up:hover {
    color: #1a1b1a;
}

#product .bootstrap-touchspin .bootstrap-touchspin-down,
#product .frn-qty-placeholder--down {
    order: 1;
}

#product .bootstrap-touchspin .bootstrap-touchspin-up,
#product .frn-qty-placeholder--up {
    order: 3;
}

#product .bootstrap-touchspin ~ .frn-qty-placeholder {
    display: none !important;
}

#product .bootstrap-touchspin .bootstrap-touchspin-down i,
#product .bootstrap-touchspin .bootstrap-touchspin-up i {
    display: none !important;
}

#product .bootstrap-touchspin .bootstrap-touchspin-down::before,
#product .frn-qty-placeholder--down::before {
    content: "—"; /* em dash for minus sign */
    font-size: var(--fz-12);
    font-weight: 500;
}

#product .bootstrap-touchspin .bootstrap-touchspin-up::before,
#product .frn-qty-placeholder--up::before {
    content: "+";
    font-size: var(--fz-18);
    font-weight: 500;
}

#product .frn-input {
    min-width: auto;
}

/* Prevent wrapping of flex elements in container */
#product .frn-add-to-cart__left .frn-input__bottom {
    flex-wrap: nowrap !important;
}

/* Mobile overrides to prevent overflowing on narrow screens */
@media (max-width: 767px) {
    #product .frn-add-to-cart__left .frn-input__bottom {
        padding: 0 8px !important;
        gap: 6px !important;
    }

    #product .bootstrap-touchspin .bootstrap-touchspin-down,
    #product .bootstrap-touchspin .bootstrap-touchspin-up,
    #product .frn-qty-placeholder {
        flex: 0 0 20px !important;
        width: 20px !important;
        height: 20px !important;
    }

    #product #quantity_wanted {
        min-width: 20px !important;
        font-size: var(--fz-14);
    }
}
