/* ------------------- BARRA INFERIOR Y OFFCANVAS ------------------- */
.fixed-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #2f4050;
  text-align: center;
}

.offcanvas-start {
  width: 250px;
  background-color: #2f4050;
  color: #fff;
}

.offcanvas-header {
  background-color: #2f4050;
  color: #fff;
  border-bottom: 1px solid #4f5d75;
}

.offcanvas-body ul li a {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  padding: 10px;
  border-radius: 5px;
  -webkit-transition: background-color 0.3s ease-in-out;
  transition: background-color 0.3s ease-in-out;
  color: #fff;
  text-decoration: none;
}

.offcanvas-body ul li a:hover {
  background-color: #4f5d75;
}

.offcanvas-body ul li a i {
  margin-right: 10px;
}

/* ------------------- FUENTE MONTSERRAT ------------------- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

/* ------------------- ANIMACIONES ------------------- */
@-webkit-keyframes chat-pulse {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
    -webkit-box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  }
  50% {
    -webkit-transform: scale(1.1);
    transform: scale(1.1);
    -webkit-box-shadow: 0 8px 32px rgba(232, 70, 70, 0.45);
    box-shadow: 0 8px 32px rgba(232, 70, 70, 0.45);
    border-color: #fff;
  }
  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    -webkit-box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  }
}

@keyframes chat-pulse {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
    -webkit-box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  }
  50% {
    -webkit-transform: scale(1.1);
    transform: scale(1.1);
    -webkit-box-shadow: 0 8px 32px rgba(232, 70, 70, 0.45);
    box-shadow: 0 8px 32px rgba(232, 70, 70, 0.45);
    border-color: #fff;
  }
  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    -webkit-box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  }
}

@-webkit-keyframes fadeInUp {
  from {
    -webkit-transform: translateY(70px);
    transform: translateY(70px);
    opacity: 0;
  }
  to {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes fadeInUp {
  from {
    -webkit-transform: translateY(70px);
    transform: translateY(70px);
    opacity: 0;
  }
  to {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }
}

@-webkit-keyframes blinkDot {
  from { opacity: 0.62; }
  to { opacity: 1; }
}
@keyframes blinkDot {
  from { opacity: 0.62; }
  to { opacity: 1; }
}

@-webkit-keyframes typingBounce {
  0%, 100% { -webkit-transform: translateY(0); transform: translateY(0); opacity: 0.5; }
  20% { -webkit-transform: translateY(-4px); transform: translateY(-4px); opacity: 1; }
  40% { -webkit-transform: translateY(0); transform: translateY(0); opacity: 0.7; }
}
@keyframes typingBounce {
  0%, 100% { -webkit-transform: translateY(0); transform: translateY(0); opacity: 0.5; }
  20% { -webkit-transform: translateY(-4px); transform: translateY(-4px); opacity: 1; }
  40% { -webkit-transform: translateY(0); transform: translateY(0); opacity: 0.7; }
}

/* ------------------- CHATBOT WIDGET ------------------- */
#chat-bubble {
  position: fixed;
  bottom: 90px;
  right: 32px;
  width: 64px;
  height: 64px;
  background: #191a1c;
  border: 2.5px solid #e84646;
  border-radius: 50%;
  -webkit-box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
          box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  z-index: 1000;
  padding: 0;
  will-change: transform;
  animation: chat-pulse 1.2s infinite;
  -webkit-animation: chat-pulse 1.2s infinite;
}

#chat-bubble:hover {
  animation: none !important;
  -webkit-animation: none !important;
  -webkit-transform: scale(1.1);
          transform: scale(1.1);
  -webkit-box-shadow: 0 12px 32px rgba(232, 70, 70, 0.5);
          box-shadow: 0 12px 32px rgba(232, 70, 70, 0.5);
  border-color: #fff;
}

#chat-bubble svg {
  width: 38px;
  height: 38px;
  display: block;
}

#chat-widget {
  position: fixed;
  bottom: 160px;
  right: 36px;
  width: 370px;
  max-width: 98vw;
  max-height: 72vh;
  background: #191a1c;
  border-radius: 1.6rem;
  -webkit-box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(232, 70, 70, 0.08);
          box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(232, 70, 70, 0.08);
  overflow: hidden;
  display: none;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
  z-index: 1050;
  animation: fadeInUp 0.33s cubic-bezier(.22, 1, .36, 1);
  -webkit-animation: fadeInUp 0.33s cubic-bezier(.22, 1, .36, 1);
}

#chat-header {
  background: #191a1c;
  color: #fff;
  padding: 1rem 1.1rem 0.7rem 1.1rem;
  border-bottom: 1px solid #232325;
  font-size: 1.1rem;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 0.6rem;
}

