/* Rend le panier toujours visible en haut à droite, sans casser tes styles existants. */

:root {
  --cart-fab-top: calc(10px + env(safe-area-inset-top));
  --cart-fab-right: calc(10px + env(safe-area-inset-right));
}

/* On s'appuie sur la classe existante .cart-link (déjà présente dans base.html et style.css) */
/* Ces règles surchargent uniquement la présentation, pas la structure ni les IDs. */
.header-row.header-brand-search .cart-link {
  position: fixed !important;
  top: var(--cart-fab-top) !important;
  right: var(--cart-fab-right) !important;
  z-index: 30000 !important; /* > header (20k), > chat (10k) — reste < popup promo (500k) */
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #ffffffd6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0,0,0,.10);
  backdrop-filter: blur(6px);
}

/* Icône */
.header-row.header-brand-search .cart-link img {
  width: 26px;
  height: 26px;
}

/* Badge (compteur) — conserve tes IDs existants (#cart-badge-count) */
.header-row.header-brand-search .cart-link .badge {
  position: absolute;
  top: -6px;
  right: -6px;
  transform: translate(30%, -30%);
  background: #14b8a6;   /* cohérent avec ta palette */
  color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 12px;
  min-width: 20px;
  line-height: 1.2;
}

/* Total à côté de l’icône — garde #cart-total */
.header-row.header-brand-search .cart-link .cart-total {
  font-weight: 700;
  color: #2563eb;
  font-size: 0.95rem;
}

/* Petits écrans : bulle compacte, on masque le total pour économiser l’espace */
@media (max-width: 640px) {
  .header-row.header-brand-search .cart-link {
    padding: 6px 8px;
    top: calc(8px + env(safe-area-inset-top));
    right: calc(8px + env(safe-area-inset-right));
  }
  .header-row.header-brand-search .cart-link .cart-total {
    display: none;
  }
  .header-row.header-brand-search .cart-link img {
    width: 24px;
    height: 24px;
  }
}

/* Évite que des éléments passent au-dessus par accident */
.header_00, .header-main { position: relative; }

/* Optionnel: au survol, petite mise en avant */
.header-row.header-brand-search .cart-link:hover {
  box-shadow: 0 8px 24px rgba(37,99,235,.20);
  border-color: #dbeafe;
}
