/* =============================================================
   AskPerTask — Experts (Vendors) List Page  (apt-experts-list.css)

   Scope:
   • body.hp-template--vendors-view-page  → /experts/

   Loaded only on this route via APT_Detail_Pages::enqueue_assets().
   All selectors are prefixed with the body class so nothing bleeds
   to other HivePress pages. Written independently of apt-requests-list.css
   (design tokens not shared) but structurally mirrors its proven
   sidebar-to-top-row technique and breakpoint/modal fixes, since the
   underlying HivePress DOM/CSS mechanism is identical for both routes.

   DOM landmarks (HivePress + ExpertHive):
     body.hp-template--vendors-view-page
       .content-area
         .hp-page.site-main
           .hp-page__header                     ← Keywords search (kept visible
                                                    at every width — unlike the
                                                    requests page, this search
                                                    bar is real, working UI, so
                                                    it is styled/contained here
                                                    rather than hidden)
             .hp-form--vendor-search
             .hp-button--vendor-filter           ← mobile-only Filter trigger
           .hp-row
             aside.hp-page__sidebar              ← filter widget
               .hp-widget--vendor-filter
                 .hp-modal--mobile.hp-modal
                   .hp-form--vendor-filter
                     category radio tree, Availability select, Experience select
             .hp-page__content
               .hp-page__topbar                 ← count · sort
               .hp-vendors.hp-grid              ← grid of vendor cards
               .hp-page__pagination
   ============================================================= */

/* ---- Design tokens (self-contained — not shared with other apt-*.css files) ---- */
body.hp-template--vendors-view-page {
  --apt-el-text:          #1A1A1A;
  --apt-el-muted:         #6B7280;
  --apt-el-muted-light:   #9CA3AF;
  --apt-el-border:        #E5E7EB;
  --apt-el-border-light:  #F3F4F6;
  --apt-el-bg:            #F4F5F7;
  --apt-el-white:         #FFFFFF;
  /* AUDIT-2A-REMEDIATION-BATCH-6: were #2D6CDF / #EAF1FD (generic blue,
     off-brand — AskPerTask's accent is green everywhere else on the
     site). Values only, not the variable names, changed — every rule
     below still reads var(--apt-el-blue[-light]), now resolving to the
     same green tokens homepage-v2.css defines as --aptv2-green /
     --aptv2-green-light. */
  --apt-el-blue:          #1FA34A;
  --apt-el-blue-light:    #EAF7EE;
  --apt-el-radius:        12px;
  --apt-el-shadow:        0 2px 8px rgba(16, 24, 40, 0.06);
}

/* ============================================================
   PAGE BACKGROUND
   ============================================================ */

body.hp-template--vendors-view-page {
  background-color: var(--apt-el-bg);
}

body.hp-template--vendors-view-page .content-area {
  background-color: var(--apt-el-bg);
}

/* Clip the HivePress .hp-row negative-margin (-16px) that causes 16px
   horizontal scroll at narrow viewports (same fix as apt-requests-list.css). */
body.hp-template--vendors-view-page .hp-page {
  overflow-x: hidden;
}

/* ============================================================
   PAGE HEADING — real <h1>, AUDIT-2A-REMEDIATION-BATCH-6
   (page previously had no real page-level heading at all)
   ============================================================ */

body.hp-template--vendors-view-page .apt-experts-heading {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--apt-el-text);
}

/* HELPERS-PROFESSIONALS-DIRECTORY-UNIFICATION-1A: /helpers/ and
   /professionals/ render this template too; their heading sits in a row
   with the "View on Map" pill (same pill shape as apt-requests-list.css,
   in this file's green tokens). /experts/ keeps the bare <h1> above. */
body.hp-template--vendors-view-page .apt-experts-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 0;
  box-sizing: border-box;
}

body.hp-template--vendors-view-page .apt-experts-heading-row .apt-experts-heading {
  max-width: none;
  margin: 0;
  padding: 0;
}

