/* =========================================================================
   walker_bag.css — styling for the walker bag UI (collapsed bar + accordion +
   modals). Renders in-flow inside .demo-card on a semi-transparent cream
   surface, taking the place of the "View Our Work" showcase block whenever
   the bag holds at least one design.

   All classes are wk-bag- prefixed. Reuses walker.html's brand tokens
   (--cream, --ink, --gold, --hairline, --serif, --sans, ...).

   Positioning: #wkBag is an ordinary block in .demo-card's flow, sitting
   between #bpInterview and the "View Our Work" showcase block (#viewOurWork,
   injected by logic.js immediately before #sandbox). It is empty — and so
   zero-height — until the first add. Once walker_bag.js flags .demo-card with
   .wk-has-bag, #viewOurWork is hidden and the bag takes over its slot.
   ========================================================================= */

/* ---- mount: in-flow host, directly above the showcase block ---- */
#wkBag {
  position: relative;
  z-index: 5;
}
#wkBag *,
#wkBag *::before,
#wkBag *::after { box-sizing: border-box }

/* ---- Step 4 results framing note (lives in walker_bp-interview's panel) ---- */
.wk-rnote {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-style: italic;
  margin: -6px 0 16px;
  padding: 8px 12px;
  background: rgba(156, 125, 63, 0.06);
  border-left: 2px solid var(--gold);
  border-radius: 0 6px 6px 0;
  line-height: 1.5;
}

/* ---- Step 4 result cards: SVG thumbnail + variable legend + Add to bag.
   These styles assume the base .wk-card / .wk-grid layout is set elsewhere
   in walker_bp-interview.css; we override what we need for the new content. */
.wk-card {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px !important;
  align-items: stretch !important;
  cursor: default !important;
}

/* "CUSTOMIZABLE DESIGN" header — only rendered when a design has variables.
   Small uppercase label in the gold tone, sits above the imprint preview. */
.wk-card-hdr {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--darkgold);
  text-align: center;
  margin: -2px 0 -2px;
}

.wk-card-thumb {
  width: 100%;
  aspect-ratio: 856 / 700;       /* matches the dieTop/dieBot stacked viewBox */
  background: #fff;
  border: 1px solid rgba(221, 211, 191, 0.7);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wk-card-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.wk-card-thumb-skel {
  width: 78%;
  height: 70%;
  background: repeating-linear-gradient(
    -45deg,
    rgba(156, 125, 63, 0.12) 0,
    rgba(156, 125, 63, 0.12) 6px,
    rgba(156, 125, 63, 0.04) 6px,
    rgba(156, 125, 63, 0.04) 12px
  );
  border-radius: 4px;
  animation: wk-bag-skel-pulse 1.4s ease-in-out infinite;
}

/* legend: **1 = First Name  ·  **2 = Place */
.wk-card-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.4;
  padding: 4px 2px 0;
  letter-spacing: .01em;
}
.wk-leg { white-space: nowrap; }
.wk-leg-k {
  font-family: 'Saira Stencil One', var(--serif);
  color: var(--darkgold);
  font-weight: normal;
  letter-spacing: .04em;
  font-size: 12.5px;
}
.wk-leg-sep { color: var(--ink-soft); }
.wk-leg-v { color: var(--ink); font-weight: 500; }
.wk-leg-dot { color: rgba(156, 125, 63, 0.45); margin: 0 2px; }

/* Add to bag CTA per card */
.wk-card-add {
  margin-top: auto;             /* anchor to bottom when card stretches */
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .03em;
  cursor: pointer;
  transition: background .18s, transform .1s;
}
.wk-card-add:hover { background: var(--gold); }
.wk-card-add:active { transform: scale(.98); }

/* ---- the showcase block yields its slot to the bag ---- */
.demo-card.wk-has-bag #viewOurWork { display: none; }

/* ---- visible host: stacks bar + accordion in the flow of .demo-card. Only
   rendered when the bag has items, so its margin never leaves a gap. ---- */
