/**
 * Appily Fifty-One — Canopy Satchel cart
 * Unique layout: mint crest + foil sachet lines + sticky seal sidebar
 * (not the classic bay/manifest strip used across other Appily carts)
 */

.page-cart-satchel {
  --sc-ink: #0E1F18;
  --sc-canopy: #0B3D2E;
  --sc-deep: #062820;
  --sc-lime: #C8E86C;
  --sc-mint: #F1F6EF;
  --sc-paper: #FAFCF8;
  --sc-muted: #5A6B62;
  --sc-line: rgba(11, 61, 46, 0.12);
  --sc-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sc-snap: cubic-bezier(0.34, 1.45, 0.64, 1);
  background:
    radial-gradient(900px 420px at 100% -8%, rgba(200, 232, 108, 0.16), transparent 55%),
    radial-gradient(720px 360px at 0% 40%, rgba(26, 92, 69, 0.08), transparent 50%),
    var(--sc-mint);
}
.page-cart-satchel .page-main {
  padding-top: 0;
  overflow-x: clip;
}
.a51-satchel { padding-bottom: 5.5rem; }

.a51-satchel-reveal,
.a51-bay-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .65s var(--sc-ease), transform .65s var(--sc-ease);
}
.a51-satchel-reveal.is-visible,
.a51-bay-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Hero */
.a51-satchel-hero {
  position: relative;
  padding: clamp(2.2rem, 5vw, 3.3rem) 0 1.5rem;
  overflow: hidden;
}
.a51-satchel-hero-glow {
  position: absolute;
  inset: -28% 40% auto -12%;
  height: 260px;
  background: radial-gradient(circle, rgba(200, 232, 108, 0.28), transparent 65%);
  pointer-events: none;
  animation: a51ScDrift 8s ease-in-out infinite alternate;
}
@keyframes a51ScDrift {
  from { transform: translate(0, 0); }
  to { transform: translate(32px, 14px); }
}
.a51-satchel-hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.35fr auto;
  gap: 1.35rem;
  align-items: end;
}
.a51-satchel-kicker {
  margin: 0 0 .55rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--sc-canopy);
}
.a51-satchel-hero h1 {
  margin: 0 0 .65rem;
  font-size: clamp(2rem, 4.8vw, 3.3rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--sc-ink);
  max-width: 12ch;
}
.a51-satchel-hero h1 span { color: var(--sc-canopy); }
.a51-satchel-lede {
  margin: 0;
  max-width: 42ch;
  color: var(--sc-muted);
  font-size: 1.02rem;
}
.a51-satchel-pips {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
}
.a51-satchel-pip {
  min-width: 96px;
  padding: .85rem 1rem;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--sc-line);
  box-shadow: 0 14px 34px rgba(11, 61, 46, 0.08);
  text-align: center;
}
.a51-satchel-pip strong {
  display: block;
  font-family: var(--a51-font-display);
  font-size: 1.2rem;
  color: var(--sc-canopy);
  line-height: 1.1;
}
.a51-satchel-pip span {
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sc-muted);
}
.a51-satchel-pip--accent {
  background: linear-gradient(145deg, var(--sc-canopy), var(--sc-deep));
  border-color: var(--sc-canopy);
}
.a51-satchel-pip--accent strong { color: var(--sc-lime); }
.a51-satchel-pip--accent span { color: rgba(255, 255, 255, 0.65); }

