/* ============================================================
   Ellocan v2 — panier coulissant, overlay de recherche, toasts
   S'appuie sur les tokens deja definis dans chaque page
   (--signal, --line, --ink, --white, --btn…) avec repli.
   ============================================================ */

:root {
  --ec-line: var(--line, #e6e1d6);
  --ec-ink: var(--ink, #1C1E22);
  --ec-signal: var(--signal, #D63B2A);
  --ec-bg: var(--white, #fff);
}

body.ec-lock { overflow: hidden; }

/* ---------- bouton icone du header ---------- */
.ec-iconbtn {
  background: none; border: 0; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; color: inherit;
}
.ec-iconbtn:hover .icon { stroke: var(--ec-signal); }
.nav-actions a.cart { cursor: pointer; }

/* ---------- panier coulissant ---------- */
.ec-drawer, .ec-search {
  position: fixed; inset: 0; z-index: 999;
  visibility: hidden; opacity: 0; transition: opacity .22s ease, visibility .22s;
}
.ec-drawer.open, .ec-search.open { visibility: visible; opacity: 1; }

.ec-scrim { position: absolute; inset: 0; background: rgba(28,30,34,.45); }

.ec-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(420px, 100%);
  background: var(--ec-bg);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(28,30,34,.18);
  transform: translateX(24px); transition: transform .26s cubic-bezier(.22,.8,.3,1);
}
.ec-drawer.open .ec-panel { transform: none; }

.ec-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px; border-bottom: 1px solid var(--ec-line);
}
.ec-head h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }

.ec-x {
  background: none; border: 0; font-size: 26px; line-height: 1;
  cursor: pointer; color: #9a9ca1; padding: 0 4px;
}
.ec-x:hover { color: var(--ec-ink); }

.ec-body { flex: 1; overflow-y: auto; padding: 8px 22px; }
.ec-foot { border-top: 1px solid var(--ec-line); padding: 18px 22px 22px; }

.ec-line { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--ec-line); }
.ec-line:last-child { border-bottom: 0; }
.ec-thumb {
  width: 74px; height: 74px; flex: 0 0 74px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(160deg, #fdfbf6, #efe9db);
}
.ec-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ec-info { flex: 1; min-width: 0; }
.ec-info h4 { margin: 0 0 4px; font-size: 15px; }
.ec-price { font-size: 14px; color: #6b6d72; display: block; margin-bottom: 10px; }

.ec-qty { display: flex; align-items: center; gap: 8px; }
.ec-qty button {
  width: 26px; height: 26px; border: 1px solid var(--ec-line); background: #fff;
  border-radius: 7px; cursor: pointer; font-size: 15px; line-height: 1; color: var(--ec-ink);
}
.ec-qty button:hover { border-color: var(--ec-ink); }
.ec-qty span { min-width: 20px; text-align: center; font-size: 14px; font-weight: 600; }
.ec-qty .ec-del {
  width: auto; height: auto; border: 0; padding: 0 0 0 10px; font-size: 12px;
  color: #9a9ca1; text-decoration: underline; background: none;
}
.ec-qty .ec-del:hover { color: var(--ec-signal); }

.ec-tot { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.ec-tot strong { font-size: 20px; }
.ec-note { font-size: 12px; color: #9a9ca1; margin: 4px 0 14px; }
.ec-checkout { display: block; width: 100%; text-align: center; }
.ec-viewcart {
  display: block; text-align: center; margin-top: 12px;
  font-size: 13px; color: #6b6d72; text-decoration: underline;
}

.ec-empty { text-align: center; padding: 56px 12px; color: #9a9ca1; }
.ec-empty svg {
  width: 46px; height: 46px; fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; margin-bottom: 12px;
}
.ec-empty p { margin: 0 0 18px; font-size: 15px; }

/* ---------- overlay de recherche ---------- */
.ec-sbox {
  position: absolute; left: 50%; top: 12vh; transform: translate(-50%, -10px);
  width: min(620px, calc(100% - 32px));
  background: var(--ec-bg); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(28,30,34,.28);
  transition: transform .24s cubic-bezier(.22,.8,.3,1);
}
.ec-search.open .ec-sbox { transform: translate(-50%, 0); }

.ec-sfield { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--ec-line); }
.ec-sfield svg {
  width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: #9a9ca1;
  stroke-width: 1.8; stroke-linecap: round;
}
.ec-sfield input {
  flex: 1; border: 0; outline: 0; font: inherit; font-size: 17px;
  background: none; color: var(--ec-ink); min-width: 0;
}
.ec-sres { max-height: 58vh; overflow-y: auto; padding: 8px 0 12px; }
.ec-hint { padding: 22px 20px; margin: 0; color: #9a9ca1; font-size: 14px; }

.ec-sr-group h4 {
  margin: 12px 0 4px; padding: 0 20px; font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: #9a9ca1;
}
.ec-sr {
  display: flex; align-items: center; gap: 14px; padding: 12px 20px;
  text-decoration: none; color: inherit;
}
.ec-sr:hover { background: #faf7f0; }
.ec-sr-img {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 10px; overflow: hidden;
  background: linear-gradient(160deg, #fdfbf6, #efe9db);
}
.ec-sr-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ec-sr-txt { flex: 1; min-width: 0; }
.ec-sr-txt strong { display: block; font-size: 15px; font-weight: 600; }
.ec-sr-txt span { display: block; font-size: 13px; color: #6b6d72; }
.ec-sr-go { width: 18px; height: 18px; fill: none; stroke: #c8c4bb; stroke-width: 2; stroke-linecap: round; }
.ec-sr-add { padding: 8px 16px; font-size: 13px; }

/* ---------- toast ---------- */
.ec-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  background: var(--ec-ink); color: #fff; padding: 13px 20px; border-radius: 12px;
  font-size: 14px; z-index: 1200; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.ec-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ec-toast.err { background: var(--ec-signal); }

@media (max-width: 640px) {
  .ec-sbox { top: 6vh; }
  .ec-panel { width: 100%; }
}

/* Badge « bientot de retour » : pose par hydrate() sur toutes les pages,
   mais seule la boutique le declarait dans son CSS inline */
.badge.b-soon { background: rgba(199,161,107,.20); color: #8a6a35; }
