/* ─── CART ICON ─── */
.cart-icon-link {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--text-on-dark-muted);
  transition: color 0.3s;
  text-decoration: none;
}

.cart-icon-link:hover { color: var(--text-light); }

.cart-badge {
  position: absolute;
  top: -6px; right: -8px;
  background: var(--warm-tan);
  color: var(--text-heading);
  font-size: var(--font-size-3xs);
  font-weight: var(--weight-semibold);
  width: 16px; height: 16px;
  border-radius: var(--radius-full);
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
}

/* ─── CART OVERLAY ─── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: var(--black-a50);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.cart-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ─── CART DRAWER ─── */
.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  width: var(--cart-drawer-width);
  max-width: 90vw;
  height: 100vh;
  background: var(--surface-white);
  z-index: 310;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-drawer);
  border-radius: var(--radius-2xl) 0 0 var(--radius-2xl);
}

.cart-drawer.active {
  transform: translateX(0);
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5xl) var(--space-6xl);
  border-bottom: var(--border-muted);
}

.cart-drawer-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-title-2xl);
  font-weight: var(--weight-regular);
  color: var(--text-heading);
}

.cart-drawer-close {
  background: none;
  border: none;
  font-size: var(--font-size-close);
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-0);
  line-height: var(--line-solid);
  transition: color 0.2s;
}

.cart-drawer-close:hover { color: var(--text-heading); }

/* Cart items */
.cart-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2xl) var(--space-6xl);
}

.cart-item {
  display: flex;
  gap: var(--space-2xl);
  padding: var(--space-2xl) var(--space-0);
  border-bottom: var(--border-subtle);
  align-items: center;
}

.cart-item-img {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  filter: saturate(0.8);
  flex-shrink: 0;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-family: var(--font-heading);
  font-size: var(--font-size-base-tight);
  color: var(--text-heading);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-family: var(--font-accent);
  font-size: var(--font-size-body);
  color: var(--text-muted);
}

.cart-item-options {
  font-family: var(--font-body);
  font-size: var(--font-size-xs-plus);
  color: var(--text-secondary);
  margin-top: var(--space-3xs);
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  opacity: 0.4;
  cursor: pointer;
  font-size: var(--font-size-title-xl);
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.cart-item-remove:hover { opacity: 1; }

/* Empty state */
.cart-drawer-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5xl);
  padding: var(--space-7xl);
}

.cart-drawer-empty p {
  font-family: var(--font-accent);
  font-size: var(--font-size-title-xl);
  color: var(--text-muted);
}

/* Footer / total */
.cart-drawer-footer {
  display: none;
  padding: var(--space-5xl) var(--space-6xl);
  border-top: 1px solid var(--coffee-a15);
}

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

.cart-drawer-total span:first-child {
  font-family: var(--font-body);
  font-size: var(--font-size-ui-md);
  letter-spacing: var(--tracking-button);
  text-transform: uppercase;
  color: var(--text-muted);
}

.cart-drawer-total span:last-child {
  font-family: var(--font-heading);
  font-size: var(--font-size-title-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-heading);
}

.cart-checkout-btn {
  width: 100%;
  text-align: center;
  border-radius: var(--radius-full);
}

/* ─── CART PAGE ─── */
.cart-page {
  padding: var(--space-14xl) var(--space-11xl) var(--space-12xl);
  min-height: 60vh;
}

.cart-page-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-page-title);
  color: var(--text-heading);
  margin-bottom: var(--space-7xl);
}

.cart-message {
  color: var(--text-muted);
  font-family: var(--font-accent);
  font-size: var(--font-size-title-md);
}

/* ─── SUCCESS PAGE ─── */
.success-page {
  padding: var(--space-16xl) var(--space-11xl) var(--space-12xl);
  text-align: center;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.success-icon {
  font-size: var(--font-size-error-icon);
  margin-bottom: var(--space-5xl);
}

.success-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-empty-icon);
  color: var(--text-heading);
  margin-bottom: var(--space-2xl);
}

.success-text {
  font-size: var(--font-size-base);
  line-height: var(--line-copy);
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: var(--space-7xl);
}

.success-actions {
  display: flex;
  gap: var(--space-2xl);
  flex-wrap: wrap;
  justify-content: center;
}

.success-actions .btn-secondary {
  color: var(--text-heading);
  border-color: var(--coffee);
}

.success-actions .btn-secondary:hover {
  background: var(--text-heading);
  color: var(--cream);
  border-color: var(--text-heading);
}

.success-text {
  font-kerning: normal;
  letter-spacing: normal;
  line-height: normal;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 600px) {
  .cart-drawer { width: 100%; max-width: 100%; }
  .cart-page { padding: var(--space-13xl) var(--space-5xl) var(--space-9xl); }
  .success-page { padding: var(--space-15xl) var(--space-5xl) var(--space-9xl); }
}
