/* ==========================================================================
   Assortis Moi — Favoris
   Le cœur vit sur tout le site. Les variables --am-* sont posées sur :root
   par la charte, mais chaque valeur garde un repli au cas où la feuille ne
   serait pas chargée sur une page donnée.
   ========================================================================== */

.am-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, .94);
  border: 1.5px solid var(--am-border, #F0E4E8);
  border-radius: var(--am-radius-pill, 50px);
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  color: var(--am-muted, #8C6070);
  transition: color .2s, border-color .2s, background .2s, transform .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
  line-height: 0;
}

.am-fav svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill .2s;
}

.am-fav:hover {
  color: var(--am-rose, #E8466A);
  border-color: var(--am-rose, #E8466A);
}

.am-fav.is-on {
  color: var(--am-rose, #E8466A);
  border-color: var(--am-rose, #E8466A);
  background: var(--am-rose-pale, #FDF0F3);
}

.am-fav.is-on svg {
  fill: currentColor;
}

.am-fav.is-occupe {
  opacity: .55;
  pointer-events: none;
}

.am-fav.is-pulse {
  transform: scale(1.14);
}

/* En surimpression de l'image, en haut à droite — en grille comme sur la
   fiche. Le bandeau des promos de Flatsome occupe le haut à gauche.

   am-favoris.js marque le cadre de l'image avec .am-fav-ancre puis y glisse
   le cœur. Tant que ce n'est pas fait, le cœur reste dans le flux : mal
   placé, jamais parti flotter par-dessus le reste de la page. */

.am-fav-ancre {
  position: relative;
}

.am-fav-ancre > .am-fav--loop {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  box-shadow: var(--am-shadow-sm, 0 2px 8px rgba(28, 16, 24, .06));
}

.am-fav-ancre > .am-fav--gallery {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 42px;
  height: 42px;
  box-shadow: var(--am-shadow-sm, 0 2px 8px rgba(28, 16, 24, .06));
}

.am-fav-ancre > .am-fav--gallery svg {
  width: 19px;
  height: 19px;
}

/* Sur une carte de la page « Mes favoris ». */
.am-fav--carte {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
}

/* --------------------------------------------------------------------------
   Compteur (shortcode [am_favoris_compteur])
   -------------------------------------------------------------------------- */

.am-fav-compteur {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--am-text, #2A1520);
  text-decoration: none;
}

.am-fav-compteur svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.am-fav-compteur.has-items svg {
  fill: var(--am-rose, #E8466A);
  stroke: var(--am-rose, #E8466A);
}

.am-fav-compteur-n {
  position: absolute;
  top: 0;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 50px;
  background: var(--am-rose, #E8466A);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.am-fav-compteur:not(.has-items) .am-fav-compteur-n {
  display: none;
}

/* --------------------------------------------------------------------------
   Page « Mes favoris »
   -------------------------------------------------------------------------- */

.am-fav-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.am-fav-item {
  position: relative;
  background: var(--am-white, #fff);
  border: 1.5px solid var(--am-border, #F0E4E8);
  border-radius: var(--am-radius-lg, 16px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: opacity .2s, transform .2s, box-shadow .2s;
}

.am-fav-item:hover {
  box-shadow: var(--am-shadow-md, 0 4px 20px rgba(28, 16, 24, .08));
}

.am-fav-item.is-partant {
  opacity: 0;
  transform: scale(.96);
}

.am-fav-vignette {
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--am-cream-dark, #F5EDE8);
  overflow: hidden;
}

.am-fav-vignette img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.am-fav-corps {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.am-fav-nom {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--am-dark, #1C1018);
  text-decoration: none;
}

.am-fav-nom:hover {
  color: var(--am-rose, #E8466A);
}

.am-fav-prix {
  font-size: 14px;
  font-weight: 600;
  color: var(--am-dark, #1C1018);
}

.am-fav-prix del {
  color: var(--am-muted, #8C6070);
  font-weight: 400;
  opacity: .6;
  margin-right: 5px;
}

.am-fav-prix ins {
  color: var(--am-rose, #E8466A);
  font-weight: 700;
  text-decoration: none;
}

.am-fav-actions {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.am-fav-rupture {
  font-size: 12px;
  font-weight: 600;
  color: var(--am-red, #c0392b);
}

/* État vide */

.am-fav-vide {
  text-align: center;
  padding: 40px 20px 32px;
}

.am-fav-vide-ico {
  font-size: 40px;
  line-height: 1;
  color: var(--am-rose-mid, #FAD7DF);
  margin-bottom: 12px;
}

.am-fav-vide p {
  font-size: 13.5px;
  color: var(--am-muted, #8C6070);
  line-height: 1.6;
  margin: 0 auto 18px;
  max-width: 340px;
}

@media (max-width: 860px) {
  .am-fav-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .am-fav-grid { grid-template-columns: 1fr; }
  .am-fav-vignette { aspect-ratio: 16 / 10; }
  .am-fav-ancre > .am-fav--loop { top: 7px; right: 7px; width: 32px; height: 32px; }
  .am-fav--loop svg { width: 15px; height: 15px; }
  .am-fav-ancre > .am-fav--gallery { top: 9px; right: 9px; width: 38px; height: 38px; }
}
