/* Asistente IA de Edificio Deymar. Colores y tipografias del sitio. */
.nbc {
  --nbc-deep: #06283d;
  --nbc-ocean: #12678c;
  --nbc-sky: #e9f3f8;
  --nbc-mist: #f5f7f8;
  --nbc-border: #e4ebef;
  --nbc-muted: #5b6c77;
  --nbc-wa: #25d366;
  --nbc-wa-deep: #1eb455;
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
  color: var(--nbc-deep);
}
.nbc *, .nbc *::before, .nbc *::after { box-sizing: border-box; }

/* Burbuja: mismo tamaño y alineacion que la de WhatsApp, justo encima */
.nbc-bubble {
  position: fixed; right: 16px; bottom: 144px; z-index: 50;
  display: flex; align-items: center; gap: 0;
  height: 52px; min-width: 52px; padding: 0;
  border: 0; border-radius: 9999px; cursor: pointer;
  background: #fff; color: var(--nbc-deep);
  box-shadow: 0 14px 40px -10px rgba(6, 40, 61, 0.5);
  transition: gap .3s, padding .3s, background-color .3s;
  font: inherit;
}
.nbc-bubble img { width: 52px; height: 52px; flex: none; display: block; border-radius: 9999px; }
.nbc-bubble span {
  max-width: 0; overflow: hidden; opacity: 0; white-space: nowrap;
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  transition: max-width .3s, opacity .3s;
}
.nbc-bubble:hover { gap: 4px; padding-right: 20px; }
.nbc-bubble:hover span { max-width: 200px; opacity: 1; }
.nbc-bubble:focus-visible { outline: 2px solid var(--nbc-ocean); outline-offset: 4px; }
.nbc-bubble .nbc-dot {
  position: absolute; top: 2px; left: 40px; width: 12px; height: 12px;
  border-radius: 9999px; background: var(--nbc-wa); border: 2px solid #fff;
}
.nbc-open .nbc-bubble .nbc-dot { display: none; }

@media (min-width: 768px) {
  .nbc-bubble { right: 28px; bottom: 96px; height: 56px; min-width: 56px; }
  .nbc-bubble img { width: 56px; height: 56px; }
  .nbc-bubble .nbc-dot { left: 44px; }
}

/* Ventana. En movil: tarjeta flotante con margen (no pantalla completa); su alto y posicion
   se ajustan por JS al area visible para que el teclado no la tape. */
.nbc-panel {
  position: fixed; z-index: 60;
  left: 10px; right: 10px; bottom: 10px;
  height: min(520px, calc(100vh - 90px));
  height: min(520px, calc(100dvh - 90px));
  display: none; flex-direction: column;
  background: #fff; overflow: hidden;
  border: 1px solid var(--nbc-border); border-radius: 16px;
  box-shadow: 0 24px 60px -16px rgba(6, 40, 61, 0.5);
  touch-action: manipulation; /* sin zoom por doble toque */
}
.nbc-log { overscroll-behavior: contain; }
.nbc-open .nbc-panel { display: flex; animation: nbc-in .25s ease-out; }
@keyframes nbc-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 767px) {
  /* La tarjeta tapa las burbujas: se ocultan mientras esta abierta */
  .nbc-open .nbc-bubble { display: none; }
  .nbc-head { padding: 10px 12px; gap: 10px; }
  .nbc-head img { width: 34px; height: 34px; }
  .nbc-head h2 { font-size: 16px; }
  .nbc-log { padding: 12px; gap: 8px; }
  .nbc-msg { font-size: 14px; padding: 9px 12px; max-width: 88%; }
  .nbc-form { padding: 8px 10px; }
  .nbc-form textarea { min-height: 40px; }
  .nbc-send { width: 40px; height: 40px; }
  .nbc-foot { padding: 0 10px 8px; }
  /* 16px evita que el iPhone haga zoom al escribir (eso desbordaba la pantalla) */
  .nbc-form textarea,
  .nbc-card input[type=text], .nbc-card input[type=email], .nbc-card input[type=tel],
  .nbc-card input[type=number], .nbc-card textarea { font-size: 16px; }
}
@media (min-width: 768px) {
  .nbc-panel {
    left: auto; right: 28px; bottom: 164px;
    width: 380px; height: min(600px, calc(100vh - 190px));
    border-radius: 14px;
    box-shadow: 0 30px 80px -20px rgba(6, 40, 61, 0.45);
  }
}

