/* The /product/search/ page (components/site/demo_stage/product_search/): its three scenes and four section panels,
   only what they add to demo_stage.css. */

/* The shop's search bar on Anna's phone, in Find it and Nothing fits. */
.demo-stage :is([data-demo-scene=find], [data-demo-scene=nofit]) {
  .phone { display: flex; flex-direction: column; }
  .address { margin: 14px auto 0; width: max-content; font-size: 12px; color: var(--muted-foreground); background: var(--ds-panel); border-radius: 99px; padding: 3px 14px; }
  .search { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 14px 8px 8px; }
  .bar { display: flex; align-items: center; gap: 10px; min-height: 48px; border-radius: 24px; background: var(--background); padding: 6px 6px 6px 16px; box-shadow: 0 10px 24px -14px rgb(0 0 0 / .35); }
  .bar > svg { width: 16px; height: 16px; flex: none; color: var(--muted-foreground); }
  .query { flex: 1; min-width: 0; font-size: 13px; min-height: 1.4em; }
  .go { width: 36px; height: 36px; border-radius: 99px; background: var(--brand); color: var(--brand-foreground); display: grid; place-items: center; flex: none; }
  .go svg { width: 16px; height: 16px; }

  .suggest { background: var(--card); border: 1px solid var(--border); border-radius: 16px; margin-top: 8px; padding: 6px; }
  .suggest li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px; font-size: 13px; }
  .suggest img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--muted); }
  .suggest b { font-weight: 500; }
  .suggest span { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

  .results { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 14px; opacity: 0; transform: translateY(10px); transition: opacity .26s var(--ds-ease), transform .26s var(--ds-ease); }
  .results.show { opacity: 1; transform: none; }
  .said { flex: 1; min-height: 0; display: flex; gap: 10px; overflow: hidden; }
  .mark { width: 26px; height: 26px; border-radius: 99px; background: var(--foreground); color: var(--background); display: grid; place-items: center; flex: none; }
  .mark svg { width: 13px; height: 13px; }
  .said-body { flex: 1; min-width: 0; padding-top: 3px; font-size: 13px; line-height: 1.42; }
  .dots { color: var(--muted-foreground); animation: ds-breathe 1.4s ease-in-out infinite; }
  .answer, .products li { opacity: 0; transform: translateY(10px); transition: opacity .26s var(--ds-ease), transform .26s var(--ds-ease); }
  .answer.show, .products li.show { opacity: 1; transform: none; }
  .answer-two { padding-bottom: 10px; }
  .answer-two.later { border-top: 1px solid var(--border); padding-top: 10px; }
  .asked { width: fit-content; margin: 10px 0 8px auto; background: var(--muted); border-radius: 14px; padding: 6px 11px; }

  .products { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 0 -36px; }
  .products li { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--background); padding: 7px; font-size: 12px; line-height: 1.3; }
  .products img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--muted); transition: opacity .2s; }
  .products b { font-weight: 500; margin-top: 7px; }
  .products span { color: var(--muted-foreground); font-variant-numeric: tabular-nums; margin: 2px 0 8px; }
  .products .add { margin: auto 0 0; text-align: center; border-radius: 99px; background: var(--foreground); color: var(--background); padding: 6px 0; font-weight: 500; transition: transform .15s, background-color .2s, color .2s; }
  .products .add.picked { background: var(--brand); color: var(--brand-foreground); transform: scale(.97); }

  .ask { display: flex; align-items: center; gap: 8px; margin-top: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 7px 7px 7px 12px; font-size: 13px; min-height: 42px; }
  .ask .typed { flex: 1; min-width: 0; }
  .ask .typed:empty { display: none; }
  .ask .hint { flex: 1; color: var(--muted-foreground); }
  .ask .typed:not(:empty) + .hint { display: none; }
  .send { width: 26px; height: 26px; border-radius: 99px; background: var(--foreground); color: var(--background); display: grid; place-items: center; flex: none; }
  .send svg { width: 13px; height: 13px; }

  .sheet svg { width: 18px; height: 18px; }

  .line { line-height: 1.4; margin-top: 6px; }
  .happened { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12.5px; color: var(--muted-foreground); padding: 2px 0 8px; }
  .happened svg { width: 14px; height: 14px; flex: none; }
  .thread { -webkit-mask-image: linear-gradient(to bottom, transparent, black 30px); mask-image: linear-gradient(to bottom, transparent, black 30px); }
}

