/* Chatbot Peonia de Sharon - coqueto, lado izquierdo */
.ps-chatbot-wrap {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 9998;
  width: 100%;
  max-width: 380px;
  pointer-events: none;
  display: flex;
  align-items: stretch;
}

.ps-chatbot-wrap.is-open {
  pointer-events: auto;
}

.ps-chatbot-panel {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #fff8fb 0%, #fff0f5 50%, #ffe8f0 100%);
  border-radius: 0 24px 24px 0;
  box-shadow: 8px 0 40px rgba(228, 93, 134, 0.2), 0 0 0 1px rgba(228, 93, 134, 0.08);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1), box-shadow 0.3s ease;
  overflow: hidden;
}

.ps-chatbot-wrap.is-open .ps-chatbot-panel {
  transform: translateX(0);
  box-shadow: 12px 0 50px rgba(228, 93, 134, 0.25), 0 0 0 1px rgba(228, 93, 134, 0.1);
}

.ps-chatbot-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #e45d86 0%, #d84a75 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.ps-chatbot-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.ps-chatbot-header-text h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ps-chatbot-header-text p {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  opacity: 0.9;
}

.ps-chatbot-close {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.ps-chatbot-close:hover {
  background: rgba(255,255,255,0.4);
}

.ps-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ps-chatbot-msg {
  max-width: 88%;
  padding: 0.65rem 1rem;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ps-chatbot-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: #2d2a32;
  border: 1px solid rgba(228, 93, 134, 0.2);
  box-shadow: 0 2px 10px rgba(228, 93, 134, 0.08);
  border-bottom-left-radius: 4px;
}

.ps-chatbot-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #e45d86 0%, #d84a75 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 12px rgba(228, 93, 134, 0.35);
}

.ps-chatbot-msg a {
  color: #e45d86;
  text-decoration: underline;
}

.ps-chatbot-msg.user a {
  color: rgba(255,255,255,0.95);
}

.ps-chatbot-form-wrap {
  padding: 0.75rem 1rem 1rem;
  background: rgba(255,255,255,0.6);
  border-top: 1px solid rgba(228, 93, 134, 0.12);
  flex-shrink: 0;
}

.ps-chatbot-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ps-chatbot-input {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 1.5px solid rgba(228, 93, 134, 0.3);
  border-radius: 24px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #2d2a32;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ps-chatbot-input::placeholder {
  color: #8e8a99;
}

.ps-chatbot-input:focus {
  outline: none;
  border-color: #e45d86;
  box-shadow: 0 0 0 3px rgba(228, 93, 134, 0.15);
}

.ps-chatbot-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #e45d86 0%, #d84a75 100%);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(228, 93, 134, 0.35);
}

.ps-chatbot-send:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(228, 93, 134, 0.45);
}

.ps-chatbot-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Botón flotante para abrir (lado izquierdo) */
.ps-chatbot-trigger {
  position: fixed;
  left: 20px;
  bottom: 24px;
  z-index: 9997;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #e45d86 0%, #d84a75 100%);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(228, 93, 134, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, bottom 0.3s ease;
}

.ps-chatbot-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(228, 93, 134, 0.5);
}

.ps-chatbot-wrap.is-open .ps-chatbot-trigger {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 480px) {
  .ps-chatbot-wrap {
    max-width: 100%;
  }
  .ps-chatbot-panel {
    border-radius: 0 20px 20px 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .ps-chatbot-trigger {
    left: max(14px, env(safe-area-inset-left));
    bottom: max(22px, calc(env(safe-area-inset-bottom) + 12px));
    width: 54px;
    height: 54px;
    font-size: 1.5rem;
    border-radius: 50%;
  }
  .ps-chatbot-header {
    padding: 0.9rem 1rem;
    padding-top: max(0.9rem, env(safe-area-inset-top));
  }
  .ps-chatbot-avatar {
    width: 42px;
    height: 42px;
    font-size: 1.3rem;
  }
  .ps-chatbot-messages {
    padding: 0.9rem;
  }
  .ps-chatbot-msg {
    font-size: 0.9rem;
    padding: 0.6rem 0.95rem;
    max-width: 92%;
  }
  .ps-chatbot-input {
    padding: 0.65rem 0.95rem;
    font-size: 16px; /* evita zoom automático en iOS */
  }
  .ps-chatbot-send {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
}

@media (max-width: 360px) {
  .ps-chatbot-trigger {
    left: max(10px, env(safe-area-inset-left));
    bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px));
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
  }
}

.ps-chatbot-trigger span {
  line-height: 1;
}

/* Modo oscuro */
.ps-theme-dark .ps-chatbot-panel {
  background: linear-gradient(180deg, #1a1525 0%, #241a35 50%, #2d2240 100%);
  box-shadow: 8px 0 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06);
}

.ps-theme-dark .ps-chatbot-msg.bot {
  background: rgba(40, 35, 60, 0.9);
  color: #f0e8f5;
  border-color: rgba(228, 93, 134, 0.25);
}

.ps-theme-dark .ps-chatbot-form-wrap {
  background: rgba(30, 26, 45, 0.95);
  border-top-color: rgba(255,255,255,0.08);
}

.ps-theme-dark .ps-chatbot-input {
  background: rgba(50, 44, 70, 0.9);
  border-color: rgba(228, 93, 134, 0.35);
  color: #f0e8f5;
}

.ps-theme-dark .ps-chatbot-input::placeholder {
  color: #8e8a99;
}
