/* EasyCartouche — moteur de recherche maison : panneau large (imprimantes / consommables) */

/* ---- Logo : agrandi proprement (validé par inspection navigateur) ----
   Les 3 colonnes du header sont en flex:0 1 auto (taille = contenu). En donnant
   au logo une taille DÉFINIE (hauteur forcée + max-width:none, donc PAS de bride
   circulaire qui le déformait), sa colonne grandit pour l'accueillir et la colonne
   recherche rétrécit -> logo net 4:1, jamais déformé ni rogné, header équilibré.
   clamp : min 60px / fluide 6vw / max 100px. */
#tvcmsdesktop-logo img.logo,
.tv-header-logo img.logo,
.tvcms-header-logo img.logo,
#_desktop_logo img.logo {
  height: clamp(60px, 6vw, 100px) !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
}
#tvcmsdesktop-logo,
.tvcms-header-logo,
.tv-header-logo,
#_desktop_logo {
  width: auto !important;
  overflow: visible !important;
}
@media (max-width: 767px) {
  #tvcmsdesktop-logo img.logo, .tv-header-logo img.logo, .tvcms-header-logo img.logo, #_desktop_logo img.logo { height: 44px !important; }
}

/* ---- Zone compte + panier (droite) : nom sur UNE ligne, panier toujours à côté ----
   Validé par inspection navigateur : nowrap sur le conteneur garde compte+panier
   sur la même ligne ; largeur auto sur le bouton compte laisse le nom tenir sur
   une ligne (la colonne grandit, la recherche a la marge). */
.tv-contact-account-cart-wrapper { white-space: nowrap !important; }
#tvcmsdesktop-account-button,
#tvcmsdesktop-account-button .tv-header-account,
#tvcmsdesktop-account-button .tv-myaccount-btn { width: auto !important; max-width: none !important; }
#tvcmsdesktop-account-button .tv-myaccount-btn span { white-space: nowrap !important; width: auto !important; max-width: none !important; }
@media (max-width: 767px) {
  /* (le logo desktop est masqué en mobile, mais au cas où) */
  .tv-header-logo img.logo, #tvcmsdesktop-logo img.logo, .tvcms-header-logo img.logo, #_desktop_logo img.logo { height: 44px !important; }
}

