.izq-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #e83e8c, #ff99cc);
  box-shadow: 0 14px 40px rgba(33, 33, 33, 0.22);
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.izq-chat-launcher::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 22px;
  background: radial-gradient(circle, rgba(232, 62, 140, 0.24), transparent 60%);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.izq-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 52px rgba(33, 33, 33, 0.28);
}

.izq-chat-launcher:hover::after {
  opacity: 1;
  transform: scale(1);
}

.izq-chat-launcher:active {
  transform: translateY(0);
}

.izq-chat-launcher__icon i {
  font-size: 1.35rem;
}

.izq-chat-launcher__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #212121;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(33, 33, 33, 0.24);
}

.izq-chat {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 9999;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 140px));
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  box-shadow: 0 26px 80px rgba(33, 33, 33, 0.24);
  overflow: hidden;
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
}

.izq-chat__header {
  padding: 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(232, 62, 140, 0.12), rgba(211, 166, 118, 0.12));
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.izq-chat__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.izq-chat__avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #e83e8c, #ff99cc);
  box-shadow: 0 12px 26px rgba(232, 62, 140, 0.22);
  overflow: hidden;
}

.izq-chat__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.izq-chat__brandText {
  min-width: 0;
}

.izq-chat__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #212121;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.izq-chat__subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: rgba(33, 33, 33, 0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.izq-chat__subtitle::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  margin-right: 6px;
  transform: translateY(-1px);
}

.izq-chat__headerActions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.izq-chat__iconBtn {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.18s ease;
  color: rgba(33, 33, 33, 0.55);
}

.izq-chat__iconBtn:hover {
  background: rgba(232, 62, 140, 0.08);
  color: #e83e8c;
  border-radius: 8px;
}

.izq-chat__body {
  flex: 1;
  overflow: auto;
  padding: 14px 14px 10px;
}

.izq-chat__date {
  margin: 2px auto 12px;
  width: fit-content;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: rgba(33, 33, 33, 0.55);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px dashed rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.6);
}

.izq-chat__row {
  display: flex;
  margin: 10px 0;
}

.izq-chat__row--bot {
  justify-content: flex-start;
}

.izq-chat__row--user {
  justify-content: flex-end;
}

.izq-chat__msgWrap {
  max-width: 78%;
  display: flex;
  flex-direction: column;
}

.izq-chat__msgWrap--user {
  align-items: flex-end;
}

.izq-chat__msgWrap--bot {
  align-items: flex-start;
}

.izq-chat__bubble {
  padding: 10px 12px;
  border-radius: 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: normal;
}

.izq-chat__bubble--bot {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: #212121;
  border-top-left-radius: 10px;
}

.izq-chat__bubble--user {
  background: linear-gradient(135deg, #e83e8c, #ff99cc);
  color: #fff;
  border-top-right-radius: 10px;
}

/* Markdown rendered content inside bot bubbles */
.izq-chat__bubble--bot .izq-chat__md-list {
  margin: 4px 0;
  padding-left: 18px;
  list-style: none;
}

.izq-chat__bubble--bot ul.izq-chat__md-list>li::before {
  content: '•';
  color: #e83e8c;
  font-weight: 700;
  display: inline-block;
  width: 14px;
  margin-left: -14px;
}

.izq-chat__bubble--bot ol.izq-chat__md-list {
  list-style: decimal;
  padding-left: 22px;
}

.izq-chat__bubble--bot ol.izq-chat__md-list>li::marker {
  color: #e83e8c;
  font-weight: 700;
}

.izq-chat__bubble--bot .izq-chat__md-list li {
  padding: 1px 0;
  line-height: 1.45;
}

.izq-chat__md-gap {
  height: 6px;
}

.izq-chat__link {
  color: #e83e8c;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.izq-chat__link:hover {
  color: #c2185b;
}

.izq-chat__bubble--bot strong {
  font-weight: 700;
  color: #1a1a1a;
}

.izq-chat__embeds {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.izq-chat__embedCard {
  --izq-embed-thumb: 76px;
  --izq-embed-pad: 12px;
  display: grid;
  grid-template-columns: var(--izq-embed-thumb) minmax(0, 1fr);
  gap: 12px;
  padding: var(--izq-embed-pad);
  min-height: 180px; /* Reduced fixed height */
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 24px rgba(33, 33, 33, 0.08);
  isolation: isolate;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

.izq-chat__embedMedia {
  width: var(--izq-embed-thumb);
  height: var(--izq-embed-thumb);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  align-self: center;
}

.izq-chat__embedImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.izq-chat__embedContent {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.izq-chat__embedTop {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-height: 3.25rem;
}

.izq-chat__embedTitle {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #212121;
  line-height: 1.25;
  min-width: 0;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.25em * 2);
  letter-spacing: -0.01em;
}

.izq-chat__embedPrice {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: #e83e8c;
  white-space: nowrap;
  line-height: 1.2;
  min-height: 1.2em;
}

.izq-chat__embedDesc {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: rgba(33, 33, 33, 0.72);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.4em * 2);
  margin: 0;
}

.izq-chat__embedMeta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.izq-chat__embedBadge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
  color: rgba(33, 33, 33, 0.72);
}

.izq-chat__embedBadge--success {
  background: rgba(25, 135, 84, 0.12);
  border-color: rgba(25, 135, 84, 0.22);
  color: #198754;
}

.izq-chat__embedBadge--danger {
  background: rgba(220, 53, 69, 0.12);
  border-color: rgba(220, 53, 69, 0.22);
  color: #dc3545;
}

.izq-chat__embedActions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.izq-chat__embedBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 8px 12px;
  min-height: 36px;
  white-space: normal;
  text-align: center;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #ffffff;
  color: #212121;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.izq-chat__embedBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(33, 33, 33, 0.12);
  background: #ffffff;
}

