/**
 * Cart Sidebar Styles
 * Slide-in cart panel for quick cart overview
 */

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 100%;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.cart-sidebar.show {
    right: 0;
}

.cart-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6);
    border-bottom: 1px solid var(--color-gray-200);
}

.cart-sidebar__title {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    margin: 0;
}

.cart-sidebar__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: var(--text-xl);
    color: var(--color-gray-500);
    cursor: pointer;
    transition: color var(--transition-base);
}

.cart-sidebar__close:hover {
    color: var(--color-black);
}

.cart-sidebar__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
}

.cart-sidebar__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.cart-sidebar__items {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.cart-sidebar-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3);
    background-color: var(--color-gray-50);
    border-radius: var(--radius-md);
}

.cart-sidebar-item__image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.cart-sidebar-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-sidebar-item__details {
    flex: 1;
}

.cart-sidebar-item__title {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    margin-bottom: var(--space-1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.cart-sidebar-item__price {
    font-size: var(--text-sm);
    color: var(--color-gray-600);
}

.cart-sidebar-item__remove {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--color-gray-400);
    cursor: pointer;
    transition: color var(--transition-base);
}

.cart-sidebar-item__remove:hover {
    color: var(--color-danger);
}

.cart-sidebar__footer {
    padding: var(--space-6);
    border-top: 1px solid var(--color-gray-200);
}

.cart-sidebar__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    font-size: var(--text-lg);
}

.cart-sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}