/**
 * Appily Fifty-Two — Cargo Hold cart
 * Layout: dark hero + sticky TOP dispatch dock + full-width cargo crates
 * (not satchel lines + right seal sidebar)
 */

.page-cart-hold {
  --hd-ink: #101820;
  --hd-harbor: #142433;
  --hd-deep: #0C1620;
  --hd-copper: #C45C26;
  --hd-brass: #C9A227;
  --hd-sea: #3D7A6A;
  --hd-fog: #EEF2F5;
  --hd-paper: #F7F9FB;
  --hd-muted: #5C6B78;
  --hd-line: rgba(20, 36, 51, 0.12);
  --hd-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hd-snap: cubic-bezier(0.34, 1.4, 0.64, 1);
  background:
    radial-gradient(880px 400px at 100% 0%, rgba(196, 92, 38, 0.1), transparent 55%),
    radial-gradient(700px 360px at 0% 35%, rgba(61, 122, 106, 0.08), transparent 50%),
    var(--hd-fog);
}
.page-cart-hold .page-main {
  padding-top: 0;
  overflow-x: clip;
}
.a52-hold { padding-bottom: 5.5rem; }

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

@keyframes a52HdDrift {
  from { transform: translate(0, 0); }
  to { transform: translate(-22px, 14px); }
}
@keyframes a52HdPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 92, 38, .4); }
  70% { box-shadow: 0 0 0 12px rgba(196, 92, 38, 0); }
}
@keyframes a52HdShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
@keyframes a52HdCrateIn {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: none; }
}
@keyframes a52HdFill {
  from { width: 0%; }
}

/* ——— Hero ——— */
.a52-hold-hero {
  position: relative;
  color: #fff;
  padding: clamp(2.3rem, 5vw, 3.5rem) 0 2.4rem;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(128deg, var(--hd-deep) 0%, var(--hd-harbor) 50%, #1E364C 100%);
}
.a52-hold-hero-bg { position: absolute; inset: 0; pointer-events: none; }
.a52-hold-orb {
  position: absolute;
  width: 380px; height: 380px;
  right: -60px; top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 92, 38, .32), transparent 68%);
  animation: a52HdDrift 10s ease-in-out infinite alternate;
}
.a52-hold-mesh {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, #000 30%, transparent 90%);
}
.a52-hold-hero-inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1.35fr auto;
  gap: 1.5rem;
  align-items: end;
}
.a52-hold-kicker {
  margin: 0 0 .6rem;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--hd-brass);
}
.a52-hold-hero h1 {
  margin: 0 0 .7rem;
  font-size: clamp(2rem, 4.8vw, 3.3rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #fff;
  max-width: 14ch;
}
.a52-hold-hero h1 em {
  font-style: italic;
  font-weight: 650;
  background: linear-gradient(100deg, var(--hd-copper), #F0A060, var(--hd-brass));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: a52HdShimmer 5s linear infinite;
}
.a52-hold-lede {
  margin: 0;
  max-width: 44ch;
  color: rgba(255,255,255,.74);
  font-size: 1.02rem;
}
.a52-hold-meters {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
}
.a52-hold-meter {
  min-width: 92px;
  padding: .8rem .9rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  text-align: center;
  backdrop-filter: blur(8px);
}
.a52-hold-meter strong {
  display: block;
  font-family: var(--a52-font-display);
  font-size: 1.15rem;
  color: #fff;
  line-height: 1.1;
}
.a52-hold-meter span {
  font-size: .66rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.78);
}
.a52-hold-meter--accent {
  background: var(--hd-copper);
  border-color: var(--hd-copper);
}
.a52-hold-meter--accent span { color: rgba(255,255,255,.8); }

.a52-hold-chip {
  display: inline-flex;
  padding: .3rem .65rem;
  background: rgba(196, 92, 38, .12);
  color: var(--hd-copper);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 50%, calc(100% - 7px) 100%, 0 100%);
}
.a52-hold-chip--light {
  background: rgba(255,255,255,.12);
  color: var(--hd-brass);
}

/* ——— Stage ——— */
.a52-hold-stage {
  position: relative;
  margin-top: -0.5rem;
  z-index: 2;
}

.a52-hold-flash,
.a52-bay-flash,
.a52-satchel-flash {
  margin: 0 0 .85rem;
  padding: .85rem 1.05rem;
  background: #fff;
  border: 1px solid var(--hd-line);
  font-weight: 600;
  font-size: .9rem;
}
.a52-bay-flash--ok,
.a52-hold-flash.a52-bay-flash--ok {
  border-color: rgba(61, 122, 106, .35);
  color: var(--hd-sea);
  background: rgba(61, 122, 106, .08);
}
.a52-bay-flash--err,
.a52-hold-flash.a52-bay-flash--err {
  border-color: rgba(196, 92, 38, .4);
  color: var(--hd-copper);
  background: rgba(196, 92, 38, .08);
}

