/* ── cart.css — drawer del carrito ─────────────────────── */

/* Overlay / mask */
.mask {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-cart) - 1);
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease);
}

.mask.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Panel lateral */
.cart {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-cart);
  width: min(420px, 100vw);
  background: var(--background);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transform: translateX(102%);
  transition: transform var(--dur-base) var(--ease);
}

.cart.is-open {
  transform: none;
}

/* Cabecera */
.cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--space-6);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.cart__title {
  font-family: var(--font-mono);
  font-size: var(--size-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  font-weight: var(--weight-bold);
}

.cart__meta {
  color: var(--accent);
  font-weight: var(--weight-regular);
  margin-left: 0.4em;
}

.cart__close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  transition: color var(--dur-fast);
}

.cart__close:hover {
  color: var(--text);
}
.cart__close [data-lucide] {
  width: 18px;
  height: 18px;
}

/* Cuerpo — scrollable */
.cart__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Estado vacío */
.cart__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--muted);
  padding: 3rem 0;
}

.cart__empty [data-lucide] {
  width: 40px;
  height: 40px;
  opacity: 0.35;
}

.cart__empty p {
  font-family: var(--font-mono);
  font-size: var(--size-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Ítem */
.cart__item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: var(--space-4);
  align-items: start;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
}

.cart__item:last-child {
  border-bottom: none;
}

.cart__img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.cart__info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cart__name {
  font-size: var(--size-sm);
  color: var(--text);
  line-height: var(--leading-tight);
}

.cart__price {
  font-family: var(--font-mono);
  font-size: var(--size-xs);
  color: var(--accent);
}

/* Cantidad */
.cart__qty {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.cart__qty span {
  font-family: var(--font-mono);
  font-size: var(--size-xs);
  min-width: 1.4em;
  text-align: center;
  color: var(--text);
}

.cart__qty-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  transition:
    color var(--dur-fast),
    border-color var(--dur-fast);
}

.cart__qty-btn:hover {
  color: var(--text);
  border-color: var(--text);
}

/* Botón eliminar */
.cart__remove {
  color: var(--muted);
  transition: color var(--dur-fast);
  padding: 2px;
}

.cart__remove:hover {
  color: var(--danger);
}
.cart__remove [data-lucide] {
  width: 15px;
  height: 15px;
}

/* Pie */
.cart__foot {
  padding: 1.25rem var(--space-6);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex-shrink: 0;
}

.cart__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: var(--size-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.cart__row b {
  font-size: var(--size-md);
  color: var(--text);
  letter-spacing: 0;
}

.cart__note {
  font-size: var(--size-xxs);
  color: var(--dim);
  text-align: center;
  line-height: var(--leading-loose);
}

/* Scroll lock */
body.no-scroll {
  overflow: hidden;
}
.cart__prices {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.35em;
  gap: var(--space-2);
}

.cart__unit {
  font-size: var(--size-xxs);
  color: var(--dim);
}

.cart__subtotal {
  font-size: var(--size-xs);
  font-weight: 600;
  color: var(--text);
}
