/* ===== Oaken — Cart (button, drawer, quantity stepper) ===== */

/* ===== Cart button ===== */
.nav__cart {
  grid-column: 3; grid-row: 1; justify-self: end;
  display: flex; align-items: center; gap: 6px;
  height: 40px;
  font-size: 14px; text-transform: uppercase;
  color: var(--ink);
  transition: color 0.3s var(--ease);
}
.nav__cart:hover { color: var(--green); }
.nav__cart svg { width: 22px; height: 22px; color: #8A8A8A; transition: color 0.3s var(--ease); }
.nav__cart:hover svg { color: var(--green); }
.nav__cart-count::before { content: "Cart("; }
.nav__cart-count::after { content: ")"; }

.cart-link {
  position: fixed; top: 20px; right: var(--pad); z-index: 90;
  display: none; align-items: center; gap: 8px;
  height: var(--nav-h);
  font-size: 16px; text-transform: uppercase;
  transition: color 0.4s var(--ease), transform 0.9s cubic-bezier(0.65, 0, 0.35, 1);
}
.nav-hidden .cart-link { transform: translateY(calc(-100% - 40px)); }
.cart-link:hover { color: var(--green); }
.cart-link__icon { width: 24px; height: 24px; color: #8A8A8A; transition: color 0.4s var(--ease); }
.cart-link:hover .cart-link__icon { color: var(--green); }

.is-bump { animation: cart-bump 0.6s var(--ease); }
@keyframes cart-bump { 40% { transform: scale(1.12); } }

@media (min-width: 768px) {
  .nav__cart svg { width: 24px; height: 24px; }
}

/* ===== Cart drawer ===== */
.cart {
  position: fixed; inset: 0; z-index: 150;
  visibility: hidden;
  transition: visibility 0s linear 0.8s;
}
.cart.is-open { visibility: visible; transition-delay: 0s; }

.cart__backdrop {
  position: absolute; inset: 0;
  background: rgba(30, 30, 30, 0.4);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.cart.is-open .cart__backdrop { opacity: 1; }

.cart__panel {
  position: absolute; top: 10px; right: 10px; bottom: 10px;
  display: flex; flex-direction: column;
  width: min(460px, calc(100% - 20px));
  border-radius: var(--radius-lg);
  background: var(--bg);
  overflow: hidden;
  transform: translateX(calc(100% + 20px));
  transition: transform 0.8s var(--ease);
}
.cart.is-open .cart__panel { transform: none; }

.cart__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 28px 24px 20px;
}
.cart__title { font-size: clamp(26px, 1vw + 20px, 32px); line-height: 1.1; }
.cart__count { color: var(--muted); font-size: 0.6em; }
.cart__close {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--white);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
.cart__close:hover { background: var(--ink); color: var(--white); }
.cart__close svg { width: 22px; height: 22px; }

.cart__items {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  display: grid; align-content: start; gap: 12px;
  padding: 0 16px 16px;
}
.cart__items[hidden], .cart__foot[hidden], .cart__empty[hidden] { display: none; }

.cart-item {
  display: grid; grid-template-columns: 92px 1fr; gap: 16px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--white);
}
.cart.is-open .cart-item { animation: cart-item-in 0.7s var(--ease) both; animation-delay: calc(0.25s + var(--i, 0) * 0.08s); }
@keyframes cart-item-in { from { opacity: 0; transform: translateX(24px); filter: blur(6px); } }

.cart-item__media {
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  background: linear-gradient(180deg, #E1E1E1 0%, #DCDCDC 48%, #B6B6B6 100%);
  overflow: hidden;
}
.cart-item__media img { width: 100%; height: 100%; object-fit: contain; padding: 6%; }

.cart-item__body { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-width: 0; }
.cart-item__top { display: flex; justify-content: space-between; gap: 12px; }
.cart-item__name { font-size: 18px; font-weight: 400; line-height: 1.25; }
.cart-item__meta { margin-top: 2px; color: var(--muted); font-size: 14px; }
.cart-item__remove {
  flex: none; align-self: flex-start;
  color: var(--muted); font-size: 14px;
  text-decoration: underline; text-underline-offset: 3px;
  transition: color 0.3s var(--ease);
}
.cart-item__remove:hover { color: var(--ink); }
.cart-item__bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cart-item__price { color: var(--green); font-size: 18px; font-weight: 400; }
.cart-item .qty { height: 36px; background: var(--bg); }
.cart-item .qty button { width: 36px; font-size: 18px; }
.cart-item .qty output { width: 28px; text-align: center; }

.cart__empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  padding: 24px;
  color: var(--muted); text-align: center;
}
.cart__empty > svg { width: 56px; height: 56px; color: #B5B5B5; }

.cart__foot {
  display: grid; gap: 12px;
  padding: 20px 24px 24px;
  border-top: 1px solid var(--line);
}
.cart__row { display: flex; align-items: baseline; justify-content: space-between; }
.cart__row strong { font-size: 24px; font-weight: 400; }
.cart__note { margin-bottom: 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.cart__foot .btn { width: 100%; }

/* ===== Quantity stepper (cart items + product page) ===== */
.qty {
  display: flex; align-items: center;
  height: 40px; border-radius: 8px;
  background: var(--white);
}
.qty button {
  width: 44px; height: 100%;
  font-size: 20px; line-height: 1; color: var(--ink);
  transition: color 0.3s var(--ease);
}
.qty button:hover { color: var(--green); }
.qty button:disabled { color: #C8C8C8; cursor: default; }
.qty input {
  width: 40px; border: 0; background: none;
  font: inherit; text-align: center; color: var(--ink);
  -moz-appearance: textfield; appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