.izq-chat__embedBtn--primary {
  border: 1px solid transparent;
  background: linear-gradient(135deg, #e83e8c 0%, #ff80b3 50%, #ff99cc 100%);
  color: #fff;
}

/* Higher specificity so generic .embedBtn:hover does not replace the gradient with semi-transparent white */
.izq-chat__embedBtn.izq-chat__embedBtn--primary:hover,
.izq-chat__embedBtn.izq-chat__embedBtn--primary:focus-visible {
  background: linear-gradient(135deg, #e83e8c 0%, #ff80b3 50%, #ff99cc 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(232, 62, 140, 0.24);
}

.izq-chat__embedBtn.izq-chat__embedBtn--primary:active {
  transform: translateY(0);
  background: linear-gradient(135deg, #c93576 0%, #b04a7a 45%, #b8895f 100%);
  box-shadow: 0 8px 20px rgba(232, 62, 140, 0.18);
}

.izq-chat__embedBtn--outline {
  border-color: rgba(232, 62, 140, 0.35);
  background: rgba(232, 62, 140, 0.08);
  color: #212121;
}

.izq-chat__embedBtn.izq-chat__embedBtn--outline:hover,
.izq-chat__embedBtn.izq-chat__embedBtn--outline:focus-visible {
  background: #ffffff;
  border-color: rgba(232, 62, 140, 0.55);
  color: #c2185b;
  box-shadow: 0 10px 22px rgba(232, 62, 140, 0.12);
}

.izq-chat__embedBtn.izq-chat__embedBtn--outline:active {
  transform: translateY(0);
  background: rgba(232, 62, 140, 0.12);
}

.izq-chat__meta {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(33, 33, 33, 0.5);
  font-family: 'Poppins', sans-serif;
}

.izq-chat__row--user .izq-chat__meta {
  text-align: right;
}

.izq-chat__quick {
  padding: 10px 14px;
  display: flex;
  gap: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.4);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.izq-chat__quick::-webkit-scrollbar {
  display: none;
}

.izq-chat__chip {
  flex-shrink: 0;
  text-align: left;
  border: 1px solid rgba(232, 62, 140, 0.12);
  background: #ffffff;
  color: #212121;
  font-family: 'Poppins', sans-serif;
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  white-space: nowrap;
  scroll-snap-align: start;
}

.izq-chat__chip:hover {
  background: #fff;
  border-color: #e83e8c;
  color: #e83e8c;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 65, 108, 0.08);
}

.izq-chat__composer {
  display: grid;
  grid-template-columns: 40px 1fr 44px;
  gap: 8px;
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.94);
  align-items: center;
}

.izq-chat__attach {
  width: 40px;
  height: 40px;
  border: 0;
  background: rgba(0, 0, 0, 0.04);
  color: rgba(33, 33, 33, 0.5);
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  transition: all 0.2s ease;
}

.izq-chat__attach:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #212121;
}

.izq-chat__inputWrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.izq-chat__input {
  width: 100%;
  border-radius: 22px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 10px 16px;
  outline: none;
  font-family: 'Poppins', sans-serif;
  font-size: 13.5px;
  background: #ffffff;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.izq-chat__input:focus {
  border-color: #e83e8c;
  box-shadow: 0 0 0 4px rgba(232, 62, 140, 0.1);
}

.izq-chat__send {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(135deg, #e83e8c, #ff99cc);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 65, 108, 0.25);
  display: grid;
  place-items: center;
  transition: all 0.23s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 1.1rem;
}

.izq-chat__send:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 12px 28px rgba(232, 62, 140, 0.28);
}

.izq-chat__send:active {
  transform: scale(0.95);
}

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

.izq-chat__typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.izq-chat__dots {
  display: inline-flex;
  gap: 4px;
}

.izq-chat__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(33, 33, 33, 0.35);
  animation: izqChatPulse 1.15s infinite ease-in-out;
}

