#productrequest-page {
    width: 100%;
    margin: 20px 0 40px;
}


/*
 * ============================================================
 * HEADER
 * ============================================================
 */

.productrequest-header {
    margin-bottom: 20px;
}

.productrequest-header h1 {
    margin-bottom: 20px;
}

.productrequest-search input {
    width: 100%;
    max-width: 500px;
    height: 42px;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}


/*
 * ============================================================
 * LAYOUT
 * ============================================================
 */

.productrequest-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}


/*
 * ============================================================
 * SIDEBAR
 * ============================================================
 */

.productrequest-sidebar {
    width: 280px;
    flex: 0 0 280px;
    border: 1px solid #ddd;
    background: #fff;
}

.productrequest-sidebar-title {
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
}

.productrequest-categories {
    padding: 10px;
    max-height: 650px;
    overflow-y: auto;
}


/*
 * ============================================================
 * CATEGORY TREE
 * ============================================================
 */

.pr-category-tree,
.pr-category-tree ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pr-category-item {
    margin: 0;
}

.pr-category-row {
    display: flex;
    align-items: center;
    min-height: 34px;
}

.pr-category-toggle,
.pr-category-empty {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    flex: 0 0 22px;
}

.pr-category-toggle:hover {
    background: #eee;
}

.pr-category-empty {
    cursor: default;
}

.pr-category-link {
    flex: 1;
    padding: 5px 7px;
    text-decoration: none;
    color: #333;
    display: block;
}

.pr-category-link:hover,
.pr-category-link.active {
    background: #f1f1f1;
    color: #333;
    text-decoration: none;
}

.pr-category-children {
    display: none;
    padding-left: 20px !important;
}

.pr-category-item.open > .pr-category-children {
    display: block;
}


/*
 * ============================================================
 * CONTENT
 * ============================================================
 */

.productrequest-content {
    flex: 1;
    min-width: 0;
}

#productrequest-loader {
    padding: 30px;
    text-align: center;
    border: 1px solid #ddd;
    background: #fafafa;
}


/*
 * ============================================================
 * PRODUCTS
 * ============================================================
 */