body.hp-template--vendors-view-page .apt-experts-heading-row .apt-view-on-map {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: var(--apt-el-blue-light);
  color: var(--apt-el-blue);
  border: 1.5px solid var(--apt-el-blue);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

body.hp-template--vendors-view-page .apt-experts-heading-row .apt-view-on-map:hover {
  background: #D5EFDD;
  text-decoration: none;
}

body.hp-template--vendors-view-page .apt-experts-heading-row .apt-view-on-map svg {
  flex-shrink: 0;
}

/* ============================================================
   SEARCH HEADER — Keywords search bar (kept visible, contained)
   ============================================================ */

body.hp-template--vendors-view-page .hp-page__header {
  background: var(--apt-el-white);
  border: 1px solid var(--apt-el-border);
  border-radius: var(--apt-el-radius);
  box-shadow: var(--apt-el-shadow);
  padding: 16px 20px;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
}

/* min-width:0 lets the search form actually shrink within the flex row
   instead of being read at its content min-size — without this, adding
   the Filter button as a second fixed-width flex sibling (below) could
   force the row past the container's edge at in-between desktop widths. */
body.hp-template--vendors-view-page .hp-page__header .hp-form--vendor-search {
  flex: 1 1 240px;
  min-width: 0;
  margin: 0;
}

body.hp-template--vendors-view-page .hp-page__header .hp-form--vendor-search .hp-form__fields {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Contain the Keywords input — core's default renders it full-bleed with no
   visible border, which is the "oversized/raw search row" being fixed here. */
body.hp-template--vendors-view-page .hp-page__header .hp-field--search {
  border: 1px solid var(--apt-el-border) !important;
  border-radius: 8px !important;
  background: var(--apt-el-border-light) !important;
  font-size: 14px !important;
  height: 42px !important;
  padding: 0 14px !important;
}

body.hp-template--vendors-view-page .hp-page__header .hp-form__field--search {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
}

body.hp-template--vendors-view-page .hp-page__header .hp-form__footer {
  flex: 0 0 auto;
  margin: 0 !important;
}

/* APT-FILTER-UI-2G: width:auto overrides HivePress core's own
   .hp-form--wide .hp-form__button{width:100%} (frontend.min.css) — with
   no explicit width here the button resolved its 100% against the
   auto-sized .hp-form__footer flex item in a circular layout, landing
   at ~56px, far too narrow for its own "Search" text + arrow icon
   (which visibly overflowed past the button's edges). Same fix pattern
   already used for the Filter trigger button in APT-FILTER-UI-2F.
   flex-shrink:0 + white-space:nowrap keep it from being squeezed again
   once it shares the row with the Filter button. */
body.hp-template--vendors-view-page .hp-page__header .hp-form__button.button-primary {
  width: auto !important;
  flex-shrink: 0 !important;
  height: 42px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  padding: 0 20px !important;
  white-space: nowrap !important;
}

/* ============================================================
   APT-FILTER-UI-2F — Filter trigger, shown at every width
   The real HivePress "Filter" button (data-component="link", opens
   #vendor_filter_modal via HivePress's own Fancybox modal JS —
   common.js's Modal component binds this on page load regardless of
   the trigger's current CSS display state). Previously hidden on
   desktop, where the filter widget rendered as a huge always-open
   inline panel instead (see SIDEBAR FILTER section below); now the
   compact button + popup is the one consistent disclosure pattern
   at every width, matching the mobile behaviour that was already
   proven to work. Sits inline after the Keywords field, right-aligned. */
body.hp-template--vendors-view-page .hp-page__header .hp-button--vendor-filter {
  /* width:auto overrides the theme's own .button--wide{width:100%} — flex-
     basis:auto defers to the width property, so without this the button
     used a 100% basis and (with flex-shrink:0) could never shrink back
     down, forcing the Keywords field to collapse to fit around it. */
  flex: 0 0 auto !important;
  width: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  height: 42px !important;
  padding: 0 16px !important;
  background: var(--apt-el-white) !important;
  border: 1.5px solid var(--apt-el-border) !important;
  color: var(--apt-el-text) !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  transition: border-color 0.15s ease, color 0.15s ease !important;
}

body.hp-template--vendors-view-page .hp-page__header .hp-button--vendor-filter:hover {
  border-color: var(--apt-el-blue) !important;
  color: var(--apt-el-blue) !important;
}

body.hp-template--vendors-view-page .hp-page__header .hp-button--vendor-filter .hp-icon {
  font-size: 13px !important;
  color: var(--apt-el-blue) !important;
}

/* ============================================================
   TOPBAR — result count · sort form
   ============================================================ */

body.hp-template--vendors-view-page .hp-page__topbar {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 10px 0 14px !important;
  margin-bottom: 8px !important;
  border-bottom: 1px solid var(--apt-el-border) !important;
  background: transparent !important;
}

body.hp-template--vendors-view-page .hp-result-count {
  font-size: 13px !important;
  color: var(--apt-el-muted) !important;
  font-weight: 500 !important;
  margin: 0 !important;
}

body.hp-template--vendors-view-page .hp-page__topbar .hp-form--pivot {
  margin: 0 0 0 auto !important;
}

body.hp-template--vendors-view-page .hp-page__topbar .hp-form--pivot select,
body.hp-template--vendors-view-page .hp-page__topbar .hp-form--pivot .hp-field__input {
  font-size: 12px !important;
  color: var(--apt-el-muted) !important;
  background: transparent !important;
  border: 1px solid var(--apt-el-border) !important;
  border-radius: 6px !important;
  padding: 4px 24px 4px 8px !important;
  height: auto !important;
}

/* ============================================================
   FILTER MODAL — CSS-only polish
   APT-EXPERT-MODALS-1F: previously all scoped to
   .hp-widget--vendor-filter, the sidebar wrapper. That div is
   `display:none` (see APT-FILTER-UI-2F below) and, critically,
   Fancybox's "inline" mode detaches #vendor_filter_modal FROM that
   wrapper when it pops the modal open — so none of that styling, or
   any button colour, ever reached the actual popup real users see.
   Retargeted to #vendor_filter_modal directly, which keeps its own id
   (and stays under <body>) whether it's sitting inline in the hidden
   sidebar or living inside Fancybox's .fancybox-content — the one
   selector root that is reliably present in both states.
   ============================================================ */

/* ── Modal shell — Fancybox gives #vendor_filter_modal a white
   background + padding via .fancybox-content (theme override:
   2.5rem); this adds the rounded/shadowed "card" look and a compact,
   professional width instead of stretching to the content's natural
   size. */
body.hp-template--vendors-view-page #vendor_filter_modal {
  width: 420px;
  max-width: calc(100vw - 40px);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(16, 24, 40, 0.18);
  box-sizing: border-box;
}

/* ── "FILTERS" panel title ── */
body.hp-template--vendors-view-page #vendor_filter_modal::before {
  content: "Filters";
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--apt-el-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

/* ── Form — remove default margins ── */
body.hp-template--vendors-view-page #vendor_filter_modal .hp-form {
  margin: 0 !important;
}

