.cart-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-sidebar {
    position: fixed;
    right: -100%;
    top: 0;
    height: 100%;
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
}

.cart-sidebar.opened {
    right: 0;
    box-shadow: -15px 0 30px rgba(0, 0, 0, 0.15);
}
.cart-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Header */
.cart-header {
    background: linear-gradient(135deg, #3d3a6b 0%, #2d2a55 100%);
    padding: 1.5rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-icon-wrapper {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.cart-title-group h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}
.cart-count-badge {
    font-size: 0.85rem;
    opacity: 0.8;
}

.btn-close-sidebar {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}
.btn-close-sidebar:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Body & Items */
.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.2s;
}
.cart-item:hover {
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #4c5ca4;
}

.cart-item-img {
    width: 70px;
    height: 70px;
    -o-object-fit: cover;
    object-fit: cover;
    border-radius: 8px;
    background: #f9fafb;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}
.cart-item-name {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item-ref {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qty-pill {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 2px;
}
.qty-btn-small {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
}
.qty-btn-small:hover {
    background: white;
}
.qty-val {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0 0.75rem;
}

.btn-remove-item {
    color: #ef4444;
    background: transparent;
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
}
.btn-remove-item:hover {
    background: #fee2e2;
}

/* Empty State */
.cart-empty-state {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-icon-circle {
    width: 80px;
    height: 80px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

/* Footer */
.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-main-checkout {
    background: linear-gradient(180deg, #302d63 0%, #201e47 100%);
    color: white;
    text-decoration: none;
    padding: 1.1rem;
    border-radius: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: transform 0.2s;
}
.btn-main-checkout:hover {
    transform: translateY(-2px);
}

.btn-return {
    background: white;
    border: 2px solid #e5e7eb;
    padding: 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}
.btn-return:hover {
    background: #f9fafb;
}

.btn-clear-all {
    text-align: center;
    color: #9ca3af;
    font-size: 0.75rem;
    text-decoration: none;
}
.btn-clear-all:hover {
    color: #ef4444;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

.no-scroll {
    overflow: hidden;
}

/* ========================================
   RESPONSIVE — Mobile (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {
    .cart-sidebar {
        max-width: 100%;
    }
    .cart-empty-state {
        text-align: center;
        padding: 2rem 1rem;
    }
}
