/* =================================================================
   floating-chat.css — global floating "Describe the store you want
   to build" prompt bar (Figma 1233:30390) + the chat overlay it
   opens. Loaded on every page except the home page (which has its
   own hero-prompt + overlay).
   =================================================================
   Temporarily hidden site-wide while the design is iterated. Remove
   this block (and the matching `.cw-overlay { display: none; }` rule
   below) to bring it back. */
.fcb, .cw-overlay { display: none !important; }

/* ── Floating prompt bar ─────────────────────────────────────────── */
.fcb {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  width: min(417px, calc(100vw - 32px));
  height: 60px;
  z-index: 998;
  border-radius: 14px;
  /* Subtle gradient border using a wrapper-bg + inset white pill */
  background: linear-gradient(
    var(--fcb-grad-angle, 96deg),
    rgb(252, 167, 89) 0%,
    rgb(232, 45, 86) 30%,
    rgb(162, 45, 180) 60%,
    rgb(100, 61, 206) 100%
  );
  padding: 1.5px;
  box-shadow:
    0 1px 2px rgba(20, 22, 33, 0.04),
    0 18px 40px rgba(20, 22, 33, 0.10),
    0 4px 16px rgba(20, 22, 33, 0.04);
  transition: opacity .2s ease, transform .25s ease;
}
.fcb-form {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  width: 100%;
  background: #fff;
  border-radius: 12.5px;
  padding: 0 8px 0 20px;
  box-sizing: border-box;
}
.fcb-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink, #0e0f12);
  letter-spacing: 0.16px;
}
.fcb-input::placeholder { color: #767779; }
.fcb-send {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--ink, #0e0f12);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.fcb-send:hover { background: #1d1f25; transform: translateY(-1px); }
.fcb-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.fcb-send svg { width: 14px; height: 14px; pointer-events: none; }

/* Hide the floating bar while the overlay is open so it doesn't
   double-up with the in-overlay input. */
body.cw-open .fcb { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(20px); }

/* Mobile: shorter bottom inset so the bar clears any browser chrome
   and the iOS home indicator. */
@media (max-width: 700px) {
  .fcb {
    bottom: max(24px, env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
    height: 56px;
  }
  .fcb-form { padding: 0 6px 0 18px; }
  .fcb-send { width: 32px; height: 32px; }
  .fcb-send svg { width: 12px; height: 12px; }
}

/* Don't render twice on pages where another floating bar already
   exists (e.g. anyone else dropping in a .fcb). The widget script
   guards on this too, but belt-and-braces. */
.fcb + .fcb { display: none; }

/* ── Chat overlay ─────────────────────────────────────────────────
   Lightweight overlay that opens when the user types + sends, OR (on
   mobile) when they focus the floating bar. Same shape as the home
   chat overlay but self-contained so it works on any page. */
.cw-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 22, 33, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility 0s linear .25s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
}
.cw-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .25s ease, visibility 0s linear 0s;
}
.cw-card {
  position: relative;
  width: min(640px, 100%);
  max-height: min(720px, 100dvh - 32px);
  height: 100dvh;
  background: #fff;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 24px 64px rgba(20, 22, 33, 0.20),
    0 4px 16px rgba(20, 22, 33, 0.08);
}
.cw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(20, 22, 33, 0.06);
  flex-shrink: 0;
}
.cw-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body, system-ui);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink, #0e0f12);
}
.cw-brand .by { color: rgba(20, 22, 33, 0.5); font-weight: 400; }
.cw-brand-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #ffffff 0%, transparent 35%),
    conic-gradient(from 90deg, #FAAD4F, #DD2A7B, #9537B0, #515BD4, #FAAD4F);
}
.cw-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(20, 22, 33, 0.06);
  color: var(--ink, #0e0f12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease;
}
.cw-close:hover { background: rgba(20, 22, 33, 0.10); }
.cw-close svg { width: 14px; height: 14px; }

.cw-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-overflow-scrolling: touch;
}
.cw-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 84%;
  animation: cw-msg-in .28s cubic-bezier(.22,1,.36,1) both;
}
.cw-msg.user {
  align-self: flex-end;
  background: rgba(20, 22, 33, 0.06);
  color: var(--ink, #0e0f12);
  padding: 10px 14px;
  border-radius: 16px;
  font-family: var(--font-body, system-ui);
  font-size: 15px;
  line-height: 1.5;
}
.cw-msg.ai {
  align-self: flex-start;
  font-family: var(--font-body, system-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink, #0e0f12);
}
.cw-msg.ai::before {
  content: '';
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-top: 3px;
  background:
    radial-gradient(circle at 30% 30%, #ffffff 0%, transparent 35%),
    conic-gradient(from 90deg, #FAAD4F, #DD2A7B, #9537B0, #515BD4, #FAAD4F);
}
.cw-msg.ai .cw-msg-text { display: block; }

.cw-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  text-decoration: none;
  font-family: var(--font-body, system-ui);
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: 0.16px;
  background-image: linear-gradient(
    rgb(252, 167, 89) 3.12%,
    rgb(232, 45, 86) 17.47%,
    rgb(162, 45, 180) 77.07%,
    rgb(100, 61, 206) 105.24%
  );
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  transition: opacity .2s ease;
}
.cw-cta:hover { opacity: 0.85; }
.cw-cta-arrow {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  background: linear-gradient(
    rgb(252, 167, 89) 3.12%,
    rgb(232, 45, 86) 17.47%,
    rgb(162, 45, 180) 77.07%,
    rgb(100, 61, 206) 105.24%
  );
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 3 11 8 6 13'/></svg>") no-repeat center / contain;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 3 11 8 6 13'/></svg>") no-repeat center / contain;
}

.cw-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
}
.cw-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(20, 22, 33, 0.4);
  animation: cw-pulse 1.2s ease-in-out infinite;
}
.cw-typing-dots span:nth-child(2) { animation-delay: .15s; }
.cw-typing-dots span:nth-child(3) { animation-delay: .30s; }

@keyframes cw-pulse {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}
@keyframes cw-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cw-input-bar {
  flex-shrink: 0;
  border-top: 1px solid rgba(20, 22, 33, 0.06);
  padding: 12px 16px 16px;
}
.cw-input-bar form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: rgba(20, 22, 33, 0.04);
  border-radius: 16px;
  padding: 4px 4px 4px 16px;
}
.cw-input-bar input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-body, system-ui);
  font-size: 15px;
  color: var(--ink, #0e0f12);
}
.cw-input-bar input::placeholder { color: rgba(20, 22, 33, 0.5); }
.cw-input-bar button {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--ink, #0e0f12);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}
.cw-input-bar button:hover { background: #1d1f25; }
.cw-input-bar button svg { width: 14px; height: 14px; }

@media (max-width: 700px) {
  .cw-overlay { padding: 0; }
  .cw-card { border-radius: 0; max-height: 100dvh; }
}
