/* JL Ropa Americana — Chatbot Widget "JL Genero Mujer" */

.jl-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: var(--rosa);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  box-shadow: 0 6px 20px rgba(255, 79, 163, .45);
  z-index: 10000;
  cursor: pointer;
  border: none;
  transition: transform .2s;
}

.jl-chat-fab:hover { transform: scale(1.1); }
.jl-chat-fab.open { display: none; }

.jl-chat-fab::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--rosa);
  animation: jl-chat-pulse 2s infinite;
  z-index: -1;
}

@keyframes jl-chat-pulse {
  0% { transform: scale(1); opacity: .6; }
  50% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* Chat Window */
.jl-chat-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
  z-index: 10001;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Jost', sans-serif;
  animation: jl-chat-slide .25s ease-out;
}

.jl-chat-window.open { display: flex; }

@keyframes jl-chat-slide {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.jl-chat-header {
  background: var(--ink);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.jl-chat-header-avatar {
  width: 40px;
  height: 40px;
  background: var(--rosa);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.jl-chat-header-info { flex: 1; min-width: 0; }
.jl-chat-header-info h4 { margin: 0; font-size: 15px; font-weight: 600; font-family: 'Playfair Display', serif; }
.jl-chat-header-info p { margin: 0; font-size: 11.5px; color: #B9B2AF; }

.jl-chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: .8;
  transition: opacity .15s;
}
.jl-chat-close:hover { opacity: 1; }

/* Messages Area */
.jl-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8f6f4;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Bubble Base */
.jl-chat-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: jl-chat-fade .2s ease-out;
}

@keyframes jl-chat-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.jl-chat-bot {
  background: #fff;
  color: #303030;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

.jl-chat-user {
  background: var(--rosa);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.jl-chat-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
  width: fit-content;
}

.jl-chat-typing span {
  width: 8px;
  height: 8px;
  background: #999;
  border-radius: 50%;
  animation: jl-chat-dot 1.2s infinite;
}
.jl-chat-typing span:nth-child(2) { animation-delay: .2s; }
.jl-chat-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes jl-chat-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* WhatsApp Button */
.jl-chat-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
  transition: background .15s, transform .15s;
}
.jl-chat-wa-btn:hover { background: #1ebe5d; transform: scale(1.03); color: #fff; }

/* Quick Replies */
.jl-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.jl-chat-quick button {
  background: #fff;
  border: 1.5px solid var(--rosa);
  color: var(--ink);
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  font-family: 'Jost', sans-serif;
}
.jl-chat-quick button:hover { background: var(--rosa); color: #fff; }

/* Input Area */
.jl-chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f0f0f0;
  border-top: 1px solid #ddd;
  flex-shrink: 0;
}

.jl-chat-input input {
  flex: 1;
  border: none;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 13.5px;
  outline: none;
  background: #fff;
  font-family: 'Jost', sans-serif;
}

.jl-chat-input button {
  width: 40px;
  height: 40px;
  background: var(--rosa);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
.jl-chat-input button:hover { background: var(--rosa-deep); }
.jl-chat-input button:disabled { background: #ccc; cursor: not-allowed; }

/* Responsive */
@media (max-width: 480px) {
  .jl-chat-window { bottom: 0; right: 0; width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .jl-chat-fab { bottom: 16px; right: 16px; }
}
