.hero-cart {
  min-width: 0;
}

.hero-play {
  position: relative;
  height: 520px;
  overflow: hidden;
  background: var(--gray-faint);
  border: 0.5px solid var(--gray-light);
  border-radius: 4px;
  isolation: isolate;
}

.hero-topography {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-topography path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
  opacity: 0.16;
}

.hero-topography text {
  fill: var(--accent);
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.8px;
  opacity: 0.34;
}

.hero-trails {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.hero-trail {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2 6;
  vector-effect: non-scaling-stroke;
  opacity: 0.28;
  transition: opacity 520ms ease-out;
}

.hero-trail.is-released {
  opacity: 0;
}

.hero-play-instruction {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 16px;
  right: 16px;
  color: var(--gray-mid);
  font-size: 11px;
  font-weight: 400;
}

.hero-shelf {
  position: absolute;
  top: 186px;
  left: 14px;
  right: 14px;
  height: 7px;
  background: var(--surface);
  border-top: 0.5px solid var(--gray-light);
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(31, 21, 13, 0.06);
}

.hero-floor {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 22px;
  background: var(--surface);
  border-top: 0.5px solid var(--gray-light);
}

.hero-bags {
  position: absolute;
  z-index: 2;
  top: 62px;
  right: 5px;
  left: 5px;
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  pointer-events: none;
}

.coffee-bag {
  position: relative;
  z-index: 2;
  width: 84px;
  height: 124px;
  flex: 0 0 84px;
  padding: 0;
  appearance: none;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  user-select: none;
  will-change: transform;
  background: transparent;
  border: 0;
  color: inherit;
  font-family: inherit;
}

.coffee-bag:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.coffee-box-render {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.coffee-box-render img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 5px 5px rgba(31, 21, 13, .14));
  -webkit-user-drag: none;
}

.coffee-box-caption {
  display: block;
  height: 24px;
  line-height: 24px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.coffee-bag-body {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  background: var(--bag-accent);
  border: var(--bag-border);
  border-radius: 5px 5px 8px 8px;
  box-shadow: 0 8px 16px rgba(31, 21, 13, 0.18);
}

.coffee-bag-seal {
  height: 10px;
  flex: 0 0 10px;
  background: rgba(0, 0, 0, 0.14);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.18);
  border-radius: 5px 5px 0 0;
}

.coffee-bag-label {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  margin: 10px 8px 0;
  padding: 9px 5px 7px;
  text-align: center;
  background: var(--bag-label);
  border: 0.5px solid var(--gray-light);
  border-radius: 2px;
}

