/* =============================================================
   AskPerTask — Services Archive  (apt-services.css)
   SVC-PUBLIC-VISUAL-2A → SERVICES-ARCHIVE-REDESIGN-1A.

   SERVICES-ARCHIVE-REDESIGN-1A (Figma Make "Services Archive
   Redesign"): hero + search band, horizontal category rail,
   "Services near you" results header with Map / Filters / Sort,
   and a 3 / 2 / 1-column vertical service-card grid.

   Scope:
   • body.apt-services-archive  → /services/ (hp_page_listings) AND
                                   /service-category/* (one design family)
   • body.apt-services-category → /service-category/* only

   Loaded on the listings_view_page route (plus vendor profile and
   front page for the two self-contained rules near the end) via
   APT_Services_Archive::enqueue_assets(). Every archive selector is
   prefixed with the body class so nothing bleeds to other pages.

   DOM landmarks (HivePress + ExpertHive + APT injections):
     body.apt-services-archive
       .hp-page.site-main
         .apt-services-hero                   ← headline + copy
         .apt-services-search-sentinel        ← sticky-search observer
         .hp-page__header                     ← real HivePress search form (hero search panel)
         nav.apt-services-categories          ← horizontal category rail
         .apt-services-layout (.hp-row)
           .apt-services-results (.hp-page__content)
             .apt-services-results-bar (.hp-page__topbar)
               .apt-services-results-head     ← h2 + real result count
               .apt-view-on-map               ← real /map/ link
               details.apt-services-filter-toggle ← real filter form (dropdown panel)
               form.apt-services-sort         ← real sort form
             .hp-listings > .hp-row           ← card grid (container query)
               article.apt-service-card
                 header.apt-service-card__media   ← image, featured flag, Save
                 .apt-service-card__main
                   .apt-service-card__eyebrow     ← category pill + real price
                   h4.apt-service-card__title
                   .apt-service-card__badges      ← provider + real rating
                   .apt-service-card__excerpt
                   .apt-service-card__location    ← masked locality
                   .apt-service-card__tags        ← real tags only
                 footer.apt-service-card__side    ← actions
             .apt-services-cta-strip
         .apt-services-towns
   ============================================================= */

/* ---- Design tokens (self-contained) ---- */
body.apt-services-archive {
  --apt-sv-text:            #111827;
  --apt-sv-muted:           #6B7280;
  --apt-sv-muted-light:     #9CA3AF;
  --apt-sv-border:          #E5E7EB;
  --apt-sv-border-light:    #F3F4F6;
  --apt-sv-bg:              #F6F7F9;
  --apt-sv-white:           #FFFFFF;
  --apt-sv-blue:            #2D6CDF;
  --apt-sv-blue-hover:      #2459BE;
  --apt-sv-blue-light:      #EAF1FD;
  --apt-sv-navy:            #14306B;
  /* Horizontal so the hero, sentinel and search header — equal-width
     stacked boxes of different heights — join without a seam. */
  --apt-sv-band:            linear-gradient(90deg, #14306B 0%, #1F4FB0 55%, #2D6CDF 100%);
  --apt-sv-green:           #1F8A55;
  --apt-sv-green-light:     #E9F7EF;
  --apt-sv-amber:           #B47800;
  --apt-sv-amber-light:     #FDF3E2;
  --apt-sv-radius:          12px;
  --apt-sv-radius-sm:       8px;
  --apt-sv-radius-lg:       16px;
  --apt-sv-shadow:          0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --apt-sv-shadow-hover:    0 12px 28px rgba(16, 24, 40, 0.12);
  --apt-sv-max:             1200px;
  --apt-sv-gutter:          24px;
  /* Side padding that centres a --apt-sv-max column inside a full-width band. */
  --apt-sv-band-pad:        max(var(--apt-sv-gutter), calc((100% - var(--apt-sv-max)) / 2));
}

body.apt-services-archive {
  background-color: var(--apt-sv-bg);
}

/* ============================================================
   HERO + SEARCH BAND
   The hero block and the real HivePress search form header
   (.hp-page__header) are adjacent siblings; they share one navy
   band so the search reads as part of the hero.
   ============================================================ */

body.apt-services-archive .apt-services-hero {
  background: var(--apt-sv-band);
  padding: 56px var(--apt-sv-band-pad) 24px;
  margin: 0;
}

body.apt-services-archive .apt-services-hero__content {
  max-width: 720px;
}

body.apt-services-archive .apt-services-hero__eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

body.apt-services-archive .apt-services-hero__eyebrow::before {
  content: "\2190\00a0";
}

body.apt-services-archive .apt-services-hero__eyebrow:hover {
  color: var(--apt-sv-white);
  text-decoration: underline;
}

body.apt-services-archive .apt-services-hero__title {
  font-size: 2.625rem;
  font-weight: 800;
  color: var(--apt-sv-white);
  margin: 0 0 12px;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

body.apt-services-archive .apt-services-hero__text {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.86);
  margin: 0;
  line-height: 1.5;
}

/* ---- Search panel (real HivePress listing_search form) ---- */

body.apt-services-archive .hp-page__header {
  background: var(--apt-sv-band);
  padding: 8px var(--apt-sv-band-pad) 48px;
  margin: 0;
  border: none;
}

/* The 1px sticky sentinel sits between the hero and the search header;
   paint it with the band so no seam shows. */
body.apt-services-archive .apt-services-search-sentinel {
  background: var(--apt-sv-band);
}

body.apt-services-archive .hp-page__header .hp-form--listing-search {
  display: flex;
  align-items: stretch;
  gap: 8px;
  max-width: 880px;
  margin: 0;
  padding: 8px;
  background: var(--apt-sv-white);
  border: none;
  border-radius: var(--apt-sv-radius-lg);
  box-shadow: 0 16px 40px rgba(10, 25, 60, 0.28);
}

/* Suppress experthive's .hp-form--primary::before left-stripe. */
body.apt-services-archive .hp-page__header .hp-form--primary::before {
  content: none;
}

body.apt-services-archive .hp-page__header .hp-form__messages:empty {
  display: none;
}

body.apt-services-archive .hp-page__header .hp-form__fields {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  padding: 0;
  margin: 0;
}

body.apt-services-archive .hp-page__header .hp-form__field {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}

body.apt-services-archive .hp-page__header .hp-form__field:not(:last-child) {
  margin-right: 0;
}

body.apt-services-archive .hp-page__header .hp-form__footer {
  flex: 0 0 auto;
  display: flex;
  padding: 0;
  margin: 0;
}

body.apt-services-archive .hp-page__header input[type="text"],
body.apt-services-archive .hp-page__header input[type="search"] {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--apt-sv-radius);
  box-shadow: none;
  background: var(--apt-sv-bg);
  font-size: 1rem;
  color: var(--apt-sv-text);
}

