.cart-modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:99999;
    backdrop-filter:blur(6px);
}

.cart-modal.active{
    display:flex;
}

.cart-content{
    width:100%;
    max-width:850px;
    max-height:calc(100vh - 40px);
    overflow-y:auto;
    background:white;
    border-radius:24px;
    padding:35px;
    box-shadow:0 20px 60px rgba(0,0,0,.2);
    animation:modalShow .25s ease;
}

@keyframes modalShow{
    from{
        opacity:0;
        transform:translateY(20px);
    }

    to{
        opacity:1;
        transform:translateY(0);
    }
}

.cart-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:24px;
}

.cart-close{
    width:40px;
    height:40px;
    padding:0;
    border:0;
    border-radius:999px;
    display:grid;
    place-items:center;
    background:transparent;
    color:#0f1f4d;
    cursor:pointer;
}

.cart-close:hover,
.cart-close:focus-visible{
    background:#f1f5f9;
}

.cart-close svg{
    width:22px;
    height:22px;
    pointer-events:none;
}

.icon-button{
    position:relative;
}

.cart-count{
    position:absolute;
    top:-7px;
    right:-7px;
    min-width:20px;
    height:20px;
    padding:0 6px;
    display:grid;
    place-items:center;
    border-radius:999px;
    background:#06298b;
    color:white;
    font-size:11px;
    font-weight:800;
    line-height:1;
}

.cart-message{
    margin-bottom:18px;
    padding:12px 14px;
    border-radius:14px;
    font-size:14px;
    font-weight:700;
}

.cart-message.success{
    background:#ecfdf5;
    color:#047857;
}

.cart-message.danger{
    background:#fef2f2;
    color:#b91c1c;
}

.cart-message.info{
    background:#eff6ff;
    color:#06298b;
}

.cart-items{
    margin-bottom:24px;
}

.cart-empty{
    padding:30px 0;
    text-align:center;
    color:#64748b;
}

.cart-item{
    display:grid;
    grid-template-columns:92px 1fr auto;
    gap:18px;
    align-items:center;
    padding:16px 0;
    border-bottom:1px solid #eef2f7;
}

.cart-item:first-child{
    padding-top:0;
}

.cart-item-image img{
    width:92px;
    height:92px;
    border-radius:16px;
    object-fit:cover;
}

.cart-item-main{
    min-width:0;
}

.cart-item-name{
    display:block;
    color:#0f1f4d;
    font-weight:800;
    text-decoration:none;
}

.cart-item-main p{
    margin:6px 0 12px;
    color:#64748b;
}

.cart-item-controls{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}

.cart-item-controls button{
    border:1px solid #dbe3ef;
    background:white;
    color:#06298b;
    border-radius:10px;
    min-width:34px;
    height:34px;
    padding:0 10px;
    font-weight:800;
    cursor:pointer;
}

.cart-item-controls button:disabled{
    opacity:.45;
    cursor:not-allowed;
}

.cart-remove{
    color:#b91c1c !important;
}

.cart-item-price{
    color:#06298b;
    white-space:nowrap;
}

.cart-total{
    display:flex;
    justify-content:space-between;
    font-size:20px;
    margin-bottom:12px;
    padding-top:20px;
    border-top:1px solid #eee;
}

.cart-free-shipping{
    margin-bottom:25px;
    padding:12px 14px;
    border:1px solid #dbeafe;
    border-radius:12px;
    background:#eff6ff;
    color:#06298b;
    font-size:14px;
    font-weight:800;
    line-height:1.35;
}

.cart-free-shipping.qualified{
    border-color:#bbf7d0;
    background:#ecfdf5;
    color:#047857;
}

.cart-related{
    margin:10px 0 28px;
    padding-top:22px;
    border-top:1px solid #eef2f7;
}

.cart-related h4{
    margin-bottom:16px;
    color:#0f1f4d;
    font-size:18px;
}

.cart-related-grid{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:14px;
}

.cart-related-item{
    min-width:0;
}

.cart-related-item img{
    width:100%;
    aspect-ratio:1 / 1;
    object-fit:cover;
    border-radius:8px;
    margin-bottom:10px;
}

.cart-related-name{
    display:block;
    min-height:42px;
    color:#0f1f4d;
    font-size:14px;
    font-weight:800;
    line-height:1.35;
    text-decoration:none;
}

.cart-related-item strong{
    display:block;
    margin:6px 0 10px;
    color:#06298b;
}

.cart-related-item button{
    width:100%;
    min-height:38px;
    border:0;
    border-radius:8px;
    background:#06298b;
    color:white;
    font-family:inherit;
    font-size:13px;
    font-weight:800;
    cursor:pointer;
}

.cart-related-item button:disabled{
    opacity:.45;
    cursor:not-allowed;
}

.cart-buttons{
    margin:30px 0 0;
    display:flex;
    flex-direction:row;
    justify-content:space-between;
    gap:16px;
}

.cart-buttons .btn{
    justify-content:center;
}

.cart-back{
    font-family:inherit;
    cursor:pointer;
}

@media(max-width:768px){
    .cart-content{
        width:95%;
        padding:25px;
        border-radius:20px;
    }

    .cart-item{
        grid-template-columns:74px 1fr;
        align-items:start;
    }

    .cart-item-image img{
        width:74px;
        height:74px;
        border-radius:14px;
    }

    .cart-item-price{
        grid-column:2;
    }

    .cart-related-grid{
        grid-template-columns:repeat(2, 1fr);
    }

    .cart-buttons{
        flex-direction:column;
    }
}

@media(max-width:420px){
    .cart-related-grid{
        grid-template-columns:1fr;
    }

    .cart-related-item{
        display:grid;
        grid-template-columns:72px 1fr;
        gap:12px;
        align-items:center;
    }

    .cart-related-item img{
        margin-bottom:0;
    }

    .cart-related-item button{
        grid-column:1 / -1;
    }
}
