/* Cerca / guida IA — sito marketing */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  background: rgba(64, 91, 238, 0.12);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.nav-search-btn:hover,
.nav-search-btn:focus-visible {
  color: var(--text);
  background: rgba(64, 91, 238, 0.28);
  outline: none;
}
.nav-search-btn kbd {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.site-search-fab {
  position: fixed;
  right: 1.15rem;
  bottom: 1.15rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  border: 2px solid var(--accent-2);
  background: #0c1224;
  color: #fff;
  font-family: 'Urbanist', ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(8, 167, 169, 0.25);
}
.site-search-fab:hover,
.site-search-fab.is-open {
  background: var(--accent-2);
  color: #041018;
}

.site-search-panel {
  position: fixed;
  right: 1.15rem;
  bottom: 4.6rem;
  z-index: 41;
  width: min(420px, calc(100vw - 1.5rem));
  max-height: min(680px, calc(100vh - 6.5rem));
  display: flex;
  flex-direction: column;
  background: #0c1020;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.site-search-panel[hidden] { display: none !important; }

.site-search-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.site-search-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}
.site-search-panel__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.site-search-panel__actions {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}
.site-search-panel__page {
  font-size: 0.7rem;
  color: var(--accent-2);
  padding-top: 0.2rem;
  white-space: nowrap;
}
.site-search-panel__close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.site-search-panel__form {
  display: flex;
  gap: 0.4rem;
  padding: 0.75rem 0.85rem 0.35rem;
}
.site-search-panel__input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(18, 24, 42, 0.9);
  color: var(--text);
  font: inherit;
}
.site-search-panel__input:focus {
  outline: 2px solid rgba(8, 167, 169, 0.45);
  border-color: var(--accent-2);
}
.site-search-panel__go {
  border: 0;
  border-radius: 10px;
  padding: 0 0.9rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.site-search-panel__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem 0;
}
.site-search-chip {
  border: 1px solid var(--border);
  background: rgba(64, 91, 238, 0.12);
  color: var(--text);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}
.site-search-chip:hover { background: rgba(64, 91, 238, 0.28); }

.site-search-panel__hint {
  margin: 0;
  padding: 0.45rem 0.95rem 0.2rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.site-search-panel__hint kbd {
  font-size: 0.65rem;
  padding: 0.05rem 0.28rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.site-search-panel__hits {
  overflow-y: auto;
  padding: 0.4rem 0.65rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 4rem;
}
.site-search-hit {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}
.site-search-hit:hover { background: var(--bg-card-hover); color: var(--text); }
.site-search-hit__group {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  font-weight: 700;
}
.site-search-hit__snippet {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.site-search-empty {
  margin: 0.4rem 0.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-search-panel__ask {
  padding: 0 0.85rem 0.5rem;
}
.site-search-panel__ask-btn {
  width: 100%;
  border: 1px dashed var(--accent-2);
  background: rgba(8, 167, 169, 0.1);
  color: var(--accent-2);
  border-radius: 10px;
  padding: 0.55rem;
  font-weight: 700;
  cursor: pointer;
}

.site-search-panel__thread {
  overflow-y: auto;
  max-height: 220px;
  padding: 0.4rem 0.75rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.site-search-msg {
  max-width: 94%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.site-search-msg--user {
  align-self: flex-end;
  background: rgba(64, 91, 238, 0.22);
}
.site-search-msg--assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.site-search-msg--system {
  align-self: stretch;
  font-size: 0.72rem;
  color: #fdba74;
  background: rgba(251, 146, 60, 0.1);
  border: 1px solid rgba(251, 146, 60, 0.35);
}
.site-search-msg a { text-decoration: underline; }

.site-search-panel__legal {
  margin: 0;
  padding: 0.45rem 0.95rem 0.75rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.site-search-hero { padding-bottom: 2rem; }
.site-search-page { padding-bottom: 4rem; }
.site-search-page__form {
  display: flex;
  gap: 0.6rem;
  margin: -1rem 0 1.5rem;
}
.site-search-page__input { flex: 1; }
.site-search-page__list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}
.site-search-page__hit a {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--text);
}
.site-search-page__group {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  font-weight: 700;
}
.site-search-page__empty { color: var(--text-muted); margin-bottom: 1rem; }

@media (max-width: 820px) {
  .nav-search-btn span,
  .nav-search-btn kbd { display: none; }
  .site-search-fab span { display: none; }
  .site-search-fab { padding: 0.75rem; }
  .site-search-panel {
    right: 0.6rem;
    left: 0.6rem;
    width: auto;
    bottom: 4.2rem;
  }
  .site-search-page__form { flex-direction: column; }
}
