/* wpgb  */

.wpgb-facet > fieldset:last-child {
  margin-bottom: 0 !important;
}
/* Force WPGB to behave like a normal grid */
body.archive .wpgb-enabled .wpgb-viewport {
  height: auto !important;
}
body.archive .wpgb-enabled .wpgb-justified {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* Disable masonry absolute layout */
body.archive .wpgb-enabled .wpgb-card {
  position: static !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  width: auto !important;
  height: auto !important;
  min-height: 5rem;
}
body.archive .wpgb-enabled .wpgb-card-media,
body.archive .wpgb-enabled .wpgb-card-media-content {
  height: 100%;
  position: static;
  width: 100%;
  background: transparent !important;
}

body.archive .wpgb-enabled .wpgb-card .wpgb-card-media-content-center {
  margin: 0;
  height: 100%;
}
body.archive .wpgb-enabled .wpgb-card [class*="wpgb-block-"] {
  white-space: normal;
}
.wp-grid-builder .wpgb-wrapper {
  max-width: var(--scopematch-site-max-width, 1140px);
  padding-left: var(--scopematch-site-padding-x, 1rem);
  padding-right: var(--scopematch-site-padding-x, 1rem);
  margin: 0 auto;
  padding-top: 24px;
  padding-bottom: 2rem;
}
.wpgb-facet select.wpgb-select.wpgb-sort:not([multiple]) {
  padding-inline-end: 55px;
}
.wpgb-facet select.wpgb-select.wpgb-sort {
  border-radius: 6px;
  border: 1px solid oklch(0.88 0 0);
  font-size: 14px;
  padding: 6px 12px;
  background: #f8f8f8;
  line-height: 1;
  min-height: 22px;
  height: 22px;
}
.wpgb-facet select.wpgb-select.wpgb-sort + .wpgb-select-controls svg {
  height: 22px;
  width: 22px;
  stroke: rgb(61 61 61);
  stroke-width: 1.5px;
}

.wpgb-facet .wpgb-facet-title {
  display: none;
}

.wpgb-facet.wpgb-style-2 input.wpgb-input:focus {
  box-shadow:
    rgba(0, 0, 0, 0) 0px 0px 0px 0px,
    rgba(0, 0, 0, 0) 0px 0px 0px 0px,
    rgba(0, 0, 0, 0) 0px 0px 0px 0px,
    oklab(0.38 -0.08 -6.99382e-9 / 0.5) 0px 0px 0px 3px,
    rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
}
.wpgb-facet.wpgb-style-2 input.wpgb-input {
  width: 256px;
  padding-top: 4px;
  padding-bottom: 4px;
  height: 36px;
  box-shadow:
    rgba(0, 0, 0, 0) 0px 0px 0px 0px,
    rgba(0, 0, 0, 0) 0px 0px 0px 0px,
    rgba(0, 0, 0, 0) 0px 0px 0px 0px,
    rgba(0, 0, 0, 0) 0px 0px 0px 0px,
    rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
}

.filters__dropdown .wpgb-facet .wpgb-checkbox-facet {
  overflow-y: auto;
  max-height: 200px;
  min-height: 162px;
}
.wpgb-facet .wpgb-hierarchical-list:first-child > li:first-child {
  margin: 0 !important;
}
.filters__dropdown .wpgb-facet:not(.wpgb-style-2):has(button.wpgb-apply) {
  width: -webkit-fill-available;
}
.filters__dropdown .wpgb-facet:not(.wpgb-style-2) button.wpgb-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  height: 32px; /* h-8 */
  padding: 0 12px; /* px-3 */
  gap: 6px; /* gap-1.5 */
  flex: 1; /* flex-1 */
  border-radius: 8px; /* rounded-md */
  background: oklch(0.92 0 0); /* bg-secondary */
  color: #0b0b0b; /* text-secondary-foreground */
  font-size: 12px; /* text-xs */
  font-weight: 500; /* font-medium */
  border: 1px solid transparent;
  cursor: pointer;
  margin-bottom: 0;
  opacity: 1;
  width: 100%;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}
