/* =================================================================
   voice-search.css
   -----------------------------------------------------------------
   Styles for the microphone button that sits just left of the
   floating call/WhatsApp/support stack, its results panel, and the
   "welcome back" card a returning visitor gets.

   Scoped entirely under .voice-* class names so it cannot collide
   with anything in style.css or the per-page stylesheets.

   Palette is pulled from the existing FAB: gold #B8860B on white,
   ink #1f2933, muted #7b6a55.
   ================================================================= */

:root {
  --voice-gold: #B8860B;
  --voice-gold-dark: #96690a;
  --voice-ink: #1f2933;
  --voice-muted: #7b6a55;
  --voice-line: #e8dfd2;
  --voice-cream: #faf6f0;
}

/* ---------- The microphone button ---------- */

.voice-fab {
  position: fixed;
  right: 88px;          /* clears the 56px FAB at right:20px */
  bottom: 90px;         /* same baseline as .fab-container */
  z-index: 1000;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--voice-gold);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(184, 134, 11, .35);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease, filter .25s ease, opacity .25s ease;
}

body.modal-open .voice-fab,
body.modal-open .voice-panel,
body.modal-open .voice-welcome {
  z-index: 1 !important;
  pointer-events: none !important;
  filter: blur(4px) !important;
  opacity: 0.45 !important;
}

.voice-fab:hover { background: var(--voice-gold-dark); transform: translateY(-2px); }
.voice-fab:focus-visible { outline: 3px solid rgba(184, 134, 11, .45); outline-offset: 3px; }
.voice-fab[hidden] { display: none; }

/* A quiet nudge on first load so people notice the button exists. */
.voice-fab.is-hinting { animation: voice-hint 2.4s ease-in-out 3; }

@keyframes voice-hint {
  0%, 70%, 100% { transform: scale(1); }
  78%           { transform: scale(1.12); }
  86%           { transform: scale(.97); }
}

/* While the browser is actually listening. */
.voice-fab.is-listening { background: #c0392b; box-shadow: 0 6px 18px rgba(192, 57, 43, .4); }

.voice-fab.is-listening::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(192, 57, 43, .55);
  animation: voice-pulse 1.4s ease-out infinite;
}

