/* ── Contenedor fijo (solo el tamaño del botón) ────────────── */
.meza-chatbot {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  width: 58px;
  height: 58px;
  font-family: Inter, Segoe UI, sans-serif;
}

/* ── Botón circular ────────────────────────────────────────── */
.meza-chatbot__toggle {
  border: none;
  background: #7b1a1a;
  color: #fff;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  position: relative;
  z-index: 1;
}

.meza-chatbot__toggle svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

/* ── Panel: absolute encima del botón, crece hacia la izquierda */
.meza-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(360px, calc(100vw - 40px));
  height: min(500px, 70vh);
  background: #fff;
  border: 1px solid #e0ddd8;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.15);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  z-index: 2;
}

/* Prevent display:grid from overriding the [hidden] attribute */
.meza-chatbot__panel[hidden] {
  display: none;
}

.meza-chatbot__head {
  background: #1c3a27;
  color: #fff;
  font-weight: 700;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.meza-chatbot__close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.meza-chatbot__suggestions {
  padding: 8px 10px;
  border-top: 1px solid #ece7e1;
  border-bottom: 1px solid #ece7e1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  background: #fff;
}

.meza-chatbot__chip {
  border: 1px solid #d9d4ce;
  background: #fff;
  color: #1c3a27;
  font-size: 12px;
  padding: 6px 10px;
  white-space: nowrap;
  cursor: pointer;
}

.meza-chatbot__chip:hover {
  border-color: #7b1a1a;
  color: #7b1a1a;
}

.meza-chatbot__messages {
  padding: 12px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #faf9f7;
}

.meza-chatbot__msg {
  padding: 10px 12px;
  line-height: 1.45;
  font-size: 14px;
  max-width: 92%;
}

.meza-chatbot__msg--bot {
  background: #fff;
  border: 1px solid #e5e0db;
  color: #193a27;
  align-self: flex-start;
}

.meza-chatbot__msg--user {
  background: #7b1a1a;
  color: #fff;
  align-self: flex-end;
}

.meza-chatbot__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #ece7e1;
  background: #fff;
}

.meza-chatbot__form input {
  border: 1px solid #d9d4ce;
  padding: 10px;
  font-size: 14px;
}

.meza-chatbot__form button {
  border: none;
  background: #c9a227;
  color: #fff;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
}

/* ── Paso “indica tu correo” (resaltado) ───────────────────── */
.meza-chatbot.meza-chatbot--awaiting-email .meza-chatbot__form {
  position: relative;
  background: linear-gradient(180deg, #fff8e6 0%, #fff 45%);
  border-top: 2px solid #c9a227;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.meza-chatbot.meza-chatbot--awaiting-email .meza-chatbot__form::before {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: #c9a227;
  opacity: 0.9;
}

.meza-chatbot.meza-chatbot--awaiting-email .meza-chatbot__form input {
  border: 2px solid #c9a227;
  background: #fffef8;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.22);
  outline: none;
}

.meza-chatbot.meza-chatbot--awaiting-email .meza-chatbot__form input:focus {
  border-color: #7b1a1a;
  box-shadow: 0 0 0 3px rgba(123, 26, 26, 0.18);
}

.meza-chatbot.meza-chatbot--awaiting-email .meza-chatbot__form button {
  background: #7b1a1a;
  box-shadow: 0 2px 8px rgba(123, 26, 26, 0.25);
}

.meza-chatbot__msg--bot.meza-chatbot__msg--prompt-email {
  background: #fffbf0;
  border: 2px solid #c9a227;
  box-shadow: 0 2px 12px rgba(201, 162, 39, 0.2);
  font-weight: 600;
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .meza-chatbot {
    right: 14px;
    bottom: 14px;
    width: 50px;
    height: 50px;
  }

  .meza-chatbot__toggle {
    width: 50px;
    height: 50px;
  }

  .meza-chatbot__toggle svg {
    width: 22px;
    height: 22px;
  }

  .meza-chatbot__panel {
    /* 14px de margen en cada lado */
    width: calc(100vw - 28px);
    right: 0;
    height: min(460px, 72vh);
  }
}