body.apt-services-archive .hp-page__header input[type="text"]:focus,
body.apt-services-archive .hp-page__header input[type="search"]:focus {
  outline: none;
  background: var(--apt-sv-white);
  border-color: var(--apt-sv-blue);
  box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.14);
}

/* Location field: the Mapbox geocoder wrapper and the shared "Locate Me"
   button (.apt-locate-btn) hardcode a 40px height; pin both to the
   input height, scoped to this archive only. */
body.apt-services-archive .hp-page__header .hp-field--location .mapboxgl-ctrl-geocoder {
  height: 52px;
}

body.apt-services-archive .hp-page__header .hp-field--location .mapboxgl-ctrl-geocoder--icon-search {
  top: 16px;
  left: 14px;
}

body.apt-services-archive .hp-page__header .hp-field--location .mapboxgl-ctrl-geocoder--pin-right {
  top: 0;
  height: 52px;
  display: flex;
  align-items: center;
}

body.apt-services-archive .hp-page__header .apt-locate-btn {
  height: 52px;
}

body.apt-services-archive .hp-page__header .hp-form__button,
body.apt-services-archive .hp-page__header .hp-form__button.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  min-width: 132px;
  padding: 0 28px;
  margin: 0;
  background: var(--apt-sv-blue);
  color: var(--apt-sv-white);
  border: 1px solid var(--apt-sv-blue);
  border-radius: var(--apt-sv-radius);
  box-shadow: none;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

/* experthive appends a Font Awesome arrow via span::after; keep it inline. */
body.apt-services-archive .hp-page__header .hp-form__button span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

body.apt-services-archive .hp-page__header .hp-form__button span::after {
  font-size: 14px;
  margin: 0;
  line-height: 1;
}

body.apt-services-archive .hp-page__header .hp-form__button:hover,
body.apt-services-archive .hp-page__header .hp-form__button.button-primary:hover {
  background: var(--apt-sv-blue-hover);
  border-color: var(--apt-sv-blue-hover);
  color: var(--apt-sv-white);
}

/* HivePress's own mobile "Filter" popup trigger inside the header —
   hidden at every width: the results-bar Filters control (same real
   filter widget) is the single filter entry point on this page. */
body.apt-services-archive .hp-page__header .hp-button--listing-filter {
  display: none;
}

/* ============================================================
   STICKY SEARCH — SERVICE-DISCOVERY-UX-POLISH-1A
   The real search header becomes sticky once scrolled past; the
   0-height sentinel before it is observed by
   apt-services-sticky-search.js to toggle .is-stuck. No second form.
   ============================================================ */

body.apt-services-archive .apt-services-search-sticky {
  position: sticky;
  top: 0;
  z-index: 40;
  transition: padding 0.15s ease, box-shadow 0.15s ease;
}

/* WP admin bar is position:fixed at the viewport top. */
body.admin-bar.apt-services-archive .apt-services-search-sticky {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar.apt-services-archive .apt-services-search-sticky {
    top: 46px;
  }
}

body.apt-services-archive .apt-services-search-sentinel {
  height: 1px;
}

/* Compact "stuck" state: slim white bar instead of the navy band. */
body.apt-services-archive .apt-services-search-sticky.is-stuck {
  background: var(--apt-sv-white);
  padding-top: 8px;
  padding-bottom: 8px;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.10);
}

body.apt-services-archive .apt-services-search-sticky.is-stuck .hp-form--listing-search {
  box-shadow: none;
  border: 1px solid var(--apt-sv-border);
  padding: 4px;
}

body.apt-services-archive .apt-services-search-sticky.is-stuck input[type="text"],
body.apt-services-archive .apt-services-search-sticky.is-stuck input[type="search"],
body.apt-services-archive .apt-services-search-sticky.is-stuck .hp-field--location .mapboxgl-ctrl-geocoder,
body.apt-services-archive .apt-services-search-sticky.is-stuck .apt-locate-btn,
body.apt-services-archive .apt-services-search-sticky.is-stuck .hp-form__button,
body.apt-services-archive .apt-services-search-sticky.is-stuck .hp-form__button.button-primary {
  height: 42px;
}

/* Mobile stuck trigger ("Search services") — hidden by default at every
   width, only shown inside the ≤768px + .is-stuck rule below, so a
   resize can never leave it visible on desktop. */
.apt-services-search-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 880px;
  margin: 0;
  height: 42px;
  border: 1px solid var(--apt-sv-border);
  border-radius: var(--apt-sv-radius-sm);
  background: var(--apt-sv-white);
  color: var(--apt-sv-text);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 768px) {
  body.apt-services-archive .apt-services-search-sticky.is-stuck:not(.is-expanded) .hp-form--listing-search {
    display: none;
  }

  body.apt-services-archive .apt-services-search-sticky.is-stuck .apt-services-search-toggle {
    display: flex;
  }

  body.apt-services-archive .apt-services-search-sticky.is-stuck.is-expanded .apt-services-search-toggle {
    display: none;
  }
}

/* ============================================================
   CATEGORY RAIL — SERVICES-ARCHIVE-REDESIGN-1A
   Real top-level hp_listing_category terms, one horizontal row;
   scrolls sideways when it doesn't fit (touch + trackpad).
   ============================================================ */

body.apt-services-archive .apt-services-categories {
  background: var(--apt-sv-white);
  border-bottom: 1px solid var(--apt-sv-border);
  padding: 14px var(--apt-sv-band-pad);
}