.filters__dropdown .wpgb-facet:not(.wpgb-style-2) button.wpgb-apply:hover {
  background: oklab(0.92 0 0 / 0.8);
}
.filters__dropdown .wpgb-facet:not(.wpgb-style-2) button.wpgb-apply:disabled,
.filters__dropdown .wpgb-facet:not(.wpgb-style-2) button.wpgb-reset:disabled {
  cursor: not-allowed;
}
.filters__dropdown .wpgb-facet:not(.wpgb-style-2) button.wpgb-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  height: 32px;
  padding: 0 12px;
  gap: 6px;
  border-radius: 8px;
  background: transparent;
  color: #0b0b0b;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  margin-bottom: 0;
  opacity: 1;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}
.filters__dropdown .wpgb-facet:not(.wpgb-style-2) button.wpgb-reset:hover {
  background: #f24800;
  color: #fff;
}
.wpgb-facet.wpgb-style-2 button.wpgb-reset.wpgb-button {
  color: oklch(0.38 0.08 180);
  border: 0px;
  padding: 0;
  margin-bottom: 0;
}
.wpgb-facet.wpgb-style-2 button.wpgb-reset.wpgb-button:hover:not(:disabled),
.wpgb-facet.wpgb-style-2 button.wpgb-reset.wpgb-button:focus {
  text-decoration: underline;
  background: transparent;
  color: oklch(0.38 0.08 180);
}
.wpgb-facet.wpgb-style-2 button.wpgb-reset.wpgb-button:disabled {
  display: none;
}
.wpgb-facet.wpgb-style-2 .wpgb-selection-facet .wpgb-button {
  background-color: oklab(0.95 0 0 / 0.5);
  border: 1px solid oklch(0.88 0 0);
  border-radius: calc(infinity * 1px);
  color: oklch(0.15 0 0);
  font-size: 13px;
  padding: 4px 12px;
  gap: 4px;
}
.wpgb-facet.wpgb-style-2 .wpgb-selection-facet .wpgb-button:hover {
  background-color: oklch(0.95 0 0);
}

.wpgb-facet.wpgb-style-2 .wpgb-selection-facet .wpgb-button .wpgb-button-label {
  font-size: inherit;
  color: inherit;
  padding: 0;
  line-height: 1.7;
}

@media (max-width: 992px) {
  body.archive .wpgb-enabled .wpgb-justified {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .wpgb-facet.wpgb-style-2 input.wpgb-input {
    width: 100%;
  }
  .wpgb-facet.wpgb-style-2[data-facet="2"] {
    width: 100%;
  }
}
@media (max-width: 768px) {
  .wpgb-facet select.wpgb-select.wpgb-sort:not([multiple]) {
    padding-inline-end: 10px;
  }
  .wpgb-facet select.wpgb-select.wpgb-sort {
    padding: 4px 10px;
    line-height: 0.9;
    min-height: 23px;
    height: 23px;
    min-width: 75px;
  }
  .wpgb-facet select.wpgb-select.wpgb-sort + .wpgb-select-controls svg {
    height: 21px;
    width: 21px;
    margin: 6px;
  }
  .wpgb-facet
    select.wpgb-select.wpgb-sort
    + .wpgb-select-controls
    .wpgb-select-separator {
    display: none;
  }
  body.archive .wpgb-enabled .wpgb-justified {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  .filters__dropdown .wpgb-facet:not(.wpgb-style-2) button.wpgb-reset {
    background-color: oklch(0.98 0 0);
    font-size: 14px;
    border: 1px solid oklch(0.88 0 0);
  }
  .filters__dropdown .wpgb-facet .wpgb-checkbox-facet {
    min-height: 80px;
  }

  .wpgb-sort-facet select.wpgb-select.wpgb-sort:focus,
  .wpgb-sort-facet select.wpgb-select.wpgb-sort:hover {
    background: oklch(0.42 0.08 180) !important;
    color: #fff !important;
  }

  select.wpgb-select.wpgb-sort option {
    background: #fff !important;
    color: #000 !important;
  }
  .wpgb-facet select.wpgb-select.wpgb-sort:focus + .wpgb-select-controls svg {
    stroke: #fff !important;
    transform: rotate(180deg);
  }
  .wpgb-facet select.wpgb-select.wpgb-sort:hover + .wpgb-select-controls svg {
    stroke: #fff !important;
  }
}
body.archive .wpgb-enabled {
  opacity: 1;
}

/* Archive Hero  */
.archive-hero {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.archive-hero__container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px 1rem;
}

.archive-hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.archive-hero__title {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 800;
  color: rgba(0, 0, 0, 0.92);
}

.archive-hero__subtitle {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.6);
}

/* =========================================================
   Company Archive Grid
   ========================================================= */

.archive-grid__container {
  display: grid;
  gap: 20px;
}

@media (min-width: 768px) {
  .archive-grid__container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .archive-grid__container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================================================
   Company Card
   ========================================================= */

body.archive .wpgb-enabled .company-card {
  position: relative; /* for stretched link */
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition:
    box-shadow 180ms ease,
    transform 180ms ease;
  overflow: hidden;
  width: 100%;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  height: 100%;
}

body.archive .wpgb-enabled .company-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

body.archive .wpgb-enabled .company-card .company-card__content {
  flex: 1;
  padding: 20px;
}

body.archive .wpgb-enabled .company-card .company-card__footer {
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
  padding: 16px !important;
}

/* =========================================================
   Header block (logo + title + badges)
   ========================================================= */

body.archive .wpgb-enabled .company-card .company-card__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

body.archive .wpgb-enabled .company-card .company-card__logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.04);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.archive .wpgb-enabled .company-card .company-card__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  display: block;
}