/* ——— Sticky TOP dispatch dock ——— */
.a52-hold-dock {
  position: sticky;
  top: 88px;
  z-index: 28;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 1rem 1.25rem;
  align-items: center;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.35rem;
  background: linear-gradient(125deg, var(--hd-harbor), var(--hd-deep));
  color: #fff;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 18px 44px rgba(20, 36, 51, .22);
  overflow: hidden;
}
.a52-hold-dock.is-pin {
  box-shadow: 0 22px 50px rgba(20, 36, 51, .3);
}
.a52-hold-dock-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: rgba(255,255,255,.1);
}
.a52-hold-gauge,
.a52-satchel-gauge,
.a52-bay-gauge {
  display: block;
  height: 100%;
  width: calc(var(--hold-gauge, var(--satchel-gauge, var(--bay-gauge, 0))) * 1%);
  background: linear-gradient(90deg, var(--hd-sea), var(--hd-copper), var(--hd-brass));
  transition: width .6s var(--hd-ease);
}
.a52-hold-dock-copy h2 {
  margin: .35rem 0 0;
  font-size: 1.2rem;
  color: #fff;
}
.a52-hold-figures {
  display: flex;
  gap: 1.25rem;
  margin: 0;
  flex-wrap: wrap;
}
.a52-hold-figures div {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.a52-hold-figures dt {
  margin: 0;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.75);
}
.a52-hold-figures dd {
  margin: 0;
  font-family: var(--a52-font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.a52-hold-figures-total dd { color: var(--hd-brass); }
.a52-hold-dock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}
.a52-hold-dock-actions .a52-btn {
  padding: .85rem 1.2rem;
}
.a52-hold-update-all {
  border: 1px solid rgba(255,255,255,.25);
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .8rem 1rem;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.a52-hold-update-all:hover {
  background: rgba(255,255,255,.08);
  border-color: #fff;
}
.a52-hold-ghost {
  font-weight: 700;
  font-size: .84rem;
  color: var(--hd-brass);
}
.a52-hold-ghost:hover { color: #fff; }
.a52-hold-ship-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: .82rem;
  color: rgba(255,255,255,.65);
}
.a52-hold-ship-note em {
  font-style: normal;
  color: var(--hd-brass);
  font-weight: 700;
}

.a52-hold-form.is-updating {
  opacity: .72;
  pointer-events: none;
}

/* ——— Cargo list ——— */
.a52-hold-cargo {
  background: #fff;
  border: 1px solid var(--hd-line);
  box-shadow: 0 16px 40px rgba(20, 36, 51, .07);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.a52-hold-cargo-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem 1.35rem;
  background:
    linear-gradient(110deg, rgba(196, 92, 38, .08), transparent 55%),
    var(--hd-paper);
  border-bottom: 1px solid var(--hd-line);
}
.a52-hold-cargo-head h2 {
  margin: .4rem 0 .25rem;
  font-size: 1.35rem;
  color: var(--hd-harbor);
}
.a52-hold-cargo-head p {
  margin: 0;
  color: var(--hd-muted);
  font-size: .9rem;
}
.a52-hold-trust {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.a52-hold-trust li {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .35rem .55rem;
  background: #fff;
  border: 1px solid var(--hd-line);
  color: var(--hd-sea);
}

.a52-hold-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.a52-hold-crate {
  display: grid;
  grid-template-columns: 40px 96px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--hd-line);
  opacity: 0;
  transform: translateX(-16px);
  transition: background .25s, border-color .25s, transform .3s var(--hd-snap);
}
.a52-hold-crate.is-visible,
.a52-hold-crate.a52-bay-ticket-reveal.is-visible {
  opacity: 1;
  transform: none;
  animation: a52HdCrateIn .45s var(--hd-ease) both;
  animation-delay: calc(min(var(--crate-i, 0), 8) * 0.05s);
}
.a52-hold-crate:last-child { border-bottom: 0; }
.a52-hold-crate:hover {
  background: rgba(196, 92, 38, .04);
}
.a52-hold-crate-num {
  font-family: var(--a52-font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--hd-copper);
}
.a52-hold-crate-media {
  display: block;
  width: 96px; height: 96px;
  overflow: hidden;
  background: var(--hd-fog);
  clip-path: polygon(0 0, 100% 0, 100% 88%, 88% 100%, 0 100%);
  position: relative;
}
.a52-hold-crate-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .55s var(--hd-ease);
}
.a52-hold-crate:hover .a52-hold-crate-media img {
  transform: scale(1.08);
}
.a52-hold-crate-body h3 {
  margin: 0 0 .3rem;
  font-family: var(--a52-font-sans);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0;
}
.a52-hold-crate-body h3 a:hover { color: var(--hd-copper); }
.a52-hold-variant {
  margin: 0 0 .35rem;
  font-size: .82rem;
  color: var(--hd-muted);
}
.a52-hold-unit {
  font-size: .8rem;
  font-weight: 700;
  color: var(--hd-sea);
}

.a52-hold-crate-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .55rem;
  min-width: 140px;
}
.a52-hold-qty {
  display: inline-flex;
  align-items: stretch;
  border: 1.5px solid var(--hd-line);
  background: var(--hd-fog);
  overflow: hidden;
}
.a52-hold-qty-btn {
  width: 36px;
  border: 0;
  background: transparent;
  color: var(--hd-harbor);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.a52-hold-qty-btn:hover {
  background: var(--hd-harbor);
  color: #fff;
}
.a52-hold-qty input {
  width: 48px;
  border: 0;
  border-inline: 1px solid var(--hd-line);
  background: #fff;
  text-align: center;
  font: inherit;
  font-weight: 700;
  color: var(--hd-ink);
  outline: none;
  -moz-appearance: textfield;
}
.a52-hold-qty input::-webkit-outer-spin-button,
.a52-hold-qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.a52-hold-line-update {
  border: 0;
  background: transparent;
  color: var(--hd-copper);
  font: inherit;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
}
.a52-hold-line-update:hover { color: var(--hd-harbor); }
.a52-hold-line-total,
.a52-satchel-line-total,
.a52-bay-ticket-total,
.a52-crate-line-total {
  font-family: var(--a52-font-display);
  font-size: 1.2rem;
  color: var(--hd-harbor);
}

/* Empty */
.a52-hold-empty {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem 1.75rem;
  background: #fff;
  border: 1px dashed rgba(196, 92, 38, .35);
  box-shadow: 0 18px 40px rgba(20, 36, 51, .08);
}
.a52-hold-empty-mark {
  width: 110px; height: 110px;
  display: grid; place-items: center;
  background: var(--hd-fog);
  border: 2px solid var(--hd-copper);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  animation: a52HdPulse 2.8s ease infinite;
}
.a52-hold-empty-mark span {
  width: 36px; height: 36px;
  border: 3px solid var(--hd-copper);
  border-radius: 50%;
  border-top-color: transparent;
}
.a52-hold-empty h2 {
  margin: .45rem 0 .4rem;
  color: var(--hd-harbor);
}
.a52-hold-empty p {
  margin: 0 0 1.15rem;
  color: var(--hd-muted);
}
.a52-hold-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  align-items: center;
}