/* ── Fields area ── */
body.hp-template--vendors-view-page #vendor_filter_modal .hp-form__fields {
  padding: 0 !important;
}

/* ── "CATEGORY" section label above the radio list ── */
body.hp-template--vendors-view-page #vendor_filter_modal .hp-form__field--radio::before {
  content: "Category";
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--apt-el-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ── Reset browser list chrome on all radio ULs ── */
body.hp-template--vendors-view-page #vendor_filter_modal .hp-field--radio ul {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* ── Nested category list — slight indent ── */
body.hp-template--vendors-view-page #vendor_filter_modal .hp-field--radio > ul > li > ul {
  padding-left: 6px !important;
  margin-top: 2px !important;
}

/* ── List items — minimal gap ── */
body.hp-template--vendors-view-page #vendor_filter_modal .hp-field--radio ul li {
  margin-bottom: 1px !important;
}

/* ── Labels — flex row, hover highlight ── */
body.hp-template--vendors-view-page #vendor_filter_modal .hp-field--radio ul li label {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: var(--apt-el-text) !important;
  line-height: 1.4 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  cursor: pointer !important;
  transition: background 0.12s !important;
  margin: 0 !important;
}

body.hp-template--vendors-view-page #vendor_filter_modal .hp-field--radio ul li label:hover {
  background: var(--apt-el-border-light) !important;
}

/* "All Categories" top-level item — slightly bolder */
body.hp-template--vendors-view-page #vendor_filter_modal .hp-field--radio > ul > li > label {
  font-weight: 600 !important;
}

/* ── Radio inputs — brand accent on the checked state.
   The theme hides the native input (opacity:0) and paints a custom
   circle via ::before/::after on the sibling <span> — accent-color has
   no effect here. Its default checked colour is a hardcoded #15cd72
   (hivetheme frontend.min.css) with a customizer-driven secondary_color
   fill layered on top, neither of which is the AskPerTask blue. */
body.hp-template--vendors-view-page #vendor_filter_modal .hp-field--radio input[type="radio"]:checked + span::before {
  border-color: var(--apt-el-blue) !important;
}

