/* MONLY — jedinstvena traka pretrage i tipografija tabova
   ---------------------------------------------------------------------------
   Jedan sistem za: početnu, agente/agencije, novogradnju, firme i profile.
   Bijela površina, iste linije, isti razmaci, ista plava ikona pretrage.
   Učitava se poslije straničnih stilova da drži isti ritam na svim stranicama.
   ------------------------------------------------------------------------- */

:root {
  --ds-line: #eef2f8;
  --ds-border: #e6ebf3;
  --ds-surface: #ffffff;
  --ds-ink: #0f172a;
  --ds-placeholder: #8b96a8;
  --ds-rail: #f4f7fc;
  --ds-radius: 14px;
  --ds-tab-font: 700 10.5px/1 var(--domis-ui);
  --ds-tab-track: .075em;
}

/* ============================== TRAKE PRETRAGE ============================ */

.agent-search,
.nv-topbar .nv-search,
.nv-topbar .nv-dev-filter {
  display: grid;
  align-items: center;
  gap: 0;
  height: 58px;
  padding: 6px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  background: var(--ds-surface);
  box-shadow: 0 12px 30px -22px rgba(2, 12, 32, .38), 0 1px 2px rgba(2, 12, 32, .04);
}

.agent-search {
  grid-template-columns: minmax(0, 1.7fr) minmax(0, .9fr) minmax(0, 1fr) 44px;
}

/* Novogradnja: traka stoji u zaglavlju, preko hero fotografije — iste mjere kao početna.
   Selektori nose body:not(.page-home) .topbar da pobijede zajedničku kožu zaglavlja
   iz site-nav.css, koja inače tjera bijelu sticky traku na svim stranicama osim početne. */
body:not(.page-home) .topbar.nv-topbar {
  display: block;
  height: auto;
}

body:not(.page-home) .topbar.nv-topbar .brand {
  flex: none;
  color: #fff;
}

body:not(.page-home) .topbar.nv-topbar .brand-symbol {
  background: #fff;
  color: #001f44;
}

.nv-topbar .nv-head-search {
  flex: 1 1 auto;
  min-width: 0;
}

/* Akcije u zaglavlju se ne skupljaju: traka se prilagođava širini, ne tekst. */
body:not(.page-home) .topbar.nv-topbar .nav-actions {
  flex: none;
}

.nv-topbar .nv-search {
  grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, .85fr)) 44px;
  height: 54px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 12px;
  background: var(--ds-surface);
  box-shadow: 0 18px 44px rgba(0, 10, 30, .26);
}

.nv-topbar .nv-dev-filter {
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  height: 54px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 12px;
  background: var(--ds-surface);
  box-shadow: 0 18px 44px rgba(0, 10, 30, .26);
}

/* hidden atribut mora pobijediti display: grid iz trake */
.nv-topbar .nv-search[hidden],
.nv-topbar .nv-dev-filter[hidden] {
  display: none;
}

body:not(.page-home) .topbar.nv-topbar .login-link {
  color: rgba(255, 255, 255, .92);
  font: 600 13px/1 var(--domis-ui);
}

body:not(.page-home) .topbar.nv-topbar .login-link:hover {
  color: #fff;
}

body:not(.page-home) .topbar.nv-topbar .post-button {
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font: 600 11.5px/1 var(--domis-ui);
  box-shadow: none;
}

body:not(.page-home) .topbar.nv-topbar .post-button:hover {
  background: #fff;
  color: #001f44;
}

@media (min-width: 980px) {
  body:not(.page-home) .topbar.nv-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    padding: 0;
    background: linear-gradient(180deg, rgba(4, 10, 20, .86) 0%, rgba(4, 10, 20, .52) 58%, rgba(4, 10, 20, 0) 100%);
    border-bottom: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  body:not(.page-home) .topbar.nv-topbar > .topbar-inner {
    width: calc(100% - 48px);
    max-width: 1180px;
    min-height: 0;
    margin: 0 auto;
    padding: 18px 0 10px;
    flex-wrap: nowrap;
    align-items: center;
    gap: 18px;
  }

  body:not(.page-home) .topbar.nv-topbar .nv-head-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 26px;
    width: calc(100% - 48px);
    max-width: 1180px;
    margin: 0 auto;
    padding: 2px 0 20px;
  }

  body:not(.page-home) .topbar.nv-topbar .nv-head-nav a {
    padding: 5px 0;
    color: rgba(255, 255, 255, .8);
    font: 600 12.5px/1 var(--domis-ui);
    letter-spacing: .015em;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    white-space: nowrap;
  }

  body:not(.page-home) .topbar.nv-topbar .nv-head-nav a:hover,
  body:not(.page-home) .topbar.nv-topbar .nv-head-nav a:focus-visible,
  body:not(.page-home) .topbar.nv-topbar .nv-head-nav a[aria-current="page"] {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, .7);
  }

  /* zaglavlje prelazi preko fotografije, pa heroju treba više zraka na vrhu */
  .nv-hero .nv-hero-inner {
    padding-top: 172px;
  }
}

