/* The store nav bar with the search that opens: the nav of an outdoor clothing store in smoked glass, on a near black
   page with two soft lights behind it (so the glass has something to blur) and a fine grain. The bar's 1px edge is a
   masked layer that catches a light at --lx; the glass pill under the links, the field, the panel and the bag are
   moved by script.js. Elements moved by GSAP never carry a CSS transform: the pressed state lives on their children. */
:root {
  --page: #0b0c0e;          /* the page */
  --glass: rgba(255, 255, 255, 0.045); /* the smoked glass of the bar and the panel */
  --edge: rgba(255, 255, 255, 0.1);    /* the edge at rest */
  --ink: #f1efea;           /* the words */
  --muted: #8b8d94;         /* the quiet words */
  --accent: #ff8a4c;        /* the ember: the badge, the light, the added state */
  --cool: #6f8cff;          /* the cool light behind the bar */
  --badge-ink: #1a0d06;     /* the number on the badge */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* a fine grain over everything */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

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

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}

.wrap {
  position: relative;
  width: min(calc(100vw - 32px), 560px);
  height: 276px;
  isolation: isolate;
}

/* the two lights behind the glass: an ember one on the left, a cool one on the right */
.wrap::before {
  content: '';
  position: absolute;
  left: -6%;
  right: -6%;
  top: -40px;
  height: 150px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 50% at 22% 50%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 70%),
    radial-gradient(34% 46% at 80% 56%, color-mix(in srgb, var(--cool) 30%, transparent), transparent 72%);
  filter: blur(18px);
}

/* ------------------------------------------------------------------ the bar */
.bar {
  --lx: 30%;
  --lo: 0.85;
  position: relative;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 14px;
  border-radius: 19px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015) 60%),
    var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 1px 1px rgba(0, 0, 0, 0.4),
    0 8px 18px -6px rgba(0, 0, 0, 0.55),
    0 28px 50px -24px rgba(0, 0, 0, 0.8);
  z-index: 2;
}

/* the 1px edge: a layer masked down to its own border, with the light at --lx on the top and the bottom edge */
.bar__edge,
.panel__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background:
    radial-gradient(150px 34px at var(--lx) 0%, rgba(255, 236, 220, var(--lo)), transparent 72%),
    radial-gradient(90px 24px at var(--lx) 100%, color-mix(in srgb, var(--accent) 70%, transparent), transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* the light that reaches into the glass under the edge */
.bar__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120px 46px at var(--lx) 0%, rgba(255, 230, 210, 0.07), transparent 75%);
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  text-decoration: none;
  flex: none;
  padding: 6px 4px;
  border-radius: 10px;
  outline: none;
}

.brand__mark {
  width: 22px;
  height: 22px;
  fill: var(--ink);
}

.brand__name {
  font-size: 15px;
  font-weight: 640;
  font-variation-settings: 'wdth' 112;
  letter-spacing: -0.01em;
}

/* ------------------------------------------------------------------ the links and their pill */
.mid {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 40px;
  margin-left: 8px;
}

.links {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.link {
  position: relative;
  z-index: 1;
  display: block;
  height: 36px;
  padding: 0 13px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  font-variation-settings: 'wdth' 100;
  line-height: 36px;
  border-radius: 11px;
  outline: none;
  transition: color 0.25s;
  -webkit-tap-highlight-color: transparent;
}

.link__in {
  display: block;
  transition: transform 0.18s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.link:active .link__in {
  transform: scale(0.95);
}

.link[aria-current='page'] {
  color: var(--ink);
}

.link:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* the glass pill: a box moved by the spring, its child carries the look */
.pill,
.ghost {
  position: absolute;
  left: 0;
  top: 2px;
  height: 36px;
  width: 0;
  pointer-events: none;
}

.pill__glass {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 6px 14px -6px rgba(0, 0, 0, 0.6);
}

/* a short ember line under the pill, like the light caught by its lower edge */
.pill__glass::after {
  content: '';
  position: absolute;
  left: 30%;
  right: 30%;
  bottom: -1px;
  height: 1px;
  border-radius: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.9;
}

.ghost {
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  opacity: 0;
}

/* ------------------------------------------------------------------ the search field */
.field {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 11px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  visibility: hidden;
}

.field__icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.field__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  caret-color: var(--accent);
  -webkit-appearance: none;
  appearance: none;
}

.field__input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.field__input::-webkit-search-cancel-button {
  display: none;
}

/* the caret the demo draws while it types by itself (the real one takes over when you type) */
.field__caret {
  position: absolute;
  left: 0;
  top: 12px;
  width: 1.5px;
  height: 16px;
  border-radius: 1px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
}

.field__key {
  flex: none;
  font: inherit;
  font-size: 10.5px;
  font-weight: 560;
  color: var(--muted);
  padding: 3px 6px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ------------------------------------------------------------------ the two buttons */
.acts {
  position: relative;
  display: flex;
  gap: 2px;
  flex: none;
}

.act {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.act::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.06);
  opacity: 0;
  transition: opacity 0.25s;
}

.act:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent);
}