#chat-header img {
  height: 23px;
  width: auto;
  margin-right: 0.6rem;
  background: none;
  border-radius: 4px;
  padding: 0;
  -webkit-box-shadow: none;
          box-shadow: none;
}

#chat-header .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #e84646;
  margin-right: 0.7rem;
  -webkit-box-shadow: 0 0 7px #e8464699;
          box-shadow: 0 0 7px #e8464699;
  animation: blinkDot 1.1s infinite alternate;
  -webkit-animation: blinkDot 1.1s infinite alternate;
}

#chat-body {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  padding: 1.1rem 1.1rem 0.35rem 1.1rem;
  background: #232325;
  overflow-y: auto;
  font-size: 1rem;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  gap: 0.3rem;
  scroll-behavior: smooth;
}

.bubble-user,
.bubble-bot {
  max-width: 80%;
  padding: 0.7em 1.1em;
  border-radius: 1.15em;
  margin-bottom: 2px;
  display: inline-block;
  line-height: 1.48;
  word-break: break-word;
  white-space: pre-line;
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
  font-size: 1.01rem;
}

.bubble-user {
  -ms-flex-item-align: end;
      align-self: flex-end;
  background: linear-gradient(120deg, #232325 90%, #3a3a3a 100%);
  color: #fff;
  border-bottom-right-radius: 0.32em;
  font-weight: 600;
  border: 1.3px solid #e84646;
}

.bubble-bot {
  -ms-flex-item-align: start;
      align-self: flex-start;
  background: #232325;
  color: #e0e0e0;
  border-bottom-left-radius: 0.32em;
  font-weight: 500;
  border: 1.3px solid #e84646;
}

#chat-footer {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  border-top: 1px solid #232325;
  background: #191a1c;
  padding: 0.9rem 0.85rem;
  gap: 0.5rem;
}

#chat-input {
  -webkit-box-flex: 1;
      -ms-flex-positive: 1;
          flex-grow: 1;
  border: none;
  padding: 0.65em 1em;
  background: #232325;
  border-radius: 1.1em;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  margin-right: 0.35rem;
  color: #fff;
  border: 1.3px solid #232325;
  -webkit-transition: background 0.16s, border-color 0.16s;
  transition: background 0.16s, border-color 0.16s;
}

#chat-input:focus {
  background: #27282d;
  border-color: #e84646;
}

#chat-send {
  background: #e84646;
  color: #fff;
  border: none;
  border-radius: 1.2em;
  padding: 0.56em 1.18em;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-box-shadow: 0 1.5px 6px rgba(232, 70, 70, 0.10);
          box-shadow: 0 1.5px 6px rgba(232, 70, 70, 0.10);
  -webkit-transition: background 0.15s;
  transition: background 0.15s;
}

#chat-send:active {
  background: #ab2727;
}

/* ANIMACIÓN TRES PUNTITOS */
.typing-dots {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  height: 18px;
  margin-left: 0.5em;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e84646;
  margin: 0 2px;
  opacity: 0.7;
  animation: typingBounce 1.1s infinite;
  -webkit-animation: typingBounce 1.1s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
  -webkit-animation-delay: 0.2s;
}
.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
  -webkit-animation-delay: 0.4s;
}

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 6px;
  background: #232325;
}
::-webkit-scrollbar-thumb {
  background: #35353a;
  border-radius: 7px;
}

/* ------------------- MOBILE RESPONSIVE ------------------- */
@media (max-width: 540px) {
  #chat-widget {
   position: fixed;
  bottom: 160px;      /* hace que la caja quede por arriba del botón */
  right: 30px;
  width: 350px;
  max-width: 95vw;
  min-height: 220px;
  max-height: 80vh;
  background: #1a1a1a;
  border-radius: 20px;
  -webkit-box-shadow: 0 8px 32px rgba(0,0,0,0.24);
          box-shadow: 0 8px 32px rgba(0,0,0,0.24);
  display: none;     /* mostrar solo cuando abrís el chat */
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  z-index: 1100;     /* menor que el botón, así nunca lo tapa */
  /* Resto de tu estilo actual */
}

  #chat-bubble {
    right: 2vw;
    bottom: 14px;
  }
}
@media (max-width: 600px) {
  #chat-widget {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    z-index: 9999 !important;
    display: none;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    /* Sombra leve para mantener el look */
    -webkit-box-shadow: 0 2px 18px rgba(0,0,0,0.18);
            box-shadow: 0 2px 18px rgba(0,0,0,0.18);
  }

  #chat-header {
    padding: 0.72rem 0.7rem 0.5rem 0.95rem !important;
    font-size: 1rem !important;
  }

  #chat-header img {
    height: 16px !important;
    margin-right: 0.3rem !important;
  }

  #chat-body {
    padding: 0.7rem 0.6rem 0.2rem 0.7rem !important;
    font-size: 0.97rem !important;
    max-height: calc(100vh - 120px) !important; /* Dejá lugar para header y footer */
  }

  #chat-footer {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: #191a1c !important;
    padding: 0.65rem 0.6rem !important;
    z-index: 10000 !important;
    border-radius: 0 !important;
    -webkit-box-shadow: 0 -3px 13px rgba(0,0,0,0.13);
            box-shadow: 0 -3px 13px rgba(0,0,0,0.13);
  }

  #chat-input {
    font-size: 1rem !important;
    padding: 0.55em 0.7em !important;
    margin-right: 0.27rem !important;
    border-radius: 0.93em !important;
  }

  #chat-send {
    font-size: 1rem !important;
    padding: 0.45em 0.9em !important;
    border-radius: 1.2em !important;
  }

  #chat-bubble {
    right: 4vw !important;
    bottom: 18px !important;
    width: 54px !important;
    height: 54px !important;
    z-index: 9999 !important;
  }
}

