/* Tidepool cart — STEPPER HERO + PACK DRAWER (Appily-onehundrednineteen)
 *
 * STRUCTURE AUDIT (Projects folder — layout / markup hierarchy already used):
 * 1. a36 / a97 default — main form with vertical card/row list + aside summary column (sticky on desktop); qty on row; empty centered card.
 * 2. a119 legacy tc-cart — same as (1): ul.tc-cart__lines + aside.tc-cart__summary + mobile tc-cart__dock.
 * 3. a115 platebundle — CSS grid split: mast, vine, form stack, aside pb-tally (right column family).
 * 4. a109 sowtote / st-split — asymmetric split + sticky aside st-totals beside item bins.
 * 5. a113 manila — ml-aside sticky summary beside line list.
 * 6. a103 seedflat — flat cell line grid + bottom drip/gate score (summary below, not aside).
 * 7. a103 xylo — vertical chime lines + bottom resonance rail checkout.
 * 8. a103 wheelbarrow — hose row layout + footer score columns.
 * 9. a96 ledger — slipstack folio strips + bottom sticky tally ribbon.
 * 10. a97 belt / a115 belt — vertical plate stack + in-flow pass-window checkout.
 * 11. a102 / a105 skyhook — TOP sticky hook holds total + checkout; zigzag packet string (no aside).
 * 12. a100 blotter — recto page seal checkout opposite list (book spread, not L/R list+box).
 * 13. a94 wiretag — horizontal wire rail tags + twine aside + clip summary section.
 * 14. a106 clip rail — horizontal hang rail packets + rail-end score split.
 * 15. a104 mulchcrate — crate slats grid with tag summary in second column.
 * 16. a37 cart — due strip FIRST then stacked glass lines (summary above list).
 * 17. Proposed crate rail (reverted) — horizontal scroll cards + full-width berth band.
 *
 * CHOSEN STRUCTURE (e): Stepper header → full-width summary HERO (first) → collapsible PACK DRAWER
 * with tile grid inside (qty/remove on tile). No aside summary column. Mobile dock + drawer toggle.
 */

.page-a119-tidecart,
.page-a119-platebundle {
  background: var(--tl-foam);
  overflow-x: clip;
}

.tg-cart {
  padding: var(--tl-space-5) 0 var(--tl-space-7);
  min-width: 0;
}

@media (min-width: 768px) {
  .page-a119-tidecart.is-filled .tg-cart {
    padding-bottom: var(--tl-space-7);
  }
}

.tg-cart__notice {
  margin-bottom: var(--tl-space-4);
  padding: 0.65rem 0.85rem;
  border-radius: var(--tl-radius-sm);
  background: color-mix(in srgb, var(--tl-coral) 14%, var(--tl-pearl));
  border: 1px solid var(--tl-coral);
  font-size: var(--tl-text-sm);
  font-weight: 600;
}

.tg-cart__mast {
  margin-bottom: var(--tl-space-4);
  max-width: 52ch;
}

.tg-cart__mast .ds-title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
}

/* —— Stepper —— */
.tg-steps {
  margin-bottom: var(--tl-space-4);
}

.tg-steps ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--tl-space-2);
  align-items: center;
}

.tg-steps__item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--tl-text-sm);
  font-weight: 600;
  color: var(--tl-mute);
}

.tg-steps__item.is-current {
  color: var(--tl-abyss);
}

.tg-steps__item.is-upcoming {
  opacity: 0.65;
}

.tg-steps__dot {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--tl-text-xs);
  font-weight: 800;
  background: var(--tl-pearl);
  border: 2px solid var(--tl-line);
  color: var(--tl-kelp);
}

.tg-steps__item.is-current .tg-steps__dot {
  background: var(--tl-kelp);
  border-color: var(--tl-kelp-bright);
  color: #fff;
}

.tg-steps__label {
  color: inherit;
  text-decoration: none;
}

.tg-steps__item a.tg-steps__label:hover {
  color: var(--tl-kelp);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tg-steps__item + .tg-steps__item::before {
  content: "›";
  margin-right: 0.15rem;
  color: var(--tl-line);
  font-weight: 700;
}

/* —— Summary hero (top, not aside) —— */
.tg-hero {
  padding: var(--tl-space-5);
  margin-bottom: var(--tl-space-4);
}

.tg-hero__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--tl-space-4);
  margin-bottom: var(--tl-space-4);
  padding-bottom: var(--tl-space-4);
  border-bottom: 1px dashed var(--tl-line);
}

