/* Cart drawer: everything the store JS builds inside #cart-dialog. The
   container, backdrop and slide-in live in store-dialogs.css; tokens in base.css. */

/* ---------- Cart drawer ---------- */

.drawer__head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--header-h);
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--border);
}

.drawer__title {
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
}

.drawer__head .dialog__close {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.drawer__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  padding: 0 var(--space-6);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cart-list { margin: 0; padding: 0; list-style: none; }

.cart-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: var(--space-4);
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--border);
  animation: fade-in var(--dur-base) var(--ease-out-soft);
}

.cart-item:last-child { border-bottom: 0; }

.cart-item__media img { width: 100%; height: 100%; padding: 8%; object-fit: contain; }

.cart-item__media {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--media-bg);
}

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

.cart-item__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.cart-item__name {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.cart-item__line {
  flex: none;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.cart-item__meta {
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.cart-item__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-3);
}

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

.cart-item__dec,
.cart-item__inc {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 1.125rem;
  line-height: 1;
  transition: color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out-soft);
}

.cart-item__dec:hover:not(:disabled),
.cart-item__inc:hover:not(:disabled) { color: var(--text); }

.cart-item__dec:active:not(:disabled),
.cart-item__inc:active:not(:disabled) { transform: scale(0.9); }

.cart-item__dec:disabled,
.cart-item__inc:disabled { color: var(--border-strong); cursor: not-allowed; }

.cart-item__qty {
  min-width: 1.75em;
  color: var(--text);
  font-size: var(--fs-sm);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.cart-item__remove {
  min-height: 44px;
  padding: 0 var(--space-1);
  border: 0;
  background: none;
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 6px;
  transition: color var(--dur-fast) ease;
}

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

.cart-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  padding-block: var(--space-8);
  text-align: center;
}

.cart-empty__text {
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
}

.drawer__foot {
  flex: none;
  padding: var(--space-5) var(--space-6) calc(var(--space-5) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.cart-summary { display: grid; gap: var(--space-2); margin: 0; }

.cart-summary__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
}

.cart-summary dd {
  margin: 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.cart-summary__row--total dt { color: var(--text); }

.cart-summary__row--total dd {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 500;
  font-variant-numeric: lining-nums tabular-nums;
}

.cart-note { margin: var(--space-3) 0 var(--space-5); color: var(--muted); font-size: var(--fs-xs); }

/* The checkout button is the one loud element in the drawer. */
#cart-checkout { min-height: 56px; }

/* Cart rows: the shared placeholder (store.css), mark only. */
.cart-item__placeholder { gap: 0; }
.cart-item__placeholder .photo-placeholder__mark { font-size: 1.125rem; letter-spacing: 0.12em; padding-left: 0.12em; }
.cart-item__placeholder .photo-placeholder__note { display: none; }
