/* =========================================================
   mybaby.ma — Header 2026 (V2.1)
   Override des règles .topbar de style.css. Ce fichier est chargé
   après style.css, donc les sélecteurs identiques l'emportent.
   ========================================================= */

:root {
  --topbar-h-strip: 36px;       /* hauteur du bandeau live */
  --topbar-h-row: 72px;         /* hauteur de la ligne principale */
  --topbar-h: 108px;            /* total — override pour catbar/sidebar */
}

/* ----- conteneur global ----- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: auto;                  /* on relâche la hauteur fixe de l'ancien design */
  background: #FAF7F4;
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border, #ECDDD8);
  font-family: var(--font-body, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);
}

/* ----- bandeau live coral ----- */
.topbar-strip {
  background: linear-gradient(90deg, #FDF0EC 0%, #FAF7F4 60%);
  border-bottom: 1px solid #F0E1DC;
  font-size: 12px; color: #3A3A3A;
  padding: 7px max(20px, calc((100% - var(--container, 1280px)) / 2 + 24px));
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.topbar-strip .ts-l { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; min-width: 0; }
.topbar-strip .ts-l span { display: inline-flex; align-items: center; gap: 8px; }
.topbar-strip .ts-l b { color: #C05848; font-weight: 600; }
.topbar-strip .ts-live { width: 6px; height: 6px; border-radius: 50%; background: #6BBF8A; box-shadow: 0 0 0 3px rgba(107,191,138,0.22); animation: tbpulse 2.4s ease-in-out infinite; flex-shrink: 0; }
@keyframes tbpulse { 0%,100% { box-shadow: 0 0 0 3px rgba(107,191,138,0.22); } 50% { box-shadow: 0 0 0 5px rgba(107,191,138,0.10); } }
.topbar-strip .ts-region { color: #7A7068; }
.topbar-strip .ts-r { display: flex; align-items: center; gap: 18px; color: #7A7068; flex-shrink: 0; }
.topbar-strip .ts-r a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.topbar-strip .ts-r a:hover { color: #C05848; }
.topbar-strip .ts-pill { background: #1C1C1C; color: #fff; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; }

/* ----- ligne principale ----- */
.topbar-inner {
  max-width: var(--container, 1280px);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--topbar-h-row);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
}

/* ----- logo lockup ----- */
.tb-logo { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; flex-shrink: 0; }
.tb-logo .tb-logo-img { display: block; height: 40px; width: auto; }
.tb-logo .tb-logo-fallback { display: none; align-items: center; gap: 10px; font-family: var(--font-display, 'Fraunces', Georgia, serif); font-size: 22px; color: var(--ink-700, #1C1C1C); font-weight: 600; }
.tb-logo .tb-logo-fallback .logo-mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(140deg, #ECA090, #C05848); color: #fff; display: grid; place-items: center; font-family: 'Fraunces', Georgia, serif; font-size: 22px; font-weight: 700; }
.tb-logo .tb-logo-fallback .dot { color: #E07B65; }

/* ----- nav principale ----- */
.nav-main { display: flex; align-items: center; gap: 2px; }
.nav-main a {
  position: relative;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 15px; font-weight: 500;
  color: #3A3A3A;
  background: transparent;
  transition: background .15s ease, color .15s ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.nav-main a:hover { background: rgba(28,28,28,0.04); color: #1C1C1C; }
.nav-main a.active { background: transparent; color: #1C1C1C; }
.nav-main a.active::after {
  content: ""; position: absolute;
  left: 14px; right: 14px; bottom: -2px;
  height: 3px; border-radius: 2px;
  background: #E07B65;
}
.nav-main .nav-badge { display: inline-block; background: #6BBF8A; color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 999px; font-weight: 700; letter-spacing: 0.04em; line-height: 1; }
.nav-main .nav-badge-coral { background: #E07B65; }

/* ----- recherche desktop ----- */
.search-bar-desktop {
  flex: 1; max-width: 320px;
  margin-left: auto;
  display: flex; align-items: center;
  background: #fff;
  border: 1.5px solid var(--border, #ECDDD8);
  border-radius: 12px;
  padding: 4px 6px 4px 4px;
  transition: border-color .15s, box-shadow .15s;
  position: relative;
  z-index: 50;
}
.search-bar-desktop:focus-within {
  border-color: #E07B65;
  box-shadow: 0 0 0 4px rgba(224,123,101,0.10);
}
.search-bar-desktop .sb-cat {
  display: inline-flex; align-items: center; gap: 6px;
  background: #F7F5F4;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px; color: #3A3A3A; font-weight: 500;
  border: 0; cursor: pointer;
  flex-shrink: 0;
}
.search-bar-desktop .sb-cat:hover { background: var(--border, #ECDDD8); }
.search-bar-desktop input {
  flex: 1; min-width: 0;
  border: 0; background: transparent;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--ink-700, #1C1C1C);
  outline: none;
}
.search-bar-desktop input::placeholder { color: var(--ink-300, #B8AFA8); }
.search-bar-desktop .sb-kbd {
  font-size: 11px;
  color: #7A7068;
  background: #F7F5F4;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: ui-monospace, Menlo, monospace;
  margin-right: 4px;
  flex-shrink: 0;
}

/* ----- actions à droite ----- */
.nav-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.nav-right .icon-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: transparent; border: 0;
  display: grid; place-items: center;
  color: #3A3A3A; cursor: pointer;
  position: relative;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-right .icon-btn:hover { background: #F7F5F4; color: #1C1C1C; }
.nav-right .icon-btn .badge {
  position: absolute; top: 5px; right: 5px;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  background: #E07B65;
  color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; padding: 0 4px;
  border: 2px solid #FAF7F4;
  font-family: var(--font-body, ui-sans-serif, system-ui);
}
.nav-right .nr-div { width: 1px; height: 24px; background: var(--border, #ECDDD8); margin: 0 6px; }

/* ----- bouton auth (pilule) ----- */
.topbar-auth {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 14px 5px 5px;
  border: 1px solid var(--border, #ECDDD8);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-700, #1C1C1C);
  font-size: 13.5px; font-weight: 500;
  text-decoration: none;
  transition: border-color .15s, background .15s;
  white-space: nowrap;
}
.topbar-auth:hover { border-color: var(--ink-300, #DDD0C8); background: #FAF7F4; }
.topbar-auth.is-logged { padding-left: 5px; }
.topbar-auth:not(.is-logged) { padding-left: 14px; }
.topbar-auth .auth-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ECA090, #E07B65);
  color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
}

/* ----- mobile responsive ----- */
.search-icon-mobile { display: none; }
.btn-hamburger { display: none; }

@media (max-width: 1100px) {
  .search-bar-desktop { max-width: 280px; }
  .search-bar-desktop .sb-kbd { display: none; }
}

@media (max-width: 980px) {
  .nav-main { display: none; }
  .nav-right .icon-btn[aria-label="Mes favoris"],
  .nav-right .icon-btn[aria-label="Mes alertes"] { display: none; }
  .nav-right .nr-div { display: none; }
  .btn-hamburger { display: grid; }
}

@media (max-width: 720px) {
  :root { --topbar-h: 94px; }
  .topbar-strip { padding: 6px 16px; font-size: 11px; }
  .topbar-strip .ts-region { display: none; }
  .topbar-strip .ts-r a:not(:last-child) { display: none; }
  .topbar-inner { padding: 0 16px; gap: 12px; height: 64px; }
  .search-bar-desktop { display: none; }
  .search-icon-mobile {
    display: grid; place-items: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    background: transparent; border: 0;
    color: #3A3A3A; cursor: pointer;
    margin-left: auto;
  }
  .search-icon-mobile:hover { background: #F7F5F4; }
  .topbar-auth .auth-btn-label { display: none; }
  .topbar-auth:not(.is-logged) .auth-btn-label { display: inline; }
  .topbar-auth { padding: 5px 8px 5px 5px; }
}

/* =========================================================
   Menu dropdowns (desktop) + accordion (mobile)
   ========================================================= */
.nav-main { gap: 0; align-items: stretch; }
.nav-main .nav-item { position: relative; display: flex; align-items: stretch; }
.nav-main .nav-item > a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 15px; font-weight: 500;
  color: #3A3A3A;
}
.nav-main .nav-item:hover > a { background: rgba(28,28,28,0.04); color: #1C1C1C; }
.nav-main .nav-item > a.active { color: #1C1C1C; }
.nav-main .nav-item > a .nav-chev { opacity: 0.5; transition: transform .18s ease; }
.nav-main .nav-item:hover > a .nav-chev,
.nav-main .nav-item:focus-within > a .nav-chev { transform: rotate(180deg); opacity: 1; }
.nav-main .nav-item.is-active > a::after {
  content: ""; position: absolute;
  left: 14px; right: 14px; bottom: -2px;
  height: 3px; border-radius: 2px;
  background: #E07B65;
}

.nav-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: #fff;
  border: 1px solid #ECDDD8;
  border-radius: 14px;
  box-shadow: 0 12px 40px -10px rgba(28,28,28,0.18), 0 2px 6px rgba(28,28,28,0.04);
  min-width: 240px; padding: 6px;
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 300;
}
.nav-main .nav-item:hover .nav-dropdown,
.nav-main .nav-item:focus-within .nav-dropdown {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.nav-dropdown-item {
  display: block;
  padding: 9px 14px;
  border-radius: 8px;
  color: #3A3A3A;
  text-decoration: none;
  font-size: 14px;
  transition: background .12s, color .12s;
  font-weight: 500;
}
.nav-dropdown-item:hover { background: #FDF0EC; color: #C05848; }
.nav-dropdown-sep { height: 1px; background: #ECDDD8; margin: 4px 8px; }

/* Mobile drawer accordion */
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-link {
  padding: 12px 14px;
  border-radius: 8px;
  color: #1C1C1C;
  font-size: 16px;
  text-decoration: none;
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px;
}
.drawer-link:hover { background: #FAF7F4; }
.drawer-link.dl-flat { justify-content: flex-start; }
.dl-ic { display: inline-flex; align-items: center; color: #C05848; flex-shrink: 0; }
.drawer-acc { padding: 0; }
.drawer-acc summary { list-style: none; cursor: pointer; }
.drawer-acc summary::-webkit-details-marker { display: none; }
.drawer-acc[open] summary { background: #FDF0EC; color: #C05848; }
.drawer-acc .acc-chev { transition: transform .18s; }
.drawer-acc[open] .acc-chev { transform: rotate(180deg); }
.drawer-sub { padding: 4px 0 8px 14px; display: flex; flex-direction: column; gap: 1px; }
.drawer-sub-link { padding: 10px 14px; font-size: 15px; color: #3A3A3A; }
.drawer-sub-link:hover { color: #C05848; }

/* =========================================================
   Compare bar sticky (bottom) — V2.1
   ========================================================= */
.compare-bar-sticky {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(140%);
  width: min(960px, calc(100vw - 32px));
  background: #fff;
  border: 1.5px solid #ECDDD8;
  border-top: 3px solid #E07B65;
  border-radius: 16px;
  box-shadow: 0 18px 48px -12px rgba(28,28,28,0.25);
  padding: 12px 16px;
  z-index: 500;
  transition: transform .22s cubic-bezier(.2,.7,.3,1);
}
.compare-bar-sticky.visible { transform: translateX(-50%) translateY(0); }
.compare-bar-sticky .cb-inner {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--font-body, ui-sans-serif, system-ui);
}
.compare-bar-sticky .cb-count { font-size: 14px; color: #3A3A3A; white-space: nowrap; flex-shrink: 0; }
.compare-bar-sticky .cb-count strong { color: #E07B65; font-size: 18px; font-family: 'Fraunces', Georgia, serif; margin-right: 4px; }
.compare-bar-sticky .cb-chips { display: flex; gap: 6px; flex: 1; overflow-x: auto; min-width: 0; padding: 2px 0; }
.compare-bar-sticky .cb-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #FAF7F4;
  border: 1px solid #ECDDD8;
  border-radius: 999px;
  padding: 4px 4px 4px 12px;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
.compare-bar-sticky .cb-chip .cb-brand { color: #7A7068; text-transform: uppercase; letter-spacing: .06em; font-size: 10px; font-weight: 600; }
.compare-bar-sticky .cb-chip .cb-name { color: #1C1C1C; font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.compare-bar-sticky .cb-chip .cb-x { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 0; cursor: pointer; color: #7A7068; font-size: 11px; display: grid; place-items: center; }
.compare-bar-sticky .cb-chip .cb-x:hover { background: #E07B65; color: #fff; }
.compare-bar-sticky .cb-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.compare-bar-sticky .cb-cancel { background: transparent; border: 0; color: #7A7068; font-size: 13px; cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.compare-bar-sticky .cb-cancel:hover { background: #F7F5F4; color: #1C1C1C; }
.compare-bar-sticky .cb-compare {
  background: #E07B65; color: #fff;
  border: 0; border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px -4px rgba(224,123,101,0.55);
}
.compare-bar-sticky .cb-compare:hover { background: #C05848; }
@media (max-width: 700px) {
  .compare-bar-sticky { left: 8px; right: 8px; transform: translateY(140%); width: auto; }
  .compare-bar-sticky.visible { transform: translateY(0); }
  .compare-bar-sticky .cb-chips { display: none; }
}

/* =========================================================
   Cards produits — V2.1 (badge économie, alerte WhatsApp)
   ========================================================= */
.card { max-height: none; }
.card-badge.badge-savings {
  background: #E07B65; color: #fff;
  font-size: 11px; font-weight: 800;
  padding: 3px 8px; border-radius: 999px;
  letter-spacing: 0.02em;
}
.card-actions { display: flex; gap: 8px; align-items: center; }
.btn-coral-solid {
  display: inline-flex; align-items: center; justify-content: center;
  background: #E07B65; color: #fff !important;
  border: 0; border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.btn-coral-solid:hover { background: #C05848; }
.compare-chip { border: 1px solid #ECDDD8; background: #fff; }
.card-alert-btn {
  background: none; border: 0;
  display: inline-flex; align-items: center; gap: 6px;
  color: #7A7068; font-size: 12px;
  margin-top: 8px; padding: 0;
  cursor: pointer;
}
.card-alert-btn:hover { color: #C05848; }

/* =========================================================
   Hero homepage — trust badges + saving stat
   ========================================================= */
.hero-trust { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.hero-trust .trust-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff;
  border: 1px solid #ECDDD8;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px; color: #3A3A3A;
  font-weight: 500;
}
.hero-trust .trust-badge .ic { color: #6BBF8A; font-weight: 700; }
.hero-trust .trust-badge .ic-svg { display: inline-flex; align-items: center; }
.hero-saving { font-size: 17px; color: #3A3A3A; margin-top: 12px; line-height: 1.5; }
.hero-saving strong {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 24px;
  color: #E07B65;
  margin: 0 4px;
}

/* =========================================================
   Sticky sidebar (filtres)
   ========================================================= */
.sidebar, #filterSidebar {
  position: sticky;
  top: calc(var(--topbar-h, 108px) + 16px);
  max-height: calc(100vh - var(--topbar-h, 108px) - 32px);
  overflow-y: auto;
  align-self: start;
  padding-right: 8px;
}

/* =========================================================
   Catbar — pills sans emoji, cohérentes
   ========================================================= */
.catbar .cat-pill {
  display: inline-flex; align-items: center;
  height: 36px;
  padding: 0 16px;
  border: 1.5px solid #ECDDD8;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: #3A3A3A;
  background: #fff;
  white-space: nowrap;
  transition: all .15s;
}
.catbar .cat-pill .emoji { display: none; }
.catbar .cat-pill:hover { border-color: #DDD0C8; color: #1C1C1C; }
.catbar .cat-pill.active { background: #1C1C1C; color: #fff; border-color: #1C1C1C; }
