/* =====================================================
   ARCHIVO GENERAL SAN JUAN — buscador.css
   Estilos exclusivos de la pantalla de resultados (buscador.html).
   Requiere shared.css cargado antes.
   ===================================================== */

/* ─── Results page wrapper ───────────────────────────────────────────── */
.pg-results {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ─── Results bar (sticky) ───────────────────────────────────────────── */
.results-bar {
  background: var(--csurf);
  border-bottom: 1px solid var(--cbrd);
  position: sticky;
  top: var(--header-h, 55px);
  z-index: 100;
}

.results-bar-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 24px 0;
}

.results-bar-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

/* Compact pill override for results bar */
.search-pill.compact {
  flex: 1;
  max-width: 580px;
  transition: opacity 0.2s, background 0.2s;
}

.search-pill.compact.disabled {
  opacity: 0.5;
  pointer-events: none;
  background: var(--csurf);
}

.search-pill.compact input {
  font-size: 15px;
  padding: 10px 0;
}

/* ─── Tab strip ──────────────────────────────────────────────────────── */
.tab-strip {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-strip::-webkit-scrollbar { display: none; }

.tab-item {
  padding: 10px 16px;
  font-family: var(--fu);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ct2);
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  min-height: 44px;
}

.tab-item:hover { color: var(--ct); }

.tab-item.active {
  color: var(--cp-dk);
  border-bottom-color: var(--cp-dk);
  font-weight: 700;
}

/* Tab strip + filter button en la misma fila */
.tab-filter-row {
  display: flex;
  align-items: center;
}

.tab-filter-row .tab-strip {
  flex: 1;
  min-width: 0;
}

/* ─── Responsive label spans ─────────────────────────────────────────── */
.seg-label-short,
.tab-label-short { display: inline; }

.seg-label-full,
.tab-label-full  { display: none; }

@media (min-width: 540px) {
  .seg-label-short,
  .tab-label-short { display: none; }

  .seg-label-full,
  .tab-label-full  { display: inline; }
}

/* ─── Active filter chips (below tabs) ───────────────────────────────── */
.active-chips {
  display: none;
}

.active-chips:not(:empty) {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.active-chips::-webkit-scrollbar { display: none; }

.filter-badge {
  background: var(--cp);
  color: var(--cton);
  font-size: 9px;
  font-weight: 700;
  border-radius: 9999px;
  min-width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  flex-shrink: 0;
}

.chip-active {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px 5px 11px;
  background: oklch(from var(--cp) l c h / 0.09);
  border: 1.5px solid oklch(from var(--cp) l c h / 0.5);
  border-radius: 9999px;
  font-family: var(--fu);
  font-size: 12px;
  font-weight: 600;
  color: var(--cp-act);
  white-space: nowrap;
  flex-shrink: 0;
}

.chip-rm {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cp-act);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1px;
  border-radius: 50%;
  opacity: 0.7;
  transition: opacity 0.12s, background 0.12s;
  min-width: 32px;
  min-height: 32px;
  margin: -5px -2px;
}

.chip-rm:hover {
  opacity: 1;
  background: oklch(from var(--cp) l c h / 0.15);
}

.chip-rm svg {
  width: 11px;
  height: 11px;
}

/* ─── Context chips (results bar, segunda fila) ───────────────────────── */
.context-chip-label {
  font-family: var(--fu);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ct3);
}

.context-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px 10px 16px;
  border-radius: 9999px;
  border: 1.5px solid var(--cbrd2);
  background: var(--csurf);
  color: var(--cp-dk);
  font-family: var(--fu);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
  min-height: 44px;
}

.context-chip-btn:hover {
  border-color: var(--cp);
  background: oklch(from var(--cp) l c h / 0.04);
}

.context-chip-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.results-context-chips {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 4px 0 8px;
}

.results-context-chips.visible { display: flex; }

/* ─── Sidebar top offset (results bar más alta que solo header) ───────── */
.results-sidebar { top: calc(var(--header-h, 55px) + 75px); }