.a51-satchel-chip {
  display: inline-flex;
  padding: .3rem .65rem;
  border-radius: 999px;
  background: rgba(200, 232, 108, 0.35);
  color: var(--sc-canopy);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* Empty */
.a51-satchel-empty {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem 1.75rem;
  background: #fff;
  border-radius: 28px;
  border: 1px dashed rgba(11, 61, 46, 0.25);
  box-shadow: 0 18px 40px rgba(11, 61, 46, 0.08);
}
.a51-satchel-empty-drop {
  position: relative;
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
}
.a51-satchel-empty-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(11, 61, 46, 0.25);
  animation: a51ScSpin 14s linear infinite;
}
@keyframes a51ScSpin { to { transform: rotate(360deg); } }
.a51-satchel-empty-bag {
  width: 64px;
  height: 72px;
  border-radius: 18px 18px 22px 22px;
  background: linear-gradient(160deg, var(--sc-canopy), var(--sc-deep));
  box-shadow: 0 12px 28px rgba(11, 61, 46, 0.25);
  position: relative;
}
.a51-satchel-empty-bag::before {
  content: '';
  position: absolute;
  top: -10px; left: 14px; right: 14px;
  height: 16px;
  border: 3px solid var(--sc-lime);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}
.a51-satchel-empty h2 { margin: .45rem 0 .5rem; }
.a51-satchel-empty p { margin: 0 0 1.15rem; color: var(--sc-muted); }
.a51-satchel-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  align-items: center;
}
.a51-satchel-ghost {
  font-weight: 800;
  color: var(--sc-canopy);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Flash */
.a51-bay-flash,
.a51-satchel-flash {
  margin: 0 0 1rem;
  padding: .85rem 1.05rem;
  border-radius: 16px;
  font-weight: 700;
  font-size: .92rem;
}
.a51-bay-flash--ok { background: rgba(200, 232, 108, 0.35); color: var(--sc-canopy); }
.a51-bay-flash--err { background: #fde8e8; color: #8a1f1f; }

/* Layout */
.a51-satchel-layout {
  display: grid;
  grid-template-columns: 1.35fr .85fr;
  gap: 1.25rem;
  align-items: start;
}
.a51-satchel-lines {
  background: #fff;
  border-radius: 28px;
  border: 1px solid var(--sc-line);
  box-shadow: 0 18px 44px rgba(11, 61, 46, 0.08);
  overflow: hidden;
}
.a51-satchel-lines-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
  padding: 1.25rem 1.3rem 1rem;
  background:
    linear-gradient(120deg, rgba(200, 232, 108, 0.18), transparent 55%),
    var(--sc-paper);
  border-bottom: 1px solid var(--sc-line);
}
.a51-satchel-lines-head h2 {
  margin: .4rem 0 .25rem;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
}
.a51-satchel-lines-head p {
  margin: 0;
  color: var(--sc-muted);
  font-size: .88rem;
}
.a51-satchel-trust {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.a51-satchel-trust li {
  padding: .35rem .65rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--sc-line);
  font-size: .72rem;
  font-weight: 700;
  color: var(--sc-canopy);
}

.a51-satchel-list {
  list-style: none;
  margin: 0;
  padding: .85rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* Foil sachet rows */
.a51-satchel-sachet,
.a51-bay-ticket {
  display: grid;
  grid-template-columns: auto 96px 1fr auto;
  gap: .9rem;
  align-items: center;
  padding: .85rem;
  border-radius: 22px;
  background: var(--sc-mint);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  transition: transform .25s var(--sc-snap), border-color .2s, box-shadow .25s, background .2s;
  opacity: 0;
  transform: translateY(14px);
}
.a51-satchel-sachet.is-visible,
.a51-bay-ticket.is-visible,
.a51-bay-ticket-reveal.is-visible {
  opacity: 1;
  transform: none;
  transition:
    opacity .55s var(--sc-ease) calc(var(--sachet-i, var(--bay-i, 0)) * 0.05s),
    transform .55s var(--sc-ease) calc(var(--sachet-i, var(--bay-i, 0)) * 0.05s),
    border-color .2s, box-shadow .25s, background .2s;
}
.a51-satchel-sachet:hover {
  background: #fff;
  border-color: rgba(200, 232, 108, 0.65);
  box-shadow: 0 14px 32px rgba(11, 61, 46, 0.1);
  transform: translateY(-3px);
}
.a51-satchel-sachet-num {
  font-size: .72rem;
  font-weight: 800;
  color: var(--sc-canopy);
  opacity: .55;
}
.a51-satchel-sachet-media {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, #e4efe0, #d5e8cf);
  flex-shrink: 0;
}
.a51-satchel-sachet-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s var(--sc-ease);
}
.a51-satchel-sachet:hover .a51-satchel-sachet-media img { transform: scale(1.06); }
.a51-satchel-foil {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.4) 48%, transparent 62%);
  transform: translateX(-120%);
  pointer-events: none;
  z-index: 1;
}
.a51-satchel-sachet:hover .a51-satchel-foil {
  animation: a51ScFoil .8s var(--sc-ease);
}
@keyframes a51ScFoil {
  to { transform: translateX(120%); }
}
.a51-satchel-sachet-body h3 {
  margin: 0 0 .25rem;
  font-family: var(--a51-font-sans);
  font-size: 1rem;
  font-weight: 800;
}
.a51-satchel-sachet-body h3 a:hover { color: var(--sc-canopy); }
.a51-satchel-variant {
  margin: 0 0 .3rem;
  font-size: .82rem;
  color: var(--sc-muted);
}
.a51-satchel-unit {
  font-size: .82rem;
  font-weight: 700;
  color: var(--sc-canopy);
}
.a51-satchel-sachet-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .45rem;
}
.a51-satchel-qty,
.a51-bay-qty {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .2rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--sc-line);
}
.a51-satchel-qty-btn,
.a51-bay-qty-btn {
  width: 34px; height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--sc-mint);
  color: var(--sc-canopy);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.a51-satchel-qty-btn:hover {
  background: var(--sc-canopy);
  color: var(--sc-lime);
}
.a51-satchel-qty input,
.a51-bay-qty input {
  width: 42px;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-weight: 800;
  color: var(--sc-ink);
  outline: none;
}
.a51-satchel-line-update {
  border: 0;
  background: transparent;
  color: var(--sc-canopy);
  font-weight: 800;
  font-size: .78rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.a51-satchel-line-total,
.a51-bay-ticket-total,
.a51-crate-line-total {
  font-size: 1.05rem;
  color: var(--sc-canopy);
  font-weight: 800;
}

/* Seal sidebar */
.a51-satchel-seal,
.a51-bay-dispatch {
  position: sticky;
  top: 100px;
  padding: 1.35rem 1.25rem 1.4rem;
  border-radius: 28px;
  background: linear-gradient(165deg, var(--sc-canopy), var(--sc-deep));
  color: #fff;
  box-shadow: 0 22px 50px rgba(11, 61, 46, 0.28);
  overflow: hidden;
}
.a51-satchel-seal-gauge {
  position: absolute;
  right: -30px;
  top: -30px;
  width: 140px;
  height: 140px;
  opacity: .35;
  pointer-events: none;
}
.a51-satchel-gauge,
.a51-bay-gauge {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(var(--sc-lime) calc(var(--satchel-gauge, var(--bay-gauge, 0)) * 1%), rgba(255, 255, 255, 0.12) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 12px), #000 calc(100% - 11px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 12px), #000 calc(100% - 11px));
  transition: background 1s var(--sc-ease);
}
.a51-satchel-seal > .a51-satchel-chip {
  background: rgba(200, 232, 108, 0.2);
  color: var(--sc-lime);
  position: relative;
  z-index: 1;
}
.a51-satchel-seal h2 {
  margin: .55rem 0 1rem;
  font-size: 1.45rem;
  color: #fff;
  position: relative;
  z-index: 1;
}
.a51-satchel-figures {
  margin: 0 0 1.15rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  position: relative;
  z-index: 1;
}
.a51-satchel-figures > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem .75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.a51-satchel-figures dt {
  margin: 0;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.a51-satchel-figures dd {
  margin: 0;
  font-weight: 800;
  color: #fff;
}
.a51-satchel-figures-total {
  background: rgba(200, 232, 108, 0.16) !important;
  border-color: rgba(200, 232, 108, 0.35) !important;
}
.a51-satchel-figures-total dd { color: var(--sc-lime); font-size: 1.15rem; }
.a51-satchel-seal-actions {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  position: relative;
  z-index: 1;
}
.a51-satchel-seal-actions .a51-btn { width: 100%; }
.a51-satchel-seal .a51-satchel-ghost {
  color: var(--sc-lime);
  text-align: center;
}
.a51-satchel-update-all {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: .7rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.a51-satchel-update-all:hover {
  border-color: var(--sc-lime);
  color: var(--sc-lime);
}
.a51-satchel-ship-note,
.a51-bay-ship-note {
  margin: 1rem 0 0;
  font-size: .82rem;
  color: rgba(255, 255, 255, 0.65);
  position: relative;
  z-index: 1;
}
.a51-satchel-ship-note em { color: var(--sc-lime); font-style: normal; font-weight: 800; }

.a51-satchel-form.is-updating { opacity: .72; pointer-events: none; }

/* Links */
.a51-satchel-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin-top: 1.35rem;
}
.a51-satchel-link {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: .7rem;
  row-gap: .1rem;
  padding: 1rem 1.05rem;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--sc-line);
  transition: transform .25s var(--sc-snap), border-color .2s, box-shadow .25s;
}
.a51-satchel-link:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  border-color: var(--sc-lime);
  box-shadow: 0 16px 36px rgba(11, 61, 46, 0.1);
}
.a51-satchel-link em {
  grid-row: 1 / span 2;
  align-self: center;
  font-style: normal;
  font-weight: 800;
  font-size: .72rem;
  width: 36px; height: 36px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--sc-canopy);
  color: var(--sc-lime);
}
.a51-satchel-link strong { font-size: .92rem; color: var(--sc-ink); }
.a51-satchel-link span { font-size: .76rem; color: var(--sc-muted); }

