.cart-drawer {
position: fixed;
top: 0;
right: 0;
width: 100%;
max-width: 400px;
height: 100vh;
background: white;
z-index: 1000;
transform: translateX(100%);
transition: transform 0.3s ease;
}
.cart-drawer.active {
transform: translateX(0);
}
.cart-drawer__overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 999;
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
}
.cart-drawer.active .cart-drawer__overlay {
opacity: 1;
visibility: visible;
}
.cart-drawer__content {
display: flex;
flex-direction: column;
height: 100%;
}
.cart-drawer__header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
border-bottom: 1px solid var(--color-border);
}
.cart-drawer__title {
font-size: 1.25rem;
font-weight: 600;
margin: 0;
}
.cart-drawer__close {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
padding: 0.5rem;
}
.cart-drawer__items {
flex: 1;
overflow-y: auto;
padding: 1rem;
}
.cart-item {
display: flex;
gap: 1rem;
padding: 1rem 0;
border-bottom: 1px solid var(--color-border);
}
.cart-item__image {
width: 80px;
height: 80px;
border-radius: 0.25rem;
overflow: hidden;
}
.cart-item__image img {
width: 100%;
height: 100%;
object-fit: cover;
}
.cart-item__content {
flex: 1;
}
.cart-item__title {
font-size: 1rem;
font-weight: 600;
margin-bottom: 0.5rem;
}
.cart-item__price {
font-weight: 600;
color: var(--color-text-primary);
margin-bottom: 0.5rem;
}
.cart-item__quantity {
display: flex;
align-items: center;
gap: 0.5rem;
}
.cart-item__qty-btn {
width: 30px;
height: 30px;
border: 1px solid var(--color-border);
background: white;
cursor: pointer;
border-radius: 0.25rem;
}
.cart-item__qty-input {
width: 50px;
text-align: center;
border: 1px solid var(--color-border);
border-radius: 0.25rem;
padding: 0.25rem;
}
.cart-item__remove {
background: none;
border: none;
font-size: 1.25rem;
cursor: pointer;
color: var(--color-text-secondary);
}
.cart-drawer__footer {
padding: 1rem;
border-top: 1px solid var(--color-border);
}
.cart-drawer__subtotal {
display: flex;
justify-content: space-between;
font-weight: 600;
margin-bottom: 1rem;
}
.cart-drawer__checkout {
width: 100%;
padding: 1rem;
background: var(--color-primary);
color: white;
border: none;
border-radius: 0.25rem;
font-weight: 600;
cursor: pointer;
transition: background-color 0.3s ease;
}
.cart-drawer__checkout:hover {
background: var(--color-primary-dark);
}