@keyframes voice-pulse {
  0%   { transform: scale(.85); opacity: .9; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* Small unread-style dot when we have a suggestion waiting. */
.voice-fab-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e74c3c;
  border: 2px solid #fff;
}
.voice-fab-dot[hidden] { display: none; }

/* ---------- The results panel ---------- */

.voice-panel {
  position: fixed;
  right: 20px;
  bottom: 158px;
  z-index: 1200;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: min(72vh, 620px);
  background: #fff;
  border: 1px solid var(--voice-line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(31, 41, 51, .22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(.97);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  font-size: 14px;
  color: var(--voice-ink);
}

.voice-panel.is-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.voice-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--voice-line);
  background: var(--voice-cream);
}

.voice-panel-title {
  font-weight: 700;
  font-size: 15px;
  margin: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.voice-panel-title i { color: var(--voice-gold); }

.voice-icon-btn {
  border: none;
  background: transparent;
  color: var(--voice-muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.voice-icon-btn:hover { background: rgba(184, 134, 11, .12); color: var(--voice-ink); }
.voice-icon-btn.is-muted { color: #c0392b; }

.voice-panel-body {
  padding: 14px;
  overflow-y: auto;
  flex: 1 1 auto;
}

/* Status / transcript */

.voice-status {
  font-size: 13px;
  color: var(--voice-muted);
  margin: 0 0 10px;
}
.voice-status:empty { display: none; }
.voice-status.is-error { color: #c0392b; }

.voice-transcript {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 10px;
}
.voice-transcript:empty { display: none; }

.voice-reply {
  font-size: 14px;
  line-height: 1.5;
  background: var(--voice-cream);
  border-left: 3px solid var(--voice-gold);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  margin: 0 0 14px;
}
.voice-reply:empty { display: none; }

/* Result cards */

.voice-results { display: flex; flex-direction: column; gap: 10px; margin: 0 0 12px; }

.voice-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--voice-line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.voice-card:hover {
  border-color: var(--voice-gold);
  box-shadow: 0 6px 16px rgba(31, 41, 51, .1);
  transform: translateY(-1px);
}

.voice-card-img {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--voice-cream);
}

.voice-card-body { min-width: 0; flex: 1 1 auto; }

/* These are <span>s so they can live inside an <a>; without display:block
   the title, location and price all run together on one line. */
.voice-card-title,
.voice-card-meta,
.voice-card-price { display: block; }

.voice-card-title {
  font-weight: 650;
  font-size: 14px;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-card-meta {
  font-size: 12px;
  color: var(--voice-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-card-price { font-size: 13px; font-weight: 700; color: var(--voice-gold); margin: 3px 0 0; }
.voice-card-price small { font-weight: 400; color: var(--voice-muted); font-size: 11px; }

/* Page answer (How it works, Contact, ...) */

.voice-page-hit {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px dashed var(--voice-gold);
  border-radius: 12px;
  background: rgba(184, 134, 11, .06);
  text-decoration: none;
  color: inherit;
  margin: 0 0 12px;
}
.voice-page-hit i { color: var(--voice-gold); font-size: 16px; }
.voice-page-hit strong { display: block; font-size: 14px; }
.voice-page-hit span { font-size: 12px; color: var(--voice-muted); }

/* Buttons */

.voice-cta {
  display: block;
  text-align: center;
  background: var(--voice-gold);
  color: #fff;
  text-decoration: none;
  font-weight: 650;
  font-size: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  border: none;
  width: 100%;
  cursor: pointer;
}
.voice-cta:hover { background: var(--voice-gold-dark); color: #fff; }

/* ---------- The idle "are you searching for something?" prompt ----------
   This is what the panel shows the moment it opens by itself, before the
   visitor has said anything. It is the whole entry point - there is no
   typed input by design. */

.voice-prompt { text-align: center; padding: 6px 0 2px; }
.voice-prompt[hidden] { display: none; }

.voice-prompt-mic {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: none;
  margin: 0 auto 14px;
  background: var(--voice-gold);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 8px 22px rgba(184, 134, 11, .32);
  transition: transform .2s ease, background .2s ease;
}
.voice-prompt-mic:hover { background: var(--voice-gold-dark); transform: scale(1.05); }

/* A slow halo so the eye is drawn to the thing you are meant to tap. */
.voice-prompt-mic::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(184, 134, 11, .45);
  animation: voice-pulse 2s ease-out infinite;
}

.voice-prompt-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}
.voice-prompt-sub {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--voice-muted);
  line-height: 1.5;
}

.voice-examples-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--voice-muted);
  margin: 0 0 8px;
}

/* History chips */

.voice-history { margin: 14px 0 0; border-top: 1px solid var(--voice-line); padding-top: 12px; }
.voice-history[hidden] { display: none; }

.voice-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--voice-muted);
  margin: 0 0 8px;
}
.voice-history-clear {
  border: none;
  background: none;
  color: var(--voice-muted);
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
  letter-spacing: 0;
  text-transform: none;
}
.voice-history-clear:hover { color: #c0392b; }

.voice-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.voice-prompt .voice-chips { justify-content: center; }

.voice-chip {
  border: 1px solid var(--voice-line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12.5px;
  color: var(--voice-ink);
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.voice-chip:hover { border-color: var(--voice-gold); background: rgba(184, 134, 11, .08); }
.voice-chip i { color: var(--voice-gold); margin-right: 5px; font-size: 11px; }

.voice-note { font-size: 12px; color: var(--voice-muted); line-height: 1.5; margin: 10px 0 0; }

/* Skeleton shown while the search is in flight */

.voice-skeleton { display: flex; flex-direction: column; gap: 10px; }
.voice-skeleton span {
  display: block;
  height: 62px;
  border-radius: 12px;
  background: linear-gradient(90deg, #f2ece3 25%, #e9e1d5 37%, #f2ece3 63%);
  background-size: 400% 100%;
  animation: voice-shimmer 1.3s ease infinite;
}
@keyframes voice-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- "Welcome back" card ---------- */

.voice-welcome {
  position: fixed;
  right: 20px;
  bottom: 160px;
  z-index: 1050;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border: 1px solid var(--voice-line);
  border-left: 4px solid var(--voice-gold);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(31, 41, 51, .2);
  padding: 14px 16px 14px 14px;
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  transition: transform .45s cubic-bezier(.22, .8, .3, 1), opacity .35s ease;
  color: var(--voice-ink);
  font-size: 14px;
}
.voice-welcome.is-open { transform: translateX(0); opacity: 1; }

.voice-welcome-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: none;
  font-size: 18px;
  line-height: 1;
  color: var(--voice-muted);
  cursor: pointer;
}
.voice-welcome-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--voice-gold);
  font-weight: 700;
  margin: 0 0 5px;
}
.voice-welcome-query {
  margin: 0 0 4px;
  font-weight: 650;
  font-size: 15px;
  line-height: 1.35;
  padding-right: 14px;
}
.voice-welcome-sub { margin: 0 0 12px; font-size: 12.5px; color: var(--voice-muted); }
.voice-welcome-actions { display: flex; gap: 8px; }
.voice-welcome-actions .voice-cta { padding: 9px 10px; font-size: 13px; }
.voice-welcome-actions .voice-cta.is-ghost {
  background: #fff;
  color: var(--voice-ink);
  border: 1px solid var(--voice-line);
}
.voice-welcome-actions .voice-cta.is-ghost:hover { border-color: var(--voice-gold); background: var(--voice-cream); }

/* ---------- Responsive ---------- */

@media (min-width: 992px) {
  .voice-fab { bottom: 28px; }        /* no mobile bottom nav on desktop */
  .voice-panel { bottom: 96px; }
  .voice-welcome { bottom: 98px; }
}

@media (max-width: 600px) {
  .voice-fab { width: 50px; height: 50px; font-size: 18px; right: 84px; }
  .voice-panel {
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    bottom: 150px;
    max-height: 68vh;
  }
  .voice-welcome { right: 8px; left: 8px; width: auto; max-width: none; bottom: 152px; }
}

@media (prefers-reduced-motion: reduce) {
  .voice-fab.is-hinting,
  .voice-fab.is-listening::after,
  .voice-skeleton span { animation: none; }
  .voice-panel, .voice-welcome { transition: opacity .2s ease; }
}
