/* ============================================
   Midnight Lace — Cart Sidebar
   ============================================ */

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  max-width: 90vw;
  height: 100vh;
  background: var(--color-bg-secondary);
  border-left: 1px solid var(--color-border);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-out);
}

.cart-sidebar.open {
  transform: translateX(0);
}

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

.cart-sidebar__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text-primary);
}

.cart-sidebar__count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-family: var(--font-body);
  margin-left: var(--space-2);
}

.cart-sidebar__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  transition: all var(--duration-normal) var(--ease-out);
}

.cart-sidebar__close:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.cart-sidebar__close svg {
  width: 20px;
  height: 20px;
}

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

/* Cart Item */
.cart-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
  animation: cart-item-in 0.3s var(--ease-out);
}

@keyframes cart-item-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.cart-item__image {
  width: 80px;
  height: 100px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-bg-tertiary);
}

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

.cart-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cart-item__name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item__variant {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.cart-item__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.cart-item__qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.cart-item__qty button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  transition: color var(--duration-fast);
}

.cart-item__qty button:hover { color: var(--color-accent-gold); }

.cart-item__qty span {
  width: 32px;
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 500;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  line-height: 28px;
}

.cart-item__price {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent-gold);
}

.cart-item__remove {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  margin-top: var(--space-2);
  opacity: 0.6;
  transition: all var(--duration-normal);
  text-align: left;
}

.cart-item__remove:hover {
  opacity: 1;
  color: var(--color-error);
}

/* Cart Footer */
.cart-sidebar__footer {
  padding: var(--space-6);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
  background: var(--color-bg-secondary);
}

.cart-sidebar__subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.cart-sidebar__subtotal-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.cart-sidebar__subtotal-value {
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--color-accent-gold);
}

.cart-sidebar__shipping {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.cart-sidebar__checkout {
  width: 100%;
  margin-bottom: var(--space-3);
}

.cart-sidebar__continue {
  width: 100%;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-2);
  transition: color var(--duration-normal);
}

.cart-sidebar__continue:hover {
  color: var(--color-accent-gold);
}

/* Empty Cart */
.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8);
  color: var(--color-text-muted);
}

.cart-empty svg {
  width: 64px;
  height: 64px;
  stroke: var(--color-text-muted);
  opacity: 0.3;
  margin-bottom: var(--space-6);
}

.cart-empty p {
  font-size: var(--text-base);
  margin-bottom: var(--space-6);
}