.wk-bag-host {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: 4px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-family: var(--sans);
  color: var(--ink);
  animation: wk-bag-in .28s cubic-bezier(.2,.7,.3,1) both;
}

@keyframes wk-bag-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ---- collapsed bar: two regions (toggle | Continue inline) ---- */
.wk-bag-bar {
  display: flex;
  align-items: stretch;       /* both regions fill bar height */
  height: 52px;
  background: rgba(246, 241, 230, 0.72);
  border: 1px solid rgba(156, 125, 63, 0.30);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
          backdrop-filter: blur(10px) saturate(1.1);
  overflow: hidden;            /* clip children to bar's rounded corners */
  font-family: var(--sans);
  color: var(--ink);
  font-size: 14px;
  letter-spacing: .02em;
  box-shadow: 0 4px 18px rgba(22,33,44,.08);
  transition: border-color .18s, box-shadow .18s;
}
.wk-bag-bar:hover {
  border-color: var(--gold);
  box-shadow: 0 6px 22px rgba(22,33,44,.12);
}

/* When accordion is open, soften the bottom corners */
.wk-bag-open .wk-bag-bar {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}

/* toggle region (left): clickable area that opens/closes accordion */
.wk-bag-bartoggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  transition: background .15s;
}
.wk-bag-bartoggle:hover { background: rgba(255, 255, 255, 0.32); }

/* inline Continue CTA (right): primary action sits to the right of toggle.
   Visually distinct from the cream-tinted bar so the eye can find it.

   A COLUMN now, because the label names the work waiting on the next page and
   will not fit on one line. font-size moves to the two spans: they are sized
   independently, and a size on the flex parent would only be inherited and
   then overridden twice. */
.wk-bag-go-bar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  padding: 0 18px;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-left: 1px solid rgba(156, 125, 63, 0.30);
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 600;
  transition: background .18s, transform .1s;
  white-space: nowrap;
  text-align: left;
}
.wk-bag-go-bar:hover { background: var(--gold); }
.wk-bag-go-bar:active { transform: scale(.98); }

.wk-bag-gostep {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .68;
}
.wk-bag-golabel {
  font-size: 13px;
  letter-spacing: .02em;
}

/* ---- bag icon + badge ---- */
.wk-bag-iconwrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--ink);
  flex: none;
}
.wk-bag-icon {
  width: 24px;
  height: 24px;
}
.wk-bag-badge {
  position: absolute;
  top: -3px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--gold);
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(22,33,44,.25);
}

/* Ellipsis is the FLOOR under the CTA beside it. That button is flex 0 0 auto
   and nowrap, so it takes the width it needs and this text absorbs the loss;
   without an overflow rule a narrow phone pushes "Your bag" into the chevron
   instead of trimming it. */
.wk-bag-bartxt {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
}
.wk-bag-chev {
  color: var(--gold);
  font-size: 14px;
  transition: transform .18s;
}
.wk-bag-open .wk-bag-chev { color: var(--darkgold); }

/* ---- accordion (expanded panel) ---- */
.wk-bag-acc {
  background: rgba(246, 241, 230, 0.72);
  border: 1px solid rgba(156, 125, 63, 0.30);
  border-top: 0;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
          backdrop-filter: blur(10px) saturate(1.1);
  padding: 14px 16px 14px;
  box-shadow: 0 12px 30px rgba(22,33,44,.14);
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: wk-bag-acc-in .22s ease-out both;
}
.wk-bag-host:not(.wk-bag-open) .wk-bag-acc { display: none; }

@keyframes wk-bag-acc-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* ---- framing note at top of accordion ----
   NOT a footnote. This is the ONE place the shopper is told that what they are
   choosing in the walker is the sand imprint and nothing else; miss it and
   they reach checkout believing style, size and colour are already settled.
   It was 12px italic grey above a hairline -- the exact typography of a
   disclaimer nobody reads.

   An opaque card on a translucent panel, with a gold rule: that contrast is
   what makes it read as a notice PLACED on the accordion rather than a line of
   the accordion's own text.

   STICKY because the accordion scrolls at max-height 380px. A notice that
   scrolls out of the panel on the third bag is a notice the shopper who added
   the most designs is least likely to have seen. */