/* ─── Empty state ────────────────────────────────────────────────────── */
.empty-state {
  padding: 0 0 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.empty-icon {
  color: var(--cbrd2);
  margin-bottom: 20px;
}

.empty-icon svg {
  width: 52px;
  height: 52px;
}

.empty-title {
  font-family: var(--fu);
  font-size: 20px;
  font-weight: 600;
  color: var(--ct);
  margin-bottom: 8px;
}

.empty-title span {
  color: var(--ct3);
  font-weight: 400;
}

.empty-body {
  font-family: var(--fb);
  font-size: 16px;
  color: var(--ct2);
  line-height: 1.7;
  max-width: 54ch;
  margin-bottom: 24px;
}

.empty-tips {
  list-style: none;
  font-family: var(--fb);
  font-size: 16px;
  color: var(--ct2);
  line-height: 1.7;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.empty-tips li::before {
  content: '—';
  margin-right: 8px;
  color: var(--ct3);
}

.empty-divider {
  width: 100%;
  max-width: 420px;
  height: 1px;
  background: var(--cbrd);
  margin-bottom: 20px;
}

.empty-cta-label {
  font-family: var(--fu);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ct3);
  margin-bottom: 12px;
}

.empty-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--csurf);
  border: 1px solid var(--cbrd2);
  border-radius: 12px;
  text-decoration: none;
  max-width: 380px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.empty-cta:hover {
  border-color: var(--cp);
  box-shadow: 0 2px 8px oklch(from var(--cp) l c h / 0.12);
}

.empty-cta-icon {
  width: 38px;
  height: 38px;
  background: var(--cp);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cton);
  flex-shrink: 0;
}

.empty-cta-icon svg {
  width: 18px;
  height: 18px;
}

.empty-cta-text-title {
  font-family: var(--fu);
  font-size: 14px;
  font-weight: 700;
  color: var(--cp-act);
}

.empty-cta-text-sub {
  font-family: var(--fb);
  font-size: 12px;
  color: var(--ct3);
  margin-top: 2px;
}

/* ─── Mobile CTA (below results, only when sidebar is collapsed) ─────── */
.mobile-cta {
  display: none; /* visible only via media query below */
}

@media (max-width: 860px) {
  .mobile-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-top: 16px;
    background: oklch(from var(--cp) l c h / 0.07);
    border: 1px solid oklch(from var(--cp) l c h / 0.25);
    border-radius: 14px;
    text-decoration: none;
    color: var(--ct);
    transition: background 0.15s, border-color 0.15s;
  }
  .mobile-cta:hover {
    background: oklch(from var(--cp) l c h / 0.13);
    border-color: oklch(from var(--cp) l c h / 0.4);
  }
  .mobile-cta > svg:first-child {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--cp);
  }
  .mobile-cta-body { flex: 1; min-width: 0; }
  .mobile-cta-title {
    display: block;
    font-family: var(--fu);
    font-size: 14px;
    font-weight: 700;
    color: var(--cp);
    line-height: 1.3;
  }
  .mobile-cta-sub {
    display: block;
    font-family: var(--fu);
    font-size: 12px;
    color: var(--ct3);
    margin-top: 3px;
    line-height: 1.4;
  }
  .mobile-cta-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--cp);
    opacity: 0.6;
  }
}

/* ─── Sidebar CTA card ───────────────────────────────────────────────── */
.sb-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sb-cta-q {
  font-family: var(--fu);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ct3);
}

.sb-cta-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: oklch(from var(--cp) l c h / 0.07);
  border: 1px solid oklch(from var(--cp) l c h / 0.22);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ct);
  transition: background 0.15s, border-color 0.15s;
}

.sb-cta-link:hover {
  background: oklch(from var(--cp) l c h / 0.13);
  border-color: oklch(from var(--cp) l c h / 0.38);
}

.sb-cta-link svg { color: var(--cp); margin-top: 1px; }

.sb-cta-title {
  display: block;
  font-family: var(--fu);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cp);
  line-height: 1.3;
}

.sb-cta-sub {
  display: block;
  font-family: var(--fu);
  font-size: 11px;
  color: var(--ct3);
  margin-top: 2px;
  line-height: 1.4;
}

/* ─── Simulation toggle ──────────────────────────────────────────────── */
.sim-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--fu);
  font-size: 12px;
  color: var(--ct3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 12px;
  transition: color 0.15s;
  vertical-align: middle;
}

.sim-toggle:hover { color: var(--cp-dk); }

.sim-toggle svg {
  width: 12px;
  height: 12px;
}

