.root {
    display: flex;
    flex-direction: row;
    overflow: hidden !important;
}

.nv-buy-again__form {
    display: flex;
    flex-wrap: wrap;
    background: unset;
    align-items: center;
    width: 100%;
    margin: 10px 0;
}

.nv-buy-again__order-by-label {
    display: flex;
    align-items: center;
    min-width: 260px;
    text-wrap: nowrap;
    margin: 10px 0 10px 8px;
    padding: 0;
}

.nv-buy-again__order-by-input {
    margin-left: 8px;
}

.search-bar-and-add-products {
    width: 100%;
    margin-top: 10px;
}

/* Update search-bar design BEGIN -------------*/
body .select2-search--dropdown:before {
    top: -6px !important;
    z-index: 1 !important;
}

.select2-search__field {
    margin: 0 !important;
    position: relative !important;
    top: -13px !important;
    height: 48px !important;
    border: transparent !important;
    border-bottom: 1px solid #ccc !important;
}

.select2-container--default .select2-results__option--selected {
    color: #f0f0f0;
    background-color: rgba(153, 153, 153, 0.1) !important;
    font-weight: 700 !important;
}

.search-bar-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    width: 100%;
}

.search-bar-box label:first-child {
    flex: 3;
}

.search-bar-box label:last-child {
    flex: 1;
    margin-left: 20px
}

/* Update search-bar design ENDED -------------*/

.buy-again-table {
    margin-top: 20px !important;
}

.buy-again-table td {
    border-width: 0 0 1.5px 0 !important;
    border-style: solid;
    border-color: black;
    color: black;
    padding-top: 30px;
    padding-bottom: 30px;
    margin-bottom: 0 !important;
}

.buy-again-table tfoot td {
    border: 0 !important;
}

.buy-again-order-table .title-row {
    background-color: #f0f0f0;
}

.buy-again-order-table .title-row th {
    border-width: 0 !important;
    padding-left: 20px !important;
    color: black;
    font-weight: 600;
    line-height: 30px;
}

.buy-again-order-table .title-row th:last-child {
    text-align: center !important;
    padding-right: 20px !important;
}

@media(min-width: 768px) {
    .buy-again-row td:first-child {
        padding-left: 20px !important;
    }
}

.buy-again-table td:last-child {
    text-align: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.buy-again-row a {
    text-decoration: none !important;
    color: black !important;
}

.buy-again-row a.add-to-cart-buy-again {
    border: solid 2px !important;
    padding: 12px 26px !important;
    font-weight: 700;
    color: #fff !important;
}

.buy-again-row a.add-to-cart-buy-again:hover {
    border-color: black !important;
    background-color: black !important;
    color: white !important;
}

.buy-again-row a.add-to-cart-buy-again[disabled] {
    background: #999 !important;
}

@media(max-width: 767px) {

    .buy-again-table thead,
    .buy-again-table th {
        display: none;
    }

    .buy-again-table tr,
    .buy-again-table td {
        display: block;
    }

    .buy-again-table tr {
        padding: 20px 0;
        border-bottom: 1.5px solid #000;
    }

    .buy-again-table td {
        border-width: 0 !important;
        padding: 10px 15px !important;
        text-align: center;
    }

    .buy-again-table .td-price:after,
    .buy-again-table .td-stock:after {
        display: inline;
        padding-left: 5px;
        color: #999;
    }

    .buy-again-table .td-sku:before {
        content: "SKU:";
        display: inline;
        padding-right: 5px;
        color: #999;
    }

    .buy-again-table .td-price:after {
        content: "Your Price";
    }

    .buy-again-table .td-stock:after {
        content: "Stock on Hand";
    }

    .variation-quantity-box {
        display: inline-block;
    }
}

.buy-again-row .product-title-anchor {
    border: 0 !important;
    margin-left: 0 !important;
    padding: 0 !important;
    font-weight: 500;
    text-decoration: none !important;
}

.buy-again-row .product-title-anchor:hover {
    color: #333;
    background-color: transparent !important;
}

.product-variation-image span {
    display: inline-block;
}

.product-variation-image .border {
    border: 1px solid black;
    padding: 5px;
    width: 110px;
    height: 110px;
}

.product-variation-image .inside {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center center;
    background-color: transparent;
    background-repeat: no-repeat;
}

.product-variation-image img {
    max-width: 100%;
    max-height: 100%;
    visibility: hidden;
}

.variation-quantity-box {
    position: relative;
}

.variation-quantity-box label {
    padding: 0px !important;
    display: flex !important;
    flex-direction: row !important;
    width: 80px !important;
    height: 46px !important;

    justify-content: space-between;
    border: solid 1.5px black !important;
    text-align: center;
}

.variation-quantity-box input {
    padding: 0 !important;
    margin: 0 !important;
}

.variation-quantity-value {
    width: 30px !important;
    flex: 1.2 !important;
    text-align: center !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    padding: 0 !important;
    background-color: transparent !important;
}

.btn-quantity-decrease,
.btn-quantity-increase {
    flex: 1 !important;
    text-align: center !important;
    border: none !important;
    padding: 0 !important;
    background-color: transparent !important;
    cursor: pointer !important;
}

#primary article {
    padding-bottom: 5rem;
}

