/* Cart — Packet Satchel (vertical deck + fanned cards + expandable checkout dock) */

.page-cart-satchel .page-main {
  padding-top: 0;
  background: #f6f3ee;
}

.page-cart-satchel .page-main:has(.a55-satchel-form) {
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0));
}

/* ── Ribbon header ── */
.a55-satchel-ribbon {
  padding: clamp(22px, 4vw, 36px) 0;
  background: linear-gradient(120deg, #a67c52 0%, #5f3f22 45%, #3d2817 100%);
  color: #f4efe4;
  position: relative;
  overflow: clip;
}

.a55-satchel-ribbon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -24deg,
    transparent,
    transparent 20px,
    rgba(255, 255, 255, 0.03) 20px,
    rgba(255, 255, 255, 0.03) 21px
  );
  pointer-events: none;
}

.a55-satchel-ribbon-inner {
  position: relative;
  z-index: 1;
}

.a55-satchel-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.88);
}

.a55-satchel-crumb a {
  color: rgba(244, 239, 228, 0.88);
  text-decoration: none;
}

.a55-satchel-crumb a:hover { color: #fff; }

.a55-satchel-ribbon-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.a55-satchel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 239, 228, 0.75);
}

.a55-satchel-kicker span {
  padding: 4px 10px;
  border-radius: 6px;
  background: #1a3d32;
  color: #d4c4a0;
  font-size: 0.62rem;
}

.a55-satchel-ribbon h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.a55-satchel-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.a55-satchel-stat {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  min-width: 88px;
  text-align: center;
  transition: transform 0.25s;
}

.a55-satchel-stat:hover {
  transform: translateY(-2px);
}

.a55-satchel-stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.a55-satchel-stat strong.is-pulse {
  animation: a55-satchel-stat-pop 0.32s ease;
}

@keyframes a55-satchel-stat-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.a55-satchel-stat span {
  display: block;
  margin-top: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}

.a55-satchel-stat-total {
  background: rgba(26, 61, 50, 0.45);
  border-color: rgba(212, 196, 160, 0.35);
}

/* ── Run / deck ── */
.a55-satchel-run {
  padding: clamp(24px, 4vw, 40px) 0 clamp(32px, 5vw, 48px);
}

.a55-satchel-deck-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(20px, 3vw, 28px);
}

.a55-satchel-deck-head p {
  margin: 0 0 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal);
}

.a55-satchel-deck-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  color: #0f172a;
}

.a55-satchel-expand-toggle {
  padding: 10px 16px;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: #fff;
  color: #0a3d62;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.22s, transform 0.22s, border-color 0.22s;
}

.a55-satchel-expand-toggle:hover {
  background: #f0fdf4;
  border-color: rgba(31, 107, 74, 0.35);
  transform: translateY(-1px);
}

/* Fanned card deck — single pane, NOT two columns */
.a55-satchel-deck {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(16px, 2.5vw, 22px);
  perspective: 1200px;
}

.a55-satchel-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  transform: rotate(calc((var(--card-i) % 3 - 1) * 0.6deg)) translateY(calc((var(--card-i) % 2) * 4px));
  transition: transform 0.38s cubic-bezier(0.34, 1.15, 0.64, 1), box-shadow 0.38s, opacity 0.28s;
  animation: a55-satchel-card-in 0.5s ease both;
  animation-delay: calc(var(--card-i) * 0.07s);
}

@keyframes a55-satchel-card-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: rotate(calc((var(--card-i) % 3 - 1) * 0.6deg)) translateY(calc((var(--card-i) % 2) * 4px)); }
}

.a55-satchel-card:hover {
  transform: rotate(0deg) translateY(-8px) scale(1.02);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.14);
  z-index: 2;
}

.a55-satchel-card.is-zero {
  opacity: 0.55;
  filter: grayscale(0.25);
}

.a55-satchel-card-index {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-family: var(--serif);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.a55-satchel-card-visual {
  display: block;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #f1f5f9;
}

.a55-satchel-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.a55-satchel-card:hover .a55-satchel-card-visual img {
  transform: scale(1.06);
}

.a55-satchel-card-body {
  padding: 16px 18px 10px;
  flex: 1;
}

.a55-satchel-card-sku {
  display: block;
  margin-bottom: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #475569;
}

.a55-satchel-card-body h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
}

.a55-satchel-card-body h3 a {
  color: #0f172a;
  text-decoration: none;
  background: linear-gradient(90deg, #1a3d32, #1a3d32) 0 100% / 0 2px no-repeat;
  transition: background-size 0.28s, color 0.22s;
}

.a55-satchel-card-body h3 a:hover {
  color: #1a3d32;
  background-size: 100% 2px;
}

.a55-satchel-card-variant {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: #64748b;
}

.a55-satchel-card-unit {
  font-size: 0.75rem;
  font-weight: 650;
  color: #475569;
}

.a55-satchel-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 18px;
  border-top: 1px dashed rgba(15, 23, 42, 0.1);
}

/* Quantity control */
.a55-satchel-qty {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1.5px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.34, 1.5, 0.64, 1), background 0.22s;
}

.a55-satchel-qty.is-plus {
  transform: scale(1.06);
  background: #ecfdf5;
}

.a55-satchel-qty.is-minus {
  transform: scale(0.96);
  background: #fef2f2;
}

