/*
 * CookinBreak — en-tête du site (desktop + mobile)
 * ------------------------------------------------------------------
 * Un seul composant, préfixe cbh- (barre, menu), cbhd- (tiroir mobile), cbhs- (recherche), cbh-verify (bandeau e-mail).
 * Tout lit les tokens de ds/tokens.css (mode sombre automatique). Balisage : app/views/site_header.php.
 *
 * Deux dispositions seulement :
 *   ≥ 1280 px  barre unique : logo · navigation (menu « Recettes » en 3 colonnes) · recherche · compte
 *   < 1280 px  barre compacte : burger · logo · recherche · compte ; la navigation passe dans le tiroir
 */

:root {
  --cbh-h: 60px;                  /* hauteur de la barre : le body réserve cet espace */
  --cbh-z: 9000;
  --cbh-z-layer: 99990;           /* tiroir et recherche : au-dessus de la page, sous les toasts (100100) */
  --cbh-sbw: 0px;                 /* largeur de la barre de défilement, compensée quand la page est verrouillée */
}
@media (min-width: 1280px) {
  :root { --cbh-h: 72px; }
}

body { padding-top: var(--cbh-h); }

html.cbh-lock,
html.cbh-lock body { overflow: hidden; }
html.cbh-lock body,
html.cbh-lock .cbh { padding-right: var(--cbh-sbw); }

.cbh__sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------
 * Pastilles d'icône colorées (partagées : menu, compte, tiroir, recherche)
 * ------------------------------------------------------------------ */
