/*=========================
Custom D Cart
==========================*/

*{
    box-sizing:border-box;
}

.dcart{

    display:flex;
    gap:20px;
    max-width:1400px;
    margin:10px auto;
    padding:10px;

}

.dcart-left{

    flex:3;

}

.dcart-right{

    flex:1;
    background:#fff;
    border:1px solid #e5e5e5;
    border-radius:6px;
    padding:15px;
    position:sticky;
    top:15px;

}

/*----------------*/

.dcart-header{

    display:flex;
    justify-content:space-between;
    align-items:center;

    background:#f7f7f7;

    border:1px solid #ddd;

    padding:12px;

    margin-bottom:10px;

}

/*----------------*/

.cart-item{

    display:grid;

    grid-template-columns:

    40px
    90px
    1fr
    150px
    120px
    70px;

    align-items:center;

    gap:10px;

    border:1px solid #ddd;

    padding:10px;

    margin-bottom:8px;

    background:#fff;

}

.cart-item:hover{

    background:#fafafa;

}

/*----------------*/

.cart-item img{

    width:70px;
    height:70px;
    object-fit:contain;
    border:1px solid #eee;

}

.cart-info h4{

    margin:0;
    font-size:15px;
    font-weight:600;

}

.cart-info p{

    margin-top:5px;
    color:#ff6600;
    font-weight:bold;

}

/*----------------*/

.cart-qty{
    display:flex;
    align-items:center;
    border:1px solid #ddd;
    border-radius:6px;
    overflow:hidden;
    width:max-content;
}

.cart-qty button{
    width:36px;
    height:36px;
    border:none;
    background:#f8f8f8;
    font-size:20px;
    font-weight:bold;
    cursor:pointer;

    display:flex;
    align-items:center;
    justify-content:center;
    line-height:1;
    padding:0;
}

.cart-qty span{
    width:42px;
    text-align:center;
    font-weight:600;
    font-size:16px;
    background:#fff;
}

/*----------------*/

.remove-item{

    border:none;

    background:#dc3545;

    color:#fff;

    padding:6px 10px;

    cursor:pointer;

}

.remove-item:hover{

    background:#b02a37;

}

/*----------------*/

.cart-check{

    width:18px;
    height:18px;

}

/*----------------*/

.dcart-right h2{

    margin-top:0;
    margin-bottom:20px;

}

.dcart-right>div{

    display:flex;

    justify-content:space-between;

    padding:8px 0;

    border-bottom:1px dashed #ddd;
    margin-bottom: 20px;

}

#subtotal{

    font-weight:bold;

}

#total{

    color:#ff6600;

    font-size:20px;

    font-weight:bold;

}

/*----------------*/

#coupon-slider{

    margin:15px 0;

}

.coupon-card{

    border:1px dashed #ff6600;

    padding:10px;

    margin-bottom:8px;

    cursor:pointer;

    background:#fffaf5;

}

/*----------------*/

#coupon{

    width:100%;

    height:40px;

    border:1px solid #ccc;

    padding:8px;

    margin-bottom:10px;

}

/*----------------*/

#apply-coupon{

    width:100%;

    height:42px;

    border:none;

    background:#0d6efd;

    color:#fff;

    cursor:pointer;

    margin-bottom:10px;

}

/*----------------*/

#checkout-btn{

    width:100%;

    height:48px;

    border:none;

    background:#198754;

    color:#fff;

    font-size:16px;

    cursor:pointer;

    font-weight:bold;

}

/*----------------*/

#delete-selected{

    background:#dc3545;

    color:#fff;

    border:none;

    padding:8px 12px;

    cursor:pointer;

}

/*==========================
Tablet
===========================*/

@media (max-width:991px){

    .dcart{
        flex-direction:column;
    }

    .dcart-left,
    .dcart-right{
        width:100%;
        flex:100%;
    }

    .dcart-right{
        position:relative;
        top:0;
        margin-top:15px;
    }

    .cart-item{

        display:grid;

        grid-template-columns:
        35px
        75px
        1fr
        120px
        55px;

        gap:10px;

        align-items:center;

    }

    .cart-item img{

        width:65px;
        height:65px;

    }

}


/*==========================
Mobile
===========================*/

@media (max-width:768px){

    .dcart{

        display:block;

        padding:5px;

    }

    .dcart-left,
    .dcart-right{

        width:100%;

    }

    .dcart-right{

        margin-top:12px;

        position:relative;

        top:0;

    }

    .dcart-header{

        padding:10px;

    }

    .cart-item{

        display:grid;

        grid-template-columns:

        30px
        65px
        1fr
        110px
        45px;

        gap:8px;

        padding:8px;

        align-items:center;

    }

    .cart-item img{

        width:60px;
        height:60px;

    }

    .cart-info{

        min-width:0;

    }

    .cart-info h4{

        font-size:14px;

        line-height:18px;

        display:-webkit-box;

        line-clamp:2;

        -webkit-line-clamp:2;

        -webkit-box-orient:vertical;

        overflow:hidden;

        word-break:break-word;

    }

    .cart-info p{

        margin-top:4px;

        font-size:15px;

    }

    .cart-qty{

        transform:scale(.9);

        transform-origin:center;

    }

    .cart-qty button{

        width:32px;
        height:32px;
        font-size:18px;
        font-weight:bold;

    }

    .cart-qty span{

        width:36px;
        font-size:15px;

    }

    .remove-item{

        width:36px;
        height:36px;

        padding:0;

        display:flex;

        justify-content:center;

        align-items:center;

        font-size:16px;

    }

}


/*==========================
Small Mobile
===========================*/

@media (max-width:480px){

    .cart-item{

        grid-template-columns:

        26px
        55px
        1fr
        95px
        36px;

        gap:6px;

        padding:6px;

    }

    .cart-item img{

        width:50px;
        height:50px;

    }

    .cart-info h4{

        font-size:13px;

        line-height:16px;

    }

    .cart-info p{

        font-size:14px;

    }

    .cart-qty{

        transform:scale(.8);

    }

}

#checkout-btn:disabled,
#delete-selected:disabled{
    opacity:.55;
    cursor:not-allowed;
}

#cart-items.is-loading{
    opacity:.6;
    pointer-events:none;
}

.dcart-toast{
    position:fixed;
    right:20px;
    bottom:22px;
    z-index:100000;
    max-width:min(360px, calc(100vw - 32px));
    padding:12px 16px;
    border-radius:12px;
    background:#111827;
    color:#fff;
    box-shadow:0 12px 35px rgba(0,0,0,.22);
    font-size:14px;
    font-weight:600;
    opacity:0;
    transform:translateY(12px);
    pointer-events:none;
    transition:opacity .2s ease, transform .2s ease;
}

.dcart-toast.active{
    opacity:1;
    transform:translateY(0);
}

.dcart-toast.error{background:#b91c1c;}
.dcart-toast.info{background:#1f2937;}

@media (max-width:600px){
    .dcart-toast{
        right:16px;
        bottom:82px;
    }
}
