:root {
  --chatbot-header-offset: 40px; /* 🔥 AJUSTA AQUÍ según tu header */
}
/**************************************
CHATBOT BUTTON
**************************************/
.chatbot-button {
  position: fixed;
  right: 14px;
  bottom: 1.5rem;

  width: 70px;
  height: 70px;
  padding: 8px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 50%;

  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  box-shadow: 0 4px 14px rgba(0,0,0,.3);

  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease;
}

.chatbot-button:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
}

.chatbot-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;

  border-radius: 50%;
}


/**************************************
CHATBOT CONTAINER
**************************************/
.chatbot-container {
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 999911;

  width: 360px;
  height: 440px;

  display: flex;
  flex-direction: column;

  overflow: hidden;

  border-radius: 6px;

  background: #f4f6fa;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);

  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all .3s ease;
}

.chatbot-container.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}


/**************************************
HEADER
**************************************/
.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 10px 12px;

  background: #6a00f4;
  color: #000;
}

.chatbot-profile {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot-logo {
  height: 30px;
  border-radius: 50%;
}

.status-dot {
  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: #22c55e;
}

.chatbot-title {
  font-size: 13px;
  font-weight: 600;

  color: white;
}

.chatbot-actions {
  display: flex;
  align-items: center;
  gap: 15px;

  font-size: 12.5px;
  color: white;
  cursor: pointer;
}


/**************************************
BODY
**************************************/
.chatbot-body {
  flex: 1;

  display: flex;
  flex-direction: column;

  padding: 15px;

  overflow-y: auto;

  background: #fefefe;

  font-size: .92rem;
  color: #333;
}
/**************************************
SCROLL PERSONALIZADO CHATBOT
**************************************/

/* Chrome, Edge, Safari */
.chatbot-body::-webkit-scrollbar {
  width: 6px;
}

.chatbot-body::-webkit-scrollbar-track {
  background: #e5e7eb;
  border-radius: 10px;
}

.chatbot-body::-webkit-scrollbar-thumb {
  background: #8b5cf6;
  border-radius: 10px;
}

.chatbot-body::-webkit-scrollbar-thumb:hover {
  background: #6a00f4;
}

/* Firefox */
.chatbot-body {
  scrollbar-width: thin;
  scrollbar-color: #8b5cf6 #e5e7eb;
}
/**************************************
BLOQUEAR SCROLL GLOBAL CUANDO BOT ABIERTO
**************************************/
body.chatbot-open {
  overflow: hidden;
  height: 100vh;
}

.chatbot-saludo {
  margin-bottom: 20px;

  font-size: 15px;
  font-weight: 500;
  text-align: start;
}

.chatbot-subtitle {
  margin-bottom: 15px;

  font-size: 14px;
  font-weight: 500;
  text-align: start;
}

.chatbot-texto-section {
  font-size: 13px;
  font-weight: 500;
  text-align: start;
}

strong {
  font-weight: 700;
}

.timestamp {
  margin-top: 10px;

  font-size: 12px;
  font-weight: 600;
  text-align: end;
}

/* BOTON */
/**************************************
LINK ESTILO (COHERENTE CON EL CHATBOT)
**************************************/
.chatbot-link {
    display: inline-block;
    color: #4f46e5; /* azul-morado base */
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    animation: shakeSoft 5s infinite;
}

/* línea visible desde inicio */
.chatbot-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 1px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    transition: all 0.3s ease;
}

.chatbot-link:hover {
    color: #6a00f4;
}