.cbh__tile {
  --t-bg: var(--ds-surface-2); --t-ink: var(--ds-text-2);
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 11px; font-size: 14px;
  background: var(--t-bg); color: var(--t-ink);
}
.cbh__tile--teal   { --t-bg: var(--ds-primary-soft); --t-ink: var(--ds-primary-text); }
.cbh__tile--orange { --t-bg: #ffe9d6; --t-ink: #b4571a; }
.cbh__tile--rose   { --t-bg: #fde3e6; --t-ink: #ae2139; }
.cbh__tile--green  { --t-bg: #e2f3e5; --t-ink: #2f7a4b; }
.cbh__tile--blue   { --t-bg: #e5edfa; --t-ink: #2f5fb3; }
.cbh__tile--sand   { --t-bg: #f3ecdf; --t-ink: #7a5c2e; }
.cbh__tile--event  { --t-bg: color-mix(in srgb, var(--cbh-event, #e8650a) 16%, transparent); --t-ink: var(--cbh-event, #e8650a); }
.dark-mode .cbh__tile--orange { --t-bg: rgba(255, 160, 92, 0.16); --t-ink: #ffb27a; }
.dark-mode .cbh__tile--rose   { --t-bg: rgba(255, 129, 150, 0.16); --t-ink: #ff9fae; }
.dark-mode .cbh__tile--green  { --t-bg: rgba(111, 212, 145, 0.16); --t-ink: #8fe0ab; }
.dark-mode .cbh__tile--blue   { --t-bg: rgba(155, 188, 247, 0.16); --t-ink: #9bbcf7; }
.dark-mode .cbh__tile--sand   { --t-bg: rgba(226, 196, 150, 0.14); --t-ink: #e6cfa6; }

/* ------------------------------------------------------------------
 * Barre
 * ------------------------------------------------------------------ */
.cbh {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--cbh-z);
  background: var(--ds-surface); color: var(--ds-text);
  border-bottom: 1px solid var(--ds-border);
  font-family: var(--ds-font-body);
  transition: transform 0.3s var(--ds-ease), box-shadow var(--ds-duration) var(--ds-ease);
}
.cbh.is-scrolled { box-shadow: var(--ds-shadow-sm); }
.cbh.is-hidden { transform: translateY(-100%); }

.cbh *,
.cbhd *,
.cbhs *,
.cbh-verify * { box-sizing: border-box; }
.cbh a, .cbhd a, .cbhs a, .cbh-verify a { text-decoration: none; }
.cbh button, .cbhd button, .cbhs button, .cbh-verify button { font-family: inherit; }

.cbh__bar {
  display: flex; align-items: center; gap: 8px;
  max-width: 1480px; height: var(--cbh-h); margin: 0 auto; padding: 0 12px;
}
@media (min-width: 1280px) {
  .cbh__bar { gap: 12px; padding: 0 28px; }
}

/* Logo */
.cbh__logo { flex: none; display: flex; align-items: center; height: 100%; padding: 0 4px; border-radius: var(--ds-radius-sm); }
.cbh__logo-img { display: block; width: auto; height: 44px; }
@media (min-width: 1280px) { .cbh__logo-img { height: 54px; } }
/* mode sombre : le logo « sombre » du site a un fond opaque ; on recolore le logo transparent (noir → blanc, teal → teal clair) */
.dark-mode .cbh__logo-img { filter: invert(1) hue-rotate(180deg); }
/* mobile : logo centré entre le burger et les actions */
@media (max-width: 1279px) {
  .cbh__logo { margin-right: auto; }
}

/* Boutons-icône (burger, favoris, fermer) */
.cbh__icon-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--ds-radius-sm);
  background: transparent; color: var(--ds-text); font-size: 19px; cursor: pointer;
  transition: background var(--ds-duration) var(--ds-ease), color var(--ds-duration) var(--ds-ease);
}
.cbh__icon-btn:hover { background: var(--ds-surface-2); }
.cbh__icon-btn:active { transform: scale(0.95); }
@media (min-width: 1280px) { .cbh__burger { display: none; } }
.cbh__fav { display: none; }
@media (min-width: 1280px) {
  .cbh__fav { display: inline-flex; }
  .cbh__fav:hover { color: var(--ds-danger); }
}

.cbh a:focus-visible,
.cbh button:focus-visible,
.cbhd a:focus-visible,
.cbhd button:focus-visible,
.cbhs a:focus-visible,
.cbhs button:focus-visible { outline: none; box-shadow: var(--ds-focus-ring); }

/* ------------------------------------------------------------------
 * Navigation (desktop)
 * ------------------------------------------------------------------ */
.cbh__nav { display: none; }
@media (min-width: 1280px) {
  .cbh__nav { display: block; flex: 1 1 auto; min-width: 0; margin-left: 8px; }
}
.cbh__list { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.cbh__item { position: relative; margin: 0; padding: 0; list-style: none; }

.cbh__link {
  display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 13px;
  border: 0; border-radius: var(--ds-radius-btn); background: transparent;
  color: var(--ds-text-2); font-size: 0.9rem; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background var(--ds-duration) var(--ds-ease), color var(--ds-duration) var(--ds-ease);
}
@media (max-width: 1439px) { .cbh__link { padding: 0 10px; } }
.cbh__link:hover,
.cbh__link[aria-expanded="true"] { background: var(--ds-surface-2); color: var(--ds-text); }
.cbh__link.is-active { color: var(--ds-primary-text); background: var(--ds-primary-soft); }
.cbh__chev { font-size: 0.65rem; opacity: 0.7; transition: transform var(--ds-duration) var(--ds-ease); }
[aria-expanded="true"] > .cbh__chev { transform: rotate(180deg); }
.cbh__ext { font-size: 0.62rem; opacity: 0.55; }

.cbh__link--ai { color: var(--ds-primary-text); font-weight: 600; }
.cbh__link--ai i { font-size: 0.85rem; }
.cbh__link--ai:hover { background: var(--ds-primary-soft); color: var(--ds-primary-text); }

.cbh__link--event {
  color: var(--cbh-event, var(--ds-accent-text)); font-weight: 600;
  background: color-mix(in srgb, var(--cbh-event, var(--ds-accent)) 13%, transparent);
}
.cbh__link--event:hover { background: color-mix(in srgb, var(--cbh-event, var(--ds-accent)) 22%, transparent); color: var(--cbh-event, var(--ds-accent-text)); }

/* Menu « Recettes » : trois colonnes */
.cbh__mega { position: absolute; top: 100%; left: 0; z-index: 2; padding-top: 12px; }
.cbh__mega:not([hidden]),
.cbh__pop:not([hidden]) { animation: cbh-pop 0.2s var(--ds-ease); }
.cbh__mega-card {
  display: grid; grid-template-columns: repeat(3, minmax(190px, 1fr)); gap: 8px;
  width: min(780px, calc(100vw - 48px)); padding: 14px;
  background: var(--ds-surface); border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-md);
}
.cbh__col { display: flex; flex-direction: column; padding: 10px; border-radius: var(--ds-radius-md); }
.cbh__col-title {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 4px 6px 4px 0;
  color: var(--ds-text); font-weight: 600; font-size: 0.98rem; border-radius: var(--ds-radius-sm);
}
.cbh__col-list { flex: 1; margin: 0; padding: 0; list-style: none; }
.cbh__col-list a {
  display: block; padding: 8px 10px; margin: 0 -10px; border-radius: 12px;
  color: var(--ds-text-2); font-size: 0.9rem; line-height: 1.3;
  transition: background var(--ds-duration) var(--ds-ease), color var(--ds-duration) var(--ds-ease), padding var(--ds-duration) var(--ds-ease);
}
.cbh__col-list a:hover { background: var(--ds-surface-2); color: var(--ds-text); padding-left: 14px; }
.cbh__col-all {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 0;
  color: var(--ds-primary-text); font-size: 0.85rem; font-weight: 600;
}
.cbh__col-all i { font-size: 0.7rem; transition: transform var(--ds-duration) var(--ds-ease); }
.cbh__col-all:hover i { transform: translateX(3px); }

@keyframes cbh-pop {
  from { opacity: 0; transform: translateY(-6px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------
 * Actions : recherche, connexion, compte
 * ------------------------------------------------------------------ */
.cbh__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@media (min-width: 1280px) { .cbh__actions { gap: 10px; margin-left: 0; } }

/* Déclencheur de recherche : icône seule sur mobile, champ factice sur grand écran */
.cbh__search-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 44px; height: 44px; padding: 0; border: 1px solid transparent; border-radius: var(--ds-radius-sm);
  background: transparent; color: var(--ds-text); font-size: 18px; cursor: pointer;
  transition: background var(--ds-duration) var(--ds-ease), border-color var(--ds-duration) var(--ds-ease);
}
.cbh__search-btn:hover { background: var(--ds-surface-2); }
.cbh__search-label, .cbh__kbd, .cbh__search-more { display: none; }
@media (min-width: 1280px) {
  .cbh__search-btn { background: var(--ds-surface-2); }
  .cbh__search-btn:hover { background: var(--ds-surface-hover); border-color: var(--ds-border-strong); }
}
@media (min-width: 1440px) {
  .cbh__search-btn { justify-content: flex-start; width: 210px; padding: 0 12px 0 16px; font-size: 0.9rem; color: var(--ds-text-3); }
  .cbh__search-btn i { font-size: 15px; color: var(--ds-text-2); }
  .cbh__search-label { display: block; flex: 1; text-align: left; white-space: nowrap; }
  .cbh__kbd {
    display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 6px;
    border: 1px solid var(--ds-border-strong); border-radius: 8px; background: var(--ds-surface);
    color: var(--ds-text-3); font: 600 0.75rem var(--ds-font-body);
  }
}
@media (min-width: 1680px) {
  .cbh__search-btn { width: 290px; }
  .cbh__search-more { display: inline; }
}

/* Boutons de connexion */
.cbh__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--ds-radius-btn);
  font-size: 0.9rem; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background var(--ds-duration) var(--ds-ease), border-color var(--ds-duration) var(--ds-ease), transform var(--ds-duration) var(--ds-ease);
}
.cbh__btn:active { transform: scale(0.97); }
.cbh__btn--primary { background: var(--ds-primary); color: var(--ds-on-primary); }
.cbh__btn--primary:hover { background: var(--ds-primary-hover); }
.cbh__btn--ghost { background: transparent; color: var(--ds-text); border-color: var(--ds-border-strong); }
.cbh__btn--ghost:hover { background: var(--ds-surface-2); }
/* mobile : la barre ne garde que « Se connecter » (l'inscription est dans le tiroir) */
@media (max-width: 1279px) {
  .cbh__actions .cbh__btn { height: 40px; padding: 0 14px; font-size: 0.85rem; }
  .cbh__actions .cbh__btn--primary { display: none; }
}

/* Compte : avatar + panneau */
.cbh__account { position: relative; }
.cbh__avatar {
  display: block; width: 44px; height: 44px; padding: 0; border: 2px solid var(--ds-surface); border-radius: 50%;
  background: var(--ds-surface-2); cursor: pointer; overflow: hidden;
  box-shadow: 0 0 0 1px var(--ds-border-strong);
  transition: box-shadow var(--ds-duration) var(--ds-ease), transform var(--ds-duration) var(--ds-ease);
}
.cbh__avatar:hover,
.cbh__avatar[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--ds-primary); }
.cbh__avatar:active { transform: scale(0.95); }
.cbh__avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }

.cbh__pop { position: absolute; top: 100%; right: 0; z-index: 2; padding-top: 12px; }
.cbh__pop-card {
  width: min(340px, calc(100vw - 24px)); padding: 10px;
  background: var(--ds-surface); border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-md);
}
.cbh__pop-head { display: flex; align-items: center; gap: 14px; padding: 12px 12px 14px; }
.cbh__pop-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--ds-border-strong); }
.cbh__pop-hello { margin: 0; font-size: 1.02rem; font-weight: 700; color: var(--ds-text); line-height: 1.3; }
.cbh__pop-name { margin: 2px 0 0; font-size: 0.8rem; color: var(--ds-text-3); line-height: 1.3; }
.cbh__pop-name i { margin-right: 3px; }
.cbh__pop-list { margin: 0; padding: 6px 0; list-style: none; border-top: 1px solid var(--ds-border); }
.cbh__pop-list a {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--ds-radius-sm);
  color: var(--ds-text); font-size: 0.92rem; font-weight: 500;
  transition: background var(--ds-duration) var(--ds-ease);
}
.cbh__pop-list a:hover { background: var(--ds-surface-2); }
.cbh__pop-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding-top: 8px; border-top: 1px solid var(--ds-border); }
.cbh__pop-foot a {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: var(--ds-radius-sm);
  color: var(--ds-text-2); font-size: 0.85rem; font-weight: 600;
  transition: background var(--ds-duration) var(--ds-ease);
}
.cbh__pop-foot a:hover { background: var(--ds-surface-2); color: var(--ds-text); }
.cbh__pop-foot .cbh__pop-out { color: var(--ds-danger); }
.cbh__pop-foot .cbh__pop-out:hover { background: var(--ds-danger-soft); color: var(--ds-danger); }

/* ------------------------------------------------------------------
 * Tiroir de navigation (< 1280 px)
 * ------------------------------------------------------------------ */
.cbhd { position: fixed; inset: 0; z-index: var(--cbh-z-layer); visibility: hidden; pointer-events: none; transition: visibility 0s linear 0.35s; }
.cbhd.is-open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
@media (min-width: 1280px) { .cbhd { display: none; } }

.cbhd__backdrop { position: absolute; inset: 0; background: var(--ds-overlay); opacity: 0; transition: opacity 0.3s var(--ds-ease); }
.cbhd.is-open .cbhd__backdrop { opacity: 1; }

.cbhd__panel {
  position: absolute; top: 0; bottom: 0; left: 0; display: flex; flex-direction: column;
  width: min(92vw, 410px); background: var(--ds-bg); color: var(--ds-text);
  border-radius: 0 var(--ds-radius-lg) var(--ds-radius-lg) 0; box-shadow: var(--ds-shadow-lg);
  transform: translateX(-102%); transition: transform 0.35s var(--ds-ease);
  padding-top: env(safe-area-inset-top); font-family: var(--ds-font-body);
}
.cbhd.is-open .cbhd__panel { transform: none; }

.cbhd__top { flex: none; display: flex; align-items: center; justify-content: space-between; height: var(--cbh-h); padding: 0 12px 0 20px; }
.cbhd__logo { display: flex; align-items: center; height: 100%; }
.cbhd__scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px calc(28px + env(safe-area-inset-bottom)); }

.cbhd__join {
  margin-bottom: 14px; padding: 18px; background: var(--ds-primary-soft);
  border-radius: var(--ds-radius-md);
}
.cbhd__join-title { margin: 0 0 4px; font-family: var(--ds-font-display); font-size: 1rem; font-weight: 600; color: var(--ds-text); }
.cbhd__join-text { margin: 0 0 14px; font-size: 0.86rem; line-height: 1.5; color: var(--ds-text-2); }
.cbhd__join-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cbhd__join-actions .cbh__btn { height: 46px; padding: 0 10px; }
.cbhd__join-actions .cbh__btn--ghost { background: var(--ds-surface); }

.cbhd__search {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 50px; margin-bottom: 14px; padding: 0 16px;
  border: 1px solid var(--ds-border); border-radius: var(--ds-radius-sm); background: var(--ds-surface);
  color: var(--ds-text-3); font-size: 0.95rem; text-align: left; cursor: pointer;
}
.cbhd__search i { color: var(--ds-text-2); }

.cbhd__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.cbhd__list > li { margin: 0; padding: 0; list-style: none; }
.cbhd__link {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 10px 14px;
  border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-surface);
  color: var(--ds-text); font-size: 1rem; font-weight: 600; text-align: left; cursor: pointer;
  transition: background var(--ds-duration) var(--ds-ease), border-color var(--ds-duration) var(--ds-ease);
}
.cbhd__link:active { background: var(--ds-surface-2); }
.cbhd__link[aria-current="page"] { border-color: var(--ds-primary); background: var(--ds-primary-soft); }
.cbhd__link .cbh__chev { margin-left: auto; font-size: 0.75rem; }
.cbhd__link .cbh__ext { margin-left: -6px; }
.cbhd__link--ai { color: var(--ds-primary-text); }
.cbhd__link--event { color: var(--cbh-event); border-color: color-mix(in srgb, var(--cbh-event) 35%, transparent); }

.cbhd__sub { padding: 10px 2px 4px; }
.cbhd__sub:not([hidden]) { animation: cbh-pop 0.25s var(--ds-ease); }
.cbhd__all {
  display: flex; align-items: center; justify-content: space-between; height: 46px; margin-bottom: 10px; padding: 0 16px;
  border-radius: var(--ds-radius-sm); background: var(--ds-primary); color: var(--ds-on-primary);
  font-size: 0.92rem; font-weight: 600;
}
.cbhd__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cbhd__cat {
  position: relative; display: flex; align-items: flex-end; height: 96px; overflow: hidden;
  border-radius: var(--ds-radius-md); background: var(--ds-surface-2);
}
.cbhd__cat img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cbhd__cat::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.05) 70%); }
.cbhd__cat span { position: relative; z-index: 1; padding: 10px 12px; color: #fff; font-size: 0.88rem; font-weight: 600; line-height: 1.2; }

/* ------------------------------------------------------------------
 * Recherche (panneau centré sur desktop, plein écran sur mobile)
 * ------------------------------------------------------------------ */
.cbhs { position: fixed; inset: 0; z-index: var(--cbh-z-layer); visibility: hidden; pointer-events: none; transition: visibility 0s linear 0.25s; }
.cbhs.is-open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.cbhs__backdrop { position: absolute; inset: 0; background: var(--ds-overlay); opacity: 0; transition: opacity 0.25s var(--ds-ease); }
.cbhs.is-open .cbhs__backdrop { opacity: 1; }

.cbhs__panel {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  background: var(--ds-surface); color: var(--ds-text); font-family: var(--ds-font-body);
  padding-top: env(safe-area-inset-top);
  opacity: 0; transform: translateY(-10px); transition: opacity 0.25s var(--ds-ease), transform 0.25s var(--ds-ease);
}
.cbhs.is-open .cbhs__panel { opacity: 1; transform: none; }
@media (min-width: 720px) {
  .cbhs__panel {
    inset: 9vh auto auto 50%; width: min(720px, calc(100vw - 32px)); max-height: min(640px, 82dvh);
    margin-left: calc(min(720px, calc(100vw - 32px)) / -2);
    border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-lg); overflow: hidden;
  }
}

.cbhs__form { flex: none; display: flex; align-items: center; gap: 12px; height: 70px; padding: 0 12px 0 22px; border-bottom: 1px solid var(--ds-border); }
.cbhs__form:focus-within { border-bottom-color: var(--ds-primary); }
.cbhs__form-icon { flex: none; color: var(--ds-text-2); font-size: 18px; }
.cbhs__input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent;
  color: var(--ds-text); font: 500 1.1rem var(--ds-font-body); outline: none; box-shadow: none; -webkit-appearance: none; appearance: none;
}
.cbhs__input::placeholder { color: var(--ds-text-3); font-weight: 400; }
.cbhs__input::-webkit-search-cancel-button { display: none; }
.cbhs__close {
  flex: none; height: 40px; padding: 0 14px; border: 0; border-radius: var(--ds-radius-sm); background: var(--ds-surface-2);
  color: var(--ds-text-2); font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.cbhs__close:hover { background: var(--ds-border); color: var(--ds-text); }

.cbhs__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 14px calc(18px + env(safe-area-inset-bottom)); }
.cbhs__sec { padding: 12px 6px 4px; }
.cbhs__sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cbhs__sec-head h2 { margin: 0; color: var(--ds-text-3); font: 600 0.72rem var(--ds-font-body); letter-spacing: 0.08em; text-transform: uppercase; }
.cbhs__clear { padding: 4px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--ds-primary-text); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.cbhs__clear:hover { background: var(--ds-primary-soft); }

