
/* CTEJA Sticky Search V1.1 */
body.cteja-search-sticky-active{--cteja-sticky-top:0px}
body.admin-bar.cteja-search-sticky-active{--cteja-sticky-top:32px}

/* At page top keep normal flow */
.cteja-search-shell{
  transition:transform .22s ease, box-shadow .22s ease, background .22s ease;
}

/* Once sticky mode begins */
body.cteja-search-sticky-active .cteja-search-shell{
  position:fixed!important;
  left:0;
  right:0;
  top:var(--cteja-sticky-top)!important;
  z-index:99980;
  max-width:none!important;
  width:100%;
  margin:0!important;
  padding:9px 18px!important;
  background:#fff;
  border-bottom:1px solid #e5eaee;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
}
body.cteja-search-sticky-active .cteja-search-form{
  max-width:1220px;
  margin:0 auto;
  box-shadow:none!important;
  border-top:0!important;
  padding:0!important;
  gap:8px!important;
}
body.cteja-search-sticky-active .cteja-search-field{
  padding:5px 9px!important;
}
body.cteja-search-sticky-active .cteja-search-field label{
  display:none!important;
}
body.cteja-search-sticky-active .cteja-search-field input,
body.cteja-search-sticky-active .cteja-search-field select{
  min-height:36px!important;
}
body.cteja-search-sticky-active .cteja-search-btn{
  min-height:48px!important;
}

/* Hide global header while scrolling down so search occupies the top */
body.cteja-search-sticky-active.cteja-scroll-down #cteja-global-header{
  transform:translateY(-110%)!important;
  transition:transform .24s ease!important;
}
#cteja-global-header{
  transition:transform .24s ease!important;
}

/* spacer prevents page jump */
#cteja-search-spacer{display:none}
body.cteja-search-sticky-active #cteja-search-spacer{display:block}

/* Mobile compact filter behaviour */
.cteja-mobile-filter-toggle{display:none}
@media(max-width:920px){
  body.cteja-search-sticky-active .cteja-search-shell{
    padding:8px 12px!important;
  }
  body.cteja-search-sticky-active .cteja-search-form{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto auto!important;
    align-items:center;
  }
  body.cteja-search-sticky-active .cteja-search-form .cteja-keyword{
    grid-column:auto!important;
    display:block!important;
  }
  body.cteja-search-sticky-active .cteja-search-form .cteja-search-field:not(.cteja-keyword){
    display:none!important;
  }
  body.cteja-search-sticky-active .cteja-search-form.cteja-filters-open{
    grid-template-columns:1fr 1fr!important;
    padding-top:6px!important;
  }
  body.cteja-search-sticky-active .cteja-search-form.cteja-filters-open .cteja-keyword{
    grid-column:1/-1!important;
  }
  body.cteja-search-sticky-active .cteja-search-form.cteja-filters-open .cteja-search-field:not(.cteja-keyword){
    display:block!important;
  }
  body.cteja-search-sticky-active .cteja-search-form.cteja-filters-open .cteja-mobile-filter-toggle,
  body.cteja-search-sticky-active .cteja-search-form.cteja-filters-open .cteja-search-btn{
    min-height:46px!important;
  }
  .cteja-mobile-filter-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:48px;
    padding:0 15px;
    border:1px solid #d8e0e5;
    border-radius:5px;
    background:#fff;
    color:#084f7a;
    font-weight:800;
    cursor:pointer;
  }
  body.cteja-search-sticky-active .cteja-search-btn{
    padding:0 18px!important;
  }
}
@media(max-width:782px){
  body.admin-bar.cteja-search-sticky-active{--cteja-sticky-top:46px}
}
@media(max-width:600px){
  body.cteja-search-sticky-active .cteja-search-shell{padding:7px 8px!important}
  body.cteja-search-sticky-active .cteja-search-form{
    grid-template-columns:minmax(0,1fr) 46px 74px!important;
  }
  body.cteja-search-sticky-active .cteja-search-form.cteja-filters-open{
    grid-template-columns:1fr!important;
  }
  body.cteja-search-sticky-active .cteja-search-form.cteja-filters-open .cteja-keyword{
    grid-column:auto!important;
  }
  .cteja-mobile-filter-toggle{padding:0;font-size:0}
  .cteja-mobile-filter-toggle:before{content:"☰";font-size:19px}
  body.cteja-search-sticky-active .cteja-search-btn{padding:0 11px!important;font-size:12px!important}
}