.chatbot-link:hover::after {
    height: 3px;
    background: linear-gradient(90deg, #6a00f4, #8b5cf6);
}


/**************************************
BOTÓN ESTILO (FULL MATCH CHATBOT)
**************************************/
.chatbot-btn {
    display: inline-block;
    padding: 10px 18px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: pulseSoft 4s infinite;
}

.chatbot-btn:hover {
    background: linear-gradient(135deg, #4338ca, #6a00f4);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4);
}


/**************************************
ANIMACIÓN SACUDIDA (SUAVE + PAUSA)
**************************************/
@keyframes shakeSoft {
    0%   { transform: translateX(0); }
    4%   { transform: translateX(-2px); }
    8%   { transform: translateX(2px); }
    12%  { transform: translateX(-2px); }
    16%  { transform: translateX(2px); }
    20%  { transform: translateX(0); }

    /* pausa larga */
    100% { transform: translateX(0); }
}
@keyframes pulseSoft {
    0%   { transform: scale(1); }
    10%  { transform: scale(1.05); }
    20%  { transform: scale(1); }

    /* pausa */
    100% { transform: scale(1); }
}

/**************************************
USER MESSAGE
**************************************/
.user-message {
  align-self: flex-end;

  max-width: 75%;
  margin: 8px 0;
  padding: 16px 10px;

  border-radius: 14px 14px 0 14px;

  text-align: right;

  background: rgba(202, 138, 4, 0.08);
  color: #000;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);

  font-size: 15px;
  font-weight: 600;
}


/**************************************
BOT BUTTONS
**************************************/
.bot-button {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 18px;

  border-radius: 8px;

  background: linear-gradient(135deg, #6a5cff, #8b5cf6);
  color: #fff;

  font-size: 13px;
  font-weight: 500;
  text-align: start;

  cursor: pointer;
  transition: all 0.3s ease;
}

.bot-button:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #5a4df0, #7c4df0);
}


/**************************************
BOT MESSAGES
**************************************/
.chat-section,
.chat-typing {
  align-self: flex-start;

  max-width: 75%;
  margin: 8px 0;
  padding: 10px 14px;

  border-radius: 14px 14px 14px 0;

  text-align: left;

  background: rgba(124, 58, 237, 0.08);
  color: #222;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.chat-section {
  display: none;
}

.chat-section + .timestamp {
  text-align: left;
  color: #666;
}

.user-message + .timestamp {
  text-align: right;
  color: #e0e0ff;
}

.chatbot-container.expanded {
  top: 54px;
  right: 10px;
  width: 500px;
  height: calc(100vh - 54px - 10px);
}

.bot-countdown {
  font-size: 14px;
  font-weight: 600;
  color: #7c3aed;
  text-align: center;
}

/**************************************
TYPING INDICATOR (3 DOTS)
**************************************/
.chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  padding: 10px 14px;
  margin: 8px 0;

  border-radius: 14px 14px 14px 0;

  background: rgba(124, 58, 237, 0.08);

  max-width: 60%;
}

/* los 3 punticos */
.chat-typing span {
  width: 6px;
  height: 6px;

  background: #6a00f4;
  border-radius: 50%;

  display: inline-block;

  animation: typingBounce 1.4s infinite ease-in-out;
}

/* animación en secuencia */
.chat-typing span:nth-child(1) {
  animation-delay: 0s;
}

.chat-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

/* animación */
@keyframes typingBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/**************************************
RESPONSIVE CHATBOT BUTTON
**************************************/
@media (max-width: 1100px) {
  .chatbot-button {
    right: 13px;
    bottom: 1.4rem;
    width: 65px;
    height: 65px;
  }
}

@media (max-width: 1000px) {
  .chatbot-button {
    right: 12px;
    bottom: 1.3rem;
    width: 62px;
    height: 62px;
  }
}

@media (max-width: 900px) {
  .chatbot-button {
    right: 12px;
    bottom: 1.2rem;
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 800px) {
  .chatbot-button {
    right: 11px;
    bottom: 1.1rem;
    width: 58px;
    height: 58px;
  }
}

@media (max-width: 700px) {
  .chatbot-button {
    right: 10px;
    bottom: 1rem;
    width: 55px;
    height: 55px;
  }
}

@media (max-width: 600px) {
  .chatbot-button {
    right: 10px;
    bottom: 0.9rem;
    width: 52px;
    height: 52px;
  }

  .chatbot-container {
    top: var(--chatbot-header-offset);
    right: 0;
    left: 0;

    width: 100vw;
    height: calc(100vh - var(--chatbot-header-offset));

    border-radius: 0;
  }

  .chatbot-container.expanded {
    width: 100vw;
    height: calc(100vh - var(--chatbot-header-offset));
  }
  #chatbot-minimize,
  #chatbot-expand {
    display: none;
  }
}

@media (max-width: 500px) {
  .chatbot-button {
    right: 9px;
    bottom: 0.8rem;
    width: 48px;
    height: 48px;
  }
}

@media only screen and (max-height: 500px) and (orientation: landscape) {
  .chatbot-container {
    top: 0;
    right: 0;
    left: 0;

    width: 100vw;

    height: 100vh;
    height: 100dvh;

    z-index: 9999991;
    border-radius: 0;
  }

  .chatbot-container.expanded {
    width: 100vw;

    height: 100vh;
    height: 100dvh;
  }
  #chatbot-minimize,
  #chatbot-expand {
    display: none;
  }
}