/* =========================================================
   wassla.ma — recherche : champ de la barre bleue, suggestions, recherche plein écran (mobile), page /recherche/
   ========================================================= */

/* ---------- Champ de la barre bleue (ordinateur) ---------- */
.wsearch { position: relative; }
.wsearch--bar { flex: 1 1 auto; min-width: 220px; max-width: 460px; margin: 0 6px; }
.wsearch--bar .wsearch__input {
    width: 100%; height: 23px; padding: 0 34px 0 12px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px;
    background: #fff; color: #331e1e; font: 500 13.5px/1 "Karla", Arial, sans-serif; outline: none;
    transition: background .15s, border-color .15s;
}
/* Fond blanc : texte d'aide gris et loupe bleue pour rester visibles */
.wsearch--bar .wsearch__input::placeholder { color: #7b8794; }
.wsearch--bar .wsearch__input:focus { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.45); }
.wsearch--bar .wsearch__input::-webkit-search-cancel-button { display: none; }
.wsearch--bar .wsearch__btn {
    position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: grid; place-items: center;
    width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #194ba1; cursor: pointer;
}

/* ---------- Liste de suggestions ---------- */
.wsearch__panel {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 2147483000; width: min(440px, 92vw); max-height: min(70vh, 560px); overflow-y: auto;
    padding: 6px; border: 1px solid #e3e9f0; border-radius: 12px; background: #fff; box-shadow: 0 18px 44px rgba(11,44,74,.18);
    text-align: left; font-family: "Karla", Arial, sans-serif;
}
.wsearch__group { margin: 8px 10px 4px; color: #64748b; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.wsearch__opt { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; color: #1d2733; text-decoration: none; }
.wsearch__opt:hover, .wsearch__opt.is-active { background: #eef4fb; }
.wsearch__logo { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border: 1px solid #eef1f4; border-radius: 8px; background: #fff; overflow: hidden; }
.wsearch__logo img { width: 34px; height: 34px; object-fit: contain; }
.wsearch__initial { color: #194ba1; font-weight: 800; }
.wsearch__txt { display: flex; flex-direction: column; min-width: 0; }
.wsearch__name { overflow: hidden; font-size: 14.5px; font-weight: 700; line-height: 1.3; text-overflow: ellipsis; }
.wsearch__name mark { padding: 0; background: #fff2b3; color: inherit; }
.wsearch__meta { color: #64748b; font-size: 12.5px; line-height: 1.35; }
.wsearch__opt--cat .wsearch__txt { padding-left: 4px; border-left: 3px solid #d7e4f5; }
.wsearch__all { justify-content: center; margin-top: 6px; border-top: 1px solid #eef1f4; border-radius: 0 0 8px 8px; color: #194ba1; font-size: 14px; font-weight: 700; }
.wsearch__empty { margin: 10px; color: #475569; font-size: 14px; line-height: 1.5; }

/* ---------- Mobile : loupe et recherche plein écran ---------- */
.mnav-search {
    display: grid; place-items: center; width: 42px; height: 42px; margin-left: auto; margin-right: 6px; padding: 0;
    border: 0; border-radius: 10px; background: transparent; color: #14263d; cursor: pointer;
}
.mnav-search:focus-visible { outline: 3px solid #194ba1; outline-offset: 2px; }
.msearch { position: fixed; inset: 0; z-index: 2147483600; display: flex; flex-direction: column; padding: 14px 16px; background: #fff; overflow-y: auto; }
.msearch[hidden] { display: none; }
.msearch__head { display: flex; gap: 10px; align-items: center; }
.wsearch--full { display: flex; flex-direction: column; gap: 10px; }
.wsearch--full .wsearch__input {
    flex: 1; min-width: 0; height: 46px; padding: 0 14px; border: 2px solid #194ba1; border-radius: 10px;
    color: #14263d; font: 600 16px/1 "Karla", Arial, sans-serif; outline: none;
}
.msearch__close { flex: none; width: 42px; height: 42px; border: 0; border-radius: 10px; background: #eef1f4; color: #14263d; font-size: 26px; line-height: 1; cursor: pointer; }
.wsearch--full .wsearch__panel { position: static; width: auto; max-height: none; border: 0; box-shadow: none; padding: 0; }
.msearch__submit { height: 46px; border: 0; border-radius: 10px; background: #194ba1; color: #fff; font: 700 15px/1 "Karla", Arial, sans-serif; cursor: pointer; }
html.msearch-open, html.msearch-open body { overflow: hidden; }

/* ---------- Page /recherche/ ---------- */
.search-wrap { padding-top: 10px; }
.search-form__bar { display: flex; gap: 10px; max-width: 760px; margin: 0 0 22px; }
.search-form__input {
    flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 1px solid #cfd8e3; border-radius: 10px;
    color: #14263d; font: 500 16px/1 "Karla", Arial, sans-serif;
}
.search-form__input:focus { border-color: #194ba1; outline: 3px solid color-mix(in srgb, #194ba1 22%, transparent); }
.search-form__submit { flex: none; height: 48px; padding: 0 22px; border: 0; border-radius: 10px; background: #194ba1; color: #fff; font: 700 15px/1 "Karla", Arial, sans-serif; cursor: pointer; }

.search-filters { padding: 18px; border: 1px solid #e3e9f0; border-radius: 14px; background: #f7f9fb; }
.search-filters__title { margin: 0 0 12px; color: #14263d; font-size: 16px; font-weight: 700; }
.search-filters label, .search-filters legend { display: block; margin: 12px 0 5px; color: #334155; font-size: 13.5px; font-weight: 700; }
.search-filters select { width: 100%; height: 40px; padding: 0 10px; border: 1px solid #cfd8e3; border-radius: 8px; background: #fff; color: #14263d; font: 500 14px "Karla", Arial, sans-serif; }
.search-filters__type { margin: 0; padding: 0; border: 0; }
.search-filters .search-radio { display: inline-flex; align-items: center; gap: 6px; margin: 4px 14px 0 0; font-weight: 500; }
.search-filters__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.btn-filter { height: 38px; padding: 0 16px; border: 1px solid #194ba1; border-radius: 8px; background: #fff; color: #194ba1; font: 700 14px "Karla", Arial, sans-serif; cursor: pointer; }
.search-filters__reset { color: #64748b; font-size: 13.5px; }

.search-toolbar__right { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.search-sort { display: inline-flex; align-items: center; gap: 8px; color: #475569; font-size: 14px; }
.search-sort select { height: 36px; padding: 0 8px; border: 1px solid #cfd8e3; border-radius: 8px; background: #fff; font: 500 14px "Karla", Arial, sans-serif; }

.search-empty { margin-bottom: 22px; padding: 22px; border: 1px dashed #cfd8e3; border-radius: 14px; background: #fff; color: #334155; }
.search-empty__title { margin: 0 0 8px; color: #14263d; font-size: 18px; font-weight: 700; }
.search-empty__label { margin: 16px 0 10px; color: #14263d; font-size: 15px; font-weight: 700; }
.search-empty__brands { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.search-empty__brands a { display: inline-block; padding: 7px 12px; border: 1px solid #d7e4f5; border-radius: 999px; color: #194ba1; font-weight: 600; text-decoration: none; }

/* 4 cartes par ligne sur ordinateur ; 3 entre 1101 et 1280 px (colonne des filtres) ; 2 sur tablette ; 1 sur mobile */
.search-grid.store-grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1280px) { .search-grid.store-grid--cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .search-grid.store-grid--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .search-grid.store-grid--cols-4 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
    .search-form__bar { margin-bottom: 16px; }
    .search-side { position: static; order: 0; }
    .search-filters { margin-bottom: 16px; }
}

/* Mobile : un seul « Voir tous les résultats » (celui de la liste quand elle est ouverte) */
.wsearch--full .wsearch__panel:not([hidden]) ~ .msearch__submit { display: none; }
/* Barre bleue : le lien « Conditions générales » laisse sa place au champ de recherche (il reste dans le pied de page) */
.wd-clientbar .wd-link-cgv { display: none; }

/* La liste de suggestions est dans la barre bleue : on neutralise les styles de ses liens (blancs, 13 px) */
.wd-clientbar .wsearch__panel a.wsearch__opt, .wsearch__panel a.wsearch__opt {
    display: flex; padding: 8px 10px; color: #1d2733; font-size: inherit; font-weight: inherit; opacity: 1; white-space: normal;
}
.wd-clientbar .wsearch__panel a.wsearch__opt:hover { color: #1d2733; }
.wd-clientbar .wsearch__panel a.wsearch__all, .wsearch__panel a.wsearch__all { justify-content: center; color: #194ba1; font-size: 14px; font-weight: 700; }
.wd-clientbar .wsearch__panel .wsearch__empty a { display: inline; padding: 0; color: #194ba1; font-size: inherit; text-decoration: underline; }

/* ---------- Barre bleue élargie : liens entiers (plus de défilement ni de texte coupé), champ de recherche extensible ---------- */
.wd-clientbar__inner { max-width: 1440px; padding: 0 24px; gap: 18px; }
.wd-clientbar .wd-links-scroll { flex: 0 0 auto; overflow: visible; scrollbar-width: none; gap: 20px; }
.wd-clientbar .wd-social-nav { flex: 0 0 auto; }
/* Écrans moyens : « Demander un devis » et « Contacter le support » en icônes (texte en info-bulle) pour garder un champ confortable */
@media (min-width: 769px) and (max-width: 1279px) {
    .wd-clientbar .wd-clientbar-cta span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .wd-clientbar .wd-links-scroll { gap: 14px; }
    .wd-clientbar__inner { padding: 0 16px; gap: 14px; }
}