/* Nothing fits: the team's question card, and the missing answer that covers it on the last beat. */
.demo-stage [data-demo-scene=nofit] {
  .ticket { position: relative; }
  .brand-mark { margin-left: auto; display: grid; place-items: center; flex: none; opacity: 0; transition: opacity .3s; }
  .brand-mark.on { opacity: 1; }
  .brand-mark svg { width: 20px; height: 20px; }
  .told { font-size: 13.5px; font-weight: 500; color: var(--brand); padding: 6px 2px 10px; }
  .gap { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--card); opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity .32s var(--ds-ease), transform .32s var(--ds-ease); }
  .gap.on { opacity: 1; transform: none; }
  .gap-body { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: 22px 18px; font-size: 14px; line-height: 1.45; }
  .gap-question { font-size: 18px; font-weight: 600; line-height: 1.3; }
  .gap-body small { display: block; font-size: 12.5px; color: var(--muted-foreground); margin-bottom: 3px; }
  .approve { margin-top: auto; align-self: flex-start; border-radius: 99px; background: var(--brand); color: var(--brand-foreground); padding: 9px 22px; font-size: 13.5px; font-weight: 500; }
}

/* Catalogue: two team views side by side, no phone. */
.demo-stage [data-demo-scene=catalogue] {
  .desk { display: contents; }
  .box { display: flex; flex-direction: column; position: relative; padding: 22px; }
  .title { display: block; font-size: 18px; font-weight: 600; line-height: 1.25; }
  .sub { display: block; font-size: 13px; color: var(--muted-foreground); margin-top: 2px; }

  .adding { display: flex; flex-direction: column; height: 100%; transition: opacity .3s; }
  .adding.off { opacity: 0; }
  .kinds { margin: 18px 0; border-top: 1px solid var(--border); }
  .kinds li { font-size: 14px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .kinds li.picked { background: color-mix(in oklab, var(--brand) 8%, transparent); color: var(--brand); font-weight: 600; }
  .field-label { font-size: 12.5px; color: var(--muted-foreground); }
  .field { border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: 14px; min-height: 40px; margin-top: 4px; }
  .connect { margin-top: auto; align-self: flex-start; border-radius: 99px; background: var(--foreground); color: var(--background); padding: 9px 22px; font-size: 13.5px; font-weight: 500; transition: transform .15s; }
  .connect.picked { transform: scale(.97); }

  .linked { position: absolute; inset: 22px; display: flex; flex-direction: column; opacity: 0; transform: translateY(12px); transition: opacity .32s var(--ds-ease), transform .32s var(--ds-ease); }
  .linked.on { opacity: 1; transform: none; }
  .linked header { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
  .rows { display: grid; gap: 16px; padding: 22px 0; font-size: 15px; }
  .rows div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
  .rows dt { color: var(--muted-foreground); }
  .changes { font-size: 14px; color: var(--muted-foreground); }

  .list { margin-top: 16px; border-top: 1px solid var(--border); }
  .row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "photo name price" "photo name stock"; column-gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); transition: opacity .3s; }
  .row img { grid-area: photo; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--muted); }
  .row p { grid-area: name; min-width: 0; font-size: 14px; line-height: 1.3; }
  .row b { display: block; font-weight: 500; }
  .row small { font-size: 12.5px; color: var(--muted-foreground); }
  .price { grid-area: price; text-align: right; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .price s { text-decoration: none; transition: color .25s; }
  .price em { display: none; font-style: normal; color: var(--brand); margin-left: 6px; }
  .price.cut s { text-decoration: line-through; font-weight: 400; color: var(--muted-foreground); }
  .price.cut em { display: inline; }
  .stock { grid-area: stock; text-align: right; font-size: 12.5px; color: var(--muted-foreground); }
  .row.out .stock { color: var(--ds-warn); font-weight: 500; }
  .quiet { margin-top: 16px; background: var(--muted); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
}

@media (min-width: 1024px) {
  .demo-stage [data-demo-scene=catalogue] {
    .desk { display: grid; grid-template-columns: 430px minmax(0, 1fr); gap: 16px; height: 600px; }
    .rows div { grid-template-columns: 130px minmax(0, 1fr); }
    .row { grid-template-columns: 52px minmax(0, 1fr) 90px 110px; grid-template-areas: "photo name price stock"; padding: 14px 0; }
    .row img { width: 52px; height: 52px; }
  }
}

/* Section panels: plain stills, fluid from 360 px. The shared panel turns its children into `display: contents` below
   1024 px and itself into a block above, both meant for the hero canvas; a still panel keeps its grid and its boxes. */
.demo-stage .panel.still:is(.search-places, .search-languages, .search-found, .search-install) {
  display: grid;
  & > * { display: flex; flex-direction: column; min-width: 0; }
  .title { display: block; font-size: 18px; font-weight: 600; line-height: 1.25; }
  .sub { display: block; font-size: 13px; color: var(--muted-foreground); margin-top: 2px; }
  .where { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-foreground); margin-bottom: 14px; }
  .where svg { width: 16px; height: 16px; flex: none; }
  .bar { display: flex; align-items: center; gap: 10px; min-height: 46px; border: 1px solid var(--border); border-radius: 23px; padding: 6px 16px; font-size: 14px; }
  .bar svg { width: 16px; height: 16px; flex: none; color: var(--muted-foreground); }
  .approve { align-self: flex-start; border-radius: 99px; background: var(--brand); color: var(--brand-foreground); padding: 9px 20px; font-size: 13.5px; font-weight: 500; }
}