.coffee-bag-code {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.coffee-bag-variety {
  margin-bottom: 3px;
  overflow-wrap: break-word;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}

.coffee-bag-process {
  color: var(--gray-mid);
  font-size: 8px;
  font-weight: 400;
  line-height: 1.3;
}

.coffee-bag-foot {
  margin: 5px 0 7px;
  color: var(--bag-foot);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-align: center;
}

.hero-box {
  position: absolute;
  right: 5%;
  bottom: 22px;
  width: 180px;
  height: 132px;
  transform: scale(1);
  transform-origin: bottom center;
  transition: transform var(--duration-press) var(--ease-out);
}

.hero-box.is-over {
  transform: scale(1.06);
}

.hero-box.is-pulsing {
  transform: scale(1.08);
  transition-duration: var(--duration-fast);
}

.hero-box.is-pulsing .hero-tote-handle {
  transition-duration: var(--duration-fast);
}

.hero-tote-handle {
  position: absolute;
  width: 108px;
  height: 76px;
  border: 8px solid #D1C3AA;
  box-shadow: inset 1px 0 1px #f4eee2, 1px -1px 2px rgba(53, 41, 27, .18);
  border-bottom: 0;
  border-radius: 58px 58px 0 0;
  transform-origin: bottom center;
  transition: transform var(--duration-press) var(--ease-out);
}

.hero-tote-handle-back {
  z-index: -1;
  top: -55px;
  left: calc(18% + 7px);
  width: calc(64% - 11px);
  border-color: #B8AA93;
  transform: scaleY(1);
}

.hero-tote-handle-front {
  z-index: 2;
  top: -50px;
  /* Center on the front panel, whose edges are 2px and 15px inset. */
  left: calc(18% - 1px);
  width: calc(64% - 11px);
  border-color: #D1C3AA;
  transform: scaleY(1);
}

.hero-tote-handle-front::before,
.hero-tote-handle-front::after {
  content: '';
  position: absolute;
  bottom: 1px;
  width: 6px;
  height: 12px;
  border: 1px dashed #9d8d73;
  pointer-events: none;
}

.hero-tote-handle-front::before { left: -7px; }
.hero-tote-handle-front::after { right: -7px; }

.hero-box.is-pulsing .hero-tote-handle-back {
  transform: scaleY(0.94);
}

.hero-box.is-pulsing .hero-tote-handle-front {
  transform: scaleY(0.94);
}

.hero-box-body {
  position: absolute;
  z-index: 1;
  inset: 5px 15px 0 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, #ffffff12 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, #59463109 0 1px, transparent 1px 3px),
    linear-gradient(100deg, #b7a990 0%, #e6dcc9 10%, #ddd0b9 65%, #cab99c 95%, #ae9b7c);
  border: 1px solid #B5A58B;
  border-radius: 3px 3px 16px 22px;
  box-shadow: inset 0 5px 3px #fff8e533, inset 0 -6px 8px #6b543c18, 0 12px 15px -7px rgba(31, 21, 13, .3);
}

.hero-box-body::before {
  position: absolute;
  inset: 8px 10px 9px;
  border: 1px dashed rgba(94, 75, 52, 0.28);
  border-radius: 2px 2px 11px 11px;
  content: '';
  pointer-events: none;
}

.hero-box-body::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 3px solid #9C8A6E;
  border-radius: inherit;
  content: '';
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97);
  transition:
    opacity var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.hero-box.is-over .hero-box-body::after {
  opacity: 1;
  transform: scale(1);
}

.hero-box-logo {
  position: relative;
  z-index: 1;
  display: block;
  height: 36px;
  width: auto;
  opacity: .9;
  transform: rotate(-1deg);
}

/* A shallow opening and side fold give the canvas tote the same depth as the boxes. */
.hero-tote-opening {
  position: absolute;
  z-index: 0;
  inset: -3px 1px auto 2px;
  height: 18px;
  border: 3px solid #c3b499;
  border-radius: 50% 50% 4px 4px;
  background: linear-gradient(#574b3b, #94836a);
  box-shadow: inset 0 3px 4px #30261966;
}

.hero-tote-gusset {
  position: absolute;
  inset: 2px 0 0 auto;
  width: 27px;
  border: 1px solid #a99779;
  border-radius: 2px 4px 15px 0;
  background: linear-gradient(100deg, #958268, #baaa8d 55%, #cdbd9f 60%, #aa987b);
  transform: skewY(-9deg);
  transform-origin: bottom left;
}

.hero-box-price {
  margin-top: 4px;
  color: var(--gray-mid);
  font-size: 9px;
}

.hero-cart-count {
  position: absolute;
  z-index: 4;
  top: -34px;
  right: -10px;
  display: flex;
  min-width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: var(--white);
  background: var(--text-primary);
  border-radius: 14px;
  box-shadow: 0 4px 10px rgba(31, 21, 13, 0.3);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9);
  transition:
    opacity var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    visibility 0s linear var(--duration-fast);
}

.hero-cart-count.is-visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition:
    opacity var(--duration-press) var(--ease-out),
    transform var(--duration-press) var(--ease-out),
    visibility 0s linear 0s;
}

.hero-cart-summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.hero-cart-empty {
  color: var(--gray-mid);
  font-size: 12px;
  font-weight: 300;
}

.hero-cart-items {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hero-cart-chip {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  color: var(--text-primary);
  background: var(--white);
  border: 0.5px solid var(--gray-light);
  border-radius: 2px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  touch-action: manipulation;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity var(--duration-press) var(--ease-out),
    transform var(--duration-press) var(--ease-out);
}

.hero-cart-chip:hover {
  border-color: var(--accent);
}

.hero-cart-chip.is-entering {
  opacity: 0;
  transform: translateY(4px) scale(0.97);
}

.hero-cart-chip.is-exiting {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(0.97);
  transition-duration: var(--duration-fast);
}

.hero-cart-chip-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  background: var(--chip-accent);
  border: 0.5px solid var(--gray-light);
  border-radius: 50%;
}

.hero-cart-chip-minus {
  color: var(--gray-mid);
  font-weight: 400;
}

.hero-cart-total {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.hero-cart-cta {
  padding: 14px 22px;
  white-space: nowrap;
}

@media (max-width: 1100px) and (min-width: 769px) {
  .hero-play {
    height: 480px;
  }

  .coffee-bag {
    width: 72px;
    height: 112px;
    flex-basis: 72px;
  }

  .hero-shelf {
    top: 174px;
  }

  .hero-cart-summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .hero-play {
    height: 440px;
  }

  .coffee-bag {
    width: 64px;
    height: 106px;
    flex-basis: 64px;
  }

  .hero-bags {
    top: 70px;
  }

  .coffee-bag-label {
    margin: 8px 5px 0;
    padding: 7px 3px 5px;
  }

  .coffee-bag-process {
    font-size: 7px;
  }

  .hero-shelf {
    top: 176px;
  }

  .hero-box {
    right: 6%;
    width: 156px;
    height: 116px;
  }

  .hero-cart-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-cart-chip {
    min-height: 48px;
    padding: 10px 14px;
  }

  .hero-cart-total {
    align-self: flex-end;
  }

  .hero-cart-cta {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 390px) {
  .hero-play {
    height: 420px;
  }

  .coffee-bag {
    width: 56px;
    height: 100px;
    flex-basis: 56px;
  }

  .coffee-bag-variety {
    font-size: 9px;
  }

  .coffee-bag-process {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-trails {
    display: none;
  }

  .coffee-bag {
    will-change: auto;
    transition: opacity var(--duration-fast) var(--ease-out);
  }

  .hero-box,
  .hero-tote-handle {
    transition: none;
  }

  .hero-box.is-over,
  .hero-box.is-pulsing {
    transform: scale(1);
  }

  .hero-box.is-pulsing .hero-tote-handle-back {
    transform: scaleY(1);
  }

  .hero-box.is-pulsing .hero-tote-handle-front {
    transform: scaleY(1);
  }

  .hero-box-body::after {
    transform: scale(1);
    transition: opacity var(--duration-fast) var(--ease-out);
  }

  .hero-cart-count {
    transform: scale(1);
    transition:
      opacity var(--duration-fast) var(--ease-out),
      visibility 0s linear var(--duration-fast);
  }

  .hero-cart-count.is-visible {
    transform: scale(1);
    transition:
      opacity var(--duration-fast) var(--ease-out),
      visibility 0s linear 0s;
  }

  .hero-cart-chip,
  .hero-cart-chip.is-entering,
  .hero-cart-chip.is-exiting {
    transform: none;
    transition: opacity var(--duration-fast) var(--ease-out);
  }
}
