.gastrobot-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  font-family: Arial, Helvetica, sans-serif;
}

.gastrobot-root,
.gastrobot-root * {
  box-sizing: border-box;
}

.gastrobot-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  font: 700 15px/1.2 Arial, Helvetica, sans-serif;
  user-select: none;
  position: relative;
  z-index: 3;
}

.gastrobot-launcher-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  flex: 0 0 30px;
}

.gastrobot-host-figure {
  position: absolute;
  right: 400px;
  bottom: 72px; /* alineado con el borde inferior del cuadro de chat */
  display: none;
  width: 250px;
  height: 470px;
  overflow: hidden;
  border-radius: 30px;
  pointer-events: none;
  z-index: 1;
}

.gastrobot-root.is-open:not(.is-minimized) .gastrobot-host-figure {
  display: block;
}

.gastrobot-host-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.24));
  animation: gastrobot-host-idle 3.8s ease-in-out infinite;
}

.gastrobot-host-video {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.24));
  transform: scale(1.18);
  transform-origin: center center;
}

.gastrobot-host-figure.has-video .gastrobot-host-video {
  display: block;
}

.gastrobot-host-figure.has-video .gastrobot-host-image {
  display: none;
}

.gastrobot-host-stage {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.gastrobot-host-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.gastrobot-host-figure.has-3d .gastrobot-host-stage {
  opacity: 1;
}

@keyframes gastrobot-host-idle {
  0%,
  100% {
    transform: translateY(0) rotateY(0deg);
  }

  50% {
    transform: translateY(-8px) rotateY(-3deg);
  }
}

.gastrobot-chat {
  position: absolute;
  right: 0;
  bottom: 72px;
  display: none;
  width: min(380px, calc(100vw - 32px));
  max-height: min(660px, calc(100vh - 112px));
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 18px;
  background: #ffffff;
  color: #1f1f1f;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.24);
  z-index: 2;
}

.gastrobot-root.is-open .gastrobot-chat {
  display: flex;
  flex-direction: column;
}

.gastrobot-root.is-minimized .gastrobot-chat-body,
.gastrobot-root.is-minimized .gastrobot-chat-footer {
  display: none;
}

.gastrobot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #111111;
  color: #ffffff;
}

.gastrobot-avatar {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  overflow: hidden;
  border-radius: 50%;
  background: #f4f1ec;
}

.gastrobot-header-copy {
  min-width: 0;
  flex: 1;
}

.gastrobot-title {
  margin: 0;
  font: 700 17px/1.2 Arial, Helvetica, sans-serif;
}

.gastrobot-subtitle {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font: 500 12px/1.3 Arial, Helvetica, sans-serif;
}

.gastrobot-line {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font: 500 11px/1.3 Arial, Helvetica, sans-serif;
}

.gastrobot-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gastrobot-icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  font: 700 18px/1 Arial, Helvetica, sans-serif;
}

.gastrobot-chat-body {
  overflow: auto;
  padding: 16px;
}

.gastrobot-messages {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.gastrobot-message {
  max-width: 88%;
  margin: 0;
  padding: 12px 13px;
  border-radius: 14px;
  background: #f4f4f4;
  color: #262626;
  font: 400 14px/1.45 Arial, Helvetica, sans-serif;
  overflow-wrap: anywhere;
}

.gastrobot-message-assistant {
  justify-self: start;
  border-bottom-left-radius: 5px;
}

.gastrobot-message-user {
  justify-self: end;
  border-bottom-right-radius: 5px;
  background: #111111;
  color: #ffffff;
}

.gastrobot-message-typing {
  color: #666666;
  font-style: italic;
}

.gastrobot-suggestions {
  display: grid;
  gap: 8px;
}

.gastrobot-suggestion {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 12px;
  background: #ffffff;
  color: #242424;
  cursor: pointer;
  text-align: left;
  font: 600 13px/1.3 Arial, Helvetica, sans-serif;
}

.gastrobot-suggestion:hover,
.gastrobot-suggestion:focus {
  border-color: rgba(17, 17, 17, 0.32);
  outline: none;
}

.gastrobot-chat-footer {
  /* display/padding explícitos: la web define footer{display:flex;padding:36px 64px} */
  display: block;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(17, 17, 17, 0.1);
  background: #ffffff;
}

.gastrobot-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.gastrobot-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gastrobot-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-radius: 999px;
  background: #ffffff;
  color: #222222;
  font: 400 14px/1 Arial, Helvetica, sans-serif;
}

