/* Catalog viewer + quote bar (#125). Colors and fonts come from styles.css tokens. */
.qv-body-page {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
}

.qv-app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.qv-top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 56px;
  padding: 0 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--card-border);
}

.qv-back,
.qv-vendor {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  color: var(--brand-2);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.qv-vendor {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
}

.qv-back:hover,
.qv-vendor:hover {
  color: var(--brand-3);
}

.qv-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qv-main {
  flex: 1;
  min-height: 0;
  display: flex;
}

.qv-frame-wrap {
  flex: 1;
  min-width: 0;
  background: #0a1029;
}

.qv-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.qv-bar {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--card-border);
  overflow-y: auto;
}

.qv-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 0.25rem;
}

.qv-bar-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.qv-sheet-close {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--muted);
  font-size: 1.6rem;
  cursor: pointer;
}

.qv-add {
  padding: 0.5rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border-bottom: 1px solid var(--surface-2);
}

.qv-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.qv-input {
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  padding: 0 0.85rem;
  border: 1px solid var(--surface-3);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.qv-style {
  height: 50px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.qv-input:focus-visible,
.qv-bar button:focus-visible,
.qv-bar a:focus-visible,
.qv-phonebar button:focus-visible,
.qv-top a:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.qv-hint {
  min-height: 1.2em;
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.qv-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.qv-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 64px;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--surface-3);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.qv-result:hover {
  border-color: var(--brand);
}

.qv-result-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.qv-result-text span {
  color: var(--muted);
  font-size: 0.92rem;
}

.qv-thumb {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #f4f4f2;
  object-fit: contain;
}

.qv-thumb-blank {
  display: block;
  background: var(--surface-3);
}

.qv-pick {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 0.9rem;
  border-radius: 14px;
  background: var(--surface-2);
}

.qv-pick[hidden],
.qv-thumb[hidden],
.qv-field[hidden] {
  display: none;
}

.qv-pick-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.qv-pick-title {
  font-weight: 700;
}

.qv-pick-name {
  color: var(--muted);
  font-size: 0.92rem;
}

.qv-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.qv-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}

.qv-grow {
  flex: 1;
}

.qv-page {
  width: 90px;
}

.qv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.qv-chip {
  min-height: 40px;
  padding: 0 0.85rem;
  border: 1px solid var(--surface-3);
  border-radius: 999px;
  background: var(--bg);
  color: var(--brand-3);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.qv-chip[aria-pressed="true"] {
  border: 2px solid var(--brand);
  background: var(--surface-3);
  color: var(--text);
  font-weight: 700;
}

.qv-primary,
.qv-ghost,
.qv-send {
  min-height: 48px;
  padding: 0 1.2rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.qv-primary {
  border: 0;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-3));
  color: var(--bg);
}

.qv-ghost {
  border: 1px solid var(--surface-3);
  background: transparent;
  color: var(--text);
}

.qv-as-typed {
  align-self: flex-start;
  border-color: var(--brand);
  color: var(--brand);
}

.qv-list {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: auto;
  background: #111a3e;
}

.qv-list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.qv-list-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
}

.qv-count-text,
.qv-small {
  color: var(--muted);
  font-size: 0.88rem;
}

.qv-small {
  margin: 0;
}

.qv-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 30vh;
  overflow-y: auto;
}

.qv-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qv-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
}

.qv-item-text span {
  color: var(--muted);
  font-size: 0.86rem;
}

.qv-remove {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
}

.qv-remove:hover {
  color: var(--text);
}

.qv-send {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.qv-send[aria-disabled="true"] {
  background: var(--surface-3);
  color: var(--muted);
  cursor: not-allowed;
}

.qv-phonebar {
  display: none;
}

.qv-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  max-width: min(420px, calc(100vw - 2rem));
  margin: 0;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: #065f46;
  color: #ecfdf5;
  font-weight: 600;
  z-index: 50;
}

.qv-toast[hidden] {
  display: none;
}

/* Phone and narrow tablet: catalog fills the screen, the bar becomes a sheet. */
@media (max-width: 899px) {
  .qv-vendor {
    display: none;
  }

  .qv-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 85dvh;
    border-left: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
    z-index: 40;
  }

  .qv-sheet-open .qv-bar {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.2s ease;
  }

  .qv-sheet-open .qv-app::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 22, 0.55);
    z-index: 30;
  }

  .qv-bar[data-mode="list"] .qv-add {
    display: none;
  }

  .qv-bar[data-mode="list"] .qv-bar-title {
    display: none;
  }

  .qv-sheet-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .qv-list {
    margin-top: 0;
  }

  .qv-phonebar {
    flex-shrink: 0;
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--card-border);
  }

  .qv-toast {
    bottom: 5.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qv-bar,
  .qv-sheet-open .qv-bar {
    transition: none;
  }
}
