/* CART OVERLAY */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  box-sizing: border-box;
  z-index: 1000;
  background: rgba(12, 15, 10, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-med), visibility var(--duration-med);
}

.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* CART PANEL */
.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform var(--duration-med) var(--ease-out);
  display: flex;
  flex-direction: column;
}

.cart-panel.open {
  transform: translateX(0);
}

/* CART HEADER */
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.cart-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.cart-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

#clear-cart {
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid rgba(17, 19, 15, 0.3);
  color: var(--ink);
  background: transparent;
  font: 700 9px var(--body);
  letter-spacing: 0.1em;
  transition: color var(--duration-fast), border-color var(--duration-fast), opacity var(--duration-fast);
}

#clear-cart:hover:not(:disabled) {
  color: #a34732;
  border-color: #a34732;
}

#clear-cart:disabled {
  opacity: 0.35;
  cursor: default;
}

#cart-close {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  background: none;
  border: none;
  color: var(--muted);
  transition: color var(--duration-fast);
}

#cart-close:hover {
  color: var(--ink);
}

.cart-close-icon {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
  opacity: 0.72;
  transition: opacity var(--duration-fast), filter var(--duration-fast);
}

#cart-close:hover .cart-close-icon {
  filter: brightness(0) invert(1) sepia(1) saturate(4) hue-rotate(34deg);
  opacity: 1;
}

/* CART ITEMS */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cart-empty-message {
  text-align: center;
  color: var(--muted);
  margin-top: 40px;
  font-size: 14px;
}

.cart-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  position: relative;
}

.cart-item-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #f0f0f0;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.cart-item-meta {
  font-size: 11px;
  color: var(--muted);
}

.cart-item-price {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

/* CART QTY */
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  width: fit-content;
}

.qty-btn {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--ink);
}

.qty-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.cart-item-qty span {
  font-size: 12px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
}

/* CART REMOVE */
.cart-item-remove {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  padding: 4px;
}

.cart-item-remove:hover {
  color: var(--orange);
}

/* CART FOOTER */
.cart-footer {
  padding: 24px 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--paper);
}

.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 600;
}

#checkout-button {
  width: 100%;
  justify-content: center;
}

#checkout-button:disabled {
  opacity: 0.45;
  cursor: default;
}