.nbc-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--nbc-deep); color: #fff;
}
.nbc-head img { width: 42px; height: 42px; border-radius: 9999px; background: #fff; flex: none; }
.nbc-head h2 { margin: 0; font-family: "Marcellus", "Times New Roman", serif; font-size: 18px; font-weight: 400; line-height: 1.2; }
.nbc-head p { margin: 2px 0 0; font-size: 11px; color: rgba(255,255,255,.7); letter-spacing: .04em; }
.nbc-head p::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 9999px; background: var(--nbc-wa); vertical-align: 1px; }
.nbc-close {
  margin-left: auto; width: 36px; height: 36px; flex: none;
  display: grid; place-items: center; border: 0; border-radius: 9999px;
  background: transparent; color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
}
.nbc-close:hover { background: rgba(255,255,255,.12); }

.nbc-log {
  flex: 1; overflow-y: auto; padding: 16px; background: var(--nbc-mist);
  display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth;
}
.nbc-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.nbc-msg a { color: inherit; text-decoration: underline; }
.nbc-bot { align-self: flex-start; background: #fff; border: 1px solid var(--nbc-border); border-bottom-left-radius: 4px; }
.nbc-user { align-self: flex-end; background: var(--nbc-ocean); color: #fff; border-bottom-right-radius: 4px; }
.nbc-note { align-self: center; max-width: 92%; font-size: 11px; color: var(--nbc-muted); text-align: center; line-height: 1.4; }

.nbc-typing { display: inline-flex; gap: 4px; }
.nbc-typing i { width: 6px; height: 6px; border-radius: 9999px; background: var(--nbc-muted); opacity: .4; animation: nbc-blink 1s infinite; }
.nbc-typing i:nth-child(2) { animation-delay: .15s; }
.nbc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes nbc-blink { 50% { opacity: 1; } }

.nbc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nbc-chip {
  padding: 7px 12px; border: 1px solid var(--nbc-ocean); border-radius: 9999px;
  background: #fff; color: var(--nbc-ocean); font: inherit; font-size: 12px; cursor: pointer;
}
.nbc-chip:hover { background: var(--nbc-sky); }

.nbc-wa {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 3px; background: var(--nbc-wa); color: #fff !important;
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
}
.nbc-wa:hover { background: var(--nbc-wa-deep); }
.nbc-wa svg { width: 16px; height: 16px; fill: currentColor; }

/* Formulario de reserva dentro del chat */
.nbc-card { align-self: stretch; padding: 14px; border: 1px solid var(--nbc-border); border-radius: 10px; background: #fff; font-size: 13px; }
.nbc-card h3 { margin: 0 0 4px; font-family: "Marcellus", serif; font-size: 17px; font-weight: 400; }
.nbc-card .nbc-sum { margin: 0 0 10px; color: var(--nbc-muted); font-size: 12px; line-height: 1.5; }
.nbc-card .nbc-total { color: var(--nbc-deep); font-weight: 700; }
.nbc-card label { display: block; margin-top: 8px; font-size: 11px; font-weight: 600; color: var(--nbc-muted); }
.nbc-card input[type=text], .nbc-card input[type=email], .nbc-card input[type=tel], .nbc-card input[type=number], .nbc-card textarea {
  width: 100%; margin-top: 3px; padding: 8px 10px; border: 1px solid var(--nbc-border); border-radius: 3px;
  font: inherit; font-size: 14px; color: var(--nbc-deep); background: #fff;
}
.nbc-card .nbc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nbc-card .nbc-consent { display: flex; gap: 6px; align-items: flex-start; font-weight: 400; line-height: 1.4; }
.nbc-card .nbc-consent input { margin-top: 2px; }
.nbc-card .nbc-err { margin: 8px 0 0; color: #b91c1c; font-size: 12px; }
.nbc-submit {
  width: 100%; margin-top: 12px; padding: 11px; border: 0; border-radius: 3px;
  background: var(--nbc-deep); color: #fff; font: inherit; font-size: 12px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
}
.nbc-submit:disabled { opacity: .6; cursor: wait; }

.nbc-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--nbc-border); background: #fff; }
.nbc-form textarea {
  flex: 1; resize: none; max-height: 110px; min-height: 42px; padding: 10px 12px;
  border: 1px solid var(--nbc-border); border-radius: 21px; font: inherit; font-size: 14px; line-height: 1.4; color: var(--nbc-deep);
}
.nbc-form textarea:focus { outline: none; border-color: var(--nbc-ocean); }
.nbc-send {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 9999px; background: var(--nbc-ocean); color: #fff; cursor: pointer;
}
.nbc-send:disabled { opacity: .5; cursor: default; }
.nbc-send svg { width: 18px; height: 18px; fill: currentColor; }
.nbc-foot { padding: 0 12px 10px; background: #fff; font-size: 10px; color: var(--nbc-muted); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .nbc-open .nbc-panel, .nbc-typing i { animation: none; }
}