body.apt-services-archive .apt-services-categories__title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.apt-services-archive .apt-services-categories__rail {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin: 0;
  padding: 2px 0 6px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

body.apt-services-archive .apt-services-categories__item {
  flex: 0 0 auto;
  margin: 0;
  scroll-snap-align: start;
}

body.apt-services-archive .apt-services-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px 0 6px;
  background: var(--apt-sv-white);
  border: 1px solid var(--apt-sv-border);
  border-radius: 999px;
  color: var(--apt-sv-text);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

body.apt-services-archive .apt-services-category-chip:hover,
body.apt-services-archive .apt-services-category-chip:focus-visible {
  border-color: var(--apt-sv-blue);
  color: var(--apt-sv-blue);
  text-decoration: none;
}

body.apt-services-archive .apt-services-category-chip__icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--apt-sv-blue-light);
  color: var(--apt-sv-blue);
  font-size: 0.8125rem;
}

body.apt-services-archive .apt-services-category-chip__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--apt-sv-border-light);
  color: var(--apt-sv-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

body.apt-services-archive .apt-services-category-chip.is-current {
  background: var(--apt-sv-blue);
  border-color: var(--apt-sv-blue);
  color: var(--apt-sv-white);
}

body.apt-services-archive .apt-services-category-chip.is-current .apt-services-category-chip__icon {
  background: rgba(255, 255, 255, 0.18);
  color: var(--apt-sv-white);
}

body.apt-services-archive .apt-services-category-chip.is-current .apt-services-category-chip__count {
  background: rgba(255, 255, 255, 0.22);
  color: var(--apt-sv-white);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */

body.apt-services-archive .apt-services-layout {
  background: transparent;
  max-width: calc(var(--apt-sv-max) + 2 * var(--apt-sv-gutter));
  margin: 0 auto;
  padding: 28px var(--apt-sv-gutter) 40px;
  box-sizing: border-box;
}

/* Core HivePress hardcodes .hp-page__content to hp-col-sm-8 for its
   sidebar layout; the sidebar is removed (filter relocated), so widen it. */
body.apt-services-archive .apt-services-layout--no-sidebar .apt-services-results {
  flex: 0 0 100%;
  max-width: 100%;
  padding: 0;
}

/* The card grid below sizes its columns from this box, not the viewport. */
body.apt-services-archive .apt-services-results {
  container-type: inline-size;
  container-name: apt-services-results;
  min-width: 0;
}

/* ============================================================
   SIDEBAR (FILTER WIDGET) — defensive fallback only.
   Applies when class-apt-services-archive.php could not find the
   filter widget in page_sidebar and left the sidebar column in
   place; unused on the current relocated (--no-sidebar) layout.
   ============================================================ */

body.apt-services-archive .apt-services-sidebar .widget,
body.apt-services-archive .apt-services-sidebar .hp-widget {
  background: var(--apt-sv-white);
  border: 1px solid var(--apt-sv-border-light);
  border-radius: var(--apt-sv-radius);
  box-shadow: none;
  overflow: hidden;
}

body.apt-services-archive .apt-services-sidebar .widget.hp-map {
  display: none;
}

body.apt-services-archive .apt-services-filter-card .hp-modal {
  padding: 0;
  margin: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

body.apt-services-archive .apt-services-filter-card .hp-form__fields {
  padding: 14px 18px 4px;
}

body.apt-services-archive .apt-services-filter-card .hp-form__footer {
  padding: 0 18px 16px;
}

/* ============================================================
   RESULTS HEADER — "Services near you" + Map / Filters / Sort
   Row: title + real count (left), controls (right). The Filters
   <details> opens its real filter form as a dropdown panel
   anchored to the full width of this bar.
   ============================================================ */

body.apt-services-archive .apt-services-results-bar {
  position: relative;
  display: flex;
  flex-direction: row; /* HivePress switches .hp-page__topbar to column ≤47.99em. */
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 20px;
  padding: 0;
  background: transparent;
  border: none;
}

body.apt-services-archive .apt-services-results-head {
  order: 1;
  flex: 1 1 280px;
  min-width: 0;
}

body.apt-services-archive .apt-services-results-head__title {
  margin: 0 0 2px;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--apt-sv-text);
}

body.apt-services-archive .apt-services-results-head .hp-result-count {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--apt-sv-muted);
}

body.apt-services-archive .apt-services-results-head__context {
  margin: 2px 0 0;
  font-size: 0.875rem;
  color: var(--apt-sv-muted);
}

/* Shared control look: map link, Filters summary, sort select. */
body.apt-services-archive .apt-services-results-bar .apt-view-on-map,
body.apt-services-archive .apt-services-filter-summary,
body.apt-services-archive .apt-services-results-bar .apt-services-sort .select2-selection--single {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  background: var(--apt-sv-white);
  border: 1px solid var(--apt-sv-border);
  border-radius: var(--apt-sv-radius);
  color: var(--apt-sv-text);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--apt-sv-shadow);
  box-sizing: border-box;
  transition: border-color 0.13s ease, color 0.13s ease;
}

body.apt-services-archive .apt-services-results-bar .apt-view-on-map:hover,
body.apt-services-archive .apt-services-filter-summary:hover,
body.apt-services-archive .apt-services-results-bar .apt-services-sort .select2-selection--single:hover {
  border-color: var(--apt-sv-blue);
  color: var(--apt-sv-blue);
  text-decoration: none;
}

body.apt-services-archive .apt-services-results-bar .apt-view-on-map {
  order: 2;
  color: var(--apt-sv-blue);
}

body.apt-services-archive .apt-services-results-bar .apt-view-on-map svg {
  flex-shrink: 0;
}

body.apt-services-archive .apt-services-results-bar .apt-services-filter-toggle {
  order: 3;
  position: static;
  display: block;
  margin: 0;
  padding: 0;
  border: none;
}

body.apt-services-archive .apt-services-filter-summary {
  list-style: none;
  user-select: none;
}

body.apt-services-archive .apt-services-filter-summary::-webkit-details-marker {
  display: none;
}

body.apt-services-archive .apt-services-filter-summary i:first-child {
  color: var(--apt-sv-blue);
  font-size: 0.8125rem;
}

body.apt-services-archive .apt-services-filter-summary__chevron {
  font-size: 0.6875rem;
  color: var(--apt-sv-muted-light);
  transition: transform 0.15s ease;
}

body.apt-services-archive .apt-services-filter-toggle[open] .apt-services-filter-summary {
  border-color: var(--apt-sv-blue);
  color: var(--apt-sv-blue);
}

body.apt-services-archive .apt-services-filter-toggle[open] .apt-services-filter-summary__chevron {
  transform: rotate(180deg);
}

body.apt-services-archive .apt-services-results-bar .apt-services-sort {
  order: 4;
  margin: 0;
}

body.apt-services-archive .apt-services-sort .hp-form__messages:empty {
  display: none;
}

body.apt-services-archive .apt-services-sort .hp-form__fields {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}

body.apt-services-archive .apt-services-sort .hp-form__field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

body.apt-services-archive .apt-services-sort .hp-field__label {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--apt-sv-muted);
  white-space: nowrap;
}

/* The sort <select> is enhanced by Select2 (data-component="select");
   the visible control is its .select2-selection box. */
body.apt-services-archive .apt-services-results-bar .apt-services-sort .select2-container {
  min-width: 120px;
}

body.apt-services-archive .apt-services-results-bar .apt-services-sort .select2-selection--single {
  position: relative;
  padding-right: 34px;
}

body.apt-services-archive .apt-services-sort .select2-selection__rendered {
  padding: 0;
  line-height: 1;
  color: inherit;
  text-transform: none;
  letter-spacing: 0;
}

body.apt-services-archive .apt-services-sort .select2-selection__arrow {
  position: absolute;
  top: 0;
  right: 10px;
  height: 100%;
  display: flex;
  align-items: center;
}

body.apt-services-archive .apt-services-results-bar .apt-services-sort .select2-selection--single:focus {
  outline: none;
  border-color: var(--apt-sv-blue);
  box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.14);
}

/* ---- Filter dropdown panel (real HivePress listing_filter widget) ----
   display:block is required: HivePress core hides this widget below 768px
   (its mobile design only ever shows it via a Fancybox clone). Visibility
   here is driven by the parent <details> at every width instead. */
body.apt-services-archive .apt-services-filter-bar.widget,
body.apt-services-archive .apt-services-filter-bar.hp-widget {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  display: block;
  margin: 0;
  padding: 20px;
  background: var(--apt-sv-white);
  border: 1px solid var(--apt-sv-border);
  border-radius: var(--apt-sv-radius-lg);
  box-shadow: var(--apt-sv-shadow-hover);
}

/* HivePress core hides .hp-modal (display:none) unless it's the inline
   .hp-modal--mobile variant at ≥48em; render it as a plain in-flow block,
   scoped to this relocated instance only. */
body.apt-services-archive .apt-services-filter-bar .hp-modal {
  display: block;
  width: auto;
  padding: 0;
  margin: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

body.apt-services-archive .apt-services-filter-bar .hp-form {
  margin: 0;
}

body.apt-services-archive .apt-services-filter-bar .hp-form__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px 20px;
  padding: 0;
}

body.apt-services-archive .apt-services-filter-bar .hp-form__field {
  margin: 0;
}

body.apt-services-archive .apt-services-filter-bar .hp-field__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--apt-sv-muted-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

/* Category — horizontal pill row spanning the full panel width. */
body.apt-services-archive .apt-services-filter-bar .hp-form__field--radio {
  flex: 1 1 100%;
  order: -1;
}

body.apt-services-archive .apt-services-filter-bar .hp-form__field--radio::before {
  content: "Category";
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--apt-sv-muted-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

body.apt-services-archive .apt-services-filter-bar .hp-field--radio ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.apt-services-archive .apt-services-filter-bar .hp-field--radio > ul > li > ul {
  flex-basis: 100%;
  padding-left: 18px;
  margin-top: 4px;
}

body.apt-services-archive .apt-services-filter-bar .hp-field--radio ul li {
  margin: 0;
}

body.apt-services-archive .apt-services-filter-bar .hp-field--radio ul li label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--apt-sv-border);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--apt-sv-text);
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
  margin: 0;
}

body.apt-services-archive .apt-services-filter-bar .hp-field--radio ul li label:hover {
  border-color: var(--apt-sv-blue);
  color: var(--apt-sv-blue);
}

body.apt-services-archive .apt-services-filter-bar .hp-field--radio > ul > li > label {
  font-weight: 700;
}

body.apt-services-archive .apt-services-filter-bar input[type="radio"] {
  accent-color: var(--apt-sv-blue);
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  margin: 0;
  cursor: pointer;
}

/* Price / availability / warranty — compact groups beneath the pills. */
body.apt-services-archive .apt-services-filter-bar .hp-form__field--number-range,
body.apt-services-archive .apt-services-filter-bar .hp-form__field--select {
  flex: 0 0 auto;
  min-width: 170px;
  max-width: 100%;
}

/* HivePress core sets these inputs to flex:1 — override so the fixed
   width applies instead of stretching past the panel on mobile. */
body.apt-services-archive .apt-services-filter-bar .hp-field--number-range input[type="number"] {
  flex: 0 0 68px;
  width: 68px;
  border: 1px solid var(--apt-sv-border);
  background: var(--apt-sv-bg);
  border-radius: var(--apt-sv-radius-sm);
  font-size: 0.8125rem;
  color: var(--apt-sv-text);
  padding: 6px 8px;
}

body.apt-services-archive .apt-services-filter-bar .ui-slider {
  width: 150px;
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.07);
  border-radius: 4px;
}

body.apt-services-archive .apt-services-filter-bar .ui-slider-range {
  background: var(--apt-sv-blue);
}

body.apt-services-archive .apt-services-filter-bar .ui-slider-handle {
  border-color: var(--apt-sv-blue);
  border-radius: 50%;
}

body.apt-services-archive .apt-services-filter-bar select {
  border: 1px solid var(--apt-sv-border);
  background: var(--apt-sv-white);
  border-radius: var(--apt-sv-radius-sm);
  font-size: 0.8125rem;
  color: var(--apt-sv-text);
  padding: 6px 10px;
  cursor: pointer;
}

body.apt-services-archive .apt-services-filter-bar .hp-form__footer {
  flex: 0 0 auto;
  margin-top: 14px;
  padding: 0;
}

body.apt-services-archive .apt-services-filter-bar .hp-form__button.button-primary {
  width: auto;
  min-width: 140px;
  margin: 0;
  box-sizing: border-box;
  height: 40px;
  padding: 0 22px;
  background: var(--apt-sv-blue);
  border: 1px solid var(--apt-sv-blue);
  color: var(--apt-sv-white);
  border-radius: var(--apt-sv-radius-sm);
  box-shadow: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s ease;
}

body.apt-services-archive .apt-services-filter-bar .hp-form__button.button-primary:hover {
  background: var(--apt-sv-blue-hover);
  border-color: var(--apt-sv-blue-hover);
}

/* ============================================================
   SERVICE CARD GRID — 1 / 2 / 3 columns from the results width
   (container query), not the viewport: ~1440 → 3, 1024 → 3,
   768 → 2, 390/430 → 1.
   ============================================================ */

body.apt-services-archive .hp-listings {
  display: block;
  margin: 0;
}

body.apt-services-archive .hp-listings > .hp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin: 0;
}

@container apt-services-results (min-width: 600px) {
  body.apt-services-archive .hp-listings > .hp-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container apt-services-results (min-width: 900px) {
  body.apt-services-archive .hp-listings > .hp-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }
}

body.apt-services-archive .hp-listings .hp-grid__item {
  display: flex;
  flex: none;
  min-width: 0;
  max-width: none;
  width: auto;
  padding: 0;
  margin: 0;
}

/* ============================================================
   SERVICE CARD
   ============================================================ */

/* padding:0 resets ExpertHive's `.hp-listing--view-block { padding:
   2rem 1.75rem 2rem 2rem }`; the card is edge-to-edge. */
body.apt-services-archive .apt-service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: var(--apt-sv-white);
  border: 1px solid var(--apt-sv-border);
  border-radius: var(--apt-sv-radius-lg);
  box-shadow: var(--apt-sv-shadow);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

body.apt-services-archive .apt-service-card:hover {
  box-shadow: var(--apt-sv-shadow-hover);
  transform: translateY(-2px);
}

/* ---- Media ---- */

/* experthive hides the header on mobile; restore it at every width. */
body.apt-services-archive .apt-service-card__media {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--apt-sv-border-light);
}

body.apt-services-archive .apt-service-card .hp-listing__image,
body.apt-services-archive .apt-service-card .hp-listing__image a,
body.apt-services-archive .apt-service-card .hp-listing__image .slick-list,
body.apt-services-archive .apt-service-card .hp-listing__image .slick-track,
body.apt-services-archive .apt-service-card .hp-listing__image .slick-slide,
body.apt-services-archive .apt-service-card .hp-listing__image .slick-slide > div {
  width: 100%;
  height: 100%;
}

body.apt-services-archive .apt-service-card .hp-listing__image {
  display: block;
  margin: 0;
  min-height: 0;
}

/* Rectangular, cover-fit (experthive applies border-radius:50% globally). */
body.apt-services-archive .apt-service-card .hp-listing__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* Multi-image listings: before the slider initialises, only the first
   image shows; once slick runs, its own track controls the slides. */
body.apt-services-archive .apt-service-card .hp-listing__image:not(.slick-initialized) > img:not(:first-of-type) {
  display: none;
}

/* The slick track sets a wide inline width for multi-slide layouts; clamp
   every layer so it can never widen the grid or the page. */
body.apt-services-archive .apt-service-card .hp-listing__image,
body.apt-services-archive .apt-service-card .slick-list {
  max-width: 100% !important;
  overflow: hidden !important;
}

body.apt-services-archive .apt-service-card .slick-arrow {
  z-index: 2;
}

/* Save — the real APT_Favorites toggle, icon-only over the image. */
body.apt-services-archive .apt-service-card__save {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
}

body.apt-services-archive .apt-service-card__save .apt-favorite-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.18);
}

body.apt-services-archive .apt-service-card__save .apt-favorite-toggle__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Featured — real hp_featured flag (rendered by HivePress inside the
   title); pinned over the image's top-left corner. */
body.apt-services-archive .apt-service-card .hp-listing__featured-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  margin: 0;
  background: rgba(17, 24, 39, 0.78);
  color: #FCD34D;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
  pointer-events: none;
}

body.apt-services-archive .apt-service-card .hp-listing__featured-badge::after {
  content: "Featured";
  color: var(--apt-sv-white);
  letter-spacing: 0.02em;
}

body.apt-services-archive .apt-service-card .hp-listing__featured-badge i {
  font-size: 0.6875rem;
}

/* Real verified badge — only rendered when the vendor's owner account
   passes verification (see restore_service_card_image()). */
body.apt-services-archive .apt-service-card__verified {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: rgba(31, 138, 85, 0.94);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 999px;
  line-height: 1.4;
  pointer-events: none;
}

/* HivePress's native per-listing "verified" checkbox is a manual admin
   toggle unconnected to APT verification — never shown as a trust signal. */
body.apt-services-archive .apt-service-card .hp-listing__verified-badge {
  display: none;
}

/* ---- Body ---- */

/* margin-right reset: experthive's `.hp-listing--view-block
   .hp-listing__content:not(:last-child)` (0,3,0) adds a row gutter ≥768px;
   this selector is (0,3,1) so it wins regardless of source order. */
body.apt-services-archive .apt-service-card .apt-service-card__main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 16px 18px 0;
}

/* Category pill + real price */
body.apt-services-archive .apt-service-card__eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
}

body.apt-services-archive .apt-service-card .hp-listing__categories {
  min-width: 0;
  margin: 0;
}

body.apt-services-archive .apt-service-card .hp-listing__categories a {
  display: inline-block;
  max-width: 100%;
  padding: 4px 10px;
  background: var(--apt-sv-blue-light);
  color: var(--apt-sv-blue);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

body.apt-services-archive .apt-service-card .hp-listing__categories a:hover {
  background: var(--apt-sv-blue);
  color: var(--apt-sv-white);
  text-decoration: none;
}

body.apt-services-archive .apt-service-card__price {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--apt-sv-text);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

body.apt-services-archive .apt-service-card__price-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--apt-sv-muted);
  letter-spacing: 0;
}

/* Title */
body.apt-services-archive .apt-service-card__title {
  margin: 2px 0 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--apt-sv-text);
}

body.apt-services-archive .apt-service-card__title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--apt-sv-text);
  text-decoration: none;
}

body.apt-services-archive .apt-service-card__title a:hover {
  color: var(--apt-sv-blue);
}

/* Provider identity + real rating */
body.apt-services-archive .apt-service-card__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--apt-sv-muted);
}

/* Provider strip — avatar + linked vendor name, one adjacent unit
   (see APT_Services_Archive::restore_service_card_image()). */
body.apt-services-archive .apt-service-card .hp-listing__vendor {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

body.apt-services-archive .apt-service-card .apt-provider-strip__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--apt-sv-text);
}

body.apt-services-archive .apt-service-card .apt-provider-strip__name a {
  color: var(--apt-sv-text);
  text-transform: none;
  letter-spacing: 0;
  text-decoration: none;
}

body.apt-services-archive .apt-service-card .apt-provider-strip__name a:hover {
  color: var(--apt-sv-blue);
  text-decoration: underline;
}

body.apt-services-archive .apt-service-card .apt-vendor-avatar {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
}

body.apt-services-archive .apt-service-card .apt-vendor-avatar img {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--apt-sv-border);
}

/* Real rating — only rendered from approved hp_review rows
   (APT_Services_Archive::apply_real_review_rating()). */
body.apt-services-archive .apt-service-card__rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  color: var(--apt-sv-text);
}

body.apt-services-archive .apt-service-card__rating i {
  color: #F59E0B;
  font-size: 0.75rem;
}

body.apt-services-archive .apt-service-card__rating-value {
  font-weight: 700;
}

body.apt-services-archive .apt-service-card__rating-count {
  color: var(--apt-sv-muted);
}

/* Real excerpt */
body.apt-services-archive .apt-service-card__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--apt-sv-muted);
}

/* Masked locality */
body.apt-services-archive .apt-service-card__location {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--apt-sv-muted);
}

body.apt-services-archive .apt-service-card__location i {
  color: var(--apt-sv-muted-light);
  font-size: 0.75rem;
}

/* Real tags — the row collapses when no tag applies. */
body.apt-services-archive .apt-service-card__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

body.apt-services-archive .apt-service-card__tags:empty {
  display: none;
}

body.apt-services-archive .apt-service-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

body.apt-services-archive .apt-service-card__badge--warranty {
  background: var(--apt-sv-green-light);
  color: var(--apt-sv-green);
}

/* Real "Book Now available" badge — SERVICE-DISCOVERY-UX-POLISH-1A.
   Deliberately NOT scoped to body.apt-services-archive: it also renders
   on the vendor profile's own services grid (see
   APT_Services_Archive::inject_booking_badge()), a page that never
   carries that body class. Self-contained (no --apt-sv-* tokens). */
.apt-service-card__badge--bookable {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.6;
  background: #E9F7EF;
  color: #1F8A55;
}

/* ---- Actions footer ---- */

/* margin:0 neutralises ExpertHive's mobile `margin: 2rem -2rem -0.75rem`. */
body.apt-services-archive .apt-service-card__side {
  flex: 0 0 auto;
  display: block;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 16px 18px 18px;
  background: transparent;
  border: none;
}

body.apt-services-archive .apt-service-card .hp-listing__actions--primary {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  margin: 0;
}

body.apt-services-archive .apt-service-card__cta {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  background: var(--apt-sv-blue);
  color: var(--apt-sv-white);
  border: 1px solid var(--apt-sv-blue);
  border-radius: var(--apt-sv-radius);
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  box-sizing: border-box;
}

body.apt-services-archive .apt-service-card__cta:hover {
  background: var(--apt-sv-blue-hover);
  border-color: var(--apt-sv-blue-hover);
  color: var(--apt-sv-white);
  text-decoration: none;
}

/* ASKPERTASK-HOME-WELCOME-SERVICES-FINAL-POLISH-1B §I/§J — "View Service"
   becomes secondary only when a real "Request to Book" primary CTA is
   present (genuinely booking-eligible listings). */
body.apt-services-archive .apt-service-card__cta--secondary {
  background: var(--apt-sv-white);
  color: var(--apt-sv-text);
  border-color: var(--apt-sv-border);
}

body.apt-services-archive .apt-service-card__cta--secondary:hover {
  background: var(--apt-sv-border-light);
  color: var(--apt-sv-text);
  border-color: var(--apt-sv-border);
}

/* Message Provider (SVC-PUBLIC-VISUAL-3A-R3) — the real message_send_form
   modal trigger, compact icon button beside the CTA. */
body.apt-services-archive .apt-service-card__message {
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--apt-sv-white);
  color: var(--apt-sv-muted);
  border: 1px solid var(--apt-sv-border);
  border-radius: var(--apt-sv-radius);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}

body.apt-services-archive .apt-service-card__message i {
  font-size: 0.9375rem;
}

body.apt-services-archive .apt-service-card__message:hover {
  border-color: var(--apt-sv-blue);
  color: var(--apt-sv-blue);
  text-decoration: none;
}

/* Visible label hidden; the full label stays for assistive tech. */
body.apt-services-archive .apt-service-card__message-label-short {
  display: none;
}

body.apt-services-archive .apt-service-card__message-label-full {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ============================================================
   MESSAGE PROVIDER MODAL (SVC-PUBLIC-SEARCH-3C)
   Scoped to .apt-message-modal — only the real message_send_form
   modal this archive injects. Restyled to the Services blue/white
   system instead of the theme's default yellow .button-primary.alt.
   ============================================================ */

body.apt-services-archive .apt-message-modal.hp-modal {
  padding: 28px;
}

body.apt-services-archive .apt-message-modal .hp-modal__title {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--apt-sv-text);
  margin: 0 0 18px;
}

body.apt-services-archive .apt-message-modal .hp-field__label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--apt-sv-muted-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

body.apt-services-archive .apt-message-modal .hp-field--textarea {
  border: 1px solid var(--apt-sv-border);
  border-radius: var(--apt-sv-radius-sm);
  background: var(--apt-sv-bg);
  font-size: 0.9375rem;
  color: var(--apt-sv-text);
  padding: 12px 14px;
  min-height: 120px;
}

body.apt-services-archive .apt-message-modal .hp-field--textarea:focus {
  outline: none;
  border-color: var(--apt-sv-blue);
  box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.10);
}

body.apt-services-archive .apt-message-modal .hp-form__footer {
  margin-top: 18px;
}