.tg-hero__head .ds-title {
  font-size: var(--tl-text-lg);
  margin-bottom: var(--tl-space-2);
}

.tg-hero__ship {
  margin: 0;
  font-size: var(--tl-text-sm);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.tg-hero__ship span {
  font-size: var(--tl-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tl-mute);
}

.tg-hero__meter {
  margin-top: var(--tl-space-2);
  max-width: 14rem;
  height: 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tl-kelp) 12%, var(--tl-pearl));
  overflow: hidden;
}

.tg-hero__meter i {
  display: block;
  height: 100%;
  width: var(--tg-fill, 0%);
  background: linear-gradient(90deg, var(--tl-kelp), var(--tl-coral));
  transition: width 0.4s var(--tl-ease);
}

.tg-hero__due {
  margin: 0;
  text-align: right;
}

.tg-hero__due span {
  display: block;
  font-size: var(--tl-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tl-mute);
}

.tg-hero__due strong {
  display: block;
  font-family: var(--tl-font-display);
  font-size: clamp(1.75rem, 4.5vw, 2.35rem);
  line-height: 1.05;
  color: var(--tl-kelp);
  transition: color 0.35s var(--tl-ease);
}

.tg-hero__due.is-flash strong {
  color: var(--tl-coral);
}

@media (prefers-reduced-motion: reduce) {
  .tg-hero__due.is-flash strong {
    transition: none;
  }
}

.tg-hero__rows {
  margin: 0 0 var(--tl-space-4);
  padding: 0;
  max-width: 22rem;
}

.tg-hero__rows div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  font-size: var(--tl-text-sm);
  border-bottom: 1px dashed var(--tl-line);
}

.tg-hero__rows dt {
  margin: 0;
  font-weight: 600;
  color: var(--tl-mute);
}

.tg-hero__rows dd {
  margin: 0;
  font-weight: 700;
  color: var(--tl-abyss);
}

.tg-hero__promo {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: var(--tl-space-4);
}

.tg-hero__promo-label {
  flex: 1 1 12rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: var(--tl-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tl-mute);
}

.tg-hero__promo-note {
  margin: 0;
  width: 100%;
  font-size: var(--tl-text-xs);
  color: var(--tl-kelp);
}

.tg-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tl-space-3);
}

.tg-hero__checkout {
  min-height: 2.85rem;
  padding-inline: 1.25rem;
}

@media (max-width: 767px) {
  .tg-hero__checkout {
    display: none;
  }

  .tg-hero__actions .ds-btn--ghost {
    width: 100%;
    justify-content: center;
  }
}

/* —— Pack drawer —— */
.tg-drawer {
  border: 1px solid var(--tl-line);
  border-radius: var(--tl-radius-lg);
  background: var(--tl-sand);
  box-shadow: var(--tl-shadow-sm);
  overflow: hidden;
}

.tg-drawer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tl-space-3);
  padding: var(--tl-space-3) var(--tl-space-4);
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--tl-abyss);
  background: color-mix(in srgb, var(--tl-pearl) 85%, var(--tl-sand));
  border-bottom: 1px solid transparent;
}

.tg-drawer__bar::-webkit-details-marker {
  display: none;
}

.tg-drawer[open] .tg-drawer__bar {
  border-bottom-color: var(--tl-line);
}

.tg-drawer__title {
  font-family: var(--tl-font-display);
  font-size: var(--tl-text-md);
}

.tg-drawer__body {
  padding: var(--tl-space-4);
}

.tg-drawer__form {
  min-width: 0;
}

.tg-tilegrid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--tl-space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .tg-tilegrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .tg-tilegrid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tg-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
}

.tg-tile__thumb {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: color-mix(in srgb, var(--tl-abyss) 5%, var(--tl-pearl));
}

.tg-tile__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tg-tile__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: var(--tl-space-3);
  flex: 1 1 auto;
}

