/* ===== ИИ-подбор (демо): плавающая кнопка и панель. Переменные --p-* заданы в booking.css ===== */

.ai-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 950;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: #1B1C20; color: #F3F2EF;
  box-shadow: inset 0 0 0 1px rgb(243 242 239 / 0.28), 0 12px 30px rgb(0 0 0 / 0.35);
  font: 500 15px/1 "Manrope", system-ui, sans-serif;
  transition: background-color .3s, box-shadow .3s;
}
.ai-fab:hover { background: #2A2C30; box-shadow: inset 0 0 0 1px rgb(243 242 239 / 0.5), 0 12px 30px rgb(0 0 0 / 0.35); }
.ai-fab svg { color: #E8A04B; }
html.has-dialog .ai-fab { visibility: hidden; }
@media (max-width: 559px) {
  .ai-fab { right: 12px; bottom: 16px; min-height: 44px; padding: 0 16px 0 13px; font-size: 14px; }
}

.ai {
  position: fixed; inset: auto 24px 24px auto; margin: 0;
  width: min(430px, calc(100vw - 48px)); height: min(700px, calc(100vh - 48px)); max-width: none; max-height: none;
  padding: 0; border: 0; border-radius: 14px;
  background: var(--p-bg);
  box-shadow: inset 0 0 0 1px var(--p-line), 0 30px 90px rgb(0 0 0 / 0.55);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
          backdrop-filter: blur(24px) saturate(130%);
  overflow: hidden;
}
.ai[open] { display: flex; flex-direction: column; }
.ai::backdrop { background: rgb(8 8 9 / 0.4); }
@media (max-width: 639px) {
  /* На мобильном — на весь экран */
  .ai { inset: 0; width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .ai[open] { animation: ai-in .4s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .ai__msg, .ai__card { animation: ai-msg .35s cubic-bezier(0.22, 1, 0.36, 1) both; }
}
@keyframes ai-in { from { transform: translate3d(0, 24px, 0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ai-msg { from { transform: translate3d(0, 6px, 0); opacity: 0; } to { transform: none; opacity: 1; } }

.ai__head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 12px 22px; box-shadow: inset 0 -1px 0 var(--p-line); }
.ai__title { margin: 0; font-size: 18px; font-weight: 400; letter-spacing: -0.01em; }

.ai__log { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 8px; display: flex; flex-direction: column; gap: 8px; }
.ai__log:focus-visible { outline-offset: -4px; }
.ai__msg { margin: 0; max-width: 88%; padding: 11px 14px; border-radius: 14px; font-size: 15px; line-height: 1.45; }
.ai__msg--bot { align-self: flex-start; background: rgb(243 242 239 / 0.09); border-bottom-left-radius: 4px; }
.ai__msg--user { align-self: flex-end; background: #F3F2EF; color: #0E0F11; border-bottom-right-radius: 4px; }
.ai__msg--typing { display: inline-flex; gap: 5px; padding: 15px 16px; }
.ai__msg--typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--p-muted); animation: ai-dot 1s infinite ease-in-out; }
.ai__msg--typing i:nth-child(2) { animation-delay: .15s; }
.ai__msg--typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 0%, 60%, 100% { opacity: .35; } 30% { opacity: 1; } }

.ai__card { margin-top: 6px; padding: 18px; border-radius: 10px; background: rgb(243 242 239 / 0.07); box-shadow: inset 0 0 0 1px var(--p-accent); }
.ai__card-kicker { margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--p-muted); }
.ai__card h3 { margin: 8px 0 0; font-size: 22px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; }
.ai__card dl { display: flex; gap: 28px; margin: 14px 0 0; }
.ai__card dt { font-size: 12px; color: var(--p-muted); }
.ai__card dd { margin: 2px 0 0; font-size: 15px; font-weight: 500; }
.ai__card-why { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--p-line); font-size: 14px; line-height: 1.45; color: var(--p-muted); }

.ai__options { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 22px 4px; min-height: 12px; }
.ai__opt {
  min-height: 44px; padding: 8px 16px; border: 0; border-radius: 999px; cursor: pointer; text-align: left;
  background: none; color: var(--p-ink); font: 400 15px/1.2 var(--font);
  box-shadow: inset 0 0 0 1px rgb(243 242 239 / 0.4);
  transition: background-color .25s, box-shadow .25s;
}
.ai__opt:hover { background: rgb(243 242 239 / 0.1); box-shadow: inset 0 0 0 1px rgb(243 242 239 / 0.7); }
.ai__opt--accent { background: var(--p-accent); color: #0E0F11; font-weight: 500; box-shadow: none; padding: 8px 24px; }
.ai__opt--accent:hover { background: #F0B56C; box-shadow: none; }

.ai__form { display: flex; gap: 8px; padding: 12px 22px 0; }
.ai__back {
  flex: none; min-height: 48px; padding: 0 14px; border: 0; border-radius: 3px; cursor: pointer;
  background: none; color: var(--p-ink); font: 400 15px/1 var(--font);
  box-shadow: inset 0 0 0 1px rgb(243 242 239 / 0.4);
}
.ai__back:hover:not(:disabled) { background: rgb(243 242 239 / 0.1); }
.ai__back:disabled { color: rgb(243 242 239 / 0.4); box-shadow: inset 0 0 0 1px rgb(243 242 239 / 0.12); cursor: default; }
.ai__input { min-height: 48px; font-size: 16px; flex: 1; min-width: 0; }
.ai__input:disabled { opacity: .5; }
.ai__send {
  flex: none; width: 48px; height: 48px; border: 0; border-radius: 3px; cursor: pointer;
  display: grid; place-items: center; background: #F3F2EF; color: #0E0F11;
}
.ai__send:hover { background: #fff; }
.ai__foot { margin: 0; padding: 10px 22px 14px; font-size: 12px; color: var(--p-muted); }

html[data-variant="a"] .ai-fab svg { color: #C9B68E; }
html[data-variant="b"] .ai-fab svg { color: #E3A46A; }
html[data-variant="c"] .ai-fab svg { color: #8FD3FF; }

html[data-variant="a3d"] .ai-fab svg { color: #FF8A3D; }