body.hp-template--vendors-view-page #vendor_filter_modal .hp-field--radio input[type="radio"]:checked + span::after {
  background-color: var(--apt-el-blue) !important;
}

/* ── Availability / Experience selects — section separator + label treatment ── */
body.hp-template--vendors-view-page #vendor_filter_modal .hp-form__field--select {
  border-top: 1px solid var(--apt-el-border-light);
  margin-top: 14px;
  padding-top: 12px;
}

body.hp-template--vendors-view-page #vendor_filter_modal .hp-form__field--select .hp-field__label {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: var(--apt-el-muted) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  margin-bottom: 8px !important;
}

body.hp-template--vendors-view-page #vendor_filter_modal .hp-form__field--select select {
  border: 1px solid var(--apt-el-border) !important;
  background: var(--apt-el-border-light) !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  color: var(--apt-el-text) !important;
  height: 38px !important;
}

/* ── Form footer — button wrapper ── */
body.hp-template--vendors-view-page #vendor_filter_modal .hp-form__footer {
  padding: 18px 0 0 !important;
  margin-top: 16px !important;
  border-top: 1px solid var(--apt-el-border-light) !important;
}

/* ── Filter button — AskPerTask blue primary action.
   The theme's global button[type="submit"]{background-color:#ffc107}
   (hivetheme's own default, not this site's #00876F customizer accent)
   is what rendered as the old yellow button; #vendor_filter_modal's id
   specificity clears it without !important. box-shadow is separately
   forced — the theme applies a matching yellow box-shadow as an
   inline style (JS, not a stylesheet rule), which only !important can
   beat — same mechanism already fixed for the Services message modal's
   button in this codebase (apt-services.css, .apt-message-modal). */
body.hp-template--vendors-view-page #vendor_filter_modal .hp-form__button.button-primary {
  width: 100% !important;
  height: 44px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
  background: var(--apt-el-blue);
  border-color: var(--apt-el-blue);
  color: #fff !important;
  box-shadow: none !important;
  transition: background-color 0.15s ease;
}

body.hp-template--vendors-view-page #vendor_filter_modal .hp-form__button.button-primary:hover {
  /* AUDIT-2A-REMEDIATION-BATCH-6: was a hardcoded blue hover (#2459be) —
     bypassed the --apt-el-blue token this batch already re-pointed to
     green, so the base button went green while hover stayed blue. Same
     darker-green pairing used sitewide (--aptv2-green-dark). */
  background: #168238;
  box-shadow: none !important;
}

/* Minimap — hidden: consistent with apt-requests-list.css precedent */
body.hp-template--vendors-view-page .hp-page__sidebar .hp-map {
  display: none !important;
}

/* ============================================================
   SEND MESSAGE MODAL — CSS-only polish
   APT-EXPERT-MODALS-1F: this modal only exists in the DOM for a
   logged-in visitor (HivePress's own `_capability: read` gate on the
   message_send_modal block — guests get the #user_login_modal link
   instead, untouched here), so its markup was verified from source
   rather than a live render: HivePress's generic Blocks\Modal always
   renders id="message_send_modal_<vendor id>" (hence the attribute
   selector below, since the id itself isn't static) with a
   .hp-modal__title, and the form itself always carries
   .hp-form--message-send (HivePress derives hp-form--{slug} from the
   Message_Send form class — the exact same mechanism that produces
   .hp-form--vendor-filter above). One field ("Message", a required
   textarea) plus the same button-primary submit element, so the same
   theme-default-yellow problem and fix documented above applies here
   too. Nothing about the recipient/listing hidden fields, validation,
   or submit action is touched.
   ============================================================ */

body.hp-template--vendors-view-page .hp-modal[id^="message_send_modal_"] {
  width: 440px;
  max-width: calc(100vw - 40px);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(16, 24, 40, 0.18);
  box-sizing: border-box;
}

body.hp-template--vendors-view-page .hp-modal[id^="message_send_modal_"] .hp-modal__title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--apt-el-text);
  margin: 0 0 16px;
}

body.hp-template--vendors-view-page .hp-form--message-send {
  margin: 0 !important;
}

body.hp-template--vendors-view-page .hp-form--message-send .hp-form__fields {
  padding: 0 !important;
}

body.hp-template--vendors-view-page .hp-form--message-send .hp-field__label {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: var(--apt-el-muted) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  margin-bottom: 8px !important;
}

body.hp-template--vendors-view-page .hp-form--message-send .hp-field--textarea {
  border: 1px solid var(--apt-el-border) !important;
  border-radius: 8px !important;
  background: var(--apt-el-border-light) !important;
  font-size: 14px !important;
  color: var(--apt-el-text) !important;
  padding: 12px 14px !important;
  min-height: 120px !important;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

body.hp-template--vendors-view-page .hp-form--message-send .hp-field--textarea:focus {
  outline: none !important;
  border-color: var(--apt-el-blue) !important;
  background: var(--apt-el-white) !important;
  box-shadow: 0 0 0 3px var(--apt-el-blue-light) !important;
}

body.hp-template--vendors-view-page .hp-form--message-send .hp-form__footer {
  padding: 18px 0 0 !important;
  margin-top: 16px !important;
  border-top: 1px solid var(--apt-el-border-light) !important;
}

/* Same AskPerTask-blue treatment, same inline-box-shadow override, as
   the Filter modal button above. */
body.hp-template--vendors-view-page .hp-form--message-send .hp-form__button.button-primary {
  width: 100% !important;
  height: 44px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
  background: var(--apt-el-blue);
  border-color: var(--apt-el-blue);
  color: #fff !important;
  box-shadow: none !important;
  transition: background-color 0.15s ease;
}

body.hp-template--vendors-view-page .hp-form--message-send .hp-form__button.button-primary:hover {
  background: #168238;
  box-shadow: none !important;
}

/* ============================================================
   APT-FILTER-UI-2F — filter panel hidden by default, all widths
   Supersedes the old "filters panel above results on desktop"
   pattern, which was the source of the oversized filter block
   pushing results down. HivePress core already hides
   .hp-widget--vendor-filter below 47.99em (frontend.min.css) in
   favour of the Filter button + Fancybox modal; this extends that
   same hidden-by-default state to every width, so the compact
   Filter trigger + modal (styled above, in the SEARCH HEADER
   section) is now the one consistent disclosure pattern everywhere,
   not just on mobile. The widget/modal markup itself is untouched —
   hiding the ancestor .hp-page__sidebar does not prevent Fancybox
   from still finding and cloning #vendor_filter_modal by id when the
   Filter button is clicked (same mechanism already proven on
   mobile). Content then takes the full row width instead of the old
   66% two-column split. */
body.hp-template--vendors-view-page .hp-page__sidebar {
  display: none !important;
}

body.hp-template--vendors-view-page .hp-page__content.hp-col-sm-8 {
  flex-basis: 100%;
  max-width: 100%;
}

/* ── Minimum page gutter — guarantees content never sits flush
   against the browser edge, independent of the theme's own
   .hp-page margin, which drops to 0 below its container breakpoint.
   This is what was reported as the /experts/ search bar/button
   looking "cramped/clipped on the right" at in-between desktop
   widths. */
body.hp-template--vendors-view-page .hp-page {
  padding-left: 20px !important;
  padding-right: 20px !important;
  box-sizing: border-box !important;
}

/* ============================================================
   APT-EXPERT-CARDS-1B — compact vendor cards
   Ports the layout/spacing of the already-shipped .apt-browse-professionals
   card (wp-content/themes/askpertask-child/style.css) — a real vendor's
   card was compared side-by-side on both pages to confirm this is a
   faithful structural port, not a new design. Deliberately NOT reusing the
   apt-browse-professionals class itself: /experts/ shows every published
   vendor (no apt_is_vendor/apt_is_helper filtering, unlike /professionals/),
   so reusing that class name would misleadingly imply the same filtered
   pool. Scoped to this file's own hp-template--vendors-view-page class
   instead, which is already unique to /experts/. Accent colour uses this
   file's own --apt-el-blue token (matching the Search/Filter row directly
   above the grid) rather than the professionals page's green, for visual
   consistency within this page rather than an exact colour copy.

   Card content (all real data, no invented fields):
     avatar · online-status dot · name · verified badge (real only) ·
     service category chip (APT_Browse_Pages::inject_card_service_chip(),
     real taxonomy/listing category only — suppressed, never a placeholder,
     when none exists) · location (real hp_location meta only) · member
     since date · experience/availability attributes (real vendor data) ·
     "View Profile" CTA (APT_Browse_Pages::inject_card_cta(), real
     permalink) + existing message icon action, both preserved.
   ============================================================ */

body.hp-template--vendors-view-page .hp-vendors .hp-row {
  row-gap: 1rem;
}

/* Card shell — CSS grid: [avatar | content] top row, [footer] bottom row */
body.hp-template--vendors-view-page .hp-vendor--view-block {
  background: var(--apt-el-white);
  border: 1px solid var(--apt-el-border);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
  overflow: hidden;
  display: grid;
  grid-template-areas: "avatar content" "footer footer";
  grid-template-columns: 68px 1fr;
  grid-template-rows: 1fr auto;
  height: 100%;
}

body.hp-template--vendors-view-page .hp-vendor--view-block:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.09);
  transform: translateY(-2px);
}

