:root {
  --color-primary: #2E6DA4;
  --color-accent-blue: #2563EB;
  --color-sky: #C9DFF2;
  --color-text: #222;
  --color-text-dark: #24303D;
  --color-text-muted: #5B6B78;
  --color-white: #fff;
  --color-border: #E2E5E9;

  /* Paleta centro de ayuda: teal + lavanda, amigable */
  --color-ha-teal: #1EA6A6;
  --color-ha-teal-dark: #147A7A;
  --color-ha-lavender: #1B2A4A;
  --color-ha-pale: #EEFBFB;
  --color-ha-pale-lav: #EAEEF5;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #FDFEFE;
  color: var(--color-text);
}

a { color: var(--color-ha-teal-dark); text-decoration: none; }

/* ---------- Header ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 6%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text-dark);
}

.logo-img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }

.logo-fallback {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent-blue));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-teal {
  background: linear-gradient(135deg, var(--color-ha-teal), var(--color-ha-teal-dark));
  color: #fff;
  box-shadow: 0 8px 20px rgba(30, 166, 166, 0.3);
}
.btn-teal:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(30, 166, 166, 0.38); }

.btn-secondary {
  background: #fff;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}
.btn-secondary:hover { background: var(--color-sky); transform: translateY(-2px); }

/* ---------- Hero ---------- */
.ha-hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 80px 6% 130px;
  text-align: center;
  background: radial-gradient(120% 100% at 50% 0%, var(--color-ha-pale) 0%, transparent 70%);
}

.ha-eyebrow {
  display: inline-block;
  background: var(--color-ha-pale-lav);
  color: var(--color-ha-lavender);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 7px 18px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.ha-hero h1 {
  font-size: clamp(2rem, 4.6vw, 2.8rem);
  font-weight: 800;
  color: var(--color-text-dark);
  line-height: 1.25;
  margin-bottom: 14px;
}

.ha-hero p {
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 34px;
}

.ha-hero-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.ha-hero-nav-link {
  display: inline-flex;
  align-items: center;
  background: #fff;
  color: var(--color-ha-teal-dark);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 11px 24px;
  border-radius: 999px;
  border: 1.5px solid var(--color-border);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.ha-hero-nav-link:hover {
  background: var(--color-ha-teal);
  color: #fff;
  border-color: var(--color-ha-teal);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(30, 166, 166, 0.24);
}

.ha-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 8px 8px 20px;
  box-shadow: 0 10px 30px rgba(30, 166, 166, 0.12);
  max-width: 560px;
  margin: 0 auto;
}

.ha-search-icon { font-size: 1rem; flex-shrink: 0; }

.ha-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--color-text-dark);
  background: transparent;
}

.ha-search-btn { flex-shrink: 0; padding: 10px 22px; }

.ha-popular-tags {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.ha-tags-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-right: 4px;
}

.ha-tag {
  background: var(--color-ha-pale);
  color: var(--color-ha-teal-dark);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
}

.ha-tag:hover { background: var(--color-ha-teal); color: #fff; }

/* ---------- Sections ---------- */
.ha-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 6%;
}

.ha-section-alt {
  max-width: none;
  background: var(--color-ha-pale-lav);
  padding: 70px 6%;
}

.ha-section-alt > * { max-width: 900px; margin-left: auto; margin-right: auto; }

.section-head {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 40px;
}

.section-eyebrow {
  display: inline-block;
  color: var(--color-ha-lavender);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 800;
  color: var(--color-text-dark);
  line-height: 1.3;
}

/* ---------- Categories ---------- */
.ha-categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.ha-category-card {
  display: block;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 26px 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ha-category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(30, 166, 166, 0.12);
  border-color: var(--color-ha-teal);
  text-decoration: none;
}

.ha-cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--color-ha-pale);
  font-size: 1.4rem;
  margin-bottom: 14px;
}

.ha-category-card h4 {
  font-size: 1rem;
  color: var(--color-text-dark);
  font-weight: 700;
  margin-bottom: 6px;
}

.ha-category-card p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* ---------- FAQ tabs ---------- */
.ha-faq-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.ha-faq-tab {
  border: none;
  background: #fff;
  color: var(--color-text-muted);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 9px 20px;
  border-radius: 999px;
  cursor: pointer;
  border: 1.5px solid var(--color-border);
}

