/* CartDrawer - slide-in cart panel (see _CartDrawer.cshtml / CartDrawer.js) */

#cartDrawerOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    z-index: 1050;
}

    #cartDrawerOverlay.open {
        opacity: 1;
        visibility: visible;
    }

#cartDrawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    height: 100dvh;
    width: 420px;
    max-width: 100%;
    background: #fff;
    color: #000;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform 0.25s ease;
    box-shadow: -4px 0 18px rgba(0, 0, 0, 0.25);
    text-align: left;
}

    #cartDrawer.open {
        transform: translateX(0);
    }

body.cartDrawerOpen {
    overflow: hidden;
}

.cartDrawerHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #39b91c;
    color: #fff;
    flex: 0 0 auto;
}

.cartDrawerTitle {
    font-size: 18px;
    font-weight: 700;
}

.cartDrawerClose {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.cartDrawerItems {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 8px 16px;
}

.cartDrawerEmpty {
    padding: 40px 10px;
    text-align: center;
    color: #666;
    font-size: 16px;
}

.cartDrawerItem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
}

    .cartDrawerItem:last-child {
        border-bottom: none;
    }

.cartDrawerItemImage {
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex: 0 0 auto;
}

.cartDrawerItemInfo {
    flex: 1 1 auto;
    min-width: 0;
}

.cartDrawerItemName {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: break-word;
}

.cartDrawerItemSub {
    font-size: 11px;
    color: #777;
    margin-top: 2px;
}

.cartDrawerItemUnit {
    font-size: 12px;
    color: #555;
    margin-top: 4px;
    white-space: nowrap;
}

.cartDrawerUpsell {
    color: #1350c1;
    font-weight: 600;
}

.cartDrawerUpsellLink {
    background: none;
    border: none;
    padding: 0;
    color: #f9722b;
    font-size: 11px;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
}

    .cartDrawerUpsellLink:hover {
        color: #e0631d;
    }

.cartDrawerFree {
    color: #39b91c;
    font-weight: 700;
    white-space: nowrap;
}

.cartDrawerItemRight {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex: 0 0 auto;
}

.cartDrawerRemove {
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

    .cartDrawerRemove:hover {
        color: #d33;
    }

.cartDrawerQty {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
}

.cartDrawerQtyBtn {
    background: #f4f4f4;
    border: none;
    width: 32px;
    height: 32px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #333;
}

    .cartDrawerQtyBtn:hover:not(:disabled) {
        background: #e2e2e2;
    }

    .cartDrawerQtyBtn:disabled {
        color: #bbb;
        cursor: default;
    }

.cartDrawerQtyValue {
    min-width: 34px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.cartDrawerLineTotal {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.cartDrawerFooter {
    flex: 0 0 auto;
    border-top: 1px solid #ddd;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) 16px;
    background: #fafafa;
}

.cartDrawerTotals .cartDrawerTotalRow {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 2px 0;
    color: #333;
}

.cartDrawerTotals .cartDrawerTotalRow.grand {
    font-size: 17px;
    font-weight: 700;
    color: #000;
    padding-top: 6px;
}

.cartDrawerTaxNote {
    font-size: 11px;
    color: #888;
    text-align: right;
    margin: 2px 0 8px 0;
}

.cartDrawerContinue {
    display: block;
    width: 100%;
    text-align: center;
    background: #f9722b;
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    padding: 13px 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}

    .cartDrawerContinue:hover {
        background: #e0631d;
    }

.cartDrawerClear {
    display: block;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    color: #888;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 10px;
    padding: 4px 0;
}

    .cartDrawerClear:hover {
        color: #d33;
    }

    .cartDrawerClear.armed {
        color: #d33;
        font-weight: 700;
    }

@media only screen and (max-width: 750px) {
    #cartDrawer {
        width: 100%;
        box-shadow: none;
    }
}