/* Profil firme i projekat: ista traka i iste boje, ali zaglavlje ostaje u toku
   stranice (nema hero fotografije preko koje bi prelazilo). */
@media (min-width: 980px) {
  body:not(.page-home) .topbar.nv-topbar.is-flow {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    z-index: 50;
    background: #001528;
    border-bottom: 0;
    box-shadow: 0 8px 24px rgba(0, 10, 25, .28);
  }

  body:not(.page-home) .topbar.nv-topbar.is-flow > .topbar-inner {
    padding: 12px 0 8px;
  }

  body:not(.page-home) .topbar.nv-topbar.is-flow .nv-head-nav {
    padding: 0 0 10px;
  }
}

/* Telefon i tablet: zaglavlje je sticky u toku stranice, traka ide u drugi red. */
@media (max-width: 979px) {
  body:not(.page-home) .topbar.nv-topbar {
    min-height: 0;
    border-bottom: 0;
    background: #001528;
    box-shadow: 0 12px 30px rgba(0, 10, 25, .24);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  body:not(.page-home) .topbar.nv-topbar > .topbar-inner {
    width: calc(100% - 32px);
    height: auto;
    min-height: 0;
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 9px 0 0;
  }

  .nv-topbar .nv-head-search {
    order: 3;
    flex-basis: 100%;
    padding-bottom: 9px;
  }

  .nv-topbar .nv-search,
  .nv-topbar .nv-dev-filter {
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0, 10, 30, .22);
  }
}


.agent-search label,
.nv-topbar .nv-search label,
.nv-topbar .nv-dev-filter label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  min-width: 0;
  padding: 0 16px;
  border-right: 1px solid var(--ds-line);
}

.agent-search label:last-of-type,
.nv-topbar .nv-search label:nth-of-type(4),
.nv-topbar .nv-dev-filter label:last-child {
  border-right: 0;
}

/* Bez sitnih natpisa iznad polja — ista mirna traka kao na početnoj. */
.agent-search small,
.nv-topbar .nv-search small,
.nv-topbar .nv-dev-filter small {
  display: none;
}

.agent-search input,
.agent-search select,
.nv-topbar .nv-search input,
.nv-topbar .nv-search select,
.nv-topbar .nv-dev-filter input,
.nv-topbar .nv-dev-filter select {
  width: 100%;
  height: 24px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ds-ink);
  font: 500 13.5px/1.35 var(--domis-ui);
  letter-spacing: 0;
  outline: none;
}

.agent-search input::placeholder,
.nv-topbar .nv-search input::placeholder,
.nv-topbar .nv-dev-filter input::placeholder {
  color: var(--ds-placeholder);
  font-weight: 400;
}

.agent-search select,
.nv-topbar .nv-search select,
.nv-topbar .nv-dev-filter select {
  cursor: pointer;
}

/* Ista uvučena plava lupa na svim trakama. */
.agent-search button,
.nv-topbar .nv-search button[type="submit"] {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0 0 0 4px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #0058ff;
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(0, 88, 255, .9);
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}

.agent-search button:hover,
.nv-topbar .nv-search button[type="submit"]:hover {
  background: #0046cc;
  transform: translateY(-1px);
}

.agent-search button svg,
.nv-topbar .nv-search button[type="submit"] svg {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: none;
}