/* ─── Pagination ─────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.pg-num {
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: none;
  font-family: var(--fu);
  font-size: 14px;
  color: var(--ct2);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  transition: background 0.15s, color 0.15s;
}

.pg-num:hover {
  background: var(--cmuted);
  color: var(--ct);
}

.pg-num.active {
  background: var(--cp);
  color: var(--cton);
  font-weight: 700;
}

.pg-num.dots {
  cursor: default;
  pointer-events: none;
  color: var(--ct3);
}

.pg-arrow {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--fu);
  font-size: 14px;
  font-weight: 600;
  color: var(--cp-dk);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.15s;
}

.pg-arrow:hover { background: var(--cmuted); }

.pg-arrow svg {
  width: 15px;
  height: 15px;
}

.pg-arrow[aria-disabled="true"] {
  opacity: 0.38;
  cursor: default;
  pointer-events: none;
}


/* ─── Todo tab (federated results) ───────────────────────────────────── */
.todo-section {
  padding: 20px 0 4px;
}

.todo-section + .todo-section { padding-top: 4px; }

.todo-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.todo-section-label {
  font-family: var(--fu);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ct3);
}

.todo-section-count {
  font-family: var(--fu);
  font-size: 11px;
  color: var(--ct3);
}

.todo-ver-mas {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 6px;
}

.todo-ver-mas::before,
.todo-ver-mas::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cbrd);
}

.todo-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--fu);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ct2);
  text-decoration: none;
  padding: 9px 22px;
  border-radius: 9999px;
  border: 1px solid var(--cbrd2);
  background: var(--csurf);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  cursor: pointer;
  white-space: nowrap;
}

.todo-cta-link:hover {
  border-color: var(--cp);
  color: var(--cp-dk);
  background: oklch(from var(--cp) l c h / 0.04);
}

.todo-cta-link svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.todo-summary {
  font-family: var(--fb);
  font-size: 13px;
  color: var(--ct3);
  margin-bottom: 20px;
}

.todo-summary strong {
  color: var(--ct2);
  font-weight: 400;
}

.todo-summary .todo-sum-count {
  font-weight: 700;
  color: var(--ct);
  font-family: var(--fu);
}

/* ─── Satisfaction survey card ───────────────────────────────────────── */
.survey-card {
  margin-top: 0;
  padding: 18px 0 6px;
  border-top: 1px solid var(--cbrd);
}

.survey-q-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.survey-dismiss {
  background: none; border: none;
  color: var(--ct3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 4px; border-radius: 6px;
  min-width: 44px; min-height: 44px;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.survey-dismiss:hover { background: var(--cmuted); color: var(--ct2); }
.survey-dismiss svg  { width: 14px; height: 14px; }

.survey-q {
  font-family: var(--fu);
  font-size: 14px;
  font-weight: 500;
  color: var(--ct3);
  margin: 0;
}

.survey-btns {
  display: flex;
  gap: 6px;
}

.survey-btn {
  font-family: var(--fu);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 9999px;
  border: 1.5px solid var(--cbrd2);
  background: transparent;
  color: var(--ct3);
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.survey-btn:hover {
  border-color: var(--cp);
  color: var(--cp-dk);
  background: oklch(from var(--cp) l c h / 0.04);
}
.survey-btn--yes {
  background: oklch(from var(--cok) l c h / 0.07);
  border-color: oklch(from var(--cok) l c h / 0.25);
  color: var(--cok-dk);
}
.survey-btn--yes:hover {
  background: oklch(from var(--cok) l c h / 0.13);
  border-color: var(--cok);
  color: var(--cok);
}

.survey-label {
  font-family: var(--fu);
  font-size: 13px;
  font-weight: 600;
  color: var(--ct2);
  display: block;
  margin-bottom: 8px;
}
.survey-opt { font-weight: 400; color: var(--ct3); }

.survey-textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  font-size: 16px;
  font-family: var(--fb);
  box-sizing: border-box;
}

.survey-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.survey-char {
  font-family: var(--fu);
  font-size: 12px;
  color: var(--ct3);
}
.survey-card .btn-apply { width: auto; padding: 10px 24px; }

.survey-thanks {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.survey-thanks-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: oklch(from var(--cok) l c h / 0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--cok);
}
.survey-thanks-icon svg { width: 18px; height: 18px; }
.survey-thanks-title {
  font-family: var(--fu);
  font-size: 16px; font-weight: 600;
  color: var(--ct); margin: 0 0 4px;
}
.survey-thanks-sub {
  font-family: var(--fb);
  font-size: 14px;
  color: var(--ct2); margin: 0;
}

.survey-expand { animation: surveyExpand 0.22s var(--ease) forwards; }
@keyframes surveyExpand {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .survey-expand { animation: none; }
}

/* ─── Responsive buscador ────────────────────────────────────────────── */
@media (min-width: 861px) {
  .btn-filter-open { display: none; }
  .active-chips    { display: none !important; }
}