body.archive .wpgb-enabled .company-card .company-card__logo svg {
  width: 22px !important;
  height: 22px !important;
  opacity: 0.55 !important;
  overflow: initial !important;
}

body.archive .wpgb-enabled .company-card .company-card__head {
  flex: 1;
  min-width: 0;
}

body.archive .wpgb-enabled .company-card .company-card__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.archive .wpgb-enabled .company-card .company-card__title {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.92);

  /* truncate */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.archive .wpgb-enabled .company-card .company-card__verified {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: #0ea5a4; /* teal-ish */
}

body.archive .wpgb-enabled .company-card .company-card__badges {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* =========================================================
   Location row
   ========================================================= */

body.archive .wpgb-enabled .company-card .company-card__location {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  color: rgba(0, 0, 0, 0.6);
  font-size: 14px;
  line-height: 1.4;
}

body.archive .wpgb-enabled .company-card .company-card__location svg {
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 16px !important;
  opacity: 0.8 !important;
  overflow: initial !important;
}

body.archive .wpgb-enabled .company-card .company-card__location-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   Description (2-line clamp)
   ========================================================= */

body.archive .wpgb-enabled .company-card .company-card__desc {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.6);

  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================================================
   Taxonomy groups
   ========================================================= */

body.archive .wpgb-enabled .company-card .company-card__tax {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.archive .wpgb-enabled .company-card .company-card__tax-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* =========================================================
   Badges (business type, certifications, categories)
   ========================================================= */

body.archive .wpgb-enabled .company-card .company-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 600;
  border: 1px solid transparent;
}

/* business type + certification look */
body.archive .wpgb-enabled .company-card .company-badge--solid {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.8);
}

/* categories look (more "outline") */
body.archive .wpgb-enabled .company-card .company-badge--outline {
  background: transparent;
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.78);
}

/* optional: unclaimed/claimed badge style if you keep it */
body.archive .wpgb-enabled .company-card .company-badge--muted {
  background: transparent;
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.55);
}

/* =========================================================
   Footer button (if you keep it visible)
   ========================================================= */

body.archive .wpgb-enabled .company-card .company-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 34px;
  line-height: 1.2 !important;
  padding: 0 12px !important;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  background: #f8f8f8;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: rgba(0, 0, 0, 0.85) !important;
  text-decoration: none;
  transition: all 160ms ease !important;
}

body.archive .wpgb-enabled .company-card:hover .company-card__btn {
  background: var(--primary);
  color: var(--primary-foreground) !important;
}
body.archive .wpgb-enabled .company-card .company-card__btn svg {
  width: 18px !important;
  height: auto !important;
  overflow: initial !important;
}

/* =========================================================
   Whole card clickable (stretched link)
   ========================================================= */

/* Put an <a class="company-card__link"> inside card (preferably in footer or top) */
body.archive .wpgb-enabled .company-card .company-card__link {
  position: static; /* needed for pseudo stretched link */
  color: inherit;
  text-decoration: none;
}

/* This makes the link cover the entire card */
body.archive .wpgb-enabled .company-card .company-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Ensure real interactive elements can still be clicked above the stretched link */
body.archive .wpgb-enabled .company-card button,
body.archive .wpgb-enabled .company-card a .company-card__btn,
body.archive .wpgb-enabled .company-card a:not(.company-card__link) {
  position: relative;
  z-index: 2;
}

/* =========================================================
      Filter Styles
   ========================================================= */

