/* ============================================================
   portal-v2-searchbar.css — Barra de busca, multi-select
   Template 4 — Área pública WBC7
   ============================================================ */

/* --- Search bar -------------------------------------------- */
.wbc-v2 .search-bar {
  background: #fff;
  border: 0.5px solid var(--gray-mid);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.wbc-v2 .search-bar input,
.wbc-v2 .search-bar select {
  background: #f6f7fb;
  border: 0.5px solid var(--gray-mid);
  border-radius: 5px;
  padding: 5px 9px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  flex: 1;
  min-width: 100px;
}

.wbc-v2 .search-bar input:focus,
.wbc-v2 .search-bar select:focus { border-color: #a0b0e0; }

.wbc-v2 .search-bar input::placeholder { color: #b0b8d0; }

.wbc-v2 .btn-buscar {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 5px 13px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.wbc-v2 .btn-limpar {
  background: #f0f2f8;
  color: #6b7899;
  border: 0.5px solid var(--gray-mid);
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.wbc-v2 .btn-limpar:hover { background: #e0e5f5; color: var(--blue); }

/* --- Filter banner ----------------------------------------- */
.wbc-v2 .filter-banner {
  background: #eef1fb;
  border: 0.5px solid #c5cef0;
  border-radius: var(--radius);
  padding: 6px 12px;
  margin-bottom: 10px;
  font-size: 13.5px;
  color: var(--blue);
  display: none;
  align-items: center;
  gap: 8px;
}

.wbc-v2 .filter-banner.show { display: flex; }

.wbc-v2 .btn-clear {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 14px;
  cursor: pointer;
  margin-left: auto;
  font-family: inherit;
  padding: 0;
  font-weight: 600;
}

/* --- Hero search input ------------------------------------- */
.wbc-v2 .hero-input-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.wbc-v2 .new-hero-search {
  width: 100%;
}

.wbc-v2 .hero-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.wbc-v2 .hero-search-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

.wbc-v2 .hero-search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 36px 12px 40px;
  min-height: 44px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  background: #f7f9fc;
  box-sizing: border-box;
}

.wbc-v2 .hero-search-input:focus { border-color: var(--brand); }
.wbc-v2 .hero-search-input::placeholder { color: var(--faint); }

.wbc-v2 .hero-search-clear {
  display: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--faint);
  padding: 4px;
  line-height: 0;
  border-radius: 50%;
  z-index: 2;
}

.wbc-v2 .hero-search-clear:hover { color: var(--ink); background: #eef1f6; }

.wbc-v2 .hero-select {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 30px 12px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: #f7f9fc url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2365718a' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 10px center;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

/* --- Botão sólido geral ------------------------------------ */
.wbc-v2 .scr-btn-solid {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  min-height: 44px;
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}

.wbc-v2 .scr-btn-solid:hover { background: var(--brand-dk); }

.wbc-v2 .scr-btn-solid:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wbc-v2 .hero-search-btn {
  flex-shrink: 0;
  min-width: 108px;
}

.wbc-v2 .scr-btn-solid.scr-btn-compact {
  min-height: 32px;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
}

/* --- Botão outline (secundário) ----------------------------- */
.wbc-v2 .scr-btn-solid.scr-btn-outline {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
  transition: all .15s;
}

.wbc-v2 .scr-btn-solid.scr-btn-outline:hover {
  background: var(--brand-dk);
  color: #fff;
  border-color: var(--brand-dk);
}

.wbc-v2 .scr-btn-solid.scr-btn-outline:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Busca mural ------------------------------------------- */
.wbc-v2 .mural-search-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }

.wbc-v2 .mural-search-input {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #f7f9fc;
  outline: none;
}

.wbc-v2 .mural-search-input:focus { border-color: var(--brand); }
.wbc-v2 .mural-search-input::placeholder { color: var(--faint); }

/* --- Avisos date filter ------------------------------------ */
.wbc-v2 .avisos-date-filters { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wbc-v2 .avisos-date-label { font-size: 12px; font-weight: 800; color: rgba(255,255,255,0.65); letter-spacing: .08em; text-transform: uppercase; margin-right: 2px; }
.wbc-v2 .avisos-date-field { display: flex; align-items: stretch; background: none; border: none; padding: 0; }
.wbc-v2 .avisos-date-field > span { display: none; }
.wbc-v2 .avisos-date-clear { font-size: 13px; font-weight: 600; color: #fff; background: none; border: none; cursor: pointer; padding: 0 4px; text-decoration: underline; text-underline-offset: 2px; }

/* --- PbsDatePicker (Proposta A) ----------------------------- */
.wbc-v2 .pbs-date {
  position: relative;
  display: inline-flex;
  min-width: 176px;
  width: 176px;
}

.wbc-v2 .mural-filter-item .pbs-date {
  width: 176px;
  min-width: 176px;
}

.wbc-v2 .pbs-date__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  clip: rect(0, 0, 0, 0);
}

.wbc-v2 .pbs-date__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 6px 12px 6px 14px;
  background: #fff;
  border: 1px solid #d5deec;
  border-radius: 12px;
  box-sizing: border-box;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(17, 42, 84, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wbc-v2 .pbs-date.is-open .pbs-date__trigger,
.wbc-v2 .pbs-date.has-value .pbs-date__trigger {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.wbc-v2 .pbs-date__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.15;
}

.wbc-v2 .pbs-date__label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint, #8b97ab);
}

.wbc-v2 .pbs-date__value {
  font-size: 13.5px;
  font-weight: 700;
  color: #1c3b67;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wbc-v2 .pbs-date__value.is-placeholder {
  font-weight: 500;
  color: #9aa7bb;
}

.wbc-v2 .pbs-date__icon {
  flex: 0 0 auto;
  color: var(--brand);
}

.pbs-date-pop {
  width: 292px;
  padding: 16px 16px 12px;
  background: #fff;
  border: 1px solid #e7edf8;
  border-radius: 18px;
  box-shadow: 0 22px 48px rgba(17, 42, 84, 0.18);
  box-sizing: border-box;
  font-family: inherit;
  color: #1c3b67;
}

.pbs-date-pop[hidden] { display: none !important; }

.pbs-date-pop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.pbs-date-pop__title {
  font-size: 14px;
  font-weight: 800;
  text-transform: lowercase;
  color: #1c3b67;
}

.pbs-date-pop__nav { display: flex; align-items: center; gap: 2px; }

.pbs-date-pop__nav-btn {
  width: 26px;
  height: 26px;
  border: 0;
  background: none;
  color: #7b8798;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  padding: 0;
}

.pbs-date-pop__nav-btn:hover { color: var(--brand, #2d5f9c); }

.pbs-date-pop__week,
.pbs-date-pop__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.pbs-date-pop__week {
  margin-bottom: 6px;
}

.pbs-date-pop__week span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #b4becc;
}

.pbs-date-pop__day {
  width: 100%;
  height: 34px;
  border: 0;
  background: none;
  border-radius: 50%;
  color: #3d4d63;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

.pbs-date-pop__day.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.pbs-date-pop__day.is-weekend { color: #c3ccd8; }

.pbs-date-pop__day.is-today:not(.is-selected) {
  font-weight: 700;
  color: var(--brand, #2d5f9c);
}

.pbs-date-pop__day:hover:not(.is-selected) {
  background: #eef3fb;
}

.pbs-date-pop__day.is-selected {
  background: var(--brand, #2d5f9c);
  color: #fff;
  font-weight: 700;
}

.pbs-date-pop__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 8px 4px 2px;
}

.pbs-date-pop__action {
  border: 0;
  background: none;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: #8b97ab;
  cursor: pointer;
}

.pbs-date-pop__action.is-primary {
  color: var(--brand, #2d5f9c);
}

/* --- Multi-select dropdown --------------------------------- */
.wbc-v2 .ms-wrap { position: relative; display: inline-flex; flex-direction: column; min-width: 150px; }

.wbc-v2 .ms-trigger {
  background: #fff;
  border: 0.5px solid var(--gray-mid);
  border-radius: 5px;
  padding: 5px 28px 5px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 32px;
  position: relative;
}

.wbc-v2 .ms-trigger::after {
  content: "▾";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--gray-txt);
  pointer-events: none;
}

.wbc-v2 .ms-trigger.has-sel { border-color: var(--blue); color: var(--blue); font-weight: 600; }

.wbc-v2 .ms-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 0.5px solid var(--gray-mid);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 500;
  padding: 6px 0;
  max-height: 260px;
  overflow-y: auto;
}

.wbc-v2 .ms-wrap.open .ms-dropdown { display: block; }
.wbc-v2 .ms-item { padding: 8px 14px; cursor: pointer; font-size: 13px; color: var(--text); transition: background 0.1s; }
.wbc-v2 .ms-item:hover { background: #f0f4ff; }
.wbc-v2 .ms-item.selected { background: #e8eeff; color: var(--blue); font-weight: 600; }
.wbc-v2 .ms-sep { height: 0.5px; background: var(--gray-mid); margin: 4px 0; }
.wbc-v2 .ms-clear { font-size: 12px; color: #9aa2be; padding: 5px 14px 7px; cursor: pointer; display: block; }
.wbc-v2 .ms-clear:hover { color: var(--blue); }

/* --- Responsivo search ------------------------------------- */
@media (max-width: 760px) {
  .wbc-v2 .search-bar { flex-wrap: wrap; }
  .wbc-v2 .search-bar input,
  .wbc-v2 .search-bar select { min-width: 0; flex: 1 1 130px; }
  .wbc-v2 .normas-search { flex-direction: column; }
  .wbc-v2 .normas-field { min-width: 0; }
  /* — hero inputs: zerar min-width que transborda em viewports pequenos — */
  .wbc-v2 .hero-input-wrap { min-width: 0; }
  .wbc-v2 .mural-search-shell .hero-input-wrap { min-width: 0; }
  .wbc-v2 .mural-v2-filters .hero-input-wrap { min-width: 0; }
  /* — dropdown buttons dos filtros do mural: largura total — */
  .wbc-v2 .mural-filter-item .catalogo-dd-btn { min-width: 0; width: 100%; box-sizing: border-box; }
  /* — painel de ordenação: select flexível — */
  .wbc-v2 .mural-sort-panel .hero-select { min-width: 0; flex: 1; }
  /* — Noticias: label FILTRAR à esquerda; campos de data em largura total — */
  .wbc-v2 .avisos-date-filters { flex-direction: column; align-items: flex-start; gap: 8px; }
  .wbc-v2 .avisos-date-field,
  .wbc-v2 .pbs-date,
  .wbc-v2 .mural-filter-item .pbs-date { width: 100%; min-width: 0; box-sizing: border-box; }
}

@media (max-width: 640px) {
  .wbc-v2 .mural-search-row { flex-direction: column; }
  .wbc-v2 .mural-filter-label { display: none; }
  .wbc-v2 .mural-dd-btn { font-size: 14px; padding: 9px 12px; min-height: 40px; }
  .wbc-v2 .mural-dd-pop { min-width: 250px; max-width: min(92vw, 320px); }
  .wbc-v2 .mural-sticky-inner { padding: 8px 14px; flex-wrap: wrap; }
}

@media (max-width: 600px) {
  .wbc-v2 .search-bar { flex-direction: column; }
}