/* ---- La barre de recherche (pilule + bouton arrondi) ---- */
.tvcmsheader-search { width: 100%; }
.tvcmsheader-search .tvheader-sarch-display { display: none; }
.tvcmsheader-search form {
  display: flex; align-items: center; width: 100%; max-width: 560px; margin: 0 auto;
  background: #fff; border-radius: 30px; border: 1px solid #e3e3e3;
  box-shadow: 0 2px 12px rgba(0,0,0,.08); padding: 4px 4px 4px 10px; gap: 6px;
}
.tvcmsheader-search .tvheader-top-search { flex: 1; display: flex; min-width: 0; }
.tvcmsheader-search .tvheader-top-search-wrapper-info-box { flex: 1; min-width: 0; }
.tvcmsheader-search input.tvcmssearch-words {
  width: 100%; border: none; outline: none; background: transparent;
  padding: 10px 12px; font-size: 15px; color: #222; height: auto;
}
.tvcmsheader-search .tvheader-top-search-wrapper { display: flex; }
.tvcmsheader-search .tvheader-search-btn {
  background: #003845; border: none; cursor: pointer; height: 44px; padding: 0 24px;
  border-radius: 24px; display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.tvcmsheader-search .tvheader-search-btn:hover { background: #0e6e7d; }
.tvcmsheader-search .tvheader-search-btn svg { display: block; }

/* ---- Panneau overlay (centré, animé, ne pousse plus le header) ---- */
.tvcmsheader-search .tvsearch-header-display-wrappper { position: relative; }
.tvcmsheader-search .tvsearch-result {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  width: min(1100px, 96vw); z-index: 99995;
}
.tvcmsheader-search .tvsearch-result:empty { display: none; }
@keyframes ecsIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.ecs-mega {
  display: flex; background: #fff; border: 1px solid #ececec;
  border-radius: 14px; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.20);
  max-height: 80vh; font-size: 14px; color: #222; animation: ecsIn .16s ease;
}
.ecs-col { padding: 18px 20px; overflow-y: auto; min-height: 0; }
.ecs-col-printers { flex: 0 0 270px; background: #f7f9fa; border-right: 1px solid #eee; max-height: 72vh; }
.ecs-col-products { flex: 1; min-width: 0; max-height: 72vh; }
.ecs-col-title {
  font-weight: 700; font-size: 16px; color: #003845; margin-bottom: 14px;
  display: inline-flex; align-items: center; gap: 8px; padding-bottom: 5px; border-bottom: 3px solid #FFD741;
}
.ecs-col-count {
  background: #003845; color: #fff; font-size: 12px; font-weight: 700;
  border-radius: 20px; padding: 1px 9px; min-width: 22px; text-align: center;
}
/* Ascenseur discret sur les colonnes */
.ecs-col::-webkit-scrollbar { width: 8px; }
.ecs-col::-webkit-scrollbar-thumb { background: #cbd6da; border-radius: 8px; }
.ecs-col::-webkit-scrollbar-thumb:hover { background: #adbcc1; }
.ecs-col-printers .ecs-printer-row + .ecs-printer-row { border-top: 1px solid #eef2f3; }

/* Barre de fermeture (visible seulement en plein écran mobile) */
.ecs-topbar { display: none; }
.ecs-nr-body { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 36px 24px; flex: 1; justify-content: center; }

/* Colonne imprimantes */
.ecs-printer-row {
  display: flex; align-items: center; gap: 11px; padding: 10px 8px; min-width: 0;
  text-decoration: none; color: #222; border-radius: 10px; transition: background .12s;
}
.ecs-printer-row:hover { background: #fff; box-shadow: 0 1px 8px rgba(0,0,0,.09); }
.ecs-pic {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 9px; color: #003845;
  background: #e3eff0; display: flex; align-items: center; justify-content: center;
}
.ecs-printer-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Grille consommables */
.ecs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ecs-card {
  display: flex; flex-direction: column; gap: 9px; padding: 12px;
  border: 1px solid #ededed; border-radius: 12px; background: #fff; transition: box-shadow .15s, border-color .15s, transform .1s;
}
.ecs-card:hover { border-color: #1aa14c; box-shadow: 0 6px 18px rgba(0,0,0,.10); transform: translateY(-1px); }
.ecs-card-link { display: flex; gap: 12px; align-items: center; text-decoration: none; color: #222; min-width: 0; }
.ecs-card-img { width: 92px; height: 92px; flex: 0 0 92px; object-fit: contain; background: #fff; border-radius: 8px; }
.ecs-card-noimg { background: #f3f3f3; }
.ecs-card-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ecs-card-name {
  font-size: 13px; line-height: 1.35; color: #333;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ecs-card-price { font-weight: 700; color: #003845; font-size: 16px; }

/* Actions : Voir (30%) + Ajouter (70%) — couleurs charte (vert = panier) */
.ecs-actions { display: flex; gap: 6px; margin-top: 2px; }
.ecs-view {
  flex: 3; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #003845; color: #003845; background: #fff; border-radius: 24px;
  padding: 9px 8px; font-size: 13px; font-weight: 600; text-decoration: none; transition: background .15s;
}
.ecs-view:hover { background: #eef3f4; }
.ecs-add {
  flex: 7; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: #1aa14c; color: #fff; border: none; border-radius: 24px;
  padding: 9px 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: filter .15s; text-decoration: none;
}
.ecs-add:hover { filter: brightness(.94); }
.ecs-add.ecs-busy { opacity: .7; pointer-events: none; }
.ecs-add.ecs-added { background: #15803d; }
.ecs-add-off { flex: 7; background: #eee; color: #999; cursor: default; justify-content: center; border-radius: 24px; padding: 9px 8px; font-size: 13px; font-weight: 600; text-align: center; }

/* ---- Aucun résultat (soigné, avec accès conseiller) ---- */
.ecs-noresult { flex-direction: column; align-items: stretch; }
.ecs-nr-icon {
  width: 58px; height: 58px; border-radius: 50%; background: #eef3f4; color: #003845;
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.ecs-nr-title { font-size: 17px; font-weight: 700; color: #1a1a1a; margin-bottom: 6px; }
.ecs-nr-text { color: #777; font-size: 14px; max-width: 460px; line-height: 1.5; margin-bottom: 18px; }
.ecs-ask-chat {
  background: #003845; color: #fff; border: none; border-radius: 26px;
  padding: 12px 24px; font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; transition: background .15s;
}
.ecs-ask-chat:hover { background: #0e6e7d; }

.ecs-empty { padding: 18px 4px; color: #888; font-size: 13px; line-height: 1.5; grid-column: 1 / -1; }
.ecs-empty-ai { margin-top: 12px; }

/* Bandeau "résultats approchants" (quand le ET strict a donné 0 et qu'on a relâché) */
.ecs-relaxed-note {
  display: flex; align-items: center; gap: 8px;
  background: #fff7e0; color: #8a6d00; border: 1px solid #f3e2a8;
  border-radius: 12px; padding: 10px 14px; margin-bottom: 8px;
  font-size: 13px; font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.ecs-relaxed-note svg { flex: 0 0 auto; }
.ecs-ai-note { background: #eef3ff; color: #2c3e8a; border-color: #d6def8; }

/* Actions du panneau "aucun résultat" + bouton IA */
.ecs-nr-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ecs-ai-btn {
  background: #003845; color: #FFD741; border: none; border-radius: 26px;
  padding: 12px 22px; font-size: 14px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; transition: background .15s, transform .1s;
}
.ecs-ai-btn:hover { background: #0e6e7d; transform: translateY(-1px); }
.ecs-ai-spin {
  width: 36px; height: 36px; margin: 0 auto 14px; border-radius: 50%;
  border: 3px solid #e3eff0; border-top-color: #003845; animation: ecsSpin .8s linear infinite;
}
@keyframes ecsSpin { to { transform: rotate(360deg); } }

/* ---- Notification "ajouté au panier" (au-dessus de tout, app comprise) ---- */
.ecs-toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(24px);
  background: #15803d; color: #fff; border-radius: 30px; padding: 9px 9px 9px 18px;
  display: flex; align-items: center; gap: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.28);
  z-index: 100090; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  max-width: 94vw;
}
.ecs-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.ecs-toast-msg { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.ecs-toast-btn {
  background: #fff; color: #15803d; border-radius: 22px; padding: 9px 18px;
  font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap;
}
.ecs-toast-btn:hover { background: #f0f0f0; }

/* Responsive */
@media (max-width: 991px) { .ecs-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   MOBILE : application de recherche plein écran dédiée
   ============================================================ */

/* L'appli plein écran */
.ecs-app {
  position: fixed; inset: 0; top: 0; left: 0; right: 0; bottom: 0;
  background: #f4f6f8; z-index: 100060; display: none; flex-direction: column;
}
.ecs-app.open { display: flex; }
body.ecs-app-lock { overflow: hidden; }
/* on masque tout le reste (chat compris) pendant la recherche */
body.ecs-app-lock #easychatia-widget { display: none !important; }

.ecs-app-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: #003845; flex: 0 0 auto;
}
.ecs-app-back { background: transparent; border: none; color: #fff; display: flex; align-items: center; padding: 6px; cursor: pointer; }
.ecs-app-field {
  flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
  background: #fff; border-radius: 26px; padding: 0 10px 0 14px;
}
.ecs-app-loupe { color: #8a8a8a; flex: 0 0 auto; }
.ecs-app-input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  padding: 12px 4px; font-size: 16px; color: #222;
}
.ecs-app-clear { background: transparent; border: none; color: #aaa; font-size: 18px; padding: 6px 8px; cursor: pointer; }

.ecs-app-results { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ecs-app-results .ecs-mega {
  flex-direction: column; border: none; border-radius: 0; box-shadow: none;
  max-height: none; min-height: 100%; background: transparent; animation: none;
}
.ecs-app-results .ecs-col { width: 100%; box-sizing: border-box; background: #fff; margin-bottom: 8px; padding: 16px; }
.ecs-app-results .ecs-col-printers { flex: none; border: none; }
.ecs-app-results .ecs-printer-row { padding: 14px 6px; border-bottom: 1px solid #f1f1f1; border-radius: 0; }
.ecs-app-results .ecs-printer-row:last-child { border-bottom: none; }
.ecs-app-results .ecs-grid { grid-template-columns: 1fr; gap: 10px; }
.ecs-app-results .ecs-card { flex-direction: row; align-items: center; gap: 12px; }
.ecs-app-results .ecs-card-link { flex: 1; min-width: 0; }
.ecs-app-results .ecs-card-name { -webkit-line-clamp: 3; }
.ecs-app-results .ecs-actions { flex-direction: column; flex: 0 0 116px; gap: 6px; }
.ecs-app-results .ecs-view, .ecs-app-results .ecs-add { width: 100%; flex: none; }
.ecs-app-results .ecs-noresult { background: #fff; margin: 0; min-height: 70vh; }

/* Sur mobile, on n'utilise PAS le dropdown desktop (l'appli le remplace) */
@media (max-width: 767px) {
  .tvcmsheader-search .tvsearch-result { display: none !important; }
}

/* ============================================================
   Page de résultats plein écran (validation Entrée / loupe)
   ============================================================ */
.ecs-results-page { max-width: 1180px; margin: 24px auto 50px; padding: 0 16px; color: #222; }
.ecs-results-title { font-size: 24px; font-weight: 800; color: #003845; margin: 0 0 6px; }
.ecs-results-h2 {
  font-size: 17px; font-weight: 700; color: #003845; margin: 28px 0 14px;
  display: inline-flex; align-items: center; gap: 9px; padding-bottom: 5px; border-bottom: 3px solid #FFD741;
}
.ecs-results-count { background: #003845; color: #fff; font-size: 12px; font-weight: 700; border-radius: 20px; padding: 1px 9px; }
.ecs-results-printers { display: flex; flex-wrap: wrap; gap: 10px; }
.ecs-results-printer {
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px;
  background: #f7f9fa; border: 1px solid #e6eced; border-radius: 26px; color: #003845;
  text-decoration: none; font-weight: 600; font-size: 14px; transition: background .12s, box-shadow .12s;
}
.ecs-results-printer:hover { background: #fff; box-shadow: 0 3px 12px rgba(0,0,0,.10); color: #0e6e7d; text-decoration: none; }
.ecs-results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.ecs-rcard {
  border: 1px solid #ededed; border-radius: 14px; background: #fff; overflow: hidden;
  transition: box-shadow .15s, border-color .15s, transform .1s;
}
.ecs-rcard:hover { border-color: #1aa14c; box-shadow: 0 8px 22px rgba(0,0,0,.10); transform: translateY(-2px); }
.ecs-rcard-link { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16px; text-decoration: none; color: #222; height: 100%; }
.ecs-rcard-img { width: 140px; height: 140px; object-fit: contain; background: #fff; margin-bottom: 10px; }
.ecs-rcard-noimg { background: #f3f3f3; border-radius: 8px; }
.ecs-rcard-name { font-size: 13px; line-height: 1.4; color: #333; margin-bottom: 8px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ecs-rcard-price { font-weight: 800; color: #003845; font-size: 18px; }
.ecs-rcard-off { margin-top: 6px; font-size: 12px; color: #999; }
.ecs-results-empty { color: #777; font-size: 15px; margin-top: 20px; }
@media (max-width: 767px) {
  .ecs-results-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .ecs-rcard-img { width: 110px; height: 110px; }
}