.company-card__bottom-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.filters__section .filters__sort-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.filters__section .container.filters__container {
  padding-bottom: 0;
}
.filters__section .filters__main-block {
  display: flex;
  flex-flow: row wrap;
  gap: 12px;
  margin-bottom: 10px;
  align-items: center;
}
.filters__section .filters__mob-collape {
  display: flex;
  flex-flow: row wrap;
  gap: 12px;
  align-items: center;
}
.filters__section .filters__applied {
  display: flex;
  flex-flow: row wrap;
  gap: 7px;
  margin-bottom: 20px;
  align-items: center;
}
.filters__section .filters__sort-inner {
  display: flex;
  flex-flow: row wrap;
  gap: 6px;
  color: #636363;
  align-items: center;
}
@media (max-width: 480px) {
  .filters__section .filters__sort-block {
    gap: 16px;
    flex-direction: column;
    align-items: flex-start;
  }
}

/* -----------------------------
  Filter Footer Buttons
------------------------------ */
.filters__dropdown .btn.btn--apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-height: 32px;
  padding: 0 12px;
  gap: 6px;
  flex: 1;
  border-radius: 8px;
  background: oklch(0.92 0 0);
  color: #0b0b0b;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  margin-bottom: 0;
  opacity: 1;
  width: 100%;
  transition: all 0.15s ease;
}
.filters__dropdown .btn.btn--apply:hover {
  background: oklab(0.92 0 0 / 0.8);
}
.filters__dropdown .footer {
  margin-top: 12px; /* mt-3 */
  padding-top: 12px; /* pt-3 */
  border-top: 1px solid var(--dropdown-border);
  display: flex;
  gap: 8px;
}
@media (max-width: 768px) {
  .filters__dropdown .dropdown__panel[aria-label="Catalog-Categories menu"],
  .filters__dropdown .dropdown__panel[aria-label="Countries menu"] {
    left: unset;
    right: 0;
  }
  .filters__dropdown .dropdown__panel {
    width: calc(100vw - 47px);
    padding: 16px;
  }
  .filters__dropdown .btn.btn--apply {
    background-color: var(--primary);
    color: var(--primary-foreground);
    font-size: 14px;
  }
  .filters__dropdown .btn.btn--apply:hover {
    background-color: oklab(0.38 -0.08 -6.99382e-9 / 0.9);
    border: 1px solid oklch(0.88 0 0);
  }
  .filters__dropdown .footer {
    margin-top: 16px; /* mt-3 */
    padding-top: 16px; /* pt-3 */
  }
}

/* =========================================================
      Filters Accordion
   ========================================================= */

:root {
  --filters-accordion-bg: transparent;
  --filters-accordion-text: #0f172a;
  --filters-accordion-muted: #64748b;
  --filters-accordion-hover: #f1f5f9;
  --filters-accordion-ring: rgba(59, 130, 246, 0.35);

  --filters-accordion-radius: 10px;
  --filters-accordion-font:
    ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

/* wrapper */
.filters-accordion {
  font-family: var(--filters-accordion-font);
  color: var(--filters-accordion-text);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* each item */
.filters-accordion__item {
  border-radius: var(--filters-accordion-radius);
}

/* trigger row */
.filters-accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 0px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--filters-accordion-radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--filters-accordion-text);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease;
}

/* focus ring */
.filters-accordion__trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--filters-accordion-ring);
}

/* title */
.filters-accordion__title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* icon (angle) */
.filters-accordion__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.18s ease;
  color: var(--filters-accordion-muted);
}

/* rotate when open */
.filters-accordion__item[data-open="true"] .filters-accordion__icon {
  transform: rotate(180deg);
}

/* panel animation wrapper */
.filters-accordion__panel {
  height: 0;
  overflow: hidden;
  transition: height 0.2s ease;
}

/* content inside panel */
.filters-accordion__content {
  padding: 4px 0px 8px;
  /* color: var(--filters-accordion-text); */
}

/* Smooth transition when WPGB updates results */
.wpgb-content,
.companies-tax-grid {
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  will-change: opacity, transform;
}

.wpgb-is-loading .wpgb-content,
.wpgb-is-loading .companies-tax-grid {
  opacity: 0.6;
  transform: translateY(2px);
  pointer-events: none;
}
.wpgb-content.wpgb-is-loading,
.companies-tax-grid.wpgb-is-loading {
  opacity: 0.6;
  transform: translateY(2px);
  pointer-events: none;
}
