/* The cart drawer (footer.php, assets/js/cart.js). From the Phase 2 prototype (shared/base.css). */

.drawer { position: fixed; inset: 0 0 0 auto; width: min(480px, 100%); max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: #fff; color: var(--navy); box-shadow: -20px 0 60px rgba(0, 0, 92, .2); }
.drawer[open] { display: flex; animation: drawer-in .28s cubic-bezier(.2, .8, .2, 1); }
.drawer::backdrop { background: rgba(0, 0, 40, .45); }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
html.drawer-open { overflow: hidden; }
.drawer__panel { display: flex; flex-direction: column; width: 100%; min-height: 0; }

.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; padding-top: calc(16px + env(safe-area-inset-top, 0px)); border-bottom: 2px solid var(--line); }
.drawer__head h2 { font-size: var(--t-xl); outline-offset: 4px; }
.drawer__n { font-weight: 400; font-size: var(--t-b); color: var(--muted); }
.drawer__scroll { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 20px; padding: 16px 20px; }
.drawer__loading { color: var(--muted); }

.drawer__added { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--mint); }
.drawer__check { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--green); font-weight: 600; }
.drawer__empty { display: grid; gap: 10px; }
.drawer__empty-t { font-size: var(--t-l); font-weight: var(--fw-m); }
.drawer__err { padding: 12px 14px; border: 2px solid var(--red); border-radius: 0; color: var(--red); font-weight: var(--fw-m); }

.drawer__items { list-style: none; display: grid; gap: 16px; }
.ci { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: start; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.ci__art { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 0; background: var(--mist); }
.ci__art img { width: 100%; height: 100%; object-fit: contain; }
.ci__name { font-weight: var(--fw-m); line-height: 1.3; }
.ci__name a { display: inline-block; padding-block: 12px; margin-block: -12px; text-decoration: none; }
.ci__name a:hover { text-decoration: underline; }
.ci__opt { font-size: var(--t-s); color: var(--muted); }
.ci__note { font-size: var(--t-s); color: var(--navy); } /* e.g. "Pre-order: Expected to ship around Monday, Dec 15" */
.ci__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.ci__row .stepper { height: 52px; } /* 48px buttons inside the 2px border */
.ci__row .stepper__b { width: 48px; }
.ci__price { font-weight: var(--fw-m); text-align: right; font-variant-numeric: tabular-nums; }
.ci__price span { display: block; font-weight: 400; font-size: var(--t-xs); color: var(--muted); }

.drawer__forgot h3 { font-size: var(--t-l); margin-bottom: 10px; }
.drawer__forgot ul { list-style: none; display: grid; gap: 10px; }
.drawer__sug h4 { margin: 16px 0 8px; font-size: var(--t-s); color: var(--muted); font-weight: var(--fw-m); }
.mini { display: grid; grid-template-columns: 60px 1fr auto; gap: 12px; align-items: center; padding: 10px; border: 2px solid var(--line); border-radius: var(--radius); }
.mini__art { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 0; background: var(--mist); }
.mini__art img { width: 100%; height: 100%; object-fit: contain; }
.mini__name { font-weight: var(--fw-m); font-size: var(--t-s); line-height: 1.25; }
.mini__price { font-size: var(--t-s); color: var(--muted); }

.drawer__est { display: grid; gap: 8px; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--radius); font-size: var(--t-s); }
.paylater { color: var(--muted); }
.paylater strong { color: var(--navy); }
.drawer__help { padding: 14px 16px; border-radius: var(--radius); background: var(--mist); font-size: var(--t-s); color: var(--muted); }
.drawer__help a { display: inline-block; padding-block: 12px; margin-block: -12px; color: var(--navy); font-weight: var(--fw-m); }

.drawer__foot { display: grid; gap: 10px; padding: 14px 20px calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 2px solid var(--line); background: #fff; box-shadow: 0 -10px 24px rgba(0, 0, 92, .08); }
.sum { display: grid; gap: 4px; margin: 0; }
.sum div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sum dt { color: var(--muted); }
.sum dd { margin: 0; font-size: var(--t-l); font-weight: var(--fw-m); font-variant-numeric: tabular-nums; }
.drawer__actions { display: grid; gap: 8px; }
.drawer__two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drawer__two .btn { padding: 0 10px; white-space: nowrap; }

/* The quantity stepper, shared with the product page */
.stepper { display: inline-flex; align-items: stretch; height: 52px; overflow: hidden; border: 2px solid var(--line-strong); border-radius: var(--btn-radius); background: #fff; }
.stepper__b { width: 48px; border: 0; background: #fff; color: var(--navy); font: var(--fw-m) 1.5rem/1 var(--font); cursor: pointer; }
.stepper__b:hover { background: var(--mist); }
.stepper__b:disabled { color: var(--line-strong); cursor: not-allowed; }
.stepper__i { width: 52px; border: 0; border-inline: 2px solid var(--line); text-align: center; font: var(--fw-m) var(--t-b) var(--font); color: var(--navy); -moz-appearance: textfield; appearance: textfield; }
.stepper__i::-webkit-outer-spin-button, .stepper__i::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper :focus-visible { outline-offset: -3px; }

/* "Added to your cart" (change 11), bottom right, from buttons that add without opening the drawer */
.toast { position: fixed; right: 16px; bottom: 16px; z-index: 150; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; width: min(420px, calc(100vw - 32px)); padding: 16px 12px 16px 18px; border: 2px solid var(--navy); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow); color: var(--navy);
  opacity: 0; transform: translateY(16px); visibility: hidden; transition: opacity .2s, transform .2s, visibility 0s .2s; }
.toast.is-on { opacity: 1; transform: none; visibility: visible; transition: opacity .2s, transform .2s; }
.toast__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: var(--navy); font-weight: 600; }
.toast__body { display: grid; gap: 4px; min-width: 0; }
.toast__t { font-weight: var(--fw-m); font-size: var(--t-l); }
.toast__btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.toast__x { width: 48px; height: 48px; margin: -8px -4px 0 0; border: 0; border-radius: 50%; background: none; color: var(--navy); font-size: 1.75rem; line-height: 1; cursor: pointer; }
.toast__x:hover { background: var(--mist); }
.cart-count.is-bump { animation: cart-bump .5s ease; }
@keyframes cart-bump { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.35); } }

@media (prefers-reduced-motion: reduce) { .drawer[open], .cart-count.is-bump { animation: none; } }
