/* Widget de chat EFNE - estilos aislados con prefijo .efne-chat- para evitar colisiones con el theme de Shopify */

/* Dawn y algunas apps aplican reglas globales a botones, formularios y SVG. El
   contenedor y sus controles se fuerzan a un estado visible y predecible. */
#efne-chat-root,
#efne-chat-root * {
  box-sizing: border-box;
}

#efne-chat-root {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.efne-chat-fab {
  position: fixed;
  right: 20px;
  /* Elevado para NO solaparse con el botón de WhatsApp de la tienda (esquina
     inferior derecha). Ajusta este valor si el de WhatsApp cambia de tamaño. */
  bottom: 104px;
  z-index: 2147483646;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.efne-chat-fab-label {
  background: #1a1a1a;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.efne-chat-launcher {
  -webkit-appearance: none;
  appearance: none;
  width: 60px;
  min-width: 60px;
  height: 60px;
  min-height: 60px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  border: none;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.efne-chat-launcher:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.efne-chat-launcher svg {
  display: block;
  width: 26px;
  height: 26px;
  pointer-events: none;
}

.efne-chat-window {
  position: fixed;
  right: 20px;
  bottom: 180px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 200px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483646;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

.efne-chat-window.efne-chat-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.efne-chat-header {
  background: #1a1a1a;
  color: #fff;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.efne-chat-header-title {
  font-size: 16px;
  font-weight: 600;
}

.efne-chat-header-subtitle {
  font-size: 12px;
  opacity: 0.75;
}

.efne-chat-close {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  padding: 0;
  margin: 0;
  min-width: 24px;
  min-height: 24px;
}

.efne-chat-close:hover {
  opacity: 1;
}

.efne-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f7f8;
}

.efne-chat-msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.efne-chat-msg-bot {
  align-self: flex-start;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #e6e6e8;
  border-bottom-left-radius: 4px;
}

.efne-chat-msg-user {
  align-self: flex-end;
  background: #1a1a1a;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.efne-chat-msg-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.efne-chat-msg-bot .efne-chat-msg-link {
  color: #0b5fff;
}

.efne-chat-msg-link:hover {
  opacity: 0.85;
}

.efne-chat-typing {
  align-self: flex-start;
  font-size: 13px;
  color: #888;
  padding: 4px 13px;
}

.efne-chat-products {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.efne-chat-product-card {
  border: 1px solid #e6e6e8;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  text-decoration: none;
  color: #1a1a1a;
  display: block;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.efne-chat-product-card:hover {
  border-color: #1a1a1a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.efne-chat-product-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.efne-chat-product-meta {
  font-size: 12px;
  color: #666;
}

.efne-chat-document-card {
  background: #f7f7f8;
}

.efne-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #eee;
  background: #fff;
}

.efne-chat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
}

.efne-chat-input:focus {
  border-color: #1a1a1a;
}

.efne-chat-send {
  -webkit-appearance: none;
  appearance: none;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0 18px;
  cursor: pointer;
  font-size: 14px;
}

.efne-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.efne-chat-handoff-panel {
  padding: 14px 16px;
  border-top: 1px solid #eee;
  background: #f7f7f8;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.efne-chat-handoff-text {
  font-size: 12.5px;
  line-height: 1.4;
  color: #555;
  margin: 0;
}

.efne-chat-handoff-mail-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.efne-chat-handoff-mail-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  opacity: 0.95;
}

.efne-chat-handoff-mail-btn svg {
  flex-shrink: 0;
}

.efne-chat-handoff-whatsapp-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
}

.efne-chat-handoff-whatsapp-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
  opacity: 0.95;
}

.efne-chat-handoff-whatsapp-btn svg {
  flex-shrink: 0;
}

.efne-chat-handoff-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.efne-chat-handoff-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 2px;
}

.efne-chat-handoff-close {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  color: #888;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin: 0;
  min-width: 20px;
  min-height: 20px;
  flex-shrink: 0;
}

.efne-chat-handoff-close:hover {
  color: #1a1a1a;
}

@media (max-width: 480px) {
  .efne-chat-window {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 92px;
  }
  .efne-chat-fab {
    right: 16px;
    /* Elevado sobre el botón de WhatsApp también en móvil. */
    bottom: 96px;
  }
}