.wk-bag-note {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  border: 1px solid rgba(156, 125, 63, 0.32);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(22, 33, 44, 0.08);
}
.wk-bag-note strong {
  font-weight: 700;
  color: var(--darkgold);
}

/* The bag line is an OFFER, not a warning, and one card cannot shout two
   things at once. Quieter and on its own line, so the checkout sentence stays
   the loudest thing in the box -- that is the one with a cost attached to
   being missed. */
.wk-bag-note-more {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---- item list ---- */
.wk-bag-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wk-bag-empty {
  font-size: 13px;
  color: var(--ink-soft);
  padding: 16px 4px;
  text-align: center;
}

/* ---- single item row: [thumb] [label+edit] [walk] ....... [×] ----
   Flex, not grid: the label hugs its text so the edit pencil and the Walk
   pill sit right beside the design instead of being flung to the far edge by
   a stretched 1fr column. Only the destructive Remove is pushed to the right
   rail (margin-left:auto), where it can't be hit by accident. */
.wk-bag-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(221, 211, 191, 0.55);
  border-radius: 9px;
  transition: border-color .15s;
}
.wk-bag-item:hover { border-color: var(--gold); }

/* thumbnail: SVG sand-imprint preview, matches bp-review's pattern */
.wk-bag-thumb {
  flex: none;
  width: 96px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.wk-bag-thumb-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.wk-bag-thumb-skel {
  width: 78%;
  height: 70%;
  background: repeating-linear-gradient(
    -45deg,
    rgba(156, 125, 63, 0.12) 0,
    rgba(156, 125, 63, 0.12) 6px,
    rgba(156, 125, 63, 0.04) 6px,
    rgba(156, 125, 63, 0.04) 12px
  );
  border-radius: 4px;
  animation: wk-bag-skel-pulse 1.4s ease-in-out infinite;
}
@keyframes wk-bag-skel-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.85; }
}

/* label wrap: label + edit pencil with optional "no label" hint underneath */
.wk-bag-labwrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  flex: 0 1 auto;      /* hug the label; shrink (and ellipsis) only when forced */
  min-width: 0;
}
/* Static now: "Pair N", not an editable label. The hover colour, the pencil
   (.wk-bag-edit) and the "no label — tap to add" hint (.wk-bag-lblhint) all
   went with the label modal. */
.wk-bag-lbl {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}

/* Walk toggle — flips this design into the sandbox rotation. A bare footprint
   glyph read as decoration rather than a control, so it's now a labelled pill:
   a mirrored footprint PAIR (reads as steps, not a stamp) beside an explicit
   verb. Off = white pill, gold outline, "Walk it". On = solid gold, "Walking",
   with a soft pulse so the customer can see at a glance which designs are in
   the sand right now. */
.wk-bag-walk {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 40px;
  padding: 0 16px 0 12px;
  background: #fff;
  border: 1px solid rgba(156, 125, 63, 0.55);
  border-radius: 999px;
  color: var(--darkgold);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
}
/* aspect follows the icon's 1216 x 800 viewBox (two 816x320 soles, one stride
   apart). Sized so a single sole renders ~20px long — readable as a flip-flop. */
.wk-bag-walk-ico {
  width: 30px;
  height: 20px;
  flex: none;
  display: block;
}
.wk-bag-walk-txt { line-height: 1; }
.wk-bag-walk:hover {
  border-color: var(--gold);
  background: rgba(156, 125, 63, 0.10);
  color: var(--gold);
}
.wk-bag-walk-on {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(156, 125, 63, 0.18);
  animation: wk-bag-walk-pulse 1.6s ease-in-out infinite;
}
.wk-bag-walk-on:hover {
  background: var(--darkgold);
  border-color: var(--darkgold);
  color: #fff;
}
@keyframes wk-bag-walk-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(156, 125, 63, 0.18); }
  50%      { box-shadow: 0 0 0 5px rgba(156, 125, 63, 0.10); }
}