.buy-again-actions-top {
    float: top;
    display: flex !important;
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
    margin-top: 40px;
    border-bottom: 2px solid black;
}

.btn-updateTemplate {
    margin-top: 10px;
    min-width: 170px;
    height: 46px;
    white-space: nowrap;
}

.form-add-product {
    display: flex;
    flex-direction: column;
}

.form-add-product .form-item {
    display: flex;
    flex-direction: column;
}

.form-add-product .form-item .select2 {
    width: 100% !important;
}

a.button.add-to-cart-buy-again {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    width: 100%;
}

a.button.add-to-cart-buy-again:hover {
    background-color: var(--hover-color);
}

.buy-again-order-table .title-row {
    background: var(--primary-color) !important;
}

.select2-container--default .select2-results__option--selected {
    color: var(--primary-color) !important;
}

.buy-again-order-table {
    width: 100%;
}

.buy-again-order-table .title-row th {
    color: var(--text-color);
}

.buy-again-order-table .add-to-cart-buy-again.single-add.gem-button,
.buy-again-order-table .buy-again-actions .add-to-cart-buy-again.bulk-add.gem-button {
    cursor: pointer;
}

.buy-again-order-row .td-small-screen-details {
    display: none;
}

#search-bar-input-order-template {
    padding: 8px 20px;
    flex-grow: 1;
    background: unset;
    border-color: #dfe5e8;
    margin-top: 0;
    margin-bottom: 0;
}

#search-bar-input-order-template::placeholder {
    font-style: italic;
    color: #505050;
}

.nv-buy-again__order-by-input {
    padding: 10px 20px 10px 10px;
    border-color: #dfe5e8;
    color: #505050;
    flex-grow: 1;
    margin-top: 0;
    margin-bottom: 0;
}

/* Small screen styles */
@media only screen and (max-width: 1200px) {
    .buy-again-order-table .title-row {
        display: none;
    }

    .buy-again-order-table td {
        /* The border should not be on the td elements but the row... */
        border: none!important;
    }

    .buy-again-order-table tr {
        border-bottom: 1px solid #e5e5e5;
    }

    .buy-again-order-row {
        display: flex;
        align-items: center;
    }

    .buy-again-order-row .product-variation-image {
        padding-left: 0;
    }

    .buy-again-order-row .td-sku,
    .buy-again-order-row .td-title,
    .buy-again-order-row .td-price,
    .buy-again-order-row .td-stock {
        display: none;
    }

    .buy-again-order-row .td-cart {
        /* Prevent text wrapping and keep buttons aligned from */
        /* one row to the next as we are using display: flex */
        min-width: 228px;
    }

    .buy-again-order-row .td-small-screen-details {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }

    .buy-again-order-row .td-small-screen-details span:not(:first-child) {
        padding-top: 6px;
    }

    .td-small-screen-details .td-small-screen-details-title {
        display: flex;
    }

    .td-small-screen-details .td-small-screen-details-title .product-title-anchor {
        display: inline-block;
        padding-left: 4px;
    }

    .buy-again-order-table .buy-again-actions-spacer {
        display: none;
    }

    .buy-again-actions .add-to-cart-buy-again.bulk-add {
        float: right;
    }
}

@media only screen and (max-width: 920px) {
    .buy-again-order-table tr {
        flex-wrap: wrap;
    }

    .buy-again-order-table tr .product-variation-image {
        padding-right: 20px;
    }

    .td-small-screen-details {
        padding-left: 0;
    }

    .buy-again-order-table tr .td-quantity {
        flex-basis: 100%;
        padding-left: 0;
        padding-top: 0;
    }

    .buy-again-order-table tr .td-cart{
        padding-left: 0;
        padding-top: 0;
    }

    .buy-again-actions .add-to-cart-buy-again.bulk-add {
        float: unset;
    }
}