/* Tekst dugmeta ostaje za čitače ekrana, ali ne širi traku. */
.agent-search .search-submit-label,
.nv-topbar .nv-search button[type="submit"] span {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Početna: ista traka, samo u zaglavlju. */
.page-home .hero-search-bar {
  height: 54px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 12px;
  background: var(--ds-surface);
  box-shadow: 0 12px 30px rgba(0, 10, 30, .22);
}

.page-home .hero-search-bar .hs-q input {
  height: 52px;
  padding-left: 16px;
  font: 500 13.5px/1 var(--domis-ui);
}

.page-home .hero-search-bar .search-submit {
  width: 44px;
  height: 44px;
  margin: 4px;
  border-radius: 10px;
}

.page-home .hero-search-bar .search-submit svg {
  width: 18px;
  height: 18px;
}

.page-home .hero-search-bar .hs-type select,
.page-home .hero-search-bar .hs-price select {
  font: 500 13.5px/1 var(--domis-ui);
}

/* ================================ TABOVI ================================= */

/* Ista tipografija za sve prekidače i tabove na javnim stranicama. */
body.page-home .search-console .rb-tab,
.dir-switch button,
.nv-switch button,
.nv-tab,
.dev-tabs button,
.ap-tab {
  font: var(--ds-tab-font);
  letter-spacing: var(--ds-tab-track);
  text-transform: uppercase;
}

/* Glavni prekidači: ista svijetla šina i ista navy aktivna pilula. */
.dir-switch,
.nv-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: max-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid #e7ebf3;
  border-radius: 999px;
  background: var(--ds-rail);
}

.dir-switch button,
.nv-switch button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5b6880;
  box-shadow: none;
  transition: background .18s ease, color .18s ease;
}

.dir-switch button:hover,
.nv-switch button:hover {
  background: #fff;
  color: #001f44;
}

.dir-switch button.is-active,
.dir-switch button.active,
.nv-switch button.is-active {
  background: #001f44;
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(0, 31, 68, .9);
}

/* Brojači uz tabove: ista pilula i isti brojevi. */
.dir-switch button span,
.nv-switch button span,
body.page-home .search-console .rb-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #eef2f8;
  color: #5b6880;
  font: 700 9.5px/1 var(--domis-ui);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.dir-switch button.is-active span,
.dir-switch button.active span,
.nv-switch button.is-active span,
body.page-home .search-console .rb-tab.active .rb-count {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

/* Tabovi projekta: ista navy aktivna pilula kao u imenicima. */
.nv-tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  width: max-content;
  max-width: 100%;
  margin: 0 0 20px;
  padding: 3px;
  border: 1px solid #e7ebf3;
  border-radius: 999px;
  background: var(--ds-rail);
}

.nv-tab {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5b6880;
  padding: 10px 18px;
}

.nv-tab:hover {
  background: #fff;
  color: #001f44;
}

.nv-tab.is-active {
  background: #001f44;
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(0, 31, 68, .9);
}

.nv-tab[data-count]::after {
  margin-left: 7px;
  color: inherit;
  font: 700 9.5px/1 var(--domis-ui);
  letter-spacing: 0;
  opacity: .65;
}

/* Profil agenta: ista veličina slova, aktivna linija u navy boji. */
.ap-tab {
  color: #64748b;
  padding-bottom: 11px;
}

.ap-tab:hover,
.ap-tab.is-active {
  color: #001f44;
}

.ap-tab.is-active:after {
  background: #001f44;
}

/* Profil firme: ista visina i isti razmaci kao ostali tabovi. */
.dev-tabs {
  gap: 2px;
  width: max-content;
  max-width: 100%;
  padding: 3px;
  border-color: #e7ebf3;
  background: var(--ds-rail);
}

.dev-tabs button {
  color: #5b6880;
  padding: 9px 16px;
}

.dev-tabs button:hover {
  background: #fff;
  color: #001f44;
}

.dev-tabs button.is-active {
  background: #001f44;
  color: #fff;
}

/* ================================ MOBILNO ================================ */

@media (max-width: 980px) {
  .agent-search {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 44px;
    height: auto;
    padding: 6px;
  }

  .agent-search label:first-child {
    grid-column: 1 / -1;
    height: 52px;
    padding-right: 58px;
    border-right: 0;
    border-bottom: 1px solid var(--ds-line);
  }

  .agent-search label:nth-of-type(2),
  .agent-search label:nth-of-type(3) {
    height: 52px;
    border-bottom: 0;
  }
}