/* El body del chat debe dejar espacio para el input fijo en mobile */
@media (max-width: 600px) {
  #chat-body {
    /* Dejá espacio al final igual al alto del footer para que el último mensaje nunca quede tapado */
    padding-bottom: 68px !important;
    /* Asegura que se pueda scrollear completo hasta el fondo */
    overflow-y: auto !important;
  }
}

@media (max-width: 600px) {
  #chat-widget {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 55vh !important;      /* <-- 50% del alto visible */
    max-width: 100vw !important;
    max-height: 55vh !important;
    border-radius: 0 0 20px 20px !important; /* puntas inferiores redondeadas, si querés */
    z-index: 9999 !important;
    background: #191a1c !important;
    /* Dejá flex-direction: column en el css global, no hace falta repetirlo acá */
    right: auto !important;
    bottom: auto !important;
    /* No pongas display ni flex-direction acá */
    -webkit-box-shadow: 0 8px 32px rgba(0,0,0,0.24);
            box-shadow: 0 8px 32px rgba(0,0,0,0.24);
  }

  #chat-header {
    min-height: 52px;
    font-size: 1.05rem !important;
    padding: 0.7rem 0.7rem 0.6rem 1rem !important;
    border-bottom: 1.5px solid #232325;
    background: #191a1c !important;
    z-index: 10;
    position: relative !important;
  }
  #chat-header img {
    height: 28px !important;
    margin-right: 0.55rem !important;
  }
  #chat-body {
    -webkit-box-flex: 1 !important;
        -ms-flex: 1 1 auto !important;
            flex: 1 1 auto !important;
    overflow-y: auto !important;
    padding: 0.7rem 0.7rem 0.6rem 1rem !important;
    font-size: 0.98rem !important;
    background: #232325 !important;
    min-height: 0 !important;
    max-height: none !important;
    -webkit-box-sizing: border-box;
            box-sizing: border-box;
  }
  #chat-footer {
    min-height: 56px;
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-align: center !important;
        -ms-flex-align: center !important;
            align-items: center !important;
    border-top: 1.5px solid #232325;
    background: #191a1c !important;
    padding: 0.7rem 0.6rem 0.7rem 0.6rem !important;
    z-index: 10;
    position: relative !important;
  }
  #chat-input {
    font-size: 1rem !important;
    padding: 0.5em 0.7em !important;
    margin-right: 0.27rem !important;
    border-radius: 0.93em !important;
    -webkit-box-flex: 1 !important;
        -ms-flex: 1 1 auto !important;
            flex: 1 1 auto !important;
    min-width: 0 !important;
    border: 1.3px solid #232325 !important;
    background: #232325 !important;
    color: #fff !important;
  }
  #chat-send {
    font-size: 1rem !important;
    padding: 0.45em 0.9em !important;
    border-radius: 1.2em !important;
    -ms-flex-negative: 0;
        flex-shrink: 0;
    background: #e84646 !important;
    color: #fff !important;
    border: none !important;
    font-weight: 700 !important;
    cursor: pointer;
  }
  #chat-bubble {
    right: 4vw !important;
    bottom: 18px !important;
    width: 54px !important;
    height: 54px !important;
    z-index: 9999 !important;
  }
}

#chat-header {
  position: relative;
}

#chat-header #chat-close {
  background: transparent;
  border: none;
  color: #e84646;
  font-size: 2.1em;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  padding: 0 8px 0 16px;
  margin-left: auto;
  -webkit-transition: color 0.18s;
  transition: color 0.18s;
  outline: none;
  -webkit-box-shadow: none;
          box-shadow: none;
  position: absolute;
  right: 12px;
  top: 50%;
  -webkit-transform: translateY(-50%);
          transform: translateY(-50%);
  z-index: 10;
}

#chat-header #chat-close:hover,
#chat-header #chat-close:focus {
  color: #fff;
  background: none;
}