/**
 * Smart Finder - fenêtre de recherche instantanée.
 * Toutes les règles sont préfixées .sf- pour ne pas interférer avec le thème.
 */
.sf-layer {
  --sf-accent: #2f6fde;
  --sf-text: #1f2933;
  --sf-muted: #6b7785;
  --sf-line: #e3e7ec;
  --sf-bg: #f5f7f9;
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2147483000;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  color: #1f2933;
  color: var(--sf-text);
  text-align: left;
  -webkit-text-size-adjust: 100%;
}

.sf-layer.sf-visible {
  display: block;
}

.sf-layer *,
.sf-layer *::before,
.sf-layer *::after {
  box-sizing: border-box;
}

.sf-layer [hidden] {
  display: none !important;
}

html.sf-lock,
html.sf-lock body {
  overflow: hidden !important;
}

/* l'autocomplétion native du thème ferait doublon pendant que la fenêtre est ouverte */
html.sf-lock .ui-autocomplete,
html.sf-lock .searchbar-autocomplete {
  display: none !important;
}

.sf-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(17, 24, 39, 0.55);
}

.sf-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  max-width: 1320px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

@media (min-width: 1360px) {
  .sf-panel {
    top: 20px;
    bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
  }
}

/* ------------------------------------------------------------------ en-tête */
.sf-head {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 14px 20px;
  border-bottom: 1px solid #e3e7ec;
  border-bottom: 1px solid var(--sf-line);
  background: #fff;
}

.sf-inputwrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.sf-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  display: flex;
  margin-top: -11px;
  color: #6b7785;
  color: var(--sf-muted);
  pointer-events: none;
}

.sf-layer .sf-input {
  display: block;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 46px 0 46px;
  border: 2px solid #e3e7ec;
  border: 2px solid var(--sf-line);
  border-radius: 8px;
  outline: none;
  background: #fff;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-size: 17px;
  -webkit-appearance: none;
  appearance: none;
}

.sf-layer .sf-input:focus {
  border-color: #2f6fde;
  border-color: var(--sf-accent);
}

.sf-layer .sf-input::-ms-clear {
  display: none;
}

.sf-layer button {
  font: inherit;
  cursor: pointer;
}

.sf-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: -17px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6b7785;
  color: var(--sf-muted);
}

.sf-clear:hover {
  background: #f5f7f9;
  background: var(--sf-bg);
}

.sf-close {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  height: 48px;
  margin: 0 0 0 12px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
}

.sf-close span {
  margin-right: 6px;
  font-size: 14px;
}

.sf-close:hover {
  background: #f5f7f9;
  background: var(--sf-bg);
}

.sf-progress {
  position: relative;
  flex: 0 0 auto;
  height: 3px;
  margin-top: -3px;
  overflow: hidden;
  background: transparent;
}

.sf-progress::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 40%;
  background: #2f6fde;
  background: var(--sf-accent);
  animation: sf-slide 0.9s linear infinite;
}

@keyframes sf-slide {
  to {
    left: 100%;
  }
}

/* -------------------------------------------------------------------- corps */
.sf-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.sf-side {
  flex: 0 0 260px;
  width: 260px;
  padding: 18px 16px 24px 20px;
  overflow-y: auto;
  border-right: 1px solid #e3e7ec;
  border-right: 1px solid var(--sf-line);
  background: #f5f7f9;
  background: var(--sf-bg);
  -webkit-overflow-scrolling: touch;
}

.sf-no-facets .sf-side {
  display: none;
}

.sf-side-head,
.sf-side-foot {
  display: none;
}

.sf-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 16px 20px 40px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sf-count {
  color: #6b7785;
  color: var(--sf-muted);
}

.sf-count strong {
  color: #1f2933;
  color: var(--sf-text);
}

.sf-tools {
  display: flex;
  align-items: center;
}

.sf-sortwrap {
  display: flex;
  align-items: center;
  margin: 0;
  color: #6b7785;
  color: var(--sf-muted);
  font-size: 14px;
  font-weight: normal;
}

.sf-sortwrap span {
  margin-right: 6px;
}

.sf-layer .sf-sort {
  width: auto;
  height: 36px;
  margin: 0;
  padding: 0 28px 0 10px;
  border: 1px solid #e3e7ec;
  border: 1px solid var(--sf-line);
  border-radius: 6px;
  background-color: #fff;
  color: #1f2933;
  color: var(--sf-text);
  font: inherit;
  font-size: 14px;
}

.sf-filter-toggle {
  display: none;
  align-items: center;
  height: 36px;
  margin-right: 8px;
  padding: 0 12px;
  border: 1px solid #e3e7ec;
  border: 1px solid var(--sf-line);
  border-radius: 6px;
  background: #fff;
  color: inherit;
  font-size: 14px;
}

.sf-filter-toggle span {
  margin-left: 6px;
}

.sf-filter-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 9px;
  background: #2f6fde;
  background: var(--sf-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.sf-notice {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 6px;
  background: #f5f7f9;
  background: var(--sf-bg);
  color: #1f2933;
  color: var(--sf-text);
}

.sf-notice-error {
  background: #fdecea;
  color: #8a1f11;
}

/* ------------------------------------------------------------------ grille */
.sf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  grid-gap: 14px;
  gap: 14px;
}

