/* ===== LeanShirt - cart ===== */

/* Cart button in header */
.cart-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  background: transparent; border: 1.5px solid var(--line); border-radius: 999px;
  color: var(--ink); cursor: pointer; transition: .2s ease;
}
.cart-btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.cart-btn svg { width: 21px; height: 21px; }
.cart-btn__count {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  font-size: 11.5px; font-weight: 800; line-height: 1;
  border-radius: 999px; border: 2px solid #fff;
  transform: scale(0); transition: transform .25s cubic-bezier(.2,.9,.3,1.4);
}
.cart-btn__count.is-visible { transform: scale(1); }
.cart-btn--bump { animation: cartBump .4s ease; }
@keyframes cartBump {
  30% { transform: scale(1.18); }
  60% { transform: scale(.94); }
  100% { transform: scale(1); }
}

/* Overlay */
.cart-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(14,16,20,.45); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease;
}
.cart-overlay.is-open { opacity: 1; visibility: visible; }

/* Drawer */
.cart {
  position: fixed; top: 0; right: 0; z-index: 91;
  width: 420px; max-width: 100vw; height: 100%;
  background: var(--bg); display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .35s cubic-bezier(.2,.9,.3,1.05);
}
.cart.is-open { transform: translateX(0); }

.cart__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--line);
}
.cart__head h3 { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.cart__head h3 span { color: var(--muted); font-weight: 600; }
.cart__close {
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font-size: 26px; line-height: 1; padding: 4px; transition: .15s;
}
.cart__close:hover { color: var(--ink); }

/* Body */
.cart__body { flex: 1; overflow-y: auto; padding: 8px 24px; }

.cart__empty {
  display: none; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; height: 100%; gap: 14px; color: var(--muted);
}
.cart__empty svg { width: 54px; height: 54px; color: var(--line); }
.cart__empty p { font-size: 15px; }
.cart.is-empty .cart__empty { display: flex; }
.cart.is-empty .cart__foot { display: none; }

/* Line item */
.cart-item {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 14px;
  align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line);
}
.cart-item__thumb {
  width: 56px; height: 64px; border-radius: 10px;
  display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
  background: #f4f6f9;
}
.cart-item__thumb svg { width: 100%; height: auto; }
.cart-item__info { min-width: 0; }
.cart-item__name { font-size: 14.5px; font-weight: 700; letter-spacing: -.2px; }
.cart-item__meta { font-size: 13px; color: var(--muted); margin: 2px 0 9px; }
.cart-item__qty { display: inline-flex; align-items: center; gap: 0; border: 1.5px solid var(--line); border-radius: 999px; }
.cart-item__qty button {
  width: 28px; height: 28px; background: none; border: 0; cursor: pointer;
  font-size: 17px; line-height: 1; color: var(--ink); border-radius: 999px; transition: .15s;
}
.cart-item__qty button:hover { background: var(--bg-alt); color: var(--accent); }
.cart-item__qty span { min-width: 26px; text-align: center; font-size: 14px; font-weight: 700; }
.cart-item__right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; height: 100%; }
.cart-item__price { font-size: 14.5px; font-weight: 800; }
.cart-item__remove {
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font-size: 12px; transition: .15s; padding: 0; text-decoration: underline; text-underline-offset: 2px;
}
.cart-item__remove:hover { color: #d23b3b; }

/* Foot */
.cart__foot { padding: 18px 24px 24px; border-top: 1px solid var(--line); background: var(--bg-alt); }
.cart__row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.cart__row--total { font-size: 18px; color: var(--ink); font-weight: 800; margin: 10px 0 4px; }
.cart__row--total b { font-weight: 800; }
.cart__ship { color: var(--accent); font-weight: 600; }
.cart__note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; }
.cart__checkout { margin-top: 14px; }

@media (max-width: 480px) {
  .cart { width: 100%; }
}
