/* The bags step of a flight booking, alone on white. Each bag is one element moved by GSAP (the drop, the squash,
   the slide); its body, handle and straps are children drawn in CSS. The numbers roll inside a clipped window:
   no shadows live inside those windows, so the clip never cuts one. A GSAP element never has a transform in the CSS. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #15161b;           /* the text, the buttons, the big bag */
  --muted: #8b8c96;         /* the small lines */
  --line: #e6e6ec;          /* the card and row edges */
  --soft: #f5f5f8;          /* the row under the pointer, the stepper buttons */
  --accent: #2f5bff;        /* the cabin bag, the focus ring */
  --checked: #15161b;       /* the checked bag */
  --free: #1f8a5b;          /* Included */
  --warn: #d4492f;          /* the limit hint */
  --belt: #d9d9e1;          /* the belt rail */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: clamp(12px, min(1.7vw, 3.1vh), 19px); }
html, body { height: 100%; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  position: relative;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 1rem;
}

/* ---- the card ---- */
.bags {
  width: min(92vw, 25rem);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 1px 2px rgba(20, 20, 30, 0.04), 0 18px 40px -22px rgba(20, 20, 40, 0.28);
  padding: 1.1rem 1.1rem 1rem;
}

.bags__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.bags__route {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.plane { width: 0.9rem; height: 0.55rem; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.bags__title { font-size: 1.25rem; font-weight: 640; font-stretch: 105%; letter-spacing: -0.01em; margin-top: 0.15rem; }
.bags__weight {
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
  color: var(--ink);
}
.unit { font-size: 0.72rem; color: var(--muted); font-weight: 500; }

/* ---- the belt ---- */
.belt {
  position: relative;
  height: 5.2rem;
  margin: 0.8rem 0 0.4rem;
  border-radius: 0.9rem;
  background: linear-gradient(180deg, #fafafc, #f3f3f7);
  border: 1px solid #efeff4;
  /* bags drop in through the top edge, as from a hatch: the clip follows the rounded corners */
  clip-path: inset(0 round 0.9rem);
}
.belt__stack {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.95rem;
  height: 4rem;
}
.belt__line {
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.55rem;
  height: 0.42rem;
  border-radius: 1rem;
  background: var(--belt);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.35rem;
  overflow: hidden;
}
.belt__line span {
  width: 0.22rem;
  height: 0.22rem;
  border-radius: 50%;
  background: #f7f7fa;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.belt__empty {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.15rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
}

/* a bag: the element GSAP moves, with its drawn children */
.bag {
  position: absolute;
  bottom: 0;
  left: 0;
  transform-origin: 50% 100%;
}
.bag__body {
  position: absolute;
  inset: 0.5rem 0 0.18rem;
  border-radius: 0.42rem;
  background: var(--c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -0.18rem 0 rgba(0, 0, 0, 0.18);
}
.bag__body::before, .bag__body::after {
  content: "";
  position: absolute;
  top: 18%;
  bottom: 14%;
  width: 1px;
  background: rgba(255, 255, 255, 0.28);
}
.bag__body::before { left: 30%; }
.bag__body::after { right: 30%; }
.bag__handle {
  position: absolute;
  left: 30%;
  right: 30%;
  top: 0;
  height: 0.62rem;
  border: 2px solid var(--c);
  border-bottom: 0;
  border-radius: 0.35rem 0.35rem 0 0;
}
.bag__wheels {
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 0;
  height: 0.22rem;
  display: flex;
  justify-content: space-between;
}
.bag__wheels i { width: 0.22rem; height: 0.22rem; border-radius: 50%; background: #3a3b44; }
.bag__tag {
  position: absolute;
  right: -0.18rem;
  top: 0.9rem;
  width: 0.5rem;
  height: 0.7rem;
  border-radius: 0.12rem;
  background: #f2c84b;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}
.bag--cabin { width: 2.2rem; height: 3.05rem; --c: var(--accent); }
.bag--checked { width: 2.75rem; height: 3.9rem; --c: var(--checked); }
.bag__shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -0.32rem;
  height: 0.35rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(20, 20, 40, 0.22), transparent);
}

/* ---- the rows ---- */
.rows { list-style: none; display: grid; gap: 0.2rem; }
.row {
  display: grid;
  grid-template-columns: 2.1rem 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.45rem;
  border-radius: 0.8rem;
  transition: background-color 0.2s ease;
}
@media (hover: hover) { .row:hover { background: #fafafc; } }
.row__icon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.65rem;
  background: var(--soft);
  display: grid;
  place-items: center;
}
.row__icon svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.row__text { display: grid; gap: 0.08rem; min-width: 0; }
.row__name { font-size: 0.88rem; font-weight: 600; }
.row__sub { font-size: 0.72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__sub b { font-weight: 600; color: var(--ink); }
.row__free {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--free);
  background: #eaf6f0;
  border-radius: 1rem;
  padding: 0.25rem 0.55rem;
}

/* the stepper */
.step {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  background: var(--soft);
  border-radius: 1rem;
  padding: 0.18rem;
}
.step__btn {
  appearance: none;
  border: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 20, 40, 0.1), 0 0 0 1px rgba(20, 20, 40, 0.04);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
  transition: background-color 0.18s ease, color 0.18s ease, opacity 0.2s ease;
}
.step__btn svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
@media (hover: hover) { .step__btn:hover { background: var(--ink); color: #fff; } }
.step__btn:focus-visible, .go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.step__btn.is-off { opacity: 0.38; }
@media (hover: hover) { .step__btn.is-off:hover { background: #fff; color: var(--ink); } }
.step__num {
  width: 1.4rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}

/* a rolling number: a clipped window with two layers */
.roll {
  position: relative;
  display: inline-block;
  height: 1.2em;
  line-height: 1.2em;
  overflow: hidden;
  vertical-align: bottom;
  font-variant-numeric: tabular-nums;
}
.roll > span { display: block; white-space: nowrap; }
.roll > span[style*="absolute"] { left: 0; top: 0; }

/* ---- the footer ---- */
.bags__foot { margin-top: 0.55rem; border-top: 1px solid var(--line); padding-top: 0.75rem; }
.hint { font-size: 0.72rem; color: var(--warn); min-height: 1.05rem; font-weight: 500; }
.total { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.15rem; }
.total__label { font-size: 0.78rem; color: var(--muted); }
.total__price { font-size: 1.25rem; font-weight: 660; font-stretch: 104%; font-variant-numeric: tabular-nums; margin-right: auto; display: flex; align-items: baseline; }
.go {
  position: relative;
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  border-radius: 2rem;
  height: 2.6rem;
  padding: 0 1.05rem 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 18px -10px rgba(20, 20, 40, 0.6);
}
.go svg { width: 0.95rem; height: 0.95rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.go__shine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 35%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  pointer-events: none;
  opacity: 0;
}

/* the drawn pointer of the autopilot */
.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 5;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
}
.ghost path { fill: #15161b; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }
