
/* NILA v21.46 Direct Map, CTA and Marquee Recovery */
:root{
  --v46-ink:#071b31;
  --v46-green:#075f3c;
  --v46-teal:#007f78;
  --v46-blue:#176fc2;
  --v46-yellow:#ffc400;
  --v46-line:rgba(7,27,49,.12);
  --v46-muted:#52677f;
}

/* HOMEPAGE MOBILE: CTA directly under header text, image after CTA, no empty white box */
@media(max-width:780px){
  body.page-home .v42-hero,
  body[data-nila-page="index"] .v42-hero{
    padding:22px 0 26px!important;
  }
  body.page-home .v42-hero-inner,
  body[data-nila-page="index"] .v42-hero-inner{
    display:flex!important;
    flex-direction:column!important;
    gap:16px!important;
  }
  body.page-home .v42-hero-copy,
  body[data-nila-page="index"] .v42-hero-copy{
    order:1!important;
  }
  body.page-home .v42-hero-visual,
  body[data-nila-page="index"] .v42-hero-visual{
    order:2!important;
    width:100%!important;
    transform:none!important;
    padding:0!important;
    border:0!important;
    box-shadow:none!important;
    background:transparent!important;
  }
  body.page-home .v42-hero-visual img,
  body[data-nila-page="index"] .v42-hero-visual img{
    aspect-ratio:1.62/1!important;
    border-radius:22px!important;
    box-shadow:0 22px 60px rgba(7,27,49,.14)!important;
  }
  body.page-home .v42-search-shell,
  body[data-nila-page="index"] .v42-search-shell{
    display:block!important;
    margin-top:16px!important;
    padding:0!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
  }
  /* remove the empty white input spaces on mobile */
  body.page-home .v42-search-shell .hs-field,
  body[data-nila-page="index"] .v42-search-shell .hs-field{
    display:none!important;
  }
  body.page-home .v42-search-shell #heroSearch,
  body[data-nila-page="index"] .v42-search-shell #heroSearch{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
    padding:0!important;
  }
  body.page-home .v42-location-action,
  body.page-home .v42-search-shell .hs-submit,
  body[data-nila-page="index"] .v42-location-action,
  body[data-nila-page="index"] .v42-search-shell .hs-submit{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-height:62px!important;
    border-radius:18px!important;
    font-size:18px!important;
    font-weight:950!important;
  }
  body.page-home .v42-trust-row,
  body[data-nila-page="index"] .v42-trust-row{
    order:3!important;
    margin-top:16px!important;
    border-radius:18px!important;
    width:100%!important;
  }

  /* Homepage popular services is the only mobile auto-marquee */
  body.page-home .v42-mobile-marquee,
  body[data-nila-page="index"] .v42-mobile-marquee{
    overflow:hidden!important;
    width:100%!important;
  }
  body.page-home .v42-service-grid,
  body[data-nila-page="index"] .v42-service-grid{
    display:flex!important;
    gap:14px!important;
    width:max-content!important;
    min-width:max-content!important;
    animation:v46HomeServicesMarquee 34s linear infinite!important;
    will-change:transform!important;
    overflow:visible!important;
  }
  body.page-home .v42-service-card,
  body[data-nila-page="index"] .v42-service-card{
    flex:0 0 245px!important;
    width:245px!important;
  }
  @keyframes v46HomeServicesMarquee{
    from{transform:translateX(0);}
    to{transform:translateX(-50%);}
  }
}

/* DIRECTORY AND CATEGORY MAP RECOVERY */
body.page-directory #dirMapCard,
body[data-nila-page="directory"] #dirMapCard,
body.v46-directory-page #dirMapCard{
  display:flex!important;
  visibility:visible!important;
  opacity:1!important;
}
body.page-directory #dirMap,
body[data-nila-page="directory"] #dirMap,
body.v46-directory-page #dirMap{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  width:100%!important;
  min-height:320px!important;
  background:#eaf2fb!important;
}