.gastrobot-input:focus {
  border-color: rgba(17, 17, 17, 0.42);
  outline: none;
}

.gastrobot-input::placeholder {
  color: #8a8a8a;
}

.gastrobot-send {
  flex: 0 0 auto;
  height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  cursor: pointer;
  font: 700 13px/1 Arial, Helvetica, sans-serif;
}

.gastrobot-send:disabled,
.gastrobot-input:disabled {
  cursor: wait;
  opacity: 0.72;
}

.gastrobot-disclaimer {
  margin: 0;
  color: #5f5f5f;
  font: 400 11px/1.4 Arial, Helvetica, sans-serif;
}

@media (max-width: 640px) {
  .gastrobot-root {
    right: 16px;
    bottom: 16px;
  }

  .gastrobot-launcher {
    min-height: 50px;
    padding: 11px 15px;
    font-size: 14px;
  }

  .gastrobot-launcher-text-full {
    display: none;
  }

  .gastrobot-launcher-text-mobile {
    display: inline;
  }

  .gastrobot-chat {
    right: 0;
    bottom: 66px;
    width: calc(100vw - 32px);
    max-height: calc(100vh - 96px);
    border-radius: 16px;
  }

  .gastrobot-host-figure {
    position: fixed;
    left: 34px;
    top: 150px;
    right: auto;
    bottom: auto;
    width: 104px;
    height: 154px;
    border-radius: 18px;
    z-index: 10002;
  }

  .gastrobot-host-video {
    object-position: 50% 18%;
    transform: scale(1.28);
  }

  .gastrobot-root.is-open:not(.is-minimized) .gastrobot-host-figure {
    display: block;
  }

  .gastrobot-message {
    max-width: 94%;
  }

  .gastrobot-messages .gastrobot-message-assistant:first-child {
    min-height: 172px;
    padding-left: 118px;
  }

  .gastrobot-form {
    gap: 6px;
  }

  .gastrobot-send {
    padding: 0 12px;
  }
}

@media (min-width: 641px) and (max-width: 980px) {
  .gastrobot-host-figure {
    right: 350px;
    bottom: 72px;
    width: 220px;
    height: 420px;
  }

  .gastrobot-chat {
    width: min(330px, calc(100vw - 32px));
  }
}

@media (min-width: 641px) {
  .gastrobot-launcher-text-mobile {
    display: none;
  }
}


/* ============================================================
   GASTROBOT VOZ + LIP-SYNC
   ============================================================ */

.gastrobot-voice-meter {
  position: absolute;
  left: 50%;
  bottom: 10px;
  display: none;
  gap: 3px;
  align-items: flex-end;
  height: 22px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.72);
  transform: translateX(-50%);
}

.gastrobot-host-figure.is-talking .gastrobot-voice-meter {
  display: flex;
}

.gastrobot-voice-meter span {
  width: 3px;
  border-radius: 2px;
  background: #c8a15d;
  height: calc(3px + 11px * var(--gastrobot-open, 0));
  transition: height 70ms linear;
}

.gastrobot-voice-meter span:nth-child(2),
.gastrobot-voice-meter span:nth-child(4) {
  height: calc(3px + 8px * var(--gastrobot-open, 0));
}

.gastrobot-voice-meter span:nth-child(1),
.gastrobot-voice-meter span:nth-child(5) {
  height: calc(3px + 5px * var(--gastrobot-open, 0));
}

.gastrobot-host-figure.is-talking .gastrobot-host-image {
  animation: gastrobot-host-talking 0.42s ease-in-out infinite;
}

@keyframes gastrobot-host-talking {
  0%,
  100% {
    transform: translateY(0) rotateZ(0deg);
  }

  25% {
    transform: translateY(-3px) rotateZ(-0.6deg);
  }

  75% {
    transform: translateY(-1px) rotateZ(0.6deg);
  }
}

.gastrobot-root.is-talking .gastrobot-avatar {
  box-shadow: 0 0 0 3px rgba(200, 161, 93, 0.65);
}

.gastrobot-message-assistant a {
  color: #8a6a2f;
  font-weight: 700;
  text-decoration: none;
}

.gastrobot-message-assistant a:hover {
  text-decoration: underline;
}

.gastrobot-message-assistant strong {
  font-weight: 700;
}