.a55-satchel-qty button {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.a55-satchel-qty button:hover {
  background: rgba(26, 61, 50, 0.1);
  color: #1a3d32;
}

.a55-satchel-qty input {
  width: 44px;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  -moz-appearance: textfield;
}

.a55-satchel-qty input::-webkit-outer-spin-button,
.a55-satchel-qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.a55-satchel-card-line {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--signal-deep);
  transition: transform 0.28s, color 0.22s;
}

.a55-satchel-card-line.is-pulse {
  animation: a55-satchel-line-flash 0.32s ease;
}

@keyframes a55-satchel-line-flash {
  0% { transform: scale(1); color: var(--signal-deep); }
  40% { transform: scale(1.08); color: #c81d25; }
  100% { transform: scale(1); color: var(--signal-deep); }
}

/* Expandable checkout dock */
.a55-satchel-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  pointer-events: none;
}

.a55-satchel-dock-bar,
.a55-satchel-dock-panel {
  pointer-events: auto;
}

.a55-satchel-dock-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0));
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.25);
}

.a55-satchel-dock-handle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  font: inherit;
  cursor: pointer;
  transition: background 0.22s;
}

.a55-satchel-dock-handle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.a55-satchel-dock-grip {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.a55-satchel-dock-bar-label em {
  font-style: normal;
  font-weight: 800;
  color: #d4c4a0;
}

.a55-satchel-dock-bar-label strong {
  font-weight: 800;
  color: #fff;
}

.a55-satchel-dock-checkout {
  flex: 0 0 auto;
  padding: 14px 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #c81d25, #9e151c);
  color: #fff !important;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(200, 29, 37, 0.35);
  transition: transform 0.22s, box-shadow 0.22s;
}

.a55-satchel-dock-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(200, 29, 37, 0.45);
}

.a55-satchel-dock-panel {
  max-height: 0;
  overflow: hidden;
  background: #fff;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  transition: max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.a55-satchel-dock.is-open .a55-satchel-dock-panel {
  max-height: min(420px, 70vh);
}

.a55-satchel-dock-panel-inner {
  padding: 20px clamp(16px, 4vw, 28px) calc(20px + env(safe-area-inset-bottom, 0));
  max-width: 640px;
  margin-inline: auto;
}

.a55-satchel-dock-head h3 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}

.a55-satchel-dock-head p {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: #64748b;
}

.a55-satchel-ledger {
  margin: 0 0 14px;
  display: grid;
  gap: 10px;
}

.a55-satchel-ledger div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.9rem;
}

.a55-satchel-ledger dt {
  color: #64748b;
  font-weight: 650;
}

.a55-satchel-ledger dd {
  margin: 0;
  font-weight: 800;
  color: #0f172a;
}

.a55-satchel-ledger-grand {
  padding-top: 10px;
  margin-top: 4px;
  border-top: 2px solid rgba(15, 23, 42, 0.08);
  font-size: 1rem;
}

.a55-satchel-ledger-grand dd {
  color: var(--signal-deep);
  font-family: var(--serif);
  font-size: 1.15rem;
}

.a55-satchel-ship {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.45;
}

.a55-satchel-ship-free {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #86efac;
}

.a55-satchel-dock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.a55-satchel-btn {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.22s, transform 0.22s;
}

.a55-satchel-btn-ghost:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

.a55-satchel-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 14px;
  background: #1a3d32;
  color: #fff !important;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(26, 61, 50, 0.28);
  transition: transform 0.22s, box-shadow 0.22s;
}

.a55-satchel-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(26, 61, 50, 0.35);
}

.a55-satchel-cta-inline {
  flex: 1 1 auto;
  min-width: 180px;
}

.a55-satchel-fine {
  margin: 0;
  font-size: 0.72rem;
  color: #475569;
  line-height: 1.45;
}

/* Empty */
.a55-satchel-empty {
  text-align: center;
  padding: clamp(48px, 8vw, 80px) clamp(20px, 4vw, 32px);
  border-radius: 28px;
  background: #fff;
  border: 2px dashed rgba(166, 124, 82, 0.35);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.06);
  max-width: 560px;
  margin-inline: auto;
}

.a55-satchel-empty-tag {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(26, 61, 50, 0.08);
  color: #1a3d32;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.a55-satchel-empty-art {
  width: 96px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, #d4c4a0 0%, #a67c52 100%);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.12);
  position: relative;
}

.a55-satchel-empty-art::before {
  content: "";
  position: absolute;
  inset: -10px 8px auto;
  height: 14px;
  border-radius: 4px 4px 0 0;
  background: #5f3f22;
  transform: rotate(-2deg);
}

.a55-satchel-empty h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.a55-satchel-empty p {
  margin: 0 0 22px;
  color: #64748b;
  max-width: 36ch;
  margin-inline: auto;
  line-height: 1.55;
}

.a55-satchel-empty-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.a55-satchel-empty .a55-satchel-btn-ghost {
  border-color: rgba(15, 23, 42, 0.14);
}

/* Animate */
.a55-satchel-animate {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.a55-satchel-animate.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* Empty state is always visible even before JS runs */
.a55-satchel-empty.a55-satchel-animate {
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (max-width: 640px) {
  .a55-satchel-deck {
    grid-template-columns: 1fr;
  }
  .a55-satchel-card {
    transform: none !important;
  }
  .a55-satchel-card:hover {
    transform: translateY(-4px) !important;
  }
  .a55-satchel-dock-bar {
    flex-wrap: wrap;
  }
  .a55-satchel-dock-checkout {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .a55-satchel-card,
  .a55-satchel-qty,
  .a55-satchel-card-line,
  .a55-satchel-stat strong,
  .a55-satchel-animate {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