.sf-layer a.sf-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e3e7ec;
  border: 1px solid var(--sf-line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.sf-layer a.sf-card:hover,
.sf-layer a.sf-card:focus {
  border-color: #2f6fde;
  border-color: var(--sf-accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  outline: none;
  text-decoration: none;
}

.sf-card-pinned {
  border-color: #2f6fde !important;
  border-color: var(--sf-accent) !important;
}

.sf-thumb {
  position: relative;
  display: block;
  padding-top: 82%;
  background: #fff;
}

.sf-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sf-flag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 7px;
  border-radius: 4px;
  background: #d92d20;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.sf-info {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 10px 12px 12px;
  border-top: 1px solid #e3e7ec;
  border-top: 1px solid var(--sf-line);
}

.sf-brand {
  margin-bottom: 2px;
  color: #6b7785;
  color: var(--sf-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sf-name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.sf-layer mark {
  padding: 0;
  background: rgba(255, 214, 10, 0.45);
  color: inherit;
}

.sf-ref {
  margin-top: 3px;
  color: #6b7785;
  color: var(--sf-muted);
  font-size: 12px;
}

.sf-price {
  margin-top: auto;
  padding-top: 8px;
  font-size: 16px;
}

.sf-price b {
  font-weight: 700;
}

.sf-price s {
  margin-right: 4px;
  color: #6b7785;
  color: var(--sf-muted);
  font-size: 13px;
}

.sf-stock {
  margin-top: 4px;
  font-size: 12px;
}

.sf-stock::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  vertical-align: 1px;
}

.sf-stock-in {
  color: #1a7f4b;
}

.sf-stock-in::before {
  background: #1a7f4b;
}

.sf-stock-out {
  color: #8a94a0;
}

.sf-stock-out::before {
  background: #b6bec8;
}

.sf-more {
  margin-top: 22px;
  text-align: center;
}

.sf-btn {
  min-height: 42px;
  padding: 0 22px;
  border: 0;
  border-radius: 6px;
  background: #2f6fde;
  background: var(--sf-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.sf-btn:hover {
  opacity: 0.92;
}

.sf-link {
  padding: 0;
  border: 0;
  background: none;
  color: #2f6fde;
  color: var(--sf-accent);
  font-size: 13px;
  text-decoration: underline;
}

/* ----------------------------------------------------------------- filtres */
.sf-facets .sf-reset {
  margin-bottom: 12px;
}

.sf-layer fieldset.sf-facet {
  min-width: 0;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.sf-layer .sf-facet legend {
  float: none;
  width: auto;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  color: #1f2933;
  color: var(--sf-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sf-layer label.sf-check {
  display: flex;
  align-items: flex-start;
  margin: 0;
  padding: 5px 0;
  color: inherit;
  font-size: 14px;
  font-weight: normal;
  text-align: left;
  cursor: pointer;
}

.sf-layer .sf-check input {
  position: static;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 2px 8px 0 0;
  opacity: 1;
  accent-color: #2f6fde;
  accent-color: var(--sf-accent);
  -webkit-appearance: auto;
  appearance: auto;
}

.sf-check-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sf-check-count {
  flex: 0 0 auto;
  margin-left: 8px;
  color: #6b7785;
  color: var(--sf-muted);
  font-size: 12px;
}

.sf-check-empty {
  opacity: 0.5;
}

/* -------------------------------------------------- fenêtre sans recherche */
.sf-empty {
  grid-column: 1 / -1;
  max-width: 720px;
  padding: 10px 0;
}

.sf-empty-hint {
  margin: 0 0 18px;
  color: #6b7785;
  color: var(--sf-muted);
}

.sf-suggest {
  margin-bottom: 20px;
}

.sf-layer .sf-suggest h3 {
  margin: 0 0 10px;
  color: #1f2933;
  color: var(--sf-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sf-chips {
  display: flex;
  flex-wrap: wrap;
  margin: -4px;
}

.sf-chip {
  margin: 4px;
  padding: 7px 14px;
  border: 1px solid #e3e7ec;
  border: 1px solid var(--sf-line);
  border-radius: 18px;
  background: #fff;
  color: inherit;
  font-size: 14px;
}

.sf-chip:hover {
  border-color: #2f6fde;
  border-color: var(--sf-accent);
  color: #2f6fde;
  color: var(--sf-accent);
}

/* ------------------------------------------------------------------ mobile */
@media (max-width: 860px) {
  .sf-head {
    padding: 10px 12px;
  }

  .sf-close {
    margin-left: 4px;
    padding: 0 8px;
  }

  .sf-close span {
    display: none;
  }

  .sf-main {
    padding: 12px 12px 40px;
  }

  .sf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-gap: 10px;
    gap: 10px;
  }

  .sf-filter-toggle {
    display: flex;
  }

  .sf-no-facets .sf-filter-toggle {
    display: none;
  }

  .sf-sortwrap span {
    display: none;
  }

  .sf-side {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    display: none;
    flex-direction: column;
    width: 86%;
    max-width: 340px;
    padding: 0;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.25);
  }

  .sf-side.sf-side-open {
    display: flex;
  }

  .sf-no-facets .sf-side.sf-side-open {
    display: none;
  }

  .sf-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    padding: 12px 12px 12px 16px;
    border-bottom: 1px solid #e3e7ec;
    border-bottom: 1px solid var(--sf-line);
    background: #fff;
  }

  .sf-side-close {
    display: flex;
    padding: 6px;
    border: 0;
    background: none;
    color: inherit;
  }

  .sf-facets {
    flex: 1 1 auto;
    padding: 16px;
    overflow-y: auto;
  }

  .sf-side-foot {
    display: block;
    flex: 0 0 auto;
    padding: 12px 16px;
    border-top: 1px solid #e3e7ec;
    border-top: 1px solid var(--sf-line);
    background: #fff;
  }

  .sf-side-foot .sf-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sf-progress::before {
    animation: none;
    left: 0;
    width: 100%;
    opacity: 0.4;
  }

  .sf-layer a.sf-card {
    transition: none;
  }
}
