
/*
|--------------------------------------------------------------------------
| SIDEBAR CART
|--------------------------------------------------------------------------
*/

.kgcode-sidebar-cart {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: #fff;
    color: #222;
    font-family: inherit;
    box-sizing: border-box;
}

.kgcode-sidebar-cart *,
.kgcode-sidebar-cart *::before,
.kgcode-sidebar-cart *::after {
    box-sizing: border-box;
}


/*
|--------------------------------------------------------------------------
| EMPTY CART
|--------------------------------------------------------------------------
*/

.kgcode-sidebar-cart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 160px;
    padding: 25px;
    font-size: 16px;
    color: #555;
}


/*
|--------------------------------------------------------------------------
| PRODUCTS BLOCK
|--------------------------------------------------------------------------
*/

.kgcode-sidebar-cart-products {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 18px 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.kgcode-sidebar-cart-products::-webkit-scrollbar {
    display: none;
}


/*
|--------------------------------------------------------------------------
| PRODUCT ITEM
|--------------------------------------------------------------------------
*/

.kgcode-sidebar-cart-items {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.kgcode-sidebar-cart-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
}


/*
|--------------------------------------------------------------------------
| PRODUCT IMAGE
|--------------------------------------------------------------------------
*/

.kgcode-sidebar-cart-item-image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 15px;
    background: #f4f4f4;
}

.kgcode-sidebar-cart-item-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin: 0;
}


/*
|--------------------------------------------------------------------------
| PRODUCT CONTENT
|--------------------------------------------------------------------------
*/

.kgcode-sidebar-cart-item-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    gap: 3px;
}

.kgcode-sidebar-cart-item-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #222;
    overflow-wrap: anywhere;
}

.kgcode-sidebar-cart-item-category {
    font-size: 13px;
    line-height: 1.4;
    color: #777;
}

.kgcode-sidebar-cart-item-price {
    font-size: 15px;
    font-weight: 500;
    color: #222;
    line-height: 1.4;
}

.kgcode-sidebar-cart-item-details {
    font-size: 12px;
    line-height: 1.4;
    color: #777;
}


/*
|--------------------------------------------------------------------------
| QUANTITY AND REMOVE
|--------------------------------------------------------------------------
*/

.kgcode-sidebar-cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 5px;
}

.kgcode-sidebar-cart-quantity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 136px;
    height: 46px;
    flex: 0 0 136px;
    padding: 0 8px;
    border: 1px solid #c8c8c8;
    border-radius: 10px;
}

.kgcode-sidebar-cart-qty-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.kgcode-sidebar-cart-qty-button img {
    display: block;
    width: 17px;
    height: 17px;
    object-fit: contain;
}

.kgcode-sidebar-cart-qty-value {
    font-size: 15px;
    font-weight: 400;
    color: #222;
    text-align: center;
    min-width: 20px;
}

.kgcode-sidebar-cart-remove {
    padding: 8px 5px;
    border: none;
    background: transparent;
    color: #222;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}


/*
|--------------------------------------------------------------------------
| PROMOTION PRODUCT
|--------------------------------------------------------------------------
*/

.kgcode-sidebar-cart-promotion {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #dedede;
    border-radius: 11px;
    background: #fff;
}

.kgcode-sidebar-cart-promotion-image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border-radius: 12px;
    background: #e1e9f7;
}

.kgcode-sidebar-cart-promotion-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin: 0;
}

.kgcode-sidebar-cart-promotion-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.kgcode-sidebar-cart-promotion-label {
    font-size: 11px;
    color: #777;
    line-height: 1.4;
}

.kgcode-sidebar-cart-promotion-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #222;
}

.kgcode-sidebar-cart-promotion-category {
    font-size: 12px;
    line-height: 1.35;
    color: #777;
}

.kgcode-sidebar-cart-promotion-price {
    font-size: 13px;
    line-height: 1.4;
    color: #222;
}