/* Avatar column — no green band, just a small ring */
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__header {
  grid-area: avatar;
  background: none;
  padding: 0.875rem 0 0 1rem;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__image {
  margin: 0;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__image img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--apt-el-white);
  box-shadow: 0 0 0 2px var(--apt-el-blue);
  display: block;
}

/* Content column */
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__content {
  grid-area: content;
  padding: 0.875rem 1rem 0.625rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

/* Name — left-aligned, tight */
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--apt-el-text);
  margin: 0 0 0.2rem;
  text-align: left;
  line-height: 1.25;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__name a {
  color: inherit;
  text-decoration: none;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__name a:hover {
  color: var(--apt-el-blue);
}

/* Service chip — compact, left-aligned; only rendered at all when a real
   category exists (see inject_card_service_chip() docblock).
   APT-EXPERT-CARDS-1C: lightened from a bold uppercase pill (font-weight
   700, saturated fill/border) to a quieter label-style tag — heavy
   enough to still read as a tag, not so heavy it competes with the
   vendor's own name for attention. max-width + ellipsis stop long real
   category names (e.g. "Home Repairs (Plumbing, Heating, Electrical,
   Appliances)") from stretching the chip to dominate the card; the full
   name is still available via the title attribute on hover. */
body.hp-template--vendors-view-page .apt-service-chip {
  display: inline-block;
  align-self: flex-start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  background: var(--apt-el-border-light);
  color: var(--apt-el-muted);
  border: 1px solid var(--apt-el-border);
  border-radius: 100px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.6;
  margin: 0 0 0.15rem;
}

/* Location badge — inline, left-aligned; only rendered when real
   hp_location meta exists (see inject_card_location()) */
body.hp-template--vendors-view-page .apt-card-location {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  color: var(--apt-el-muted);
  text-align: left;
  line-height: 1.4;
}

body.hp-template--vendors-view-page .apt-card-location strong {
  color: #374151;
  font-weight: 600;
}

body.hp-template--vendors-view-page .apt-card-location__pin {
  color: var(--apt-el-blue);
}

/* Registered date — minimal, left-aligned */
body.hp-template--vendors-view-page .hp-vendor__date {
  font-size: 0.7rem;
  color: var(--apt-el-muted-light);
  text-align: left;
  display: block;
}

/* Footer — full-width CTA + existing message icon action */
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__footer {
  grid-area: footer;
  padding: 0.5rem 0.875rem 0.75rem;
  border-top: 1px solid var(--apt-el-border-light);
  position: relative;
}

/* APT-EXPERT-CARDS-1C: the parent ExpertHive theme (style.css) draws a
   decorative ::before accent bar on every .hp-vendor__footer — a 3px
   green (#00876F) rounded strip on the left edge, originally designed
   for its own spacious single-column card. Against this compact footer
   it reads as an unrelated, accidental smear of colour with no purpose.
   Neutralised here rather than left to bleed through. */
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__footer::before {
  content: none;
}

/* APT-EXPERT-CARDS-1C: CTA and message action are no longer styled
   identically — the 1B version gave both apt-card-cta and any other
   .hp-vendor__actions--primary link the exact same solid-blue full
   button, which (a) split the row's width 50/50 regardless of content,
   forcing "View Profile" to wrap onto two lines, and (b) made the
   message icon look like a second, competing primary CTA rather than a
   secondary action. Explicit gap + flex-basis fixes both: the message
   button gets a small fixed square (flex:0 0 auto), and the CTA gets
   the rest of the row (flex:1 1 auto) with white-space:nowrap so it
   always renders as a single, readable line for any real vendor name. */
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__actions--primary {
  gap: 0.5rem;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .apt-card-cta {
  display: block;
  flex: 1 1 auto;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
  padding: 0.5rem 0.75rem;
  background: var(--apt-el-blue);
  color: #fff !important;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .apt-card-cta:hover {
  background: #168238;
  color: #fff !important;
}

/* Message action — secondary, icon-only, visually distinct from the
   primary CTA (outline, not a solid fill) so it reads as a lighter-
   weight secondary action rather than a competing button.
   APT-EXPERT-CARDS-1E: quiet AskPerTask-blue accent at rest, gentle
   tinted hover with a small lift/scale, and a CSS "Message" tooltip —
   see the dedicated block lower in this file. */
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__actions--primary .hp-vendor__action--message {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  box-sizing: border-box;
  padding: 0;
  background: var(--apt-el-white);
  border: 1px solid var(--apt-el-border);
  border-radius: 6px;
  color: var(--apt-el-blue);
  opacity: 1;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__actions--primary .hp-vendor__action--message:hover,
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__actions--primary .hp-vendor__action--message:focus-visible {
  background: var(--apt-el-blue-light);
  border-color: var(--apt-el-blue);
  color: var(--apt-el-blue);
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 10px rgba(45, 108, 223, 0.18);
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__actions--primary .hp-vendor__action--message:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 5px rgba(45, 108, 223, 0.15);
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__actions--primary .hp-vendor__action--message .hp-icon {
  font-size: 13px;
}

/* ============================================================
   APT-EXPERT-CARDS-1D — layout finish
   Fixes overlap + alignment issues left by 1B/1C:
   • The parent ExpertHive theme absolutely-positions .hp-vendor__rating
     (position:absolute; top:2rem; left:2rem) for its old centred
     single-column card. Against this compact grid card that floats the
     rating over the avatar / name / category chip. Pulled back into flow.
   • Base theme sets .hp-vendor__details--primary to a centred flex
     column, which is why rating + "Member since" looked misaligned
     against the left-aligned name/chip/location. Flattened so those two
     items join the content column's own flow and sit on the same left
     edge, in a deliberate order.
   • The Save toggle (.apt-favorite-toggle--card) was never given a place
     in the footer action row, so Save / View Profile / Message were not
     balanced. Now a single aligned row.
   All real data — nothing added or hidden except the decorative rating
   progress bar, which duplicates the numeric "5.0 (1)" shown beside it.
   ============================================================ */

/* ---- Rating: back into normal flow ---- */
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__rating {
  position: static !important;
  top: auto !important;
  left: auto !important;
}

/* ---- Flatten details--primary; order the content column explicitly ---- */
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__details--primary {
  display: contents;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__content {
  gap: 0.25rem;
  padding: 0.875rem 1rem 0.75rem 0.5rem;
  /* Lets the 1fr grid track actually shrink — without this a long
     white-space:nowrap category chip sets the track's min-content width
     and pushes the whole card past its edge on narrow viewports. */
  min-width: 0;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__name { order: 1; }
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__rating { order: 2; }
body.hp-template--vendors-view-page .hp-vendor--view-block .apt-service-chip { order: 3; }
body.hp-template--vendors-view-page .hp-vendor--view-block .apt-card-location { order: 4; }
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__date { order: 5; }
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__attributes--secondary { order: 6; }
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__attributes--ternary { order: 7; }

/* ---- Name row: status dot + name on one line ---- */
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__name a {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__online-badge {
  align-self: center;
}

/* ---- Rating: compact single line under the name ---- */
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__rating.hp-rating {
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  min-height: 0;
  margin: 0;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-rating__bar {
  display: none;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-rating__details {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-rating__value {
  color: #f59e0b;
  font-weight: 700;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-rating__count {
  color: var(--apt-el-muted);
  font-weight: 500;
}

/* ---- Metadata: chip, location, member-since share the left edge ---- */
body.hp-template--vendors-view-page .hp-vendor--view-block .apt-service-chip {
  margin: 0.15rem 0;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .apt-card-location {
  margin: 0;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__date {
  margin: 0;
  font-size: 0.72rem;
  color: var(--apt-el-muted-light);
  line-height: 1.4;
}

/* ---- Availability / experience: grouped, left-aligned, divided ---- */
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__attributes--secondary {
  justify-content: flex-start;
  gap: 0.3rem 0.75rem;
  margin: 0.4rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--apt-el-border-light);
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__attributes--secondary .hp-vendor__attribute {
  margin: 0;
  font-size: 0.75rem;
  color: var(--apt-el-muted);
  line-height: 1.3;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__attributes--secondary .hp-vendor__attribute i {
  color: var(--apt-el-blue);
  margin-right: 0.3rem;
}

/* ---- Footer: Save · View Profile · Message, one balanced row ---- */
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__footer {
  display: flex;
  align-items: center;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__actions--primary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .apt-favorite-toggle--card {
  flex: 0 0 auto;
  gap: 0.3rem;
  min-height: 36px;
  padding: 0 0.65rem;
  margin: 0;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* ---- Avatar: slightly larger, softer ring ---- */
body.hp-template--vendors-view-page .hp-vendor--view-block {
  grid-template-columns: 72px 1fr;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__header {
  padding: 1rem 0 0 1rem;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__image img {
  width: 48px;
  height: 48px;
  border: none;
  box-shadow: 0 0 0 3px var(--apt-el-blue-light);
}

/* ============================================================
   APT-EXPERT-CARDS-1E — Message action tooltip + states
   The HivePress template already carries a native title="Send Message"
   (kept as the a11y fallback); this adds an instant, on-brand hover
   tooltip. Anchored to the button's right edge so it stays inside the
   card's overflow:hidden bounds. Click behaviour is untouched — the
   link still opens #message_send_modal_<id> (logged in) or
   #user_login_modal (logged out).
   ============================================================ */

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__action--message::after {
  content: "Message";
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--apt-el-text);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__action--message::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 3px);
  right: 12px;
  border: 5px solid transparent;
  border-top-color: var(--apt-el-text);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__action--message:hover::after,
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__action--message:focus-visible::after,
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__action--message:hover::before,
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__action--message:focus-visible::before {
  opacity: 1;
  transform: translateY(0);
}

/* Unavailable / disabled — clear, inert, no hover affordance */
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__action--message.hp-vendor__action--disabled,
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__action--message[aria-disabled="true"],
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__action--message[disabled],
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__action--message:disabled {
  color: var(--apt-el-muted-light);
  border-color: var(--apt-el-border-light);
  background: var(--apt-el-border-light);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__action--message.hp-vendor__action--disabled::after,
body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__action--message[aria-disabled="true"]::after {
  content: "Unavailable";
}

@media (prefers-reduced-motion: reduce) {
  body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__actions--primary .hp-vendor__action--message,
  body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__action--message::after,
  body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__action--message::before {
    transition: none;
  }
  body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__actions--primary .hp-vendor__action--message:hover,
  body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__actions--primary .hp-vendor__action--message:focus-visible {
    transform: none;
  }
}

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

body.hp-template--vendors-view-page .hp-page__pagination {
  margin-top: 24px;
}

/* ============================================================
   MOBILE — below 47.99em (matches core's own
   .hp-widget--vendor-filter hide breakpoint, frontend.min.css)
   ============================================================ */

@media ( max-width: 47.99em ) {

  body.hp-template--vendors-view-page .hp-page__header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 16px;
  }

  /* DIRECTORY-VISUAL-CLEANUP-1A: the desktop flex:1 1 240px basis becomes
     a 240px *height* once the header stacks as a column, and core's
     .hp-form--wide .hp-form__field(s) flex-grow then stretch the Keywords
     field to fill it (the tall empty box). Size to content instead, and
     stretch the field full width rather than centring it at its intrinsic
     width. */
  body.hp-template--vendors-view-page .hp-page__header .hp-form--vendor-search {
    flex: 0 0 auto;
  }

  body.hp-template--vendors-view-page .hp-page__header .hp-form--vendor-search .hp-form__fields {
    align-items: stretch;
  }

  /* Filter trigger — full-width block on mobile (shown at every width;
     the compact desktop pill variant is set in the SEARCH HEADER section) */
  body.hp-template--vendors-view-page .hp-page__header .hp-button--vendor-filter {
    display: block !important;
    width: 100% !important;
    height: 40px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer !important;
  }

  /* Footer actions — keep the three controls on one row but give them a
     comfortable touch height (matches apt-favorites.css's own 44px
     mobile bump for the Save control). */
  body.hp-template--vendors-view-page .hp-vendor--view-block .apt-favorite-toggle--card,
  body.hp-template--vendors-view-page .hp-vendor--view-block .apt-card-cta,
  body.hp-template--vendors-view-page .hp-vendor--view-block .hp-vendor__actions--primary .hp-vendor__action--message {
    min-height: 40px;
  }
}