/* The theme sets an inline yellow box-shadow on this button; !important
   is scoped to this one modal's submit button only. */
body.apt-services-archive .apt-message-modal .hp-form__button.button-primary {
  background: var(--apt-sv-blue);
  border-color: var(--apt-sv-blue);
  color: var(--apt-sv-white);
  border-radius: var(--apt-sv-radius-sm);
  font-weight: 600;
  box-shadow: none !important;
}

body.apt-services-archive .apt-message-modal .hp-form__button.button-primary:hover {
  background: var(--apt-sv-blue-hover);
  border-color: var(--apt-sv-blue-hover);
  color: var(--apt-sv-white);
}

/* ============================================================
   SERVICES EMPTY STATE (SVC-PUBLIC-SEARCH-3C)
   Rendered only when the real query returns zero results. HivePress's
   own inline "Nothing found" part is hidden in favour of it.
   ============================================================ */

body.apt-services-archive .hp-no-results {
  display: none;
}

body.apt-services-archive .apt-services-empty-state {
  background: var(--apt-sv-white);
  border: 1px solid var(--apt-sv-border);
  border-radius: var(--apt-sv-radius-lg);
  padding: 48px 24px;
  text-align: center;
}

body.apt-services-archive .apt-services-empty-state__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--apt-sv-text);
  margin: 0 0 8px;
}

body.apt-services-archive .apt-services-empty-state__text {
  font-size: 0.9375rem;
  color: var(--apt-sv-muted);
  max-width: 480px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

body.apt-services-archive .apt-services-empty-state__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

body.apt-services-archive .apt-services-empty-state__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 24px;
  border-radius: var(--apt-sv-radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.apt-services-archive .apt-services-empty-state__btn--primary {
  background: var(--apt-sv-blue);
  color: var(--apt-sv-white);
  border: 1px solid var(--apt-sv-blue);
}

body.apt-services-archive .apt-services-empty-state__btn--primary:hover {
  background: var(--apt-sv-blue-hover);
  border-color: var(--apt-sv-blue-hover);
  color: var(--apt-sv-white);
  text-decoration: none;
}

body.apt-services-archive .apt-services-empty-state__btn--ghost {
  background: transparent;
  color: var(--apt-sv-text);
  border: 1px solid var(--apt-sv-border);
}

body.apt-services-archive .apt-services-empty-state__btn--ghost:hover {
  border-color: var(--apt-sv-blue);
  color: var(--apt-sv-blue);
  text-decoration: none;
}

/* ============================================================
   BOTTOM CTA STRIP
   ============================================================ */

body.apt-services-archive .apt-services-cta-strip {
  background: var(--apt-sv-white);
  border: 1px solid var(--apt-sv-border);
  border-radius: var(--apt-sv-radius-lg);
  margin-top: 32px;
  overflow: hidden;
}

body.apt-services-archive .apt-services-cta-strip__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 28px;
}

body.apt-services-archive .apt-services-cta-strip__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.apt-services-archive .apt-services-cta-strip__text strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--apt-sv-text);
}

body.apt-services-archive .apt-services-cta-strip__text span {
  font-size: 0.875rem;
  color: var(--apt-sv-muted);
}

body.apt-services-archive .apt-services-cta-strip__btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  background: var(--apt-sv-blue);
  color: var(--apt-sv-white);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--apt-sv-radius-sm);
  white-space: nowrap;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

body.apt-services-archive .apt-services-cta-strip__btn:hover {
  background: var(--apt-sv-blue-hover);
  color: var(--apt-sv-white);
  text-decoration: none;
}

/* ============================================================
   PAGINATION
   ============================================================ */

body.apt-services-archive nav.navigation.pagination {
  margin-top: 28px;
}

body.apt-services-archive nav.navigation.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

body.apt-services-archive nav.navigation.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--apt-sv-text);
  border: 1px solid var(--apt-sv-border);
  border-radius: var(--apt-sv-radius-sm);
  text-decoration: none;
  background: var(--apt-sv-white);
  transition: border-color 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}

body.apt-services-archive nav.navigation.pagination .page-numbers:hover {
  border-color: var(--apt-sv-blue);
  color: var(--apt-sv-blue);
  text-decoration: none;
}

body.apt-services-archive nav.navigation.pagination .page-numbers.current {
  background: var(--apt-sv-blue);
  border-color: var(--apt-sv-blue);
  color: var(--apt-sv-white);
  font-weight: 600;
}

body.apt-services-archive nav.navigation.pagination .page-numbers.dots {
  border: none;
  background: transparent;
  color: var(--apt-sv-muted);
  cursor: default;
}

/* ============================================================
   TOWN DISCOVERY — SERVICE-DISCOVERY-UX-POLISH-1A
   "Find local services by town", main archive only; omitted from the
   DOM when no real, link-able town exists (see render_towns_html()).
   ============================================================ */

body.apt-services-archive .apt-services-towns {
  background: var(--apt-sv-white);
  border-top: 1px solid var(--apt-sv-border);
  padding: 32px var(--apt-sv-band-pad) 40px;
}

body.apt-services-archive .apt-services-towns__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--apt-sv-text);
  margin: 0 0 14px;
}

body.apt-services-archive .apt-services-towns__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.apt-services-archive .apt-services-towns__link {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--apt-sv-white);
  border: 1px solid var(--apt-sv-border);
  border-radius: 999px;
  color: var(--apt-sv-text);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

body.apt-services-archive .apt-services-towns__link:hover,
body.apt-services-archive .apt-services-towns__link:focus-visible {
  border-color: var(--apt-sv-blue);
  color: var(--apt-sv-blue);
}

/* Horizontal-overflow safety net (SERVICES-UX-1A): slick carousels
   compute an intrinsic track width from all slides. */
body.apt-services-archive {
  overflow-x: hidden;
}

/* ============================================================
   RESPONSIVE
   Grid columns come from the container query above; these rules
   only re-flow the hero, search, rail and results controls.
   ============================================================ */

@media (max-width: 1024px) {
  body.apt-services-archive .apt-services-hero {
    padding-top: 44px;
  }

  body.apt-services-archive .apt-services-hero__title {
    font-size: 2.25rem;
  }
}