.cbhs__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cbhs__chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 38px; padding: 0 14px;
  border: 1px solid var(--ds-border); border-radius: 13px; background: var(--ds-surface); color: var(--ds-text);
  font-size: 0.88rem; font-weight: 500; cursor: pointer;
}
.cbhs__chip i { color: var(--ds-text-3); font-size: 0.75rem; }
.cbhs__chip:hover { background: var(--ds-surface-2); }

.cbhs__tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.cbhs__tile {
  display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 12px;
  border-radius: var(--ds-radius-md); color: var(--ds-text); font-size: 0.92rem; font-weight: 600;
  transition: background var(--ds-duration) var(--ds-ease);
}
.cbhs__tile:hover { background: var(--ds-surface-2); }
.cbhs__tile--ai { grid-column: 1 / -1; background: var(--ds-primary-soft); color: var(--ds-primary-text); }
.cbhs__tile--ai:hover { background: var(--ds-primary-soft); filter: brightness(0.97); }
.cbhs__tile--ai .cbh__tile { background: var(--ds-surface); }

/* Résultats (HTML renvoyé par responsive.php?ajax_search) */
.cbhs__results { padding-top: 6px; }
.cbh-results__label { margin: 8px 8px 6px; color: var(--ds-text-3); font: 600 0.72rem var(--ds-font-body); letter-spacing: 0.08em; text-transform: uppercase; }
.cbh-result {
  display: flex; align-items: center; gap: 14px; padding: 8px 10px; border-radius: var(--ds-radius-md);
  color: var(--ds-text); transition: background var(--ds-duration) var(--ds-ease);
}
.cbh-result:hover,
.cbh-result:focus-visible { background: var(--ds-surface-2); }
.cbh-result__img { flex: none; width: 68px; height: 54px; overflow: hidden; border-radius: 14px; background: var(--ds-surface-2); }
.cbh-result__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cbh-result__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cbh-result__title { font-size: 0.96rem; font-weight: 600; line-height: 1.3; }
.cbh-result__desc {
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--ds-text-3); font-size: 0.82rem; line-height: 1.4;
}
.cbh-result__go { flex: none; color: var(--ds-text-3); font-size: 0.8rem; }
.cbh-all {
  display: flex; align-items: center; justify-content: space-between; margin-top: 6px; padding: 14px 16px;
  border-radius: var(--ds-radius-md); background: var(--ds-primary-soft); color: var(--ds-primary-text);
  font-size: 0.92rem; font-weight: 600;
}
.cbh-all:hover,
.cbh-all:focus-visible { filter: brightness(0.97); }
.cbh-empty { padding: 30px 16px 18px; text-align: center; color: var(--ds-text-2); font-size: 0.92rem; line-height: 1.5; }
.cbh-empty strong { display: block; margin-bottom: 4px; color: var(--ds-text); font-size: 1rem; }
.cbh-empty a { display: inline-block; margin-top: 12px; padding: 10px 16px; border-radius: var(--ds-radius-sm); background: var(--ds-primary-soft); color: var(--ds-primary-text); font-weight: 600; }
.cbh-loading { display: grid; gap: 10px; padding: 8px 10px; }
.cbh-loading span { display: block; height: 54px; border-radius: 14px; background: linear-gradient(90deg, var(--ds-surface-2) 25%, var(--ds-border) 37%, var(--ds-surface-2) 63%); background-size: 400% 100%; animation: cbh-shimmer 1.3s ease infinite; }
@keyframes cbh-shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

