/**
 * WK Search inside Woodmart fullscreen-2 — maschenfein-inspired layout,
 * WOLLKE CI (sage #7ab38b, square corners, clean typography).
 */

/* Hide Woodmart AJAX stub / view-all / live suggestions when admin overlay owns UI */
[class*='wd-search-full-screen'] .wk-search-woodmart-results-hidden,
[class*='wd-search-full-screen'] .wd-all-results,
.wd-search-full-screen-2.wk-search-overlay-host .wd-search-results,
.wd-search-full-screen-2.wk-search-overlay-host .wd-search-suggestions,
.wd-search-full-screen.wk-search-overlay-host .wd-search-results,
.wd-search-full-screen.wk-search-overlay-host .wd-search-suggestions {
  display: none !important;
}

.wk-search-woodmart-overlay-source {
  display: none !important;
}

/* Closed overlay must never cover the header or steal clicks.
   A full-viewport fixed layer (even with pointer-events:none) was
   breaking hit-testing on desktop in Chromium. */
.wd-search-full-screen-2.wk-search-overlay-host:not(.wd-opened),
.wd-search-full-screen.wk-search-overlay-host:not(.wd-opened) {
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  z-index: -1 !important;
  width: 0 !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  inset: auto !important;
  top: 0 !important;
  left: 0 !important;
}

