/* =========================================================
   RW Search Pro — front v2
   Palette : bleu #3492f4 · navy #123a63 · corail #e89586
   ========================================================= */
.rwsp { position: relative; width: 100%; max-width: 560px; }
.rwsp * { box-sizing: border-box; }

/* Barre */
.rwsp__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 14px;
  background: #fff;
  border: 1.5px solid #e6ecf3;
  border-radius: 999px;
  transition: border-color .18s, box-shadow .18s;
}
.rwsp--open .rwsp__bar,
.rwsp__bar:focus-within { border-color: #3492f4; box-shadow: 0 0 0 4px rgba(52,146,244,.14); }
.rwsp__icon { width: 20px; height: 20px; color: #8a98a8; flex: none; }
.rwsp__input[class] {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 15px; color: #111a28;
}
.rwsp__input[class]::placeholder { color: #9aa7b4; }
.rwsp__clear {
  width: 26px; height: 26px; flex: none; border: 0; border-radius: 50%;
  background: #f0f3f7; color: #5b6b7c; display: grid; place-items: center; cursor: pointer;
}
.rwsp__clear svg { width: 15px; height: 15px; }
.rwsp__clear:hover { background: #e6ecf3; color: #123a63; }

/* Panneau */
.rwsp__panel {
  position: absolute; z-index: 1200; top: calc(100% + 10px); left: 0; right: 0;
  max-height: min(70vh, 560px); overflow-y: auto;
  background: #fff; border: 1px solid #e6ecf3; border-radius: 18px;
  box-shadow: 0 30px 70px -28px rgba(18,58,99,.5);
  padding: 8px; scrollbar-width: thin;
}
.rwsp__overlay { display: none; }

/* Sections */
.rwsp-sec { padding: 8px 6px; }
.rwsp-sec + .rwsp-sec { border-top: 1px solid #f0f3f7; }
.rwsp-sec__head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: #8a98a8; padding: 6px 8px;
}
.rwsp-sec__clear { border: 0; background: none; color: #3492f4; font-size: 11px; font-weight: 700; cursor: pointer; text-transform: none; letter-spacing: 0; }

/* Chips (récentes / populaires) */
.rwsp-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 6px; }
.rwsp-chip[class] {
    border: 1px solid #e6ecf3;
    background: #f7fafd;
    color: #123a63;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: .15s;
}
.rwsp-chip:hover, .rwsp-chip.is-active { border-color: #3492f4; color: #3492f4; background: #eef5fe; }

/* Cartes produit */
.rwsp-cards { display: flex; flex-direction: column; }
.rwsp-card {
  display: flex; align-items: center; gap: 14px; padding: 10px 8px; border-radius: 12px;
  text-decoration: none; color: inherit; transition: background .12s;
}
.rwsp-card:hover, .rwsp-card.is-active { background: #f5f8fd; }
.rwsp-card__img {
  width: 56px; height: 56px; flex: none; border-radius: 10px; overflow: hidden;
  background: #f0f3f7; display: grid; place-items: center;
}
.rwsp-card__img img { width: 100%; height: 100%; object-fit: cover; }
.rwsp-card__img--ph { background: repeating-linear-gradient(45deg,#f0f3f7,#f0f3f7 6px,#e9eef4 6px,#e9eef4 12px); }
.rwsp-card__body { min-width: 0; flex: 1; }
.rwsp-card__name { display: block; font-size: 14px; font-weight: 600; color: #111a28; line-height: 1.3; }
.rwsp-card__name mark { background: #fff2c4; color: inherit; padding: 0 1px; border-radius: 2px; }
.rwsp-card__meta { display: block; font-size: 12px; color: #8a98a8; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rwsp-card__foot { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.rwsp-card__price { font-size: 14px; color: #123a63; }
.rwsp-card__price del { color: #b0bac6; font-weight: 500; margin-right: 4px; font-size: 12px; }
.rwsp-card__price b { font-weight: 700; }
.rwsp-card__stock { font-size: 11px; font-weight: 700; }
.rwsp-card__stock.is-in { color: #2f8f5b; }
.rwsp-card__stock.is-out { color: #c0553f; }

/* Liens entités (catégories / marques / pages / FAQ) */
.rwsp-links { display: flex; flex-direction: column; }
.rwsp-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 12px;
  text-decoration: none; color: #123a63; font-size: 14px; font-weight: 600; transition: background .12s;
}
.rwsp-link:hover, .rwsp-link.is-active { background: #f5f8fd; }
.rwsp-link__img { width: 36px; height: 36px; flex: none; border-radius: 8px; overflow: hidden; background: #f0f3f7; }
.rwsp-link__img img { width: 100%; height: 100%; object-fit: cover; }
.rwsp-link__label { flex: 1; min-width: 0; }
.rwsp-link__label mark { background: #fff2c4; color: inherit; padding: 0 1px; border-radius: 2px; }
.rwsp-link__arrow { width: 16px; height: 16px; color: #b0bac6; flex: none; }

/* Voir tout */
.rwsp-viewall {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 6px 4px 2px; padding: 12px; border-radius: 12px;
  background: #123a63; color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; transition: background .15s;
}
.rwsp-viewall:hover, .rwsp-viewall.is-active { background: #0d2b49; color: #fff; }
.rwsp-viewall svg { width: 16px; height: 16px; }

/* Bannière de redirection (merchandising) */
.rwsp-redirect {
  display: flex; align-items: center; gap: 10px; margin: 4px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(135deg,#eef5fe,#f7fbff); border: 1px solid #dbe9fb;
  color: #123a63; font-size: 14px; font-weight: 700; text-decoration: none;
}
.rwsp-redirect:hover, .rwsp-redirect.is-active { border-color: #3492f4; color: #3492f4; }
.rwsp-redirect svg { width: 18px; height: 18px; flex: none; }

/* Vouliez-vous dire */
.rwsp-dym { padding: 12px 12px 4px; font-size: 13px; color: #5b6b7c; }
.rwsp-dym__link { border: 0; background: none; color: #3492f4; font-weight: 700; cursor: pointer; font-size: 13px; }
.rwsp-dym__link:hover { text-decoration: underline; }

/* 0 résultat */
.rwsp-empty { padding: 18px 12px 6px; text-align: center; }
.rwsp-empty__title { font-size: 15px; font-weight: 700; color: #111a28; margin: 0 0 4px; }
.rwsp-empty__sub { font-size: 13px; color: #8a98a8; margin: 0; }

/* =========================================================
   Page de résultats (contrôleur results)
   ========================================================= */
.rwsp-res { max-width: 1240px; margin: 0 auto; padding: 20px 0 40px; }
.rwsp-res__head { margin-bottom: 20px; }
.rwsp-res__title { font-size: 26px; font-weight: 700; color: #123a63; margin: 0 0 4px; }
.rwsp-res__count { color: #8a98a8; font-size: 14px; margin: 0; }
.rwsp-res__dym { font-size: 14px; color: #5b6b7c; margin-top: 6px; }
.rwsp-res__dym a { color: #3492f4; font-weight: 700; }

.rwsp-res__tools { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; padding: 14px 16px; background: #f7fafd; border: 1px solid #e6ecf3; border-radius: 12px; }
.rwsp-res__tool { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #5b6b7c; font-weight: 600; }
.rwsp-res__tool select { border: 1px solid #e6ecf3; border-radius: 8px; padding: 8px 10px; background: #fff; font-size: 14px; }

.rwsp-res__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.rwsp-res__card { border: 1px solid #eef2f6; border-radius: 14px; overflow: hidden; background: #fff; display: flex; flex-direction: column; transition: box-shadow .18s, transform .18s; }
.rwsp-res__card:hover { box-shadow: 0 18px 40px -24px rgba(18,58,99,.5); transform: translateY(-2px); }
.rwsp-res__imgwrap { position: relative; display: block; aspect-ratio: 1/1; background: #f5f8fd; }
.rwsp-res__imgwrap img { width: 100%; height: 100%; object-fit: cover; }
.rwsp-res__badge { position: absolute; top: 10px; left: 10px; background: #e89586; color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.rwsp-res__body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.rwsp-res__cat { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #8a98a8; font-weight: 700; }
.rwsp-res__name { font-size: 14px; font-weight: 600; color: #111a28; text-decoration: none; line-height: 1.35; }
.rwsp-res__name:hover { color: #3492f4; }
.rwsp-res__price { margin-top: auto; font-size: 16px; color: #123a63; }
.rwsp-res__price del { color: #b0bac6; font-weight: 500; font-size: 13px; margin-right: 6px; }
.rwsp-res__price b { font-weight: 700; }
.rwsp-res__oos { font-size: 11px; font-weight: 700; color: #c0553f; }
.rwsp-res__empty { padding: 50px 20px; text-align: center; color: #8a98a8; }

.rwsp-res__pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 30px; }
.rwsp-res__pg { min-width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid #e6ecf3; border-radius: 9px; color: #123a63; text-decoration: none; font-weight: 600; padding: 0 8px; }
.rwsp-res__pg:hover { border-color: #3492f4; color: #3492f4; }
.rwsp-res__pg.is-active { background: #123a63; border-color: #123a63; color: #fff; }

/* ===== Mobile : plein écran ===== */
@media (max-width: 767px) {
  .rwsp__overlay { position: fixed; inset: 0; z-index: 1190; background: rgba(9,16,28,.45); display: block; }
  .rwsp--open {
    position: fixed; inset: 0; z-index: 1200; max-width: none; margin: 0;
    background: #fff; padding: 12px; display: flex; flex-direction: column;
  }
  .rwsp--open .rwsp__panel {
    position: static; margin-top: 12px; max-height: none; flex: 1; border: 0; box-shadow: none; border-radius: 0; padding: 0;
  }
  body.rwsp-lock { overflow: hidden; }
}