.productrequest-products {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pr-product {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border: 1px solid #ddd;
    background: #fff;
    box-sizing: border-box;
}

.pr-product:hover {
    border-color: #bbb;
}

.pr-product-image {
    width: 70px;
    flex: 0 0 70px;
    text-align: center;
}

.pr-product-image img {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

.pr-product-info {
    flex: 1;
    min-width: 0;
}

.pr-product-name {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.4;
}

.pr-product-name a {
    color: inherit;
    text-decoration: none;
}

.pr-product-name a:hover {
    text-decoration: underline;
}

.pr-product-reference {
    margin-top: 5px;
    font-size: 12px;
    color: #777;
}

.pr-product-price {
    margin-top: 5px;
    font-weight: bold;
}


/*
 * ============================================================
 * QUANTITY
 * ============================================================
 */

.pr-quantity-box {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.pr-quantity-minus,
.pr-quantity-plus {
    width: 38px;
    height: 38px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 20px;
    line-height: 36px;
    padding: 0;
    text-align: center;
}

.pr-quantity-minus:hover,
.pr-quantity-plus:hover {
    background: #e8e8e8;
}

.pr-quantity-input {
    width: 70px;
    height: 38px;
    text-align: center;
    border: 1px solid #ccc;
    border-left: 0;
    border-right: 0;
    box-sizing: border-box;
}


/*
 * ============================================================
 * SELECTED PRODUCTS
 * ============================================================
 */

.productrequest-selected {
    margin-top: 30px;
    border: 1px solid #ddd;
    background: #fff;
}

.productrequest-selected-title {
    padding: 15px 18px;
    border-bottom: 1px solid #ddd;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.productrequest-selected-title h3 {
    margin: 0;
    font-size: 18px;
}

.productrequest-selected-title span {
    font-size: 14px;
    color: #555;
}

.productrequest-selected-products {
    padding: 0;
}


/*
 * ============================================================
 * SELECTED TABLE
 * ============================================================
 */

.pr-selected-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.pr-selected-table th {
    padding: 12px 10px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    text-align: left;
    font-weight: bold;
}

.pr-selected-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.pr-selected-table tr:last-child td {
    border-bottom: 0;
}


/*
 * ============================================================
 * SELECTED QUANTITY
 * ============================================================
 */

.pr-selected-quantity {
    display: inline-flex;
    align-items: center;
}

.pr-selected-minus,
.pr-selected-plus {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 18px;
    line-height: 32px;
    text-align: center;
}

.pr-selected-minus:hover,
.pr-selected-plus:hover {
    background: #e8e8e8;
}

.pr-selected-input {
    width: 60px;
    height: 34px;
    padding: 4px;
    text-align: center;
    border: 1px solid #ccc;
    border-left: 0;
    border-right: 0;
    box-sizing: border-box;
}


/*
 * ============================================================
 * REMOVE
 * ============================================================
 */

.pr-selected-remove {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: #fff;
    color: #999;
    cursor: pointer;
    font-size: 20px;
    line-height: 28px;
    padding: 0;
}

.pr-selected-remove:hover {
    background: #f5f5f5;
    color: #c00;
}


/*
 * ============================================================
 * EMPTY
 * ============================================================
 */

.pr-selected-empty {
    padding: 20px;
    text-align: center;
    color: #777;
}


/*
 * ============================================================
 * BOTTOM SUMMARY
 * ============================================================
 */

.productrequest-bottom {
    position: sticky;
    bottom: 0;
    margin-top: 25px;
    padding: 18px;
    border: 1px solid #ddd;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    z-index: 10;
    box-sizing: border-box;
}


/*
 * ============================================================
 * SUMMARY
 * ============================================================
 */

.productrequest-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    font-size: 15px;
}

.productrequest-summary > span {
    font-weight: bold;
}

.productrequest-total-label {
    margin-left: 15px;
}


/*
 * ОБЩА ЦЕНА
 */

.productrequest-total-price-label {
    margin-left: 20px;
}

.productrequest-total-price {
    font-size: 18px;
    font-weight: bold;
    white-space: nowrap;
}


/*
 * ============================================================
 * ACTIONS
 * ============================================================
 */

.productrequest-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.productrequest-actions button {
    cursor: pointer;
}

.productrequest-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/*
 * ============================================================
 * MESSAGE
 * ============================================================
 */

.productrequest-message {
    display: none;
    padding: 12px;
    margin-bottom: 15px;
}

.productrequest-message.success {
    display: block;
    background: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
}

.productrequest-message.error {
    display: block;
    background: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
}


/*
 * ============================================================
 * MOBILE
 * ============================================================
 */

@media (max-width: 768px) {

    .productrequest-layout {
        flex-direction: column;
    }


    .productrequest-sidebar {
        width: 100%;
        flex: auto;
    }


    .productrequest-content {
        width: 100%;
    }


    .pr-product {
        flex-wrap: wrap;
    }


    .pr-product-info {
        min-width: calc(100% - 100px);
    }


    .pr-quantity-box {
        width: 100%;
        justify-content: flex-end;
    }


    .productrequest-selected-title {
        flex-direction: column;
        align-items: flex-start;
    }


    .pr-selected-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }


    .productrequest-bottom {
        flex-direction: column;
        align-items: stretch;
    }


    .productrequest-summary {
        justify-content: center;
    }


    .productrequest-actions {
        flex-direction: column;
    }


    .productrequest-actions button {
        width: 100%;
    }

}


/*
 * ============================================================
 * SMALL MOBILE
 * ============================================================
 */

@media (max-width: 480px) {

    .pr-product {
        padding: 10px;
    }


    .pr-product-image {
        width: 55px;
        flex: 0 0 55px;
    }


    .pr-product-name {
        font-size: 14px;
    }


    .pr-product-reference {
        font-size: 11px;
    }


    .pr-quantity-minus,
    .pr-quantity-plus {
        width: 36px;
        height: 36px;
    }


    .pr-quantity-input {
        width: 60px;
    }


    .productrequest-summary {
        font-size: 13px;
    }


    .productrequest-total-price {
        font-size: 16px;
    }

}

/* =========================================================
   ESonic - PRODUCT REQUEST
   ========================================================= */

/*
 * На desktop заявката излиза от стандартната
 * ширина на content колоната и използва
 * пространството до края на хоризонталното меню.
 *
 * ВАЖНО:
 * Не използваме width: 100vw,
 * защото това покрива вертикалното меню.
 */

@media (min-width: 992px) {

    #productrequest-page {
        width: calc(100% + 300px) !important;
        max-width: none !important;
        box-sizing: border-box !important;
    }

}


/*
 * При по-малки екрани връщаме
 * нормалната ширина.
 */

@media (max-width: 991px) {

    #productrequest-page {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

}


/*
 * Mobile
 */

@media (max-width: 768px) {

    #productrequest-page {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #productrequest-page .productrequest-layout {
        display: block !important;
        width: 100% !important;
    }

    #productrequest-page .productrequest-sidebar {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: none !important;
    }

    #productrequest-page .productrequest-content {
        width: 100% !important;
        margin-top: 15px;
    }

}