/* Search overlay v2 – panel layout. Everything is scoped to .swcs-v2. */
.swcs-search-overlay.swcs-v2 {
  --s2-teal: #257b7b;
  --s2-orange: #f18631;
  --s2-text: #111;
  --s2-muted: #6b7280;
  --s2-line: #e6e8e8;
  --s2-chip: #f1f3f3;
  left: 0;
  right: 0;
  transform: none;
  max-width: none;
  background: rgba(0, 0, 0, .45);
  padding: 60px 16px;
  box-sizing: border-box;
  overflow: hidden;
  align-items: center;
  justify-content: flex-start;
  font-family: CustomContentFont, sans-serif;
  color: var(--s2-text);
}

.swcs-v2 .swcs2-panel {
  width: 100%;
  max-width: 880px;
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: #fff;
  border-radius: 5px;
  padding: 22px 26px 26px;
  box-sizing: border-box;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .18);
}

/* Search field */
.swcs-v2 .swcs-search-sticky { position: sticky; top: -22px; margin: -22px -26px 0; padding: 22px 26px 0; width: auto; background: #fff; z-index: 5; }
.swcs-v2 .swcs-search-bar {
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: 0;
  gap: 10px;
}
.swcs-v2 .swcs2-field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--s2-teal);
  pointer-events: none;
}
.swcs-v2 #swcs_search_input {
  flex: 1;
  width: auto;
  min-width: 0;
  height: 52px;
  padding: 0 14px 0 46px;
  font: inherit;
  font-size: 17px;
  color: var(--s2-text);
  background: #fff;
  border: 1.5px solid var(--s2-teal);
  border-radius: 5px;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}
.swcs-v2 #swcs_search_input::placeholder { color: #8a8f94; }
.swcs-v2 #swcs_search_input:focus { box-shadow: 0 0 0 3px rgba(37, 123, 123, .15); }
.swcs-v2 .swcs-search-close {
  position: static;
  transform: none;
  flex: none;
  width: 44px;
  height: 44px;
  color: var(--s2-text);
  background: transparent;
  border-radius: 5px;
}
.swcs-v2 .swcs-search-close:hover { background: var(--s2-chip); color: var(--s2-text); }

/* Labels */
.swcs-v2 .swcs2-label {
  font-size: 13px !important;
  font-weight: 500;
  color: var(--s2-muted);
  margin: 22px 0 10px !important;
  padding: 0;
  text-align: left;
}
.swcs-v2 .swcs2-label--row { display: flex; justify-content: space-between; align-items: baseline; }
.swcs-v2 .swcs2-label a { color: var(--s2-teal); text-decoration: none; }
.swcs-v2 .swcs2-label a:hover { text-decoration: underline; }