.wd-search-full-screen-2.wk-search-overlay-host.wd-opened,
.wd-search-full-screen.wk-search-overlay-host.wd-opened {
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  /* Above WP admin bar (99999) during admin-only preview. */
  z-index: 100001 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  inset: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* Full-viewport host */
.wd-search-full-screen-2.wk-search-overlay-host {
  --wk-overlay-pad-x: clamp(24px, 3vw, 64px);
  --wk-accent: var(--wd-primary-color, #7ab38b);
  --wk-title: var(--wd-title-color, #242424);
  --wk-muted: var(--wd-text-color, #777777);
  --wk-chip-bg: color-mix(in srgb, var(--wk-accent) 14%, #fff);
  --wk-chip-border: color-mix(in srgb, var(--wk-accent) 28%, #e8e8e8);

  top: 0 !important;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  padding: 0;
  margin: 0;
  align-items: stretch;
  background-color: #fff;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  z-index: 100001;
}

.wd-search-full-screen-2.wk-search-overlay-host > .container {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  max-width: none !important;
  height: auto;
  max-height: none;
  min-height: 100%;
  margin-inline: 0;
  padding: 20px var(--wk-overlay-pad-x) 28px;
  box-sizing: border-box;
}

.wd-search-full-screen-2.wk-search-overlay-host .wd-close-search.wd-style-icon {
  --wd-action-icon-size: 26px;
  position: fixed;
  top: 10px;
  inset-inline-end: 10px;
  z-index: 6;
  color: var(--wk-title);
  pointer-events: auto;
}

.wd-search-full-screen-2.wk-search-overlay-host .wd-close-search a {
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.wd-search-full-screen-2.wk-search-overlay-host .wd-close-search a:hover {
  opacity: 1;
}

/* Search field + loading bar stick together at the top */
.wd-search-full-screen-2.wk-search-overlay-host > .container > .wk-search-overlay-query-stack {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 5;
  width: 100%;
  margin: 0 0 18px;
  background: #fff;
}

.wd-search-full-screen-2.wk-search-overlay-host > .container > .wk-search-overlay-query-stack > .searchform,
.wd-search-full-screen-2.wk-search-overlay-host > .container > .searchform {
  flex: 0 0 auto;
  position: relative;
  top: auto;
  z-index: auto;
  width: 100%;
  margin: 0;
  padding-top: 8px;
  padding-bottom: 4px;
  max-width: none !important;
  display: flex;
  align-items: center;
  background: #fff;
}

.wd-search-full-screen-2.wk-search-overlay-host .searchform .wd-search-cat {
  display: none !important;
}

.wd-search-full-screen-2.wk-search-overlay-host .searchform input[type='text'],
.wd-search-full-screen-2.wk-search-overlay-host .searchform input.s {
  flex: 1 1 auto;
  width: 100% !important;
  max-width: none !important;
  font-size: clamp(22px, 3.2vw, 36px);
  font-weight: 400;
  line-height: 1.25;
  color: var(--wk-title);
  border: 0;
  border-bottom: 1px solid #e2e2e2;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 12px 52px 14px 0;
  height: auto;
  min-height: 52px;
}

.wd-search-full-screen-2.wk-search-overlay-host .searchform input[type='text']:focus,
.wd-search-full-screen-2.wk-search-overlay-host .searchform input.s:focus {
  border-bottom-color: var(--wk-accent);
  outline: none;
}

.wd-search-full-screen-2.wk-search-overlay-host .searchform .searchsubmit {
  display: none;
}

.wd-search-full-screen-2.wk-search-overlay-host .wd-clear-search {
  /* Keep only the single top-right close control. */
  display: none !important;
}

/* Popular chips — sage pills */
.wd-search-full-screen-2.wk-search-overlay-host .wd-search-requests {
  flex: 0 0 auto;
  margin: 0 0 8px;
}

.wd-search-full-screen-2.wk-search-overlay-host .wd-search-requests .wd-search-title {
  display: none;
}

.wd-search-full-screen-2.wk-search-overlay-host .wd-search-requests ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wd-search-full-screen-2.wk-search-overlay-host .wd-search-requests li {
  margin: 0;
}

.wd-search-full-screen-2.wk-search-overlay-host .wd-search-requests a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--wk-title);
  background: var(--wk-chip-bg);
  border: 1px solid var(--wk-chip-border);
  border-radius: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wd-search-full-screen-2.wk-search-overlay-host .wd-search-requests a:hover {
  background: var(--wk-accent);
  border-color: var(--wk-accent);
  color: #fff;
}

/* Best-selling Stricksets shown before the first query */
.wk-search-overlay-preselection {
  flex: 0 0 auto;
  width: 100%;
  overflow: visible;
  padding: 8px 0 28px;
}

.wk-search-overlay-preselection[hidden] {
  display: none !important;
}

.wk-search-overlay-preselection__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8e8e8;
}

.wk-search-overlay-preselection__head h2 {
  margin: 0;
  color: var(--wk-title);
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 500;
}

.wk-search-overlay-preselection__head a {
  color: var(--wk-title);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid var(--wk-accent);
}

.wk-search-overlay-preselection__head a:hover {
  color: var(--wk-accent);
}

.wk-search-overlay-preselection .products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: clamp(16px, 2vw, 28px);
  margin: 0 !important;
}

.wk-search-overlay-preselection .products > .product-grid-item {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: none !important;
}

/* WK Search widget */
.wk-search-overlay-host:not(.wk-search-overlay-has-results) .wk-search--woodmart-overlay {
  display: none;
}

.wk-search--woodmart-overlay {
  --wk-toolbar-gap: 16px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 0;
  width: 100%;
  max-width: none;
  min-height: auto;
  min-width: 0;
  margin-top: 4px;
  overflow: visible;
}

.wk-search--woodmart-overlay .wk-search-results-heading,
.wk-search--woodmart-overlay .wk-search-image-row,
.wk-search--woodmart-overlay [data-wk-search-inline-styles],
.wk-search--woodmart-overlay .wk-search__layout,
.wk-search--woodmart-overlay .wk-search-load-more,
.wk-search--woodmart-overlay .wk-search-auto-scope-debug {
  grid-column: 1 / -1;
}

.wk-search--woodmart-overlay .wk-search-results-heading {
  display: none;
}

/* Full-width toolbar: Produkte/Inhalte left, Relevanz right, one underline */
.wk-search--woodmart-overlay [data-wk-search-form] {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  width: auto;
  margin: 0 0 14px;
  padding: 0 0 10px var(--wk-toolbar-gap);
  border-bottom: 1px solid #e8e8e8;
  box-sizing: border-box;
}

.wk-search--woodmart-overlay [data-wk-search-form] [data-wk-search-scope],
.wk-search--woodmart-overlay [data-wk-search-form] [data-wk-search-mode],
.wk-search--woodmart-overlay [data-wk-search-form] [data-wk-search-content-type],
.wk-search--woodmart-overlay [data-wk-search-form] .wk-search-query-input--concealed,
.wk-search--woodmart-overlay [data-wk-search-form] .wk-search-primary-query {
  display: none !important;
}

.wk-search--woodmart-overlay [data-wk-search-sort] {
  min-width: 0;
  width: max-content;
  max-width: 180px;
  height: 36px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #e2e2e2;
  border-radius: 0;
  background: #fff;
  color: var(--wk-title);
  font-size: 13px;
  line-height: 34px;
}

.wk-search--woodmart-overlay .wk-search-scope-tabs {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: flex-end;
  gap: 28px;
  width: 100%;
  min-width: 0;
  margin: 0 0 14px;
  padding: 0;
  border-bottom: 1px solid #e8e8e8;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wk-search--woodmart-overlay .wk-search-scope-tab {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  padding: 10px 2px 12px;
  margin: 0;
  color: #a5a5a5;
  background: transparent !important;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0 !important;
  box-shadow: none !important;
  font: inherit;
  font-size: clamp(15px, 1.6vw, 18px);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.wk-search--woodmart-overlay .wk-search-scope-tab:hover {
  color: var(--wk-title);
}

.wk-search--woodmart-overlay .wk-search-scope-tab.is-active {
  color: var(--wk-title);
  background: transparent !important;
  border-bottom-color: var(--wk-accent);
  box-shadow: none !important;
}

.wk-search--woodmart-overlay .wk-search-scope-tab__count {
  margin-left: 6px;
  font-size: 0.85em;
  font-weight: 400;
  color: #9a9a9a;
}

.wk-search--woodmart-overlay .wk-search-scope-tab.is-active .wk-search-scope-tab__count {
  color: var(--wk-muted);
}

/* Full-bleed loading strip directly under the search field (height always reserved) */
.wd-search-full-screen-2.wk-search-overlay-host .wk-search-loading-bar--under-query,
.wk-search--woodmart-overlay .wk-search-loading-bar {
  width: 100%;
  max-width: none;
  height: 3px;
  margin: 0;
  border-radius: 0;
  background: transparent;
}

.wd-search-full-screen-2.wk-search-overlay-host .wk-search-loading-bar--under-query {
  display: block !important;
  flex: 0 0 3px;
}

.wd-search-full-screen-2.wk-search-overlay-host .wk-search-loading-bar--under-query.is-active,
.wk-search--woodmart-overlay .wk-search-loading-bar.is-active {
  background: #efefef;
}

.wd-search-full-screen-2.wk-search-overlay-host .wk-search-loading-bar--under-query .wk-search-loading-bar__indicator,
.wk-search--woodmart-overlay .wk-search-loading-bar__indicator {
  background: var(--wk-accent, #7ab38b);
  border-radius: 0;
}

.wk-search--woodmart-overlay .wk-search__layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
  margin-top: 0;
  padding-bottom: 24px;
}

.wk-search--woodmart-overlay .wk-search__facets {
  width: 240px;
  flex: 0 0 240px;
  position: sticky;
  top: 88px;
  max-height: calc(100dvh - 112px);
  overflow: auto;
}

.wk-search--woodmart-overlay .wk-search__results {
  flex: 1 1 auto;
  min-width: 0;
}

.wk-search--woodmart-overlay.wk-search--no-facets .wk-search__layout {
  display: block;
}

.wk-search--woodmart-overlay .wk-search-result-count,
.wk-search--woodmart-overlay .wd-shop-head[data-wk-search-status] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  font-size: 14px;
  color: var(--wk-muted);
  border: 0;
}

.wk-search--woodmart-overlay .wk-search-facet-title {
  background: #fff;
  border-radius: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wk-title);
}

.wk-search--woodmart-overlay .wk-search-facets-container,
.wk-search--woodmart-overlay .wd-product-filters {
  border-radius: 0;
  border-color: #e8e8e8;
}

.wk-search--woodmart-overlay .wk-search-clear-btn {
  border-radius: 0;
  background: #f7f7f7;
  color: #333;
  font-weight: 600;
}

.wk-search--woodmart-overlay .wk-search-chip {
  border-radius: 0;
  background: var(--wk-chip-bg);
  border-color: var(--wk-chip-border);
}

.wk-search--woodmart-overlay .wk-search-load-more {
  padding: 28px 0 16px;
}

/* Blog / content results use the same card-grid rhythm as products. */
.wk-search--woodmart-overlay .wk-search-content-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}

.wk-search--woodmart-overlay .wk-search-content-card {
  height: 100%;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 0;
}

.wk-search--woodmart-overlay .wk-search-content-card:hover {
  background: #fff;
  border-color: color-mix(in srgb, var(--wk-accent) 55%, #e8e8e8);
}

.wk-search--woodmart-overlay .wk-search-content-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 0;
  padding: 0;
}

.wk-search--woodmart-overlay .wk-search-content-card__media {
  width: 100%;
  aspect-ratio: 4 / 3;
}

.wk-search--woodmart-overlay .wk-search-content-card__media img {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  border-radius: 0;
  object-fit: cover;
}

.wk-search--woodmart-overlay .wk-search-content-card__body {
  flex: 1 1 auto;
  padding: 18px;
}

.wk-search--woodmart-overlay .wk-search-content-card__type {
  color: var(--wk-title);
  background: var(--wk-chip-bg);
  border-color: var(--wk-chip-border);
  border-radius: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wk-search--woodmart-overlay .wk-search-content-card__title {
  color: var(--wk-title);
  font-size: clamp(17px, 1.4vw, 21px);
}

.wk-search--woodmart-overlay .wk-search-content-card__excerpt {
  color: var(--wk-muted);
  font-size: 14px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.wk-search--woodmart-overlay .wk-search-content-card--no-image .wk-search-content-card__link {
  min-height: 230px;
}

.wd-search-full-screen-2.wk-search-overlay-host.wd-opened .wk-search--woodmart-overlay,
.wd-search-full-screen-2.wk-search-overlay-host.wd-searched .wk-search--woodmart-overlay {
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
}

/* Instantly interactive on open — theme entrance animation leaves the field
   visibility:hidden / translated, so mobile taps fall through to the page and
   Woodmart's closer dismisses the overlay. */
.wd-search-full-screen-2.wk-search-overlay-host.wd-opened :is(.searchform, .wd-search-requests, .wd-search-history),
.wd-search-full-screen-2.wk-search-overlay-host.wd-opened .searchform input[type='text'],
.wd-search-full-screen-2.wk-search-overlay-host.wd-opened .searchform input.s {
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  pointer-events: auto !important;
}

@media (max-width: 991px) {
  .wd-search-full-screen-2.wk-search-overlay-host > .container {
    padding-top: 48px;
  }

  .wd-search-full-screen-2.wk-search-overlay-host > .container > .searchform,
  .wd-search-full-screen-2.wk-search-overlay-host .searchform input[type='text'],
  .wd-search-full-screen-2.wk-search-overlay-host .searchform input.s {
    pointer-events: auto !important;
  }

  .wd-search-full-screen-2.wk-search-overlay-host .searchform input[type='text'],
  .wd-search-full-screen-2.wk-search-overlay-host .searchform input.s {
    position: relative;
    z-index: 1;
    touch-action: manipulation;
    -webkit-user-select: text;
    user-select: text;
  }

  .wk-search--woodmart-overlay .wk-search__layout {
    flex-direction: column;
    gap: 16px;
  }

  .wk-search--woodmart-overlay .wk-search__facets {
    width: 100%;
    flex: 0 0 auto;
    position: static;
    max-height: none;
    order: -1;
  }

  .wk-search--woodmart-overlay .wk-search-scope-tabs {
    gap: 18px;
  }

  .wk-search--woodmart-overlay [data-wk-search-sort] {
    min-width: 108px;
    max-width: 132px;
    height: 34px;
    font-size: 12px;
    padding: 0 8px;
  }

  .wk-search--woodmart-overlay .wk-search-scope-tab {
    font-size: 14px;
    padding: 8px 2px 10px;
  }

  .wk-search--woodmart-overlay .wk-search-content-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .wd-search-full-screen-2.wk-search-overlay-host {
    --wk-overlay-pad-x: 16px;
  }

  .wd-search-full-screen-2.wk-search-overlay-host .searchform input[type='text'],
  .wd-search-full-screen-2.wk-search-overlay-host .searchform input.s {
    font-size: 22px;
    min-height: 44px;
  }

  .wd-search-full-screen-2.wk-search-overlay-host .wd-close-search.wd-style-icon {
    --wd-action-icon-size: 22px;
    top: 8px;
    inset-inline-end: 8px;
  }

  .wk-search--woodmart-overlay .wk-search-content-results {
    grid-template-columns: 1fr;
  }

  .wk-search-overlay-preselection .products {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 576px) and (max-width: 991px) {
  .wk-search-overlay-preselection .products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