.tg-tile__name {
  margin: 0;
  font-family: var(--tl-font-display);
  font-size: var(--tl-text-sm);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.tg-tile__name a {
  color: inherit;
  text-decoration: none;
}

.tg-tile__name a:hover {
  color: var(--tl-kelp);
  text-decoration: underline;
}

.tg-tile__unit {
  margin: 0;
  font-size: var(--tl-text-xs);
  color: var(--tl-mute);
}

.tg-tile__qty {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  border: 1px solid var(--tl-line);
  border-radius: var(--tl-radius-pill);
  overflow: hidden;
  background: var(--tl-pearl);
}

.tg-tile__qty button {
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: transparent;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  color: var(--tl-kelp);
}

.tg-tile__qty button:focus-visible {
  outline: 2px solid var(--tl-coral);
  outline-offset: -2px;
}

.tg-tile__qty input {
  width: 2.75rem;
  min-height: 2.75rem;
  border: 0;
  text-align: center;
  font-weight: 800;
  background: transparent;
  -moz-appearance: textfield;
}

.tg-tile__qty input::-webkit-outer-spin-button,
.tg-tile__qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.tg-tile__line {
  margin: 0;
  font-weight: 800;
  color: var(--tl-kelp);
  font-size: var(--tl-text-sm);
}

.tg-tile__remove {
  align-self: flex-start;
  margin-top: auto;
  border: 0;
  background: transparent;
  font-size: var(--tl-text-xs);
  font-weight: 700;
  color: var(--tl-coral-deep);
  text-decoration: underline;
  cursor: pointer;
  padding: 0.25rem 0;
}

.tg-drawer__sync {
  margin-top: var(--tl-space-4);
}

@media (max-width: 767px) {
  .tg-drawer__sync {
    width: 100%;
  }
}

@media (min-width: 768px) {
  .tg-drawer__sync {
    display: none;
  }
}

/* Mobile: drawer collapsed by default */
@media (max-width: 767px) {
  .tg-drawer:not([open]) .tg-drawer__body {
    display: none;
  }
}

/* —— Cart total band (in page flow) —— */
.tg-dock {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--tl-space-4);
  padding: var(--tl-space-3) var(--tl-space-4);
  background: var(--tl-pearl);
  border: 1px solid var(--tl-line);
  border-radius: var(--tl-radius-md);
  box-shadow: var(--tl-shadow-sm);
}

@media (min-width: 768px) {
  .tg-dock {
    display: none;
  }
}

.tg-dock__toggle {
  border: 1px solid var(--tl-line);
  border-radius: var(--tl-radius-sm);
  background: var(--tl-sand);
  font-size: var(--tl-text-xs);
  font-weight: 700;
  padding: 0.5rem 0.65rem;
  min-height: 2.75rem;
  cursor: pointer;
  color: var(--tl-abyss);
}

.tg-dock__sum {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
  text-align: center;
}

.tg-dock__sum span {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tl-mute);
}

.tg-dock__sum strong {
  font-size: 1.05rem;
  color: var(--tl-kelp);
}

.tg-dock .ds-btn {
  min-height: 2.75rem;
  white-space: nowrap;
}

/* —— Empty —— */
.tg-empty {
  text-align: center;
  padding: var(--tl-space-6) var(--tl-space-4) var(--tl-space-7);
  background: var(--tl-pearl);
  border: 1px dashed var(--tl-line);
  border-radius: var(--tl-radius-lg);
}

.tg-empty__scene {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0 auto var(--tl-space-5);
  max-width: 16rem;
}

.tg-empty__step {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--tl-text-xs);
  font-weight: 800;
  border: 2px solid var(--tl-line);
  color: var(--tl-mute);
  background: var(--tl-sand);
}

.tg-empty__step--done {
  background: var(--tl-kelp);
  border-color: var(--tl-kelp-bright);
  color: #fff;
}

.tg-empty__line {
  flex: 1 1 1.5rem;
  height: 2px;
  background: var(--tl-line);
}

.tg-empty .ds-lede {
  margin-inline: auto;
  max-width: 36ch;
}

.tg-empty > .ds-btn {
  margin-top: var(--tl-space-4);
}

.tg-empty__picks {
  margin-top: var(--tl-space-6);
  text-align: left;
}

.tg-empty__grid {
  list-style: none;
  margin: var(--tl-space-3) 0 0;
  padding: 0;
  display: grid;
  gap: var(--tl-space-3);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 639px) {
  .tg-empty__grid {
    grid-template-columns: 1fr;
  }
}

.tg-pick {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  min-height: 100%;
}

.tg-pick img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.tg-pick__copy {
  padding: var(--tl-space-2) var(--tl-space-3) var(--tl-space-3);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.tg-pick__copy strong {
  font-size: var(--tl-text-sm);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.tg-pick__copy em {
  font-style: normal;
  font-weight: 800;
  color: var(--tl-kelp);
  font-size: var(--tl-text-sm);
}

@media (max-width: 359px) {
  .tg-tilegrid {
    grid-template-columns: 1fr;
  }
}