/* Popular searches */
.swcs-v2 .swcs-popular-searches { padding: 0; border: 0; text-align: left; background: transparent; }
.swcs-v2 .swcs-popular-searches-list { justify-content: flex-start; gap: 8px; }
.swcs-v2 .swcs-popular-search {
  padding: 8px 16px;
  font-size: 14px;
  color: #1d2b2b;
  background: var(--s2-chip);
  border: 1px solid #e2e6e6;
  border-radius: 5px;
}
.swcs-v2 .swcs-popular-search:hover { background: var(--s2-teal); border-color: var(--s2-teal); color: #fff; }

/* Brands */
.swcs-v2 .swcs2-brands { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.swcs-v2 .swcs2-brand {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--s2-line);
  border-radius: 5px;
  cursor: pointer;
  padding: 0 8px;
  transition: border-color .15s;
}
.swcs-v2 .swcs2-brand img { width: auto; max-width: 80%; filter: brightness(0); opacity: .85; transition: opacity .15s; }
.swcs-v2 .swcs2-brand:hover { border-color: var(--s2-teal); }
.swcs-v2 .swcs2-brand:hover img { opacity: 1; }

/* Results area */
.swcs-v2 .swcs-search-results { display: block; padding: 0; background: transparent; }
.swcs-v2 .swcs-category-chips { padding: 14px 0; margin: 0; justify-content: flex-start; border-bottom: 1px solid var(--s2-line); }
.swcs-v2 #swcs_sorting_controls.is-visible { padding: 12px 0 14px 6px; margin: 0; gap: 10px; background: #fff; border: 0; border-bottom: 1px solid var(--s2-line); }
.swcs-v2 .swcs-sort-label { margin: 0; font-size: 14px; color: var(--s2-muted); }
.swcs-v2 .swcs-sort-select { height: 38px; padding: 0 10px; border: 1px solid var(--s2-line); border-radius: 5px; background: #fff; font: inherit; font-size: 14px; color: var(--s2-text); }
.swcs-v2 .swcs-search-results > .swcs2-label:first-child { margin-top: 18px !important; }

/* Product grid + cards (match the site's product cards) */
.swcs-v2 .swcs2-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.swcs-v2 .swcs2-card {
  display: flex;
  flex-direction: column;
  width: auto !important;
  margin: 0 !important;
  background: #fff;
  border-radius: 5px;
  overflow: hidden;
  color: #000;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 4px 6px rgba(0, 0, 0, .08);
  transition: transform .15s;
}
.swcs-v2 .swcs2-card:hover { transform: translateY(-2px); }
.swcs-v2 .swcs2-img { position: relative; display: block; aspect-ratio: 5 / 6; background: #fff; }
.swcs-v2 .swcs2-img img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 5px; }
.swcs-v2 .swcs2-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--s2-orange);
  color: #fff;
  font-family: CustomHeadingFont, sans-serif;
  font-size: 15px;
  font-style: italic;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
}
.swcs-v2 .swcs2-stock {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: #111;
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 3px;
}
.swcs-v2 .swcs2-title { display: block; flex: 1; font-size: 15px; line-height: 1.3; padding: 10px 12px 0; }
.swcs-v2 .swcs2-stars { display: block; padding: 6px 12px 0; color: var(--s2-teal); font-size: 19px; line-height: 1; letter-spacing: 2px; }
.swcs-v2 .swcs2-price {
  display: block;
  padding: 10px 12px 14px;
  font-family: CustomHeadingFont, sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: #212121;
}
.swcs-v2 .swcs2-price { direction: ltr !important; text-align: left !important; }
.swcs-v2 .swcs2-price del { margin-right: 4px; display: inline-block; font-family: CustomContentFont, sans-serif; font-weight: 800; color: #212121; opacity: .7; }
.swcs-v2 .swcs2-price ins { display: inline-block; text-decoration: none; color: var(--s2-orange); font-weight: 700; }
.swcs-v2 .swcs2-price .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Load more */
.swcs-v2 .swcs2-more { text-align: center; margin-top: 22px; }
.swcs-v2 .swcs2-prog { font-size: 13px; color: var(--s2-muted); margin: 0 0 8px; }
.swcs-v2 .swcs2-bar { width: 200px; max-width: 60%; height: 3px; background: var(--s2-line); margin: 0 auto 14px; border-radius: 5px; overflow: hidden; }
.swcs-v2 .swcs2-bar span { display: block; height: 100%; background: var(--s2-teal); }
.swcs-v2 .swcs2-load-more {
  background: var(--s2-teal);
  color: #fff;
  border: 0;
  border-radius: 5px;
  padding: 13px 22px;
  font-family: CustomHeadingFont, sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.swcs-v2 .swcs2-load-more:disabled { opacity: .7; cursor: default; }
.swcs-v2 .swcs2-empty { color: var(--s2-muted); text-align: center; padding: 30px 0; }

.swcs-v2 button:focus-visible,
.swcs-v2 a:focus-visible { outline: 2px solid var(--s2-teal); outline-offset: 2px; }

@media (max-width: 700px) {
  .swcs-search-overlay.swcs-v2 { padding: 0; }
  .swcs-v2 .swcs2-panel { max-width: none; max-height: none; height: 100%; border-radius: 0; padding: 14px 16px 24px; }
  .swcs-v2 .swcs-search-sticky { top: -14px; margin: -14px -16px 0; padding: 14px 16px 4px; }
  .swcs-v2 .swcs2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .swcs-v2 .swcs2-brands { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Compact sticky header: chips in one swipeable row, sorting on one short line */
  .swcs-v2 .swcs-category-chips {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 10px 16px !important;
    margin: 0 -16px !important;
    gap: 6px;
  }
  .swcs-v2 .swcs-category-chips::-webkit-scrollbar { display: none; }
  .swcs-v2 .swcs-category-chip { flex: none; white-space: nowrap; padding: 6px 12px; font-size: 13px; }
  .swcs-v2 #swcs_sorting_controls.is-visible {
    flex-direction: row !important;
    align-items: center;
    padding: 8px 0 10px !important;
    background: #fff !important;
    border-bottom: 1px solid var(--s2-line) !important;
  }
  .swcs-v2 .swcs-sort-label { font-size: 13px; white-space: nowrap; }
  .swcs-v2 .swcs-sort-select { flex: 1; width: auto !important; height: 34px; font-size: 13px; }
  .swcs-v2 .swcs-search-results > .swcs2-label:first-child { margin-top: 12px !important; }
  .swcs-v2 #swcs_search_input { height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .swcs-v2 .swcs2-card, .swcs-v2 .swcs2-brand { transition: none; }
}

/* Touch screens: no hover effects (they stick after a tap) */
@media (hover: none) {
  .swcs-v2 .swcs2-card:hover { transform: none; }
  .swcs-v2 .swcs2-brand:hover { border-color: var(--s2-line); }
  .swcs-v2 .swcs2-brand:hover img { opacity: .85; }
  .swcs-v2 .swcs-popular-search:hover { background: var(--s2-chip); border-color: #e2e6e6; color: #1d2b2b; }
  .swcs-v2 .swcs-search-close:hover { background: transparent; }
  .swcs-v2 .swcs2-label a:hover { text-decoration: none; }
  .swcs-v2 a, .swcs-v2 button { -webkit-tap-highlight-color: transparent; }
}

/* Own clear button inside the field (the native one only shows on hover) */
.swcs-v2 #swcs_search_input { padding-right: 46px; }
.swcs-v2 #swcs_search_input::-webkit-search-cancel-button,
.swcs-v2 #swcs_search_input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.swcs-v2 .swcs2-clear {
  position: absolute;
  right: 64px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--s2-chip);
  color: #444;
  cursor: pointer;
}
.swcs-v2 .swcs2-clear[hidden] { display: none; }
@media (hover: hover) { .swcs-v2 .swcs2-clear:hover { background: #e2e6e6; color: #111; } }
