/* HAT Wishlist — cœur gris au bout du nom du produit (H1), libellé déroulé au survol,
   rouge + éclat au clic. Tailles en px : indépendantes de la taille du titre. */
.hatwl { display: none; }                         /* attend que front.js le place */
.hatwl.hatwl--placed { display: inline-block; vertical-align: middle; margin-left: 10px; line-height: 1; }
.hatwl.hatwl--placed.hatwl--off { display: none; }
.hatwl-btn {
  display: inline-flex; align-items: center;
  padding: 2px; margin: 0; background: none; border: 0; border-radius: 999px;
  color: #9aa0a6; cursor: pointer; line-height: 1;
  font-family: inherit; font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: normal;
  -webkit-tap-highlight-color: transparent;
}
.hatwl-btn:focus { outline: none; }
.hatwl-btn:focus-visible { outline: 2px solid #9aa0a6; outline-offset: 3px; }
.hatwl-icon { position: relative; display: inline-flex; width: 24px; height: 24px; flex: none; }
.hatwl-heart {
  width: 24px; height: 24px; overflow: visible;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round;
  transition: fill .2s, stroke .2s, transform .2s;
}
.hatwl-btn:hover .hatwl-heart { stroke: #6b7076; }
.hatwl-btn.is-active .hatwl-heart,
.hatwl-btn.is-active:hover .hatwl-heart { fill: #e0245e; stroke: #e0245e; }
.hatwl-btn.is-busy { pointer-events: none; }

/* Libellé qui se déroule */
.hatwl-label {
  display: inline-block; max-width: 0; overflow: hidden; white-space: nowrap;
  opacity: 0; margin-left: 0; color: #6b7076; font-size: 14px; font-weight: 400;
  transition: max-width .35s ease, opacity .25s ease, margin-left .35s ease;
}
.hatwl-label::before { content: attr(data-text); }
@media (hover: hover) {
  .hatwl-btn:hover .hatwl-label,
  .hatwl-btn:focus-visible .hatwl-label { max-width: 220px; opacity: 1; margin-left: 6px; }
}

/* Éclat : un anneau qui s'ouvre + 8 étincelles */
.hatwl-burst { position: absolute; inset: 0; pointer-events: none; }
.hatwl-burst::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid #e0245e; opacity: 0; transform: scale(.2);
}
.hatwl-burst i {
  position: absolute; left: 50%; top: 50%; width: 3px; height: 7px; margin: -3.5px 0 0 -1.5px;
  border-radius: 2px; background: #e0245e; opacity: 0;
  transform: rotate(var(--a)) translateY(0);
}
.hatwl-burst i:nth-child(1) { --a: 0deg; }
.hatwl-burst i:nth-child(2) { --a: 45deg; background: #ff8a3d; }
.hatwl-burst i:nth-child(3) { --a: 90deg; }
.hatwl-burst i:nth-child(4) { --a: 135deg; background: #ff8a3d; }
.hatwl-burst i:nth-child(5) { --a: 180deg; }
.hatwl-burst i:nth-child(6) { --a: 225deg; background: #ff8a3d; }
.hatwl-burst i:nth-child(7) { --a: 270deg; }
.hatwl-burst i:nth-child(8) { --a: 315deg; background: #ff8a3d; }
.hatwl-btn.hatwl-pop .hatwl-heart { animation: hatwl-pop .45s cubic-bezier(.17,.89,.32,1.28); }
.hatwl-btn.hatwl-pop .hatwl-burst::before { animation: hatwl-ring .45s ease-out; }
.hatwl-btn.hatwl-pop .hatwl-burst i { animation: hatwl-spark .6s ease-out; }
@keyframes hatwl-pop { 0% { transform: scale(.6); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes hatwl-ring { 0% { opacity: .9; transform: scale(.2); border-width: 6px; } 100% { opacity: 0; transform: scale(1.7); border-width: 0; } }
@keyframes hatwl-spark {
  0% { opacity: 0; transform: rotate(var(--a)) translateY(-8px) scaleY(.4); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-22px) scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
  .hatwl-btn.hatwl-pop .hatwl-heart, .hatwl-btn.hatwl-pop .hatwl-burst::before, .hatwl-btn.hatwl-pop .hatwl-burst i { animation: none; }
  .hatwl-label { transition: none; }
}

/* Cœur des vignettes : pastille blanche en haut à droite de l'image */
.hatwl-host { position: relative; }
.hatwl-btn.hatwl-btn--mini {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  width: 34px; height: 34px; padding: 0; justify-content: center;
  background: rgba(255,255,255,.92); box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: transform .15s, box-shadow .15s;
}
.hatwl-btn--mini .hatwl-icon, .hatwl-btn--mini .hatwl-heart { width: 20px; height: 20px; }
.hatwl-btn--mini .hatwl-heart { stroke-width: 2; }
@media (hover: hover) {
  .hatwl-btn.hatwl-btn--mini:hover { transform: scale(1.08); box-shadow: 0 2px 8px rgba(0,0,0,.22); }
}
@media (max-width: 575px) {
  .hatwl-btn.hatwl-btn--mini { top: 6px; right: 6px; width: 30px; height: 30px; }
  .hatwl-btn--mini .hatwl-icon, .hatwl-btn--mini .hatwl-heart { width: 18px; height: 18px; }
}

/* Message éphémère */
.hatwl-toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 10000; transform: translate(-50%, 1rem);
  max-width: calc(100% - 2rem); padding: .7rem 1rem; border-radius: 8px;
  background: #222; color: #fff; font-size: .9rem; box-shadow: 0 6px 20px rgba(0,0,0,.25);
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.hatwl-toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.hatwl-toast a { color: #fff; text-decoration: underline; margin-left: .5rem; white-space: nowrap; }


/* Page « Mes favoris » */
.hatwl-list { list-style: none; margin: 0; padding: 0; }
.hatwl-item {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 1rem; align-items: center;
  padding: 1rem 0; border-bottom: 1px solid rgba(0,0,0,.08);
  transition: opacity .25s;
}
.hatwl-item.is-removing { opacity: 0; }
.hatwl-thumb img { width: 96px; height: 96px; object-fit: contain; display: block; }
.hatwl-name { font-weight: 600; color: inherit; }
.hatwl-muted { color: #777; font-size: .85rem; }
.hatwl-price { margin-top: .25rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.hatwl-regular { text-decoration: line-through; color: #888; font-size: .85rem; }
.hatwl-current { font-weight: 700; }
.hatwl-avail { font-size: .85rem; margin-top: .2rem; }
.hatwl-avail--available { color: #1a7f37; }
.hatwl-avail--last_remaining_items { color: #b26a00; }
.hatwl-avail--unavailable { color: #b42318; }
.hatwl-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.hatwl-actions form { margin: 0; }
.hatwl-remove { font-size: .85rem; color: #777; text-decoration: underline; }
.hatwl-empty { text-align: center; padding: 2.5rem 1rem; }
.hatwl-empty svg { fill: none; stroke: #e0245e; stroke-width: 1.4; margin-bottom: .75rem; }
/* Ordinateur : petites cartes en grille plutôt qu'une ligne pleine largeur */
@media (min-width: 768px) {
  .hatwl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.25rem; }
  .hatwl-item {
    display: flex; flex-direction: column; gap: .5rem; padding: 1rem;
    border: 1px solid rgba(0,0,0,.08); border-radius: 10px; background: #fff;
    transition: box-shadow .2s, opacity .25s;
  }
  .hatwl-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
  .hatwl-thumb img { width: 100%; height: 170px; object-fit: contain; }
  .hatwl-info { flex: 1; }
  .hatwl-name { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: .95rem; }
  .hatwl-actions { align-items: stretch; text-align: center; }
  .hatwl-actions form { width: 100%; }
  .hatwl-actions .btn { width: 100%; white-space: normal; }
  .hatwl-remove { align-self: center; }
}

/* Lien « Favoris » de l'en-tête, avec compteur */
.hatwl-head { position: relative; text-decoration: none; color: inherit; }
.hatwl-head:hover { text-decoration: none; }
.hatwl-head-ico { position: relative; display: inline-flex; vertical-align: middle; }
.hatwl-head-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.hatwl-count {
  position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: #e0245e; color: #fff; font: 600 11px/18px Arial, sans-serif; text-align: center;
}
.hatwl-count:empty { display: none; }
.hatwl-head--arpa { margin-right: 15px; }
.hatwl-head--arpa .hatwl-head-ico svg { width: 30px; height: 30px; stroke: #101010; }
.hatwl-head--um .hatwl-head-ico svg, .hatwl-head--km .hatwl-head-ico svg { width: 22px; height: 22px; }
.hatwl-head--kd .hatwl-head-ico svg { width: 21px; height: 21px; }

@media (max-width: 575px) {
  .hatwl-item { grid-template-columns: 72px 1fr; }
  .hatwl-thumb img { width: 72px; height: 72px; }
  .hatwl-actions { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}
.hatwl-head--ud .hatwl-head-ico svg, .hatwl-head--um .hatwl-head-ico svg { stroke-width: 2; }
/* arpa-rocket en petit écran : le cœur prend place sans chevaucher le logo */
@media (max-width: 430px) {
  .header__right > .user-info.header__rightitem, .hatwl-head--arpa { margin-right: 6px; }
  .hatwl-head--arpa .hatwl-head-ico svg { width: 26px; height: 26px; }
}
@media (max-width: 369px) {
  .hatwl-head--arpa { display: none; }
}
