/* ============================================================
   ABUNDANCE A TO Z — cart drawer (pairs with js/cart.js)
   Design language: paper surfaces, 3px ink borders, 22px
   radius, hard-offset shadows, Fredoka headings, sunshine CTA.
   Uses the shared tokens from css/style.css — load AFTER it.
   ============================================================ */

.ac-locked { overflow: hidden; }

.ac-overlay {
  position: fixed; inset: 0;
  background: rgba(31, 41, 51, .45);
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
  z-index: 90;
}
.ac-overlay.open { opacity: 1; pointer-events: auto; }

.ac-drawer {
  position: fixed; top: 0; right: 0;
  width: min(26rem, 94vw); height: 100dvh;
  background: var(--paper); color: var(--ink);
  border-left: 3px solid var(--ink);
  box-shadow: -8px 0 0 rgba(31, 41, 51, .18);
  transform: translateX(105%);
  transition: transform .22s ease;
  z-index: 95;
  display: flex; flex-direction: column;
  font-family: var(--body);
}
.ac-drawer.open { transform: translateX(0); }

.ac-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem .6rem;
}
.ac-head h2 {
  font-family: var(--display); font-weight: 600;
  font-size: 1.5rem; margin: 0;
}
.ac-close {
  font-family: var(--display); font-size: 1.6rem; line-height: 1;
  background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 50%;
  width: 2.4rem; height: 2.4rem; cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}
.ac-close:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

.ac-items {
  flex: 1; overflow-y: auto;
  padding: .4rem 1.2rem;
  display: flex; flex-direction: column; gap: .7rem;
}
.ac-empty { text-align: center; margin-top: 2rem; font-size: 1.05rem; }

.ac-item {
  background: #fff;
  border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
  padding: .7rem .9rem;
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}
.ac-item-info { flex: 1 1 9rem; display: flex; flex-direction: column; }
.ac-item-info strong { font-family: var(--display); font-weight: 600; font-size: 1rem; }
.ac-item-info span { font-size: .9rem; opacity: .75; }