/* Links */
.a52-hold-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .65rem;
  margin-top: .25rem;
}
.a52-hold-link {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: 1.05rem .95rem;
  background: #fff;
  border: 1px solid var(--hd-line);
  border-left: 3px solid var(--hd-copper);
  transition: transform .25s var(--hd-snap), box-shadow .25s;
}
.a52-hold-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(20, 36, 51, .1);
}
.a52-hold-link em {
  font-style: normal;
  font-family: var(--a52-font-display);
  font-weight: 700;
  color: var(--hd-copper);
}
.a52-hold-link strong {
  font-size: .92rem;
  color: var(--hd-harbor);
}
.a52-hold-link span {
  font-size: .76rem;
  color: var(--hd-muted);
}

/* Mobile bar */
.a52-hold-mobile-bar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  padding: .85rem 1rem;
  background: var(--hd-harbor);
  color: #fff;
  box-shadow: 0 -12px 32px rgba(0,0,0,.22);
  border-top: 2px solid var(--hd-copper);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.a52-hold-mobile-copy strong {
  display: block;
  font-family: var(--a52-font-display);
  font-size: 1.15rem;
}
.a52-hold-mobile-copy small {
  color: rgba(255,255,255,.65);
  font-size: .75rem;
}

@media (max-width: 980px) {
  .a52-hold-hero-inner { grid-template-columns: 1fr; }
  .a52-hold-dock {
    grid-template-columns: 1fr;
    top: 72px;
  }
  .a52-hold-figures { justify-content: space-between; width: 100%; }
  .a52-hold-crate {
    grid-template-columns: 32px 80px 1fr;
    grid-template-areas:
      "num media body"
      "num media controls";
  }
  .a52-hold-crate-num { grid-area: num; }
  .a52-hold-crate-media { grid-area: media; width: 80px; height: 80px; }
  .a52-hold-crate-body { grid-area: body; }
  .a52-hold-crate-controls {
    grid-area: controls;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    flex-wrap: wrap;
  }
  .a52-hold-links { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .a52-hold-empty { grid-template-columns: 1fr; text-align: center; }
  .a52-hold-empty-mark { margin: 0 auto; }
  .a52-hold-empty-actions { justify-content: center; }
  .a52-hold-links { grid-template-columns: 1fr; }
  .a52-hold-dock { display: none; }
  .a52-hold-mobile-bar { display: flex; }
  .a52-hold { padding-bottom: 6.5rem; }
  .a52-hold-crate {
    grid-template-columns: 72px 1fr;
    grid-template-areas:
      "media body"
      "media controls";
  }
  .a52-hold-crate-num { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .a52-hold-orb,
  .a52-hold-hero h1 em,
  .a52-hold-empty-mark,
  .a52-hold-crate.is-visible {
    animation: none !important;
  }
  .a52-hold-reveal,
  .a52-bay-reveal,
  .a52-satchel-reveal,
  .a52-hold-crate {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
