/* Lumia Chat — Estilos aislados y adaptables para tienda tecnológica */
.lumia-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lumia-chat-floating {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99990;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.lumia-chat-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lumia-chat-fab:hover,
.lumia-chat-fab:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(29, 78, 216, 0.35);
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.lumia-chat-panel {
  position: absolute;
  right: 0;
  bottom: 62px;
  width: 370px;
  max-width: calc(100vw - 24px);
  height: 520px;
  max-height: calc(100vh - 100px);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lumia-chat-panel[hidden] {
  display: none;
}

.lumia-chat-inline {
  width: 100%;
  max-width: 680px;
  height: 520px;
  margin: 20px auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.lumia-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #ffffff;
}

.lumia-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lumia-chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #38bdf8;
  color: #0f172a;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.lumia-chat-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.lumia-chat-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.2;
}

.lumia-chat-close {
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.lumia-chat-close:hover,
.lumia-chat-close:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  outline: none;
}

.lumia-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lumia-msg {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.lumia-msg--user {
  align-self: flex-end;
  background: #1d4ed8;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.lumia-msg--bot {
  align-self: flex-start;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.lumia-msg--error {
  align-self: flex-start;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.lumia-msg--loading {
  align-self: flex-start;
  background: #e2e8f0;
  color: #334155;
  font-style: italic;
}

.lumia-products {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  max-width: 94%;
  align-self: flex-start;
}

.lumia-product-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lumia-product-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

.lumia-product-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.lumia-price {
  font-weight: 700;
  color: #0f172a;
}

.lumia-price--old {
  text-decoration: line-through;
  color: #64748b;
  font-weight: 400;
}

.lumia-price--sale {
  color: #dc2626;
  font-weight: 700;
}

.lumia-stock {
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}

.lumia-stock--in {
  background: #dcfce7;
  color: #166534;
}

.lumia-stock--out {
  background: #fee2e2;
  color: #991b1b;
}

.lumia-product-link {
  display: inline-block;
  align-self: flex-start;
  font-size: 12.5px;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
}

.lumia-product-link:hover,
.lumia-product-link:focus-visible {
  text-decoration: underline;
}

.lumia-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.lumia-chat-input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  color: #0f172a;
  background: #ffffff;
}

.lumia-chat-input:focus {
  outline: 2px solid #3b82f6;
  border-color: #3b82f6;
}

.lumia-chat-send {
  background: #1d4ed8;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.lumia-chat-send:hover:not(:disabled) {
  background: #1e40af;
}

.lumia-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .lumia-chat-floating {
    right: 12px;
    bottom: 12px;
  }

  .lumia-chat-panel {
    width: calc(100vw - 24px);
    height: 72vh;
    bottom: 56px;
  }
}