.izq-chat__dot:nth-child(2) {
  animation-delay: 0.12s;
}

.izq-chat__dot:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes izqChatPulse {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }

  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

@media (max-width: 575.98px) {
  .izq-chat-launcher {
    right: 16px;
    bottom: 16px;
    width: 54px;
    height: 54px;
  }

  .izq-chat {
    right: 16px;
    bottom: 84px;
    width: calc(100vw - 32px);
    height: min(520px, calc(100vh - 140px));
  }

  .izq-chat__bubble {
    max-width: 92%;
  }
}

/* Chatbot Dark Mode Overrides */
[data-theme="dark"] .izq-chat {
  background: rgba(30, 30, 30, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .izq-chat__header {
  background: linear-gradient(135deg, rgba(232, 62, 140, 0.2), rgba(0, 0, 0, 0.3));
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .izq-chat__title {
  color: #f8f9fa;
}

[data-theme="dark"] .izq-chat__subtitle {
  color: rgba(248, 249, 250, 0.7);
}

[data-theme="dark"] .izq-chat__iconBtn {
  color: rgba(248, 249, 250, 0.6);
}

[data-theme="dark"] .izq-chat__iconBtn:hover {
  background: rgba(232, 62, 140, 0.2);
  color: #f38db3;
}

[data-theme="dark"] .izq-chat__bubble--bot {
  background: #2d2d2d;
  border-color: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}

[data-theme="dark"] .izq-chat__bubble--bot strong {
  color: #fff;
}

[data-theme="dark"] .izq-chat__date {
  background: rgba(45, 45, 45, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(248, 249, 250, 0.6);
}

[data-theme="dark"] .izq-chat__embedCard {
  background: #252525;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .izq-chat__embedTitle {
  color: #f8f9fa;
}

[data-theme="dark"] .izq-chat__embedDesc {
  color: rgba(248, 249, 250, 0.7);
}

[data-theme="dark"] .izq-chat__embedBadge {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(248, 249, 250, 0.7);
}

[data-theme="dark"] .izq-chat__embedBtn {
  background: #333;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8f9fa;
}

[data-theme="dark"] .izq-chat__embedBtn:hover {
  background: #444;
}

[data-theme="dark"] .izq-chat__embedBtn--outline {
  background: rgba(232, 62, 140, 0.15);
  border-color: rgba(232, 62, 140, 0.4);
  color: #f38db3;
}

[data-theme="dark"] .izq-chat__embedBtn--outline:hover {
  background: rgba(232, 62, 140, 0.25);
  color: #fff;
}

[data-theme="dark"] .izq-chat__quick {
  background: rgba(30, 30, 30, 0.8);
  border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .izq-chat__chip {
  background: #333;
  border-color: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}

[data-theme="dark"] .izq-chat__chip:hover {
  background: #444;
  border-color: #e83e8c;
  color: #f38db3;
}

[data-theme="dark"] .izq-chat__composer {
  background: rgba(35, 35, 35, 0.98);
  border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .izq-chat__input {
  background: #2d2d2d;
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

[data-theme="dark"] .izq-chat__attach {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(248, 249, 250, 0.6);
}

[data-theme="dark"] .izq-chat__attach:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

[data-theme="dark"] .izq-chat__dot {
  background: rgba(248, 249, 250, 0.5);
}

[data-theme="dark"] .izq-chat__meta {
  color: rgba(248, 249, 250, 0.4);
}

/* ── Image Preview Bar ─────────────────────────────────────────────── */
.izq-chat__imagePreviewBar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(232, 62, 140, 0.08), rgba(255, 153, 204, 0.08));
  border-top: 1px solid rgba(232, 62, 140, 0.18);
  border-bottom: 1px solid rgba(232, 62, 140, 0.18);
  animation: izqSlideUp 0.22s ease;
}

@keyframes izqSlideUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.izq-chat__imagePreviewThumb {
  position: relative;
  flex-shrink: 0;
}

.izq-chat__imagePreviewThumb img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid rgba(232, 62, 140, 0.35);
  display: block;
}

.izq-chat__imagePreviewCancel {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e83e8c;
  border: 2px solid #fff;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.65rem;
  line-height: 1;
  transition: background 0.15s ease, transform 0.15s ease;
}

.izq-chat__imagePreviewCancel:hover {
  background: #c0245e;
  transform: scale(1.15);
}

.izq-chat__imagePreviewHint {
  font-size: 0.76rem;
  color: #888;
  line-height: 1.35;
  flex: 1;
}

[data-theme="dark"] .izq-chat__imagePreviewBar {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(232, 62, 140, 0.25);
}

[data-theme="dark"] .izq-chat__imagePreviewHint {
  color: rgba(248, 249, 250, 0.45);
}

[data-theme="dark"] .izq-chat__imagePreviewCancel {
  border-color: #1e1e1e;
}