.demo-stage .panel.still.search-places {
  .place { display: flex; flex-direction: column; padding: 20px; }
  .suggest { margin-top: 10px; }
  .suggest li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 4px; font-size: 14px; }
  .suggest img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--muted); }
  .suggest b { font-weight: 500; }
  .suggest span { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
  .hero-photo { width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 220px; object-fit: cover; border-radius: 14px; background: var(--muted); }
  .name { font-size: 16px; font-weight: 600; margin-top: 14px; }
  .price { font-size: 14px; color: var(--muted-foreground); margin: 2px 0 16px; }
  .ask-button { margin-top: auto; text-align: center; border-radius: 99px; background: var(--brand); color: var(--brand-foreground); padding: 10px 16px; font-size: 14px; font-weight: 500; }
  .articles { margin-top: 10px; }
  .articles li { padding: 12px 4px; border-bottom: 1px solid var(--border); font-size: 14px; line-height: 1.35; }
  .articles b { display: block; font-weight: 500; }
  .articles small { font-size: 12.5px; color: var(--muted-foreground); }
}

.demo-stage .panel.still.search-languages {
  .phone { height: 420px; }
  .chat { height: 100%; display: flex; flex-direction: column; background: var(--card); }
  .chat header { padding: 18px 16px 12px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 600; }
  .talk { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 12px; }
  .bubble { max-width: 82%; width: fit-content; border-radius: 17px; padding: 9px 13px; font-size: 14px; line-height: 1.4; }
  .bubble.me { margin-left: auto; background: var(--brand); color: var(--brand-foreground); border-bottom-right-radius: 5px; }
  .bubble.them { background: var(--muted); border-bottom-left-radius: 5px; }
  .box-in { margin: 0 12px 14px; border: 1px solid var(--border); border-radius: 99px; padding: 10px 14px; font-size: 13.5px; color: var(--muted-foreground); }
  .ticket { min-height: 320px; }
  .thread { justify-content: center; }
  .msg { font-size: 14px; }
  .meta u { text-underline-offset: 3px; }
}

.demo-stage .panel.still.search-found {
  .asking, .gaps { display: flex; flex-direction: column; padding: 20px; }
  .bubble { max-width: 90%; width: fit-content; border-radius: 17px; padding: 10px 14px; font-size: 14px; line-height: 1.45; }
  .bubble.me { margin-left: auto; background: var(--brand); color: var(--brand-foreground); border-bottom-right-radius: 5px; }
  .bubble.them { background: var(--muted); border-bottom-left-radius: 5px; }
  .line { font-size: 13px; color: var(--muted-foreground); margin: 12px 2px; }
  .missing { margin-top: 10px; display: grid; gap: 6px; }
  .missing li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; border-top: 1px solid color-mix(in oklab, var(--foreground) 10%, transparent); padding-top: 6px; }
  .missing b { font-weight: 600; }
  .missing span { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
  .gap-list { margin: 16px 0 18px; border-top: 1px solid var(--border); }
  .gap-list li { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; line-height: 1.35; }
  .gap-list b { display: block; font-weight: 500; }
  .gap-list small { font-size: 12.5px; color: var(--muted-foreground); }
  .approve { margin-top: auto; }
}

.demo-stage .panel.still.search-install {
  .settings, .snippet { display: flex; flex-direction: column; padding: 20px; min-width: 0; }
  .modes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 16px; padding: 4px; border-radius: 14px; background: var(--muted); width: fit-content; max-width: 100%; }
  .modes span { padding: 7px 14px; border-radius: 10px; font-size: 13.5px; color: var(--muted-foreground); }
  .modes span.on { background: var(--card); color: var(--foreground); font-weight: 500; box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
  .rows { display: grid; margin-top: 16px; font-size: 14px; }
  .rows div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 11px 0; border-top: 1px solid var(--border); }
  .rows dt { color: var(--muted-foreground); }
  .rows dd { display: flex; align-items: center; gap: 8px; }
  .swatch { width: 18px; height: 18px; border-radius: 6px; background: #1F2F55; }
  .platforms { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 16px 0 12px; font-size: 13.5px; color: var(--muted-foreground); }
  .platforms .on { color: var(--foreground); font-weight: 500; text-decoration: underline 2px var(--brand); text-underline-offset: 6px; }
  .code { background: var(--ds-bezel); color: #f5f5f4; border-radius: 12px; padding: 14px 16px; font-family: "Geist Mono", ui-monospace, monospace; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
  .step { margin-top: 14px; font-size: 14px; color: var(--muted-foreground); }
}

@media (min-width: 1024px) {
  .demo-stage .panel.still.search-places { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .demo-stage .panel.still.search-languages { grid-template-columns: 334px minmax(0, 1fr); align-items: center; padding: 28px; }
  .demo-stage .panel.still.search-found { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .demo-stage .panel.still.search-install { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