.act__in {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.act__icon {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.act__icon--close {
  opacity: 0;
}

.act:active::before {
  opacity: 1;
}

.badge {
  position: absolute;
  right: 3px;
  top: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent));
  box-shadow: 0 0 0 2px #18181b, 0 2px 8px -2px color-mix(in srgb, var(--accent) 70%, transparent);
  overflow: hidden;
  pointer-events: none;
}

.badge__roll {
  display: grid;
  height: 17px;
}

.badge__n {
  grid-area: 1 / 1;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  color: var(--badge-ink);
}

/* ------------------------------------------------------------------ the results panel */
.panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 66px;
  padding: 6px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(18, 18, 21, 0.72);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 40px -16px rgba(0, 0, 0, 0.85),
    0 4px 10px -4px rgba(0, 0, 0, 0.5);
  visibility: hidden;
  opacity: 0;
  z-index: 1;
}

.panel {
  --lx: 50%;
  --lo: 0.45;
}

.panel__head {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px 6px;
  font-size: 11.5px;
  font-weight: 560;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.rows {
  position: relative;
}

.hilite {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  height: 54px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  pointer-events: none;
}

.row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 54px;
  padding: 0 8px;
  border-radius: 12px;
  cursor: pointer;
}

.row__sw {
  position: relative;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: var(--sw);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -8px 14px rgba(0, 0, 0, 0.25), 0 3px 8px -3px rgba(0, 0, 0, 0.6);
}

/* a soft sheen over the swatch, like fabric catching the light */
.row__sw::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 45%);
}

.row__txt {
  flex: 1;
  min-width: 0;
}

.row__name {
  display: block;
  font-size: 13.5px;
  font-weight: 540;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__name b {
  font-weight: 640;
  color: var(--ink);
}

.row__sub {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: color-mix(in srgb, var(--muted) 80%, transparent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__price {
  flex: none;
  font-size: 13px;
  font-weight: 560;
  color: var(--ink);
}

.row__add {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  color: var(--ink);
}

.row__add svg {
  position: relative;
  grid-area: 1 / 1;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.row__add .row__check {
  stroke: var(--badge-ink);
}

.row__fill {
  grid-area: 1 / 1;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent));
  opacity: 0;
}

.panel__none {
  display: none;
  margin: 0;
  padding: 14px 10px 16px;
  font-size: 13px;
  color: var(--muted);
}

.panel__none b {
  color: var(--ink);
  font-weight: 600;
}

.fly {
  position: absolute;
  left: 0;
  top: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  pointer-events: none;
  z-index: 5;
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.7);
}

@media (hover: hover) {
  .act:hover::before {
    opacity: 1;
  }

  .link:hover {
    color: var(--ink);
  }
}

/* narrow bars: the name of the store steps aside, the mark stays */
@media (max-width: 440px) {
  .brand__name {
    display: none;
  }

  .bar {
    padding-left: 10px;
  }

  .mid {
    margin-left: 2px;
  }

  .link {
    padding: 0 10px;
    font-size: 13.5px;
  }

  .row__sub {
    display: none;
  }
}

@media (max-width: 340px) {
  .link {
    padding: 0 7px;
  }
}