.wk-bag-rm {
  flex: none;
  margin-left: auto;      /* the only control on the right rail */
  background: none;
  border: 1px solid transparent;
  color: var(--ink-soft);
  font-size: 18px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.wk-bag-rm:hover {
  color: #b3402e;
  border-color: rgba(179, 64, 46, 0.3);
  background: rgba(255, 255, 255, 0.6);
}

/* ---- actions row: clear · spacer · shop-next · continue (TOP of accordion) ---- */
.wk-bag-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(221, 211, 191, 0.5);
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.wk-bag-spacer { flex: 1; }
.wk-bag-clear {
  background: none;
  border: 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 4px;
  letter-spacing: .02em;
  text-decoration: underline;
  text-decoration-color: rgba(69, 67, 60, 0.3);
}
.wk-bag-clear:hover { color: #b3402e; text-decoration-color: currentColor; }

.wk-bag-go {
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 11px 18px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .18s, transform .1s;
}
.wk-bag-go:hover { background: var(--gold); }
.wk-bag-go:active { transform: scale(.98); }

/* ===================== modals (label + warn) ===================== */
/* The SHELL for these -- .wk-bag-modal, -mbox, -mh, -msub, -mactions,
   -mcancel, -mok -- now lives in bag-designer.css, because the design window
   paints the same chrome and the two pages that use it must not each carry a
   copy. What stays here is the warn variant, and that is now ALL that stays:
   the design preview (.wk-bag-mprev), the label field and the use-a-variable
   chips belonged to the label capture modal, which is gone.

   bag-designer.css MUST still load before this file. The walker no longer
   loads bag-designer.JS — the drawstring designer left with the offer — but
   askAnother() and confirmClear() still paint the shell that CSS owns. */


/* warn modal variant: slightly different header tone */
.wk-bag-warn .wk-bag-mh { color: var(--darkgold); }

/* ===================== responsive ===================== */

@media (max-width: 720px) {
  .wk-bag-host { margin: 2px 0 16px; }
  .wk-bag-bar { height: 48px; font-size: 13px; }
  .wk-bag-bartoggle { padding: 0 12px; gap: 10px; }
  .wk-bag-bartxt { font-size: 14px; }
  .wk-bag-go-bar { padding: 0 13px; }
  .wk-bag-golabel { font-size: 12px; }
  .wk-bag-acc { padding: 12px 12px 12px; max-height: 320px; }
  .wk-bag-item { gap: 9px; padding: 9px 10px; }
  .wk-bag-thumb { width: 78px; height: 64px; }
  .wk-bag-walk { height: 36px; padding: 0 13px 0 10px; font-size: 11px; gap: 8px; }
  .wk-bag-walk-ico { width: 27px; height: 18px; }
  .wk-bag-lbl { font-size: 15px; }
  .wk-bag-go { padding: 10px 14px; font-size: 12.5px; }
  /* touch floor: the 28px Remove and the ~20px edit pencil are precision
     targets on glass. Grow the HIT AREA, not the glyph. */
  .wk-bag-rm { width: 40px; height: 40px; }
  .wk-bag-mbox { padding: 20px 18px 16px; }
  .wk-bag-mh { font-size: 21px; }
}

/* very narrow: the verb is the first thing to go, the pair-of-steps glyph and
   the gold fill still carry the affordance */
@media (max-width: 430px) {
  .wk-bag-walk-txt { display: none; }
  .wk-bag-walk { padding: 0 10px; }
}

/* .wk-bag-modal / -mbox / -mok / -mcancel are handled in bag-designer.css,
   which owns those rules now. */
@media (prefers-reduced-motion: reduce) {
  .wk-bag-host,
  .wk-bag-acc { animation: none; }
  .wk-bag-go,
  .wk-bag-rm,
  .wk-bag-bar { transition: none; }
}

/* ---- a11y focus ---- */
.wk-bag-bar:focus-visible,
.wk-bag-go:focus-visible,
.wk-bag-rm:focus-visible,
.wk-bag-walk:focus-visible,
.wk-bag-clear:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