.ha-faq-tab-active {
  background: var(--color-ha-lavender);
  color: #fff;
  border-color: var(--color-ha-lavender);
}

.ha-faq-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ha-faq-group[hidden] {
  display: none;
}

.ha-faq-item {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 18px 22px;
}

.ha-faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--color-text-dark);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ha-faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--color-ha-teal-dark);
  flex-shrink: 0;
  margin-left: 12px;
}

.ha-faq-item[open] summary::after { content: "–"; }

.ha-faq-item summary::-webkit-details-marker { display: none; }

.ha-faq-item p {
  margin-top: 12px;
  font-size: 0.87rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

.ha-faq-item p a { font-weight: 600; }

/* ---------- Contact ---------- */
.ha-contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.ha-contact-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ha-contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(124, 111, 224, 0.14);
}

.ha-contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--color-ha-pale-lav);
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.ha-contact-card h4 {
  font-size: 1rem;
  color: var(--color-text-dark);
  font-weight: 700;
  margin-bottom: 6px;
}

.ha-contact-card p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin-bottom: 14px;
}

.ha-contact-link {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--color-ha-teal-dark);
}

/* ---------- Footer ---------- */
.ha-footer {
  text-align: center;
  padding: 30px 6%;
  background: #16232E;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.82rem;
}

.ha-footer-links {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ha-footer-links a { color: rgba(255, 255, 255, 0.75); }
.ha-footer-links a:hover { color: #fff; text-decoration: underline; }
.ha-footer-links span { color: rgba(255, 255, 255, 0.3); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .ha-categories-grid { grid-template-columns: repeat(2, 1fr); }
  .ha-contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .navbar { padding: 12px 5%; }
  .ha-hero { padding: 60px 6% 90px; }
  .ha-search-form { flex-wrap: wrap; border-radius: 20px; padding: 14px; }
  .ha-search-btn { width: 100%; justify-content: center; }
  .ha-categories-grid { grid-template-columns: 1fr; }
  .ha-faq-tabs { justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; }
}
/* =========================================================
   WIDGET DE CHAT DE SOPORTE
   ========================================================= */

.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  font-family: 'Poppins', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Botón flotante (burbuja) */
.chat-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--color-ha-teal), var(--color-ha-teal-dark));
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(30, 166, 166, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.chat-toggle-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(30, 166, 166, 0.46);
}

.chat-toggle-icon-close { display: none; }

.chat-widget.chat-is-open .chat-toggle-icon-open { display: none; }
.chat-widget.chat-is-open .chat-toggle-icon-close { display: block; }

/* Ventana del chat */
.chat-window {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(20, 40, 60, 0.22);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatFadeIn 0.22s ease;
  transform-origin: bottom right;
}

.chat-window[hidden] {
  display: none !important;
}

.chat-window[data-minimized="true"] {
  height: 64px;
}

.chat-window[data-minimized="true"] .chat-body,
.chat-window[data-minimized="true"] .chat-quick-options,
.chat-window[data-minimized="true"] .chat-input-form {
  display: none;
}

@keyframes chatFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Encabezado */
.chat-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--color-ha-teal), var(--color-ha-teal-dark));
  color: #fff;
}

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

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.chat-header-text h4 {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.chat-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
  flex-shrink: 0;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.chat-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.chat-icon-btn:hover { background: rgba(255, 255, 255, 0.3); }

/* Cuerpo / mensajes */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-ha-pale);
}

.chat-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.86rem;
  line-height: 1.55;
  animation: chatMsgIn 0.18s ease;
}

@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg-bot {
  align-self: flex-start;
  background: #fff;
  color: var(--color-text-dark);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
}

.chat-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--color-ha-teal), var(--color-ha-teal-dark));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-bot a {
  color: var(--color-ha-teal-dark);
  font-weight: 600;
  text-decoration: underline;
}

.chat-msg-agent {
  align-self: flex-start;
  background: var(--color-ha-pale-lav);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
  max-width: 92%;
}