@media (max-width: 768px) {
  body.apt-services-archive {
    --apt-sv-gutter: 16px;
  }

  /* Compact mobile hero — not the desktop geometry scaled down. */
  body.apt-services-archive .apt-services-hero {
    padding: 28px var(--apt-sv-gutter) 16px;
  }

  body.apt-services-archive .apt-services-hero__title {
    font-size: 1.75rem;
    margin-bottom: 8px;
  }

  body.apt-services-archive .apt-services-hero__text {
    font-size: 1rem;
  }

  /* Category term descriptions can be long SEO copy; keep the mobile hero
     compact (full text stays in the DOM). */
  body.apt-services-archive .apt-services-hero--category .apt-services-hero__text {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  body.apt-services-archive .hp-page__header {
    padding: 4px var(--apt-sv-gutter) 24px;
  }

  /* Stacked search: keyword, location, full-width button. */
  body.apt-services-archive .hp-page__header .hp-form--listing-search {
    flex-direction: column;
    padding: 10px;
  }

  body.apt-services-archive .hp-page__header .hp-form__fields {
    flex-direction: column;
  }

  body.apt-services-archive .hp-page__header .hp-form__field {
    flex: 0 0 auto;
    width: 100%;
  }

  body.apt-services-archive .hp-page__header input[type="text"],
  body.apt-services-archive .hp-page__header input[type="search"],
  body.apt-services-archive .hp-page__header .hp-field--location .mapboxgl-ctrl-geocoder,
  body.apt-services-archive .hp-page__header .apt-locate-btn,
  body.apt-services-archive .hp-page__header .hp-form__button,
  body.apt-services-archive .hp-page__header .hp-form__button.button-primary {
    height: 48px;
  }

  body.apt-services-archive .hp-page__header .hp-form__button,
  body.apt-services-archive .hp-page__header .hp-form__button.button-primary {
    width: 100%;
  }

  body.apt-services-archive .apt-services-search-sticky.is-stuck {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  body.apt-services-archive .apt-services-categories {
    padding: 12px 0 10px var(--apt-sv-gutter);
  }

  body.apt-services-archive .apt-services-categories__rail {
    gap: 8px;
    padding-right: var(--apt-sv-gutter);
    scrollbar-width: none;
  }

  body.apt-services-archive .apt-services-categories__rail::-webkit-scrollbar {
    display: none;
  }

  body.apt-services-archive .apt-services-category-chip {
    height: 40px;
    font-size: 0.8125rem;
  }

  body.apt-services-archive .apt-services-category-chip__icon {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
  }

  body.apt-services-archive .apt-services-layout {
    padding-top: 20px;
    padding-bottom: 32px;
  }

  /* Results header: title row, then one row of three equal controls. */
  body.apt-services-archive .apt-services-results-bar {
    gap: 8px;
    margin-bottom: 16px;
  }

  body.apt-services-archive .apt-services-results-head {
    flex: 1 1 100%;
    margin-bottom: 4px;
  }

  body.apt-services-archive .apt-services-results-head__title {
    font-size: 1.25rem;
  }

  body.apt-services-archive .apt-services-results-bar .apt-view-on-map,
  body.apt-services-archive .apt-services-results-bar .apt-services-filter-toggle,
  body.apt-services-archive .apt-services-results-bar .apt-services-sort {
    flex: 1 1 0;
    min-width: 0;
  }

  body.apt-services-archive .apt-services-results-bar .apt-view-on-map,
  body.apt-services-archive .apt-services-filter-summary,
  body.apt-services-archive .apt-services-results-bar .apt-services-sort .select2-selection--single {
    width: 100%;
    justify-content: center;
    padding: 0 10px;
    font-size: 0.8125rem;
  }

  body.apt-services-archive .apt-services-sort .hp-form__fields,
  body.apt-services-archive .apt-services-sort .hp-form__field {
    width: 100%;
  }

  body.apt-services-archive .apt-services-sort .hp-field__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  body.apt-services-archive .apt-services-results-bar .apt-services-sort .select2-container {
    width: 100% !important; /* Select2 writes an inline pixel width. */
    min-width: 0;
  }

  body.apt-services-archive .apt-services-results-bar .apt-services-sort .select2-selection--single {
    padding-right: 28px;
  }

  body.apt-services-archive .apt-services-filter-bar.widget,
  body.apt-services-archive .apt-services-filter-bar.hp-widget {
    padding: 16px;
  }

  body.apt-services-archive .apt-services-filter-bar .hp-form__button.button-primary {
    width: 100%;
  }

  body.apt-services-archive .apt-service-card:hover {
    transform: none;
  }

  body.apt-services-archive .apt-services-cta-strip__inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 20px;
  }

  body.apt-services-archive .apt-services-cta-strip__btn {
    justify-content: center;
  }

  body.apt-services-archive .apt-services-towns {
    padding: 24px var(--apt-sv-gutter) 28px;
  }
}

/* ============================================================
   PROVIDER STRIP ON HOMEPAGE CARDS — PROVIDER-DETAILS-VISUAL-PARITY-1A
   The same provider strip renders on the homepage's real hp_listing
   cards (no .apt-service-card wrapper) — scoped to body.home so it
   stays inert everywhere else this stylesheet loads.
   ============================================================ */

body.home .hp-listing__vendor.apt-provider-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
}

body.home .apt-provider-strip .apt-vendor-avatar {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
}

body.home .apt-provider-strip .apt-vendor-avatar img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1.5px solid #E5E7EB;
}

body.home .apt-provider-strip__name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1F2937;
}

body.home .apt-provider-strip__name a {
  color: #1F2937;
  text-decoration: none;
}

body.home .apt-provider-strip__name a:hover {
  text-decoration: underline;
}

/* ============================================================
   CATEGORY ARCHIVE — body.apt-services-category
   Set alongside body.apt-services-archive on /service-category/*;
   every rule above applies (hero, rail with the current category
   highlighted, results header, cards). Retained as a semantic hook.
   ============================================================ */

/* PWA-FIX-06B: a placed "Promote this service" campaign — the map's gold "Featured" treatment. */
body.apt-services-archive .apt-service-card .apt-featured-tag {
	display: inline-block;
	align-self: flex-start;
	margin: 0 0 6px;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.5;
	color: #8A5A00;
	background: #FFF3D6;
	border: 1px solid #F5D98C;
}