/* ------------------------------------------------------------------
 * Bandeau « confirmez votre e-mail »
 * ------------------------------------------------------------------ */
.cbh-verify { padding: 16px 16px 0; font-family: var(--ds-font-body); }
.cbh-verify__card {
  display: flex; align-items: center; gap: 14px; max-width: 980px; margin: 0 auto; padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--ds-warning) 30%, transparent); border-radius: var(--ds-radius-md);
  background: var(--ds-warning-soft); color: var(--ds-text);
}
.cbh-verify__icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 13px; background: var(--ds-surface); color: var(--ds-warning); font-size: 17px; }
.cbh-verify__text { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 0.86rem; line-height: 1.45; color: var(--ds-text-2); }
.cbh-verify__text strong { color: var(--ds-text); font-size: 0.92rem; }
.cbh-verify .cbh__btn { height: 42px; }
@media (max-width: 640px) {
  .cbh-verify__card { flex-direction: column; align-items: stretch; text-align: center; }
  .cbh-verify__icon { align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  .cbh, .cbhd__panel, .cbhd__backdrop, .cbhs__panel, .cbhs__backdrop { transition: none; }
  .cbh__mega:not([hidden]), .cbh__pop:not([hidden]), .cbhd__sub:not([hidden]), .cbh-loading span { animation: none; }
}

@media print {
  .cbh, .cbhd, .cbhs, .cbh-verify { display: none !important; }
  body { padding-top: 0; }
}