/* Mobile bar */
.a51-satchel-mobile-bar,
.a51-bay-mobile-bar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  padding: .85rem 1rem calc(.85rem + env(safe-area-inset-bottom));
  background: rgba(11, 61, 46, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(200, 232, 108, 0.25);
  color: #fff;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.a51-satchel-mobile-copy strong {
  display: block;
  color: var(--sc-lime);
  font-size: 1.1rem;
}
.a51-satchel-mobile-copy small {
  color: rgba(255, 255, 255, 0.65);
  font-size: .75rem;
}

@media (max-width: 960px) {
  .a51-satchel-hero-inner,
  .a51-satchel-layout,
  .a51-satchel-empty { grid-template-columns: 1fr; }
  .a51-satchel-seal { position: relative; top: 0; }
  .a51-satchel-sachet,
  .a51-bay-ticket {
    grid-template-columns: auto 84px 1fr;
  }
  .a51-satchel-sachet-controls {
    grid-column: 2 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .a51-satchel-links { grid-template-columns: 1fr 1fr; }
  .a51-satchel-mobile-bar,
  .a51-bay-mobile-bar { display: flex; }
}
@media (max-width: 560px) {
  .a51-satchel-sachet,
  .a51-bay-ticket { grid-template-columns: 72px 1fr; }
  .a51-satchel-sachet-num { display: none; }
  .a51-satchel-sachet-media { width: 72px; height: 72px; }
  .a51-satchel-links { grid-template-columns: 1fr; }
  .a51-satchel-empty-drop { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .a51-satchel-hero-glow,
  .a51-satchel-empty-ring,
  .a51-satchel-sachet:hover .a51-satchel-foil { animation: none !important; }
  .a51-satchel-reveal,
  .a51-bay-reveal,
  .a51-satchel-sachet,
  .a51-bay-ticket { opacity: 1 !important; transform: none !important; }
}
