/* ===============================
   Service Offers block wrapper
   =============================== */

.service-offers-block {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===============================
   Finder (search + filters)
   Matches nodes finder visually
   =============================== */

.service-offers-block a {
  text-decoration: none;
}

.site-finder__row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
}

.site-finder__search {
  flex: 1 1 360px;
  padding: 10px;
  border: 1px solid #cccccc;
  border-radius: 8px;
  font-size: 14px;
}

/* Clear button (absolute, to the right) */
.site-finder__clear {
	padding: 8px 12px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	position: absolute;
	right: 3px;
	top: 50%;
	transform: translateY(-50%);
	border: 1px solid #cccccc;
	color: #000;
	background: #e8f5ee;
	border-color: #16794e;
	box-shadow: 0 0 0 1px rgba(22, 121, 78, 0.25);
}

/* Filters row */
.site-finder__filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  padding: 8px 0 0;
  /* overflow-x removed as requested */
}

/* ===============================
   Service-offers taxonomy filters
   (namespaced so-filter-*, look like nodes filters)
   =============================== */

.so-filter-block {
  position: relative;
  white-space: nowrap;
  z-index: 10001;
}

.so-filter-toggle {
  padding: 10px 10px;
  border: 1px solid #cccccc;
  background: #fff;
  color: #222;
  border-radius: 4px;
  font-size: 13px;
  letter-spacing: -0.2px;
  cursor: pointer;
}

.so-filter-toggle:hover {
  background: #eee;
}

.so-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: #eeeeee;
  font-size: 12px;
  color: #111;
}

.so-filter-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 10002;
  min-width: 280px;
  max-height: 60vh;
  overflow: auto;
  padding: 10px;
  border: 1px solid #dddddd;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  color: #111111;
}

.so-filter-term-search {
  width: 100%;
  margin-bottom: 8px;
  padding: 6px 8px;
  border: 1px solid #dddddd;
  border-radius: 6px;
  font-size: 13px;
}

.so-filter-options {
  max-height: 45vh;
  overflow: auto;
}

.so-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  line-height: 1.3;
}

.so-filter-option-label {
  font-size: 14px;
  color: inherit;
}

/* Ensure panels sit above content */
.service-offers-block .so-filter-panel {
  z-index: 10002;
}

/* ===============================
   Main category tag buttons
   =============================== */

.service-offers__main-categories {
  margin-bottom: 10px;
}

.service-offers__main-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
}

.service-offers__main-categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-offers-main-category-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #dddddd;
  background: #ffffff;
  font-size: 13px;
  cursor: pointer;
  color: #000; /* your request */
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Your hover/focus/active rule */
.service-offers-main-category-button:hover,
.service-offers-main-category-button:focus,
.service-offers-main-category-button.is-active {
  background: #e8f5ee;
  border-color: #16794e;
  box-shadow: 0 0 0 1px rgba(22, 121, 78, 0.25);
}

.service-offers-main-category-button__thumb {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.service-offers-main-category-button__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-offers-main-category-button__label {
  white-space: nowrap;
}

/* ===============================
   Results list / cards
   =============================== */

.service-offers__results-wrapper {
  position: relative;
  min-height: 120px;
}

.service-offers__loading {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 13px;
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.service-offers__results-wrapper.is-loading .service-offers__loading {
  opacity: 1;
}

.service-offers__results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.service-offer-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e3e3e3;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  cursor: pointer;
  outline: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.service-offer-card:focus-visible {
  box-shadow: 0 0 0 2px #16794e;
}

.service-offer-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  border-color: #d0d0d0;
}

.service-offer-card__inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 12px 14px;
  gap: 10px;
}

.service-offer-card__content {
  flex: 1 1 auto;
  min-width: 0;
}

.service-offer-card__title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}

.service-offer-card__excerpt {
  font-size: 13px;
  line-height: 1.4;
  color: #444;
  margin-bottom: 6px;
}

.service-offer-card__meta {
  font-size: 11px;
  color: #666;
}

.service-offer-card__main-category {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f5ee;
  color: #16794e;
  font-weight: 600;
  margin: 2px 2px 2px 0;
}

.service-offer-card__arrow {
  font-size: 20px;
  line-height: 1;
  align-self: center;
  opacity: 0.5;
}

/* Small screens: single column */
@media (max-width: 640px) {
  .service-offers__results {
	grid-template-columns: 1fr;
  }
}

/* No results text */
.service-offers__no-results {
  margin: 20px 0;
  color: #666;
  font-style: italic;
}

/* ===============================
   Shared modal styling (ns-modal)
   =============================== */

.ns-modal-open {
  overflow: hidden;
}

#ns-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
}

#ns-modal.is-open {
  display: block;
}

.ns-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.ns-modal__dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate3d(-50%,-50%,0);
  width: min(980px, 94vw);
  max-height: 90vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ns-modal__close {
  color:#000;
  position:absolute;
  top:10px;
  right:10px;
  border:none;
  background:transparent;
  font-size: 28px;
  line-height:1;
  cursor:pointer;
  padding: 10px 15px;
}
.ns-modal__close:hover {
  background: #eee;
}

.ns-modal__title {
  padding: 14px 44px 8px 16px;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid #eee;
}

.ns-modal__body {
  padding: 16px;
  overflow: auto;
  max-height: calc(90vh - 54px);
}

.ns-modal__loading {
  opacity: 0.7;
  font-style: italic;
}

/* ===============================
   Service-offer modal inner layout
   =============================== */

.service-offer-modal__header {
  margin-bottom: 12px;
}

.service-offer-modal__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.service-offer-modal__body {
  font-size: 14px;
}

.service-offer-modal__columns {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.service-offer-modal__column {
  flex: 1 1 0;
  min-width: 0;
}

.service-offer-modal__column--main {
  flex-basis: 60%;
}

.service-offer-modal__column--side {
  flex-basis: 40%;
  max-width: 320px;
}

.service-offer-modal__section-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
}

.service-offer-modal__description {
  line-height: 1.5;
}

.service-offer-modal__sites-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.service-offer-modal__site-item {
  margin: 2px 0;
}

.service-offer-modal__sites-empty {
  color: #666;
  font-style: italic;
}

@media (max-width: 768px) {
  .service-offer-modal__columns {
	flex-direction: column;
  }
  .service-offer-modal__column--side {
	max-width: none;
  }
}