/* Tablet: ista kompaktna traka kao na telefonu, bez trećeg reda za lupu. */
@media (max-width: 860px) {
  .agent-search {
    position: relative;
    grid-template-columns: 1fr 1fr;
    height: auto;
    padding: 6px;
  }

  .agent-search label {
    height: 50px;
    padding: 0 14px;
    border-right: 0;
    border-bottom: 1px solid var(--ds-line);
  }

  .agent-search label:first-child {
    grid-column: 1 / -1;
    height: 56px;
    padding-right: 58px;
  }

  .agent-search label:nth-of-type(2) {
    border-right: 1px solid var(--ds-line);
    border-bottom: 0;
  }

  .agent-search label:last-of-type {
    grid-column: auto;
    border-right: 0;
    border-bottom: 0;
  }

  .agent-search button {
    position: absolute;
    top: 12px;
    right: 12px;
    grid-column: auto;
    width: 38px;
    height: 38px;
    min-height: 38px;
    margin: 0;
    border-radius: 9px;
  }

  .agent-search button svg {
    width: 17px;
    height: 17px;
  }

  /* Prvo polje punom širinom, ostala tri u jednom redu — traka ostaje kompaktna. */
  .nv-topbar .nv-search,
  .nv-topbar .nv-dev-filter {
    position: relative;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    height: auto;
    padding: 6px;
  }

  .nv-topbar .nv-search label,
  .nv-topbar .nv-dev-filter label {
    grid-column: span 2;
    height: 50px;
    padding: 0 14px;
    border-right: 1px solid var(--ds-line);
    border-bottom: 0;
  }

  .nv-topbar .nv-search label:first-child,
  .nv-topbar .nv-dev-filter label:first-child {
    grid-column: 1 / -1;
    height: 56px;
    padding-right: 58px;
    border-right: 0;
    border-bottom: 1px solid var(--ds-line);
  }

  .nv-topbar .nv-search label:nth-of-type(4),
  .nv-topbar .nv-dev-filter label:nth-of-type(4) {
    border-right: 0;
    border-bottom: 0;
  }

  .nv-topbar .nv-search button[type="submit"] {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    min-height: 38px;
    margin: 0;
    border-radius: 9px;
  }

  .nv-topbar .nv-search button[type="submit"] svg {
    width: 17px;
    height: 17px;
  }
}

@media (max-width: 760px) {
  .page-home .hero-search-bar {
    height: 50px;
  }

  /* Na telefonu je dovoljna lokacija; cijena je odmah ispod u filterima. */
  @media (max-width: 430px) {
    .page-home .hero-search-bar .hs-price {
      display: none;
    }
  }

  .page-home .hero-search-bar .hs-q input {
    height: 48px;
    padding-left: 13px;
    font-size: 12.5px;
  }

  .page-home .hero-search-bar .search-submit {
    width: 40px;
    height: 40px;
    margin: 4px;
    border-radius: 9px;
  }

  .page-home .hero-search-bar .search-submit svg {
    width: 17px;
    height: 17px;
  }

  .dir-switch {
    width: 100%;
  }

  .dir-switch button {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
  }

  .nv-switch {
    width: 100%;
  }

  .nv-switch button {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
  }

  .ap-tab {
    font-size: 9.5px;
    letter-spacing: .06em;
  }
}

/* Telefon: traka ostaje u dva reda — polje za unos, pa tri izbora u jednom redu.
   Manji font i uži razmaci drže tekst cijelim, bez „Svi gr…". */
@media (max-width: 560px) {
  .nv-topbar .nv-search,
  .nv-topbar .nv-dev-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nv-topbar .nv-search label,
  .nv-topbar .nv-dev-filter label {
    grid-column: span 1;
    height: 40px;
    padding: 0 9px;
    border-right: 1px solid #eef2f8;
    border-bottom: 0;
  }

  .nv-topbar .nv-search label:first-child,
  .nv-topbar .nv-dev-filter label:first-child {
    grid-column: 1 / -1;
    height: 44px;
    padding-right: 50px;
    border-right: 0;
    border-bottom: 1px solid #eef2f8;
  }

  .nv-topbar .nv-search label:nth-of-type(4),
  .nv-topbar .nv-dev-filter label:nth-of-type(4) {
    grid-column: span 1;
    border-right: 0;
    border-bottom: 0;
  }

  .nv-topbar .nv-search input,
  .nv-topbar .nv-search select,
  .nv-topbar .nv-dev-filter input,
  .nv-topbar .nv-dev-filter select {
    font-size: 12px;
  }
}