.chat-agent-btn {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-ha-lavender);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.chat-agent-btn:hover { transform: translateY(-1px); }
.chat-agent-btn:disabled { opacity: 0.55; cursor: default; transform: none; }

.chat-agent-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.chat-agent-form input {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}

.chat-agent-form input:focus {
  border-color: var(--color-ha-lavender);
}

.chat-agent-form .chat-agent-btn {
  align-self: flex-start;
}

.chat-agente-status {
  align-self: center;
  background: var(--color-ha-pale-lav);
  color: var(--color-ha-teal-dark);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  margin: 4px 0;
}

.chat-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-ha-teal);
  opacity: 0.5;
  animation: chatTypingBounce 1s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Opciones rápidas */
.chat-quick-options {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  background: #fff;
}

.chat-quick-btn {
  border: 1.5px solid var(--color-border);
  background: #fff;
  color: var(--color-ha-teal-dark);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chat-quick-btn:hover {
  background: var(--color-ha-teal);
  border-color: var(--color-ha-teal);
  color: #fff;
}

.chat-quick-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Campo de texto */
.chat-input-form {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--color-border);
  background: #fff;
}

.chat-input {
  flex: 1;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--color-text-dark);
  outline: none;
  transition: border-color 0.15s ease;
}

.chat-input:focus { border-color: var(--color-ha-teal); }

.chat-send-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--color-ha-teal), var(--color-ha-teal-dark));
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.chat-send-btn:hover { transform: translateY(-1px); }

/* Responsive */
@media (max-width: 480px) {
  .chat-widget { right: 14px; bottom: 14px; }
  .chat-window {
    width: calc(100vw - 24px);
    height: calc(100vh - 120px);
    bottom: 72px;
    right: -6px;
  }
  .chat-toggle-btn { width: 54px; height: 54px; font-size: 1.35rem; }
}
/* =============================================================================
   Responsive — refuerzo para todos los dispositivos
   (móviles muy pequeños, tablets, laptops, monitores grandes y TV)
   ============================================================================= */

/* Red de seguridad global: nunca permitir scroll horizontal ni imágenes
   que se desborden del contenedor. */
html, body {
  width: 100%;
  overflow-x: hidden;
}

img, video, iframe, svg {
  max-width: 100%;
  height: auto;
}

/* --- Tablets (641px–860px): paso intermedio de 2 columnas en
   "Habla con nuestro equipo", que antes saltaba directo de 3 a 1 --- */
@media (min-width: 641px) and (max-width: 860px) {
  .ha-contact-grid { grid-template-columns: repeat(2, 1fr); }
  .ha-contact-card:last-child { grid-column: 1 / -1; max-width: 340px; margin: 0 auto; }
}

/* --- Móviles muy pequeños (320px–374px) --- */
@media (max-width: 374px) {
  .navbar { padding: 10px 4%; gap: 10px; }
  .nav-brand { font-size: 1rem; }
  .btn { padding: 9px 16px; font-size: 0.82rem; }
  .ha-hero { padding: 50px 5% 70px; }
  .ha-hero-nav-link { padding: 9px 16px; font-size: 0.84rem; }
  .ha-category-card, .ha-contact-card, .ha-faq-item { padding: 18px 16px; }
  .chat-toggle-btn { width: 50px; height: 50px; font-size: 1.25rem; }
}

/* --- Móviles en horizontal (poca altura): el hero se acorta y la
   ventana de chat ya se adapta sola por usar unidades de vh --- */
@media (max-height: 480px) and (orientation: landscape) {
  .ha-hero { padding: 32px 6% 40px; }
}

/* --- Monitores grandes y televisores (1600px en adelante) --- */
@media (min-width: 1600px) {
  html { font-size: 17px; }
  .navbar { padding: 18px 4%; }
  .ha-hero { max-width: 920px; }
  .ha-section { max-width: 1300px; }
  .ha-section-alt > * { max-width: 1080px; }
  .chat-window { width: 400px; height: 600px; }
}

/* --- Televisores 4K / pantallas ultra anchas (2200px en adelante) --- */
@media (min-width: 2200px) {
  html { font-size: 19px; }
  .ha-hero { max-width: 1040px; }
  .ha-section { max-width: 1480px; }
  .ha-section-alt > * { max-width: 1200px; }
}