/* ZoneTechOnline — Asistente de atención (sin IA, solo navegador) */
.zt-chat-root {
  --zt-chat-accent: #6366f1;
  --zt-chat-accent-dark: #4338ca;
  --zt-chat-price: #3730a3;
  --zt-chat-bg: #ffffff;
  --zt-chat-surface: #f8fafc;
  --zt-chat-border: rgba(15, 23, 42, 0.1);
  --zt-chat-text: #0f172a;
  --zt-chat-text-2: #475569;
  font-family: Inter, system-ui, sans-serif;
  box-sizing: border-box;
}
.zt-chat-root *,
.zt-chat-root *::before,
.zt-chat-root *::after {
  box-sizing: border-box;
}

.zt-chat-launcher {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(20px, calc(16px + env(safe-area-inset-bottom)));
  z-index: 9500;
  width: 56px;
  height: 56px;
  min-width: 44px;
  min-height: 44px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--zt-chat-accent-dark), var(--zt-chat-accent));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(67, 56, 202, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.zt-chat-launcher:hover {
  transform: scale(1.04);
}
.zt-chat-launcher:focus-visible {
  outline: 2px solid var(--zt-chat-accent);
  outline-offset: 3px;
}
.zt-chat-root.zt-chat-cookie-visible .zt-chat-launcher {
  bottom: max(96px, calc(80px + env(safe-area-inset-bottom)));
}
.zt-chat-root.zt-chat-open .zt-chat-launcher {
  transform: scale(0);
  pointer-events: none;
  opacity: 0;
}

.zt-chat-panel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(20px, calc(16px + env(safe-area-inset-bottom)));
  z-index: 9501;
  width: min(400px, calc(100vw - 24px));
  max-width: 100%;
  height: min(560px, calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  max-height: calc(100dvh - 24px);
  background: var(--zt-chat-bg);
  border: 1px solid var(--zt-chat-border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2,  1), opacity 0.28s ease;
}
.zt-chat-root.zt-chat-open .zt-chat-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.zt-chat-root.zt-chat-cookie-visible:not(.zt-chat-mobile-full) .zt-chat-panel {
  bottom: max(96px, calc(80px + env(safe-area-inset-bottom)));
  height: min(520px, calc(100dvh - 110px));
}

@media (max-width: 640px) {
  .zt-chat-root.zt-chat-open {
    --zt-chat-mobile-full: 1;
  }
  .zt-chat-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
  .zt-chat-root.zt-chat-cookie-visible .zt-chat-panel {
    bottom: 0;
    height: calc(100dvh - 88px);
    max-height: calc(100dvh - 88px);
    margin-bottom: 88px;
  }
  .zt-chat-root.zt-chat-cookie-visible .zt-chat-launcher {
    bottom: max(96px, calc(88px + env(safe-area-inset-bottom)));
  }
}

.zt-chat-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(124, 58, 237, 0.08));
  border-bottom: 1px solid var(--zt-chat-border);
}
.zt-chat-header-text h2 {
  margin: 0;
  font-family: 'Space Grotesk', Inter, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--zt-chat-text);
}
.zt-chat-header-text p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--zt-chat-text-2);
  line-height: 1.35;
}
.zt-chat-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--zt-chat-text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.zt-chat-close:hover {
  background: rgba(99, 102, 241, 0.15);
  color: var(--zt-chat-accent-dark);
}

.zt-chat-privacy {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
  background: #f1f5f9;
  border-bottom: 1px solid var(--zt-chat-border);
}

.zt-chat-messages {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

.zt-chat-msg {
  max-width: 92%;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.zt-chat-msg--bot {
  align-self: flex-start;
  background: var(--zt-chat-surface);
  color: var(--zt-chat-text);
  padding: 10px 12px;
  border-radius: 12px 12px 12px 4px;
  border: 1px solid var(--zt-chat-border);
}
.zt-chat-msg--user {
  align-self: flex-end;
  background: var(--zt-chat-accent);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px 12px 4px 12px;
}
.zt-chat-msg a {
  color: var(--zt-chat-accent-dark);
  text-decoration: underline;
  font-weight: 500;
}
.zt-chat-msg--user a {
  color: #e0e7ff;
}
.zt-chat-msg p {
  margin: 0 0 8px;
}
.zt-chat-msg p:last-child {
  margin-bottom: 0;
}
.zt-chat-msg ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.zt-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 14px 10px;
}
.zt-chat-chip {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--zt-chat-accent-dark);
  background: #fff;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.zt-chat-chip:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--zt-chat-accent);
}

.zt-chat-flow-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.zt-chat-flow-btn {
  min-height: 44px;
  padding: 10px 14px;
  text-align: left;
  font-size: 14px;
  font-family: inherit;
  color: var(--zt-chat-text);
  background: #fff;
  border: 1px solid var(--zt-chat-border);
  border-radius: 10px;
  cursor: pointer;
}
.zt-chat-flow-btn:hover {
  border-color: var(--zt-chat-accent);
  background: rgba(99, 102, 241, 0.06);
}

.zt-chat-products {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.zt-chat-product {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--zt-chat-border);
  border-radius: 12px;
}
.zt-chat-product img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 8px;
  background: #f8fafc;
}
.zt-chat-product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--zt-chat-text);
  margin: 0 0 4px;
  line-height: 1.3;
}
.zt-chat-product-name a {
  color: inherit;
  text-decoration: none;
}
.zt-chat-product-name a:hover {
  color: var(--zt-chat-accent-dark);
  text-decoration: underline;
}
.zt-chat-product-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--zt-chat-price);
  margin: 0 0 8px;
}
.zt-chat-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.zt-chat-product-actions a,
.zt-chat-product-actions button {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 12px;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.zt-chat-product-actions a {
  color: var(--zt-chat-accent-dark);
  border: 1px solid rgba(99, 102, 241, 0.4);
  background: #fff;
}
.zt-chat-product-actions button {
  color: #fff;
  border: none;
  background: var(--zt-chat-accent-dark);
  font-weight: 600;
}

.zt-chat-compose {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 10px 12px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--zt-chat-border);
  background: var(--zt-chat-bg);
}
.zt-chat-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--zt-chat-text);
  background: var(--zt-chat-surface);
  border: 1px solid var(--zt-chat-border);
  border-radius: 10px;
}
.zt-chat-input:focus {
  outline: 2px solid rgba(99, 102, 241, 0.45);
  border-color: var(--zt-chat-accent);
}
.zt-chat-send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--zt-chat-accent-dark);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.zt-chat-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 380px) {
  .zt-chat-chips {
    padding-left: 10px;
    padding-right: 10px;
  }
  .zt-chat-chip {
    font-size: 12px;
    padding: 8px 11px;
  }
}