.kgcode-sidebar-cart-promotion-add {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #222;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.kgcode-sidebar-cart-promotion-add img {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
}


/*
|--------------------------------------------------------------------------
| SUMMARY BLOCK
|--------------------------------------------------------------------------
*/

.kgcode-sidebar-cart-summary {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    width: 100%;
    padding: 18px;
    border-top: 1px solid #dedede;
    background: #fff;
}


/*
|--------------------------------------------------------------------------
| SUMMARY ROWS
|--------------------------------------------------------------------------
*/

.kgcode-sidebar-cart-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-bottom: 13px;
    font-size: 15px;
    line-height: 1.4;
    color: #222;
}

.kgcode-sidebar-cart-summary-row > span:last-child {
    white-space: nowrap;
}

.kgcode-sidebar-cart-discount {
    color: #df3030;
}


/*
|--------------------------------------------------------------------------
| DIVIDER
|--------------------------------------------------------------------------
*/

.kgcode-sidebar-cart-summary-divider {
    width: 100%;
    height: 1px;
    margin: 5px 0 17px;
    background: #e5e5e5;
}


/*
|--------------------------------------------------------------------------
| TOTAL
|--------------------------------------------------------------------------
*/

.kgcode-sidebar-cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
    color: #222;
}

.kgcode-sidebar-cart-total > span:last-child {
    color: #df3030;
    font-weight: 500;
    white-space: nowrap;
}

.kgcode-sidebar-cart-tax-note {
    margin-top: 10px;
    font-size: 11px;
    line-height: 1.4;
    color: #777;
}


/*
|--------------------------------------------------------------------------
| FOOTER BUTTONS
|--------------------------------------------------------------------------
*/

.kgcode-sidebar-cart-footer {
    display: flex;
    align-items: stretch;
    gap: 9px;
    width: 100%;
    margin-top: 13px;
}

.kgcode-sidebar-cart-cart-button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 75px;
    padding: 0 14px;
    border: 1px solid #2d806d;
    border-radius: 30px;
    background: #fff;
    color: #2d806d;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.kgcode-sidebar-cart-cart-button:hover {
    background: #2d806d;
    color: #fff;
}

.kgcode-sidebar-cart-checkout-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 56px;
    padding: 0 22px;
    border-radius: 30px;
    background: #2d806d;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}

.kgcode-sidebar-cart-checkout-button:hover {
    background: #246c5c;
    color: #fff;
}

.kgcode-sidebar-cart-checkout-button img {
    display: block;
    width: 19px;
    height: 19px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}


/*
|--------------------------------------------------------------------------
| LOADING STATE
|--------------------------------------------------------------------------
*/

.kgcode-sidebar-cart-loading {
    pointer-events: none;
}

.kgcode-sidebar-cart-loading .kgcode-sidebar-cart-products,
.kgcode-sidebar-cart-loading .kgcode-sidebar-cart-summary {
    opacity: 0.55;
}

.kgcode-sidebar-cart-loading {
    cursor: wait;
}


/*
|--------------------------------------------------------------------------
| SMALL SCREENS
|--------------------------------------------------------------------------
*/

@media (max-width: 380px) {

    .kgcode-sidebar-cart-products {
        padding-right: 12px;
        padding-left: 12px;
    }

    .kgcode-sidebar-cart-summary {
        padding: 14px 12px;
    }

    .kgcode-sidebar-cart-item {
        gap: 9px;
    }

    .kgcode-sidebar-cart-item-image {
        flex-basis: 68px;
        width: 68px;
        height: 68px;
    }

    .kgcode-sidebar-cart-quantity {
        width: 120px;
        flex-basis: 120px;
    }

    .kgcode-sidebar-cart-footer {
        gap: 7px;
    }

    .kgcode-sidebar-cart-cart-button {
        min-width: 62px;
        padding: 0 10px;
    }

    .kgcode-sidebar-cart-checkout-button {
        padding: 0 15px;
        font-size: 13px;
    }

}
