/* ===========================
   HEADER SLOT
   .right-part only ever showed one
   visible child per breakpoint before
   (hamburger XOR desktop nav). Adding
   the cart trigger means it now always
   needs to lay out inline with whichever
   of those is active.
=========================== */

.right-part{
    display:flex;
    align-items:center;
    gap:20px;
}

/* ===========================
   TRIGGER
=========================== */

.cart-trigger{
    position:relative;

    display:flex;
    align-items:center;
    justify-content:center;

    width:40px;
    height:40px;

    border:none;
    background:none;
    padding:0;

    color:var(--text);
    font-size:var(--fs-lg);

    cursor:pointer;
    text-decoration:none;

    transition:var(--transition);
}

.cart-trigger:hover{
    color:var(--primary);
}

.cart-badge{
    position:absolute;
    top:-4px;
    right:-6px;

    max-width:19px;
    height:19px;
    padding:0 4px;

    display:flex;
    align-items:center;
    justify-content:center;

    background:var(--warning);
    color:#fff;

    font-size:11px;
    font-weight:700;
    line-height:1;

    border-radius:999px;
    border:2px solid var(--surface);
}
.cart-badge span{
    margin-top: 2px;


}


@media (max-width:768px){

   .cart-badge{
    position:absolute;
    top:-2px;
    left:-6px !important;
    right: unset !important;



}



}
 

/* ===========================
   BACKDROP
=========================== */

.cart-drawer-backdrop{
    position:fixed;
    inset:0;

    background:var(--backdrop);
    backdrop-filter:blur(6px);
    -webkit-backdrop-filter:blur(6px);

    opacity:0;
    visibility:hidden;

    transition:var(--transition);

    z-index:99998;
}

.cart-drawer-backdrop.active{
    opacity:1;
    visibility:visible;
}

/* ===========================
   DRAWER
=========================== */

.cart-drawer{
    position:fixed;
    top:0;
    right:0;
    bottom:0;

    width:100%;
    max-width:420px;

    display:flex;
    flex-direction:column;

    background:var(--overlay);
    backdrop-filter:blur(var(--blur));
    -webkit-backdrop-filter:blur(var(--blur));

    border-left:1px solid var(--border-soft);
    box-shadow:var(--shadow-md);

    transform:translateX(100%);
    transition:transform .4s ease;

    z-index:99999;
}

.cart-drawer.active{
    transform:translateX(0);
}

/* HEAD */

.cart-drawer-head{
    display:flex;
    align-items:center;
    justify-content:space-between;

    padding:calc(var(--unit) * 6);
    border-bottom:1px solid var(--border);
    flex-shrink:0;
}

.cart-drawer-head h3{
    display:flex;
    align-items:center;
    gap:8px;

    color:var(--text);
    font-size:var(--fs-lg);
}

.cart-drawer-close{
    width:36px;
    height:36px;

    display:flex;
    align-items:center;
    justify-content:center;

    border:none;
    background:var(--surface-2);
    border-radius:50%;

    color:var(--text);
    cursor:pointer;

    transition:var(--transition);
}

.cart-drawer-close:hover{
    background:var(--border);
}

/* BODY */

.cart-drawer-body{
    flex:1;
    overflow-y:auto;
    padding:0 calc(var(--unit) * 6);
}

.cart-drawer-body::-webkit-scrollbar{
    width:4px;
}

.cart-drawer-body::-webkit-scrollbar-thumb{
    background:var(--border-soft);
    border-radius:999px;
}

/* EMPTY STATE */

.cart-drawer-empty{
    height:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    padding:calc(var(--unit) * 10) 0;
}

.cart-drawer-empty i{
    font-size:var(--fs-3xl);
    color:var(--text-soft);
    margin-bottom:calc(var(--unit) * 4);
}

.cart-drawer-empty h4{
    color:var(--text);
    font-size:var(--fs-lg);
    margin-bottom:calc(var(--unit) * 2);
}

.cart-drawer-empty p{
    color:var(--text-muted);
    font-size:var(--fs-sm);
    margin-bottom:calc(var(--unit) * 6);
}

.cart-continue-btn{
    border:1px solid var(--border);
    background:var(--surface);
    color:var(--text);
    border-radius:var(--radius-sm);
    padding:calc(var(--unit) * 3) calc(var(--unit) * 6);
    font-size:var(--fs-sm);
    cursor:pointer;
    transition:var(--transition);
}

.cart-continue-btn:hover{
    border-color:var(--primary);
    color:var(--primary);
}

/* ===========================
   LINE ITEM
=========================== */

.cart-line{
    display:flex;
    gap:calc(var(--unit) * 3);
    padding:calc(var(--unit) * 5) 0;
}

.cart-line + .cart-line{
    border-top:1px dashed var(--border);
}

.cart-line-image{
    width:64px;
    height:64px;
    flex-shrink:0;

    border-radius:var(--radius-sm);
    border:1px solid var(--border);
    overflow:hidden;

    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--surface-2);
}

.cart-line-image img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.cart-line-image i{
    color:var(--text-soft);
    font-size:var(--fs-lg);
}

.cart-line-info{
    flex:1;
    min-width:0;

    display:flex;
    flex-direction:column;
    gap:3px;
}

.cart-line-title{
    color:var(--text);
    font-size:var(--fs-sm);
    font-weight:600;

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.cart-line-meta{
    color:var(--text-muted);
    font-size:12px;
}

.cart-line-price{
    color:var(--text-soft);
    font-size:12px;
}

.cart-line-actions{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-top:6px;
}

.cart-line-subtotal{
    flex-shrink:0;
    align-self:center;

    color:var(--text);
    font-weight:700;
    font-size:var(--fs-sm);
    white-space:nowrap;
}

/* QTY STEPPER */

.cart-qty-box{
    overflow:hidden;
}

.cart-qty-box .qty-btn{
    width:26px;
    height:26px;

    background:var(--surface-2);

    font-size:12px;
}

.cart-qty-box .qty-btn:hover{
    background:var(--primary);
    color:#fff;
}

.cart-qty-box .quantity-value{
    width:32px;
    height:26px;

    font-size:12px;
}

.cart-remove-btn{
    width:30px;
    height:30px;

    display:flex;
    align-items:center;
    justify-content:center;

    border:1px solid transparent;
    background:none;

    color:var(--text-soft);
    cursor:pointer;

    border-radius:var(--radius-sm);
    transition:var(--transition);
}

.cart-remove-btn:hover{
    color:var(--warning);
    border-color:var(--warning);
    background:color-mix(in srgb, var(--warning) 8%, transparent);
}

/* ===========================
   FOOTER
=========================== */

.cart-drawer-footer{
    flex-shrink:0;
    padding:calc(var(--unit) * 6);
    border-top:1px solid var(--border);
}

.cart-drawer-total{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:calc(var(--unit) * 4);

    color:var(--text-muted);
    font-size:var(--fs-md);
}

.cart-drawer-total strong{
    color:var(--primary);
    font-size:var(--fs-lg);
}

/* ===========================
   RESPONSIVE
=========================== */

@media (max-width:480px){

    .cart-drawer{
        max-width:100%;
    }

}