.ac-qty { display: inline-flex; align-items: center; gap: .45rem; }
.ac-qty button {
  font-family: var(--display); font-weight: 600;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  border: 3px solid var(--ink); background: var(--pastel-butter, #FFF3C4);
  color: var(--ink); cursor: pointer; line-height: 1;
}
.ac-qty span { min-width: 1.2rem; text-align: center; font-weight: 700; }
.ac-remove {
  background: none; border: none; cursor: pointer;
  color: var(--teal-deep); font-family: var(--body); font-weight: 700;
  font-size: .9rem; text-decoration: underline; padding: .2rem;
}

.ac-foot {
  border-top: 3px solid var(--ink);
  padding: .9rem 1.2rem 1.2rem;
  display: flex; flex-direction: column; gap: .55rem;
  background: var(--paper);
}
.ac-country {
  font-weight: 700; font-size: .95rem;
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}
.ac-country-select {
  font-family: var(--body); font-size: .95rem;
  padding: .35rem .6rem; border-radius: 12px;
  border: 3px solid var(--ink); background: #fff; color: var(--ink);
  max-width: 100%;
}

.ac-progress {
  background: var(--pastel-mint, #DDF3E4);
  border: 3px solid var(--ink); border-radius: 14px;
  height: 1rem; position: relative; overflow: visible;
  margin-top: .9rem;
}
.ac-progress-bar {
  background: var(--teal); height: 100%;
  border-radius: 11px 0 0 11px;
  transition: width .25s ease;
}
.ac-progress-text {
  position: absolute; top: 1.15rem; left: 0; right: 0;
  margin: 0; font-size: .92rem; font-weight: 700; text-align: center;
}
.ac-progress + .ac-line, .ac-progress { margin-bottom: 0; }
.ac-progress:not([hidden]) { margin-bottom: 1.5rem; }

.ac-warn {
  background: #FFE3E3; color: var(--ink);
  border: 3px solid var(--coral); border-radius: 14px;
  padding: .6rem .8rem; margin: 0; font-size: .95rem;
}
.ac-warn-btn {
  display: inline-block; margin-top: .35rem;
  font-family: var(--display); font-weight: 600; cursor: pointer;
  background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 999px;
  padding: .3rem .9rem; box-shadow: 0 3px 0 var(--ink);
}

/* smart cart nudge — "finish your gift" panel (Nov 12, 2026):
   shows only when a US cart is $0.01–$3.00 from free shipping */
.ac-nudge {
  background: var(--pastel-pink, #FFE9F3);
  border: 3px solid var(--ink); border-radius: 14px;
  padding: .7rem .9rem;
}
.ac-nudge h3 {
  font-family: var(--display); font-weight: 600;
  font-size: 1.05rem; margin: 0 0 .25rem;
}
.ac-nudge p { margin: 0; font-size: .95rem; }
.ac-nudge-btns {
  display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .55rem;
}
.ac-nudge-btn {
  font-family: var(--display); font-weight: 600; cursor: pointer;
  background: #fff; color: var(--ink);
  border: 3px solid var(--ink); border-radius: 999px;
  padding: .35rem .85rem; box-shadow: 0 3px 0 var(--ink);
  font-size: .92rem;
}
.ac-nudge-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

.ac-line {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 1rem;
}
.ac-line.ac-package {
  font-size: .9rem; opacity: .75;
}
.ac-line.ac-total {
  font-family: var(--display); font-weight: 600; font-size: 1.2rem;
  border-top: 2px dashed rgba(31, 41, 51, .3); padding-top: .45rem;
}
.ac-note { font-size: .92rem; margin: 0; opacity: .85; }

.ac-checkout {
  font-family: var(--display); font-weight: 600; font-size: 1.08rem;
  background: var(--sunshine); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 999px;
  padding: .8rem 1.4rem; cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.ac-checkout:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.ac-checkout:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.ac-checkout:disabled { opacity: .5; cursor: not-allowed; }
.ac-status { margin: 0; font-size: .95rem; font-weight: 700; }
.ac-status:empty { display: none; }
.ac-secure { margin: 0; font-size: .85rem; opacity: .7; text-align: center; }

/* floating cart button (pages without a header cart button) */
.ac-fab {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 80;
  display: none; align-items: center; gap: .4rem;
  background: var(--sunshine); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 999px;
  padding: .7rem 1rem; cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--display); font-weight: 600;
}
.ac-fab-count {
  background: var(--ink); color: #fff; border-radius: 999px;
  min-width: 1.5rem; height: 1.5rem; display: inline-flex;
  align-items: center; justify-content: center; font-size: .9rem;
}

/* header cart button (cards + stationery pages) */
.cart-nav-btn {
  font-family: var(--display); font-weight: 500; font-size: .95rem;
  background: none; border: none; cursor: pointer; color: inherit;
  padding: .45rem .8rem; border-radius: 999px;
  display: inline-flex; align-items: center; gap: .4rem;
}
.cart-nav-btn:hover { background: rgba(255, 255, 255, .22); }
.on-pastel .cart-nav-btn:hover { background: rgba(31, 41, 51, .08); }
.cart-count {
  background: var(--coral); color: #fff; border-radius: 999px;
  min-width: 1.4rem; height: 1.4rem; padding: 0 .3rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700;
}
.cart-count[hidden] { display: none; }

/* early shipping line shown on product pages */
.ship-line {
  font-weight: 700; font-size: .98rem;
  display: inline-block;
  background: rgba(255, 255, 255, .55);
  border: 2px dashed rgba(31, 41, 51, .45); border-radius: 12px;
  padding: .35rem .8rem; margin-top: .6rem;
}

@media (prefers-reduced-motion: reduce) {
  .ac-drawer, .ac-overlay, .ac-progress-bar { transition: none; }
}
