/* Chat web GrünFlex — también cargar si style.css en servidor está desactualizado */
.gf-site-chat {
  position: fixed;
  z-index: 10100;
  right: 1rem;
  bottom: 1rem;
}

@media (max-width: 991.98px) {
  .gf-site-chat {
    bottom: 5.5rem;
    right: 0.75rem;
  }
}

.gf-site-chat__toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(163, 230, 53, 0.65);
  background: linear-gradient(145deg, #1a2a4a 0%, #0d1528 100%);
  color: #a3e635;
  font-size: 1.45rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gf-site-chat__toggle:hover {
  color: #d9f99d;
  border-color: #a3e635;
}

.gf-site-chat__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: #fff;
  background: #e11d48;
  border-radius: 999px;
}

.gf-site-chat__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.65rem);
  width: min(360px, calc(100vw - 1.5rem));
  height: 420px;
  max-height: calc(100vh - 8rem);
  background: #0f1419;
  border: 1px solid rgba(163, 230, 53, 0.4);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gf-site-chat.is-open .gf-site-chat__panel[hidden] {
  display: flex !important;
}

.gf-site-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(90deg, #152238 0%, #0f1a2e 100%);
  border-bottom: 1px solid rgba(163, 230, 53, 0.25);
  color: #e8eef8;
}

.gf-site-chat__head strong {
  display: block;
  font-size: 0.95rem;
}

.gf-site-chat__sub {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

.gf-site-chat__close {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.45rem;
}

.gf-site-chat__close:hover {
  color: #fff;
}

.gf-site-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #0a0e14;
}

.gf-site-chat__msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
}

.gf-site-chat__msg--visitor {
  align-self: flex-end;
  align-items: flex-end;
}

.gf-site-chat__msg--admin {
  align-self: flex-start;
  align-items: flex-start;
}

.gf-site-chat__msg--admin-large {
  max-width: 100%;
  width: 100%;
}

.gf-site-chat__msg--admin-large.is-new .gf-site-chat__bubble--admin {
  animation: gf-chat-admin-in 0.45s ease-out;
}

@keyframes gf-chat-admin-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gf-site-chat__sender {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a3e635;
  margin-bottom: 0.35rem;
}

.gf-site-chat__bubble--admin {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1rem;
  font-size: 1.02rem;
  line-height: 1.55;
  background: linear-gradient(145deg, #1a2f1a 0%, #152238 55%, #0f1a2e 100%);
  color: #f1f5f9;
  border: 1px solid rgba(163, 230, 53, 0.55);
  border-radius: 14px;
  border-bottom-left-radius: 6px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.gf-site-chat__msg--system {
  align-self: center;
  max-width: 100%;
  font-size: 0.78rem;
  color: #94a3b8;
  text-align: center;
  padding: 0.25rem 0;
}

.gf-site-chat__bubble {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
  word-break: break-word;
}

.gf-site-chat__msg--visitor .gf-site-chat__bubble {
  background: #3d6b00;
  color: #f7fee7;
  border-bottom-right-radius: 4px;
}

.gf-site-chat__msg--admin .gf-site-chat__bubble {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-bottom-left-radius: 4px;
}

.gf-site-chat__time {
  font-size: 0.65rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.gf-site-chat__form {
  display: flex;
  gap: 0.35rem;
  padding: 0.65rem;
  border-top: 1px solid rgba(163, 230, 53, 0.2);
  background: #0f1419;
}

.gf-site-chat__input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: #1a2332;
  color: #f1f5f9;
  padding: 0.55rem 0.65rem;
  font-size: 0.9rem;
}

.gf-site-chat__input:focus {
  outline: none;
  border-color: #a3e635;
}

.gf-site-chat__send {
  width: 42px;
  border: 0;
  border-radius: 8px;
  background: #a3e635;
  color: #0f1419;
  cursor: pointer;
  flex-shrink: 0;
}

.gf-site-chat__send:hover {
  background: #bef264;
}

/* Previsualización grande al recibir respuesta desde Telegram */
.gf-site-chat-preview {
  position: fixed;
  z-index: 10090;
  right: 1rem;
  bottom: 6.5rem;
  width: min(420px, calc(100vw - 2rem));
  max-height: min(52vh, 420px);
  padding: 1.1rem 1.15rem 1rem;
  border-radius: 16px;
  border: 2px solid rgba(163, 230, 53, 0.75);
  background: linear-gradient(160deg, #1a2f1a 0%, #152238 45%, #0d1528 100%);
  color: #f8fafc;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(163, 230, 53, 0.15);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: opacity 0.28s ease, transform 0.28s ease;
  overflow: hidden;
}

.gf-site-chat-preview.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gf-site-chat-preview__close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  background: rgba(15, 20, 25, 0.55);
  color: #cbd5e1;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.gf-site-chat-preview__close:hover {
  color: #fff;
  background: rgba(15, 20, 25, 0.85);
}

.gf-site-chat-preview__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a3e635;
  margin-bottom: 0.55rem;
  padding-right: 2rem;
}

.gf-site-chat-preview__text {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.55;
  font-weight: 500;
  word-break: break-word;
  max-height: min(36vh, 280px);
  overflow-y: auto;
}

.gf-site-chat-preview__action {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

.gf-site-chat.has-admin-preview .gf-site-chat__toggle {
  box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.45), 0 8px 24px rgba(0, 0, 0, 0.35);
}

@media (max-width: 991.98px) {
  .gf-site-chat-preview {
    bottom: 10.5rem;
    right: 0.75rem;
    width: calc(100vw - 1.5rem);
  }
}