/* Category page custom layout: summary + map + image, then providers */
body.v46-category-page #v46CategoryHero{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 340px!important;
  gap:18px!important;
  max-width:1280px!important;
  margin:20px auto 18px!important;
  padding:0 24px!important;
  align-items:stretch!important;
}
.v46-category-main{
  display:grid!important;
  grid-template-columns:minmax(280px,.9fr) minmax(380px,1.1fr)!important;
  gap:18px!important;
  background:#fff!important;
  border:1px solid var(--v46-line)!important;
  border-radius:28px!important;
  box-shadow:0 24px 70px rgba(7,27,49,.12)!important;
  padding:20px!important;
  min-height:300px!important;
}
.v46-category-copy{
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
}
.v46-category-copy .kicker{
  display:inline-flex!important;
  width:max-content!important;
  border-radius:999px!important;
  background:rgba(23,111,194,.10)!important;
  color:var(--v46-blue)!important;
  padding:8px 13px!important;
  font-weight:950!important;
  font-size:13px!important;
  margin-bottom:14px!important;
}
.v46-category-copy h1{
  font-family:Fraunces,Georgia,serif!important;
  font-size:clamp(34px,4vw,54px)!important;
  line-height:.95!important;
  letter-spacing:-.055em!important;
  margin:0 0 12px!important;
  color:var(--v46-ink)!important;
}
.v46-category-copy p{
  color:var(--v46-muted)!important;
  margin:0 0 18px!important;
  line-height:1.5!important;
}
.v46-category-actions{
  display:flex!important;
  gap:10px!important;
  flex-wrap:wrap!important;
}
.v46-category-actions a{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:44px!important;
  padding:0 16px!important;
  border-radius:999px!important;
  font-weight:950!important;
  text-decoration:none!important;
  border:1px solid var(--v46-line)!important;
}
.v46-category-actions a:first-child{
  background:var(--v46-green)!important;
  color:#fff!important;
}
.v46-category-actions a:last-child{
  background:#fff!important;
  color:var(--v46-ink)!important;
}
.v46-category-map{
  min-height:270px!important;
  border-radius:22px!important;
  overflow:hidden!important;
  background:#eaf2fb!important;
  border:1px solid rgba(7,27,49,.10)!important;
}
.v46-category-map #dirMap{
  min-height:270px!important;
  height:100%!important;
}
.v46-category-image{
  border-radius:28px!important;
  overflow:hidden!important;
  box-shadow:0 24px 70px rgba(7,27,49,.12)!important;
}
.v46-category-image img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  object-position:center!important;
  display:block!important;
}

/* Hide old injected category hero variants only after v46 exists */
body.v46-category-page #v36DirCategoryHero,
body.v46-category-page #v31DirCategoryHero,
body.v46-category-page #v30DirCategoryHero,
body.v46-category-page #v29DirCategoryHero{
  display:none!important;
}

/* Keep original map card visible on normal directory, but avoid duplicate empty shell on category only */
body.v46-category-page #dirMapCard{
  display:none!important;
}

/* Compact top search on web */
body.v46-directory-page .v19-dir-search{
  max-width:880px!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto auto!important;
  gap:8px!important;
  padding:8px!important;
  border-radius:18px!important;
}
body.v46-directory-page .v19-dir-search input,
body.v46-directory-page .v19-dir-search button{
  min-height:42px!important;
  border-radius:13px!important;
}
body.v46-directory-page #dirHeroUseLocation,
body.v46-directory-page #dirSearchBtn{
  min-width:116px!important;
  padding-left:14px!important;
  padding-right:14px!important;
}

/* WEB category rail marquee, clickable and pauses on hover/focus */
@media(min-width:781px){
  body.v46-category-page .v19-cat-rail,
  body.v46-category-page .v19-cat-rail .container{
    overflow:hidden!important;
  }
  body.v46-category-page .v19-cat-rail-inner{
    display:flex!important;
    flex-wrap:nowrap!important;
    gap:10px!important;
    width:max-content!important;
    min-width:max-content!important;
    overflow:visible!important;
    animation:v46CategoryRailMarquee 28s linear infinite!important;
    scrollbar-width:none!important;
  }
  body.v46-category-page .v19-cat-rail:hover .v19-cat-rail-inner,
  body.v46-category-page .v19-cat-rail:focus-within .v19-cat-rail-inner{
    animation-play-state:paused!important;
  }
  @keyframes v46CategoryRailMarquee{
    from{transform:translateX(0);}
    to{transform:translateX(-50%);}
  }
}

/* MOBILE category pages: no auto marquee, manual swipe only. Map visible under summary. */
@media(max-width:780px){
  body.v46-category-page .v19-cat-rail-inner{
    animation:none!important;
    transform:none!important;
    overflow-x:auto!important;
    width:auto!important;
    min-width:0!important;
    display:flex!important;
    -webkit-overflow-scrolling:touch!important;
  }
  body.v46-category-page #v46CategoryHero{
    display:block!important;
    padding:0 14px!important;
    margin:14px auto!important;
  }
  .v46-category-main{
    display:block!important;
    padding:16px!important;
    min-height:0!important;
  }
  .v46-category-map{
    margin-top:14px!important;
    min-height:230px!important;
  }
  .v46-category-map #dirMap{
    min-height:230px!important;
  }
  .v46-category-image{
    display:none!important;
  }
  body.v46-directory-page .v19-dir-search{
    grid-template-columns:1fr!important;
    max-width:none!important;
  }
  body.v46-directory-page #dirHeroUseLocation,
  body.v46-directory-page #dirSearchBtn{
    width:100%!important;
    min-width:0!important;
  }
}
