/* =====================================================================
   BeautyNest — favourites (hearts, header shortcuts, side panel) and recently viewed.
   Loaded on every page by snippets/mkc-wishlist.liquid. Logical properties (RTL).
   ===================================================================== */
.mkc-fav[hidden], .mkc-hdr-btn[hidden], .mkc-hdr-btn__count[hidden] { display: none !important; }

/* ---------- Heart button ---------- */
.mkc-fav {
  --mkc-heart: #F2448B;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #3b1430;
  box-shadow: 0 4px 14px rgba(59, 20, 48, 0.14);
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
}
.mkc-fav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.mkc-fav:hover { color: var(--mkc-heart); transform: scale(1.06); }
.mkc-fav[aria-pressed="true"] { color: var(--mkc-heart); }
.mkc-fav[aria-pressed="true"] svg { fill: currentColor; }
.mkc-fav:focus-visible { outline: 2px solid var(--mkc-heart); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .mkc-fav { transition: none; } .mkc-fav:hover { transform: none; } }

/* On product cards and "Coups de cœur" cards: top corner of the photo. */
.product-card { position: relative; }
.product-card > .mkc-fav,
.mkc-pick__frame > .mkc-fav {
  position: absolute;
  z-index: 3;
  inset-block-start: 10px;
  inset-inline-end: 10px;
}
/* A product badge set to the right corner (Réglages > Badges) moves the heart below it. */
.product-card:has(> .badge[data-position$="right"]) > .mkc-fav { inset-block-start: 52px; }
.mkc-pick__frame > .mkc-fav { inset-block-start: 12px; inset-inline-end: 12px; }
@media (max-width: 639px) {
  .product-card > .mkc-fav, .mkc-pick__frame > .mkc-fav { width: 36px; height: 36px; inset-block-start: 8px; inset-inline-end: 8px; }
  .mkc-fav svg { width: 19px; height: 19px; }
}

/* Product page: beside the title. */
.mkc-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mkc-title-row > :first-child { flex: 1; min-width: 0; }
.mkc-fav[data-variant="page"] { flex: none; width: 46px; height: 46px; border: 1px solid #eadbe1; box-shadow: none; }
.mkc-fav[data-variant="mini"] { width: 34px; height: 34px; box-shadow: 0 2px 8px rgba(59, 20, 48, 0.12); }
.mkc-fav[data-variant="mini"] svg { width: 18px; height: 18px; }

/* ---------- Header shortcuts ---------- */
.mkc-hdr-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: rgb(var(--header-text-color, 18, 18, 18));
  cursor: pointer;
  text-decoration: none;
}
.mkc-hdr-btn svg { width: 22px; height: 22px; }
.mkc-hdr-btn:hover { background: rgba(255, 255, 255, 0.55); }
.mkc-hdr-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
.mkc-hdr-btn__count {
  position: absolute;
  inset-block-start: 2px;
  inset-inline-end: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #F2448B;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
.mkc-hdr-btn__dot {
  position: absolute;
  inset-block-end: 7px;
  inset-inline-end: 6px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--header-bg-color, #ffffff);
  border-radius: 50%;
  background: #1e8449;
}
@media (max-width: 480px) {
  body yc-header .actions { gap: 4px; }
  .mkc-hdr-btn { width: 36px; height: 36px; }
  .mkc-hdr-btn svg { width: 21px; height: 21px; }
}
/* Very small phones: the favourites stay in the menu, the header keeps account + cart. */
@media (max-width: 359px) {
  yc-header .mkc-hdr-btn[data-mkc-wl-open] { display: none !important; }
}

/* ---------- Side panel (native dialog) ---------- */
html.mkc-wl-open { overflow: hidden; }
.mkc-wl {
  width: min(420px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  margin-inline-start: auto;
  padding: 0;
  border: 0;
  background: #ffffff;
  color: var(--color-base-black, #121212);
  box-shadow: -10px 0 40px rgba(59, 20, 48, 0.18);
}
.mkc-wl::backdrop { background: rgba(30, 14, 24, 0.45); }
.mkc-wl[open] { animation: mkc-wl-in 0.22s ease-out; }
[dir="rtl"] .mkc-wl[open] { animation-name: mkc-wl-in-rtl; }
@keyframes mkc-wl-in { from { transform: translateX(24px); } to { transform: none; } }
@keyframes mkc-wl-in-rtl { from { transform: translateX(-24px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .mkc-wl[open] { animation: none; } }
.mkc-wl__panel { display: flex; flex-direction: column; height: 100%; }
.mkc-wl__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-block-end: 1px solid #f1e8ec;
  background: #FDF0F5;
}
.mkc-wl__title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--text-lg, 1.7rem); font-weight: 800; }
.mkc-wl__title svg { width: 22px; height: 22px; color: #F2448B; fill: currentColor; }
.mkc-wl__close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #ffffff; color: inherit; cursor: pointer; }
.mkc-wl__close:focus-visible { outline: 2px solid #F2448B; outline-offset: 1px; }
.mkc-wl__tabs { display: flex; gap: 6px; padding: 12px 18px 0; }
.mkc-wl__tabs [role="tab"] {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #eadbe1;
  border-radius: 999px;
  background: #ffffff;
  color: #5e4c53;
  font: inherit;
  font-size: var(--text-sm, 1.3rem);
  font-weight: 700;
  cursor: pointer;
}
.mkc-wl__tabs [aria-selected="true"] { border-color: #3b1430; background: #3b1430; color: #ffffff; }
.mkc-wl__tabs [role="tab"]:focus-visible { outline: 2px solid #F2448B; outline-offset: 2px; }
[data-mkc-wl-main] { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mkc-wl__body, .mkc-wl__shared { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px; overscroll-behavior: contain; }
.mkc-wl__shared { display: flex; flex-direction: column; gap: 14px; }
.mkc-wl__body[hidden], .mkc-wl__shared[hidden], [data-mkc-wl-main][hidden], .mkc-wl__foot[hidden] { display: none; }
.mkc-wl__foot { display: grid; gap: 8px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-block-start: 1px solid #f1e8ec; }
.mkc-wl__share, .mkc-wl__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #F2448B;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.mkc-wl__share[hidden] { display: none; }
.mkc-wl__share svg, .mkc-wl__cta svg { width: 18px; height: 18px; }
.mkc-wl__cta svg { fill: currentColor; }
.mkc-wl__share:hover, .mkc-wl__cta:hover { background: #d93578; }
.mkc-wl__note { margin: 0; font-size: 1.2rem; color: #6b5f64; text-align: center; }
.mkc-wl__empty { margin: 0; padding: 24px 8px; color: #5e4c53; text-align: center; line-height: 1.5; grid-column: 1 / -1; }

/* ---------- Product tiles (panel and account) ---------- */
.mkc-wl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 760px) { .mkc-wl-grid:not(.mkc-wl-grid--panel) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mkc-wl-card { position: relative; display: grid; gap: 8px; align-content: start; }
.mkc-wl-card__media { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #f6f1ec; }
.mkc-wl-card__media img { width: 100%; height: 100%; object-fit: cover; }
.mkc-wl-card__info { display: grid; gap: 2px; }
.mkc-wl-card__name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: var(--text-sm, 1.3rem);
  font-weight: 600;
  line-height: 1.35;
  color: inherit;
  text-decoration: none;
}
.mkc-wl-card__name:hover { color: #c6386f; text-decoration: underline; text-underline-offset: 3px; }
.mkc-wl-card__price { font-size: var(--text-sm, 1.3rem); font-weight: 800; }
.mkc-wl-card > .mkc-fav { position: absolute; inset-block-start: 6px; inset-inline-end: 6px; }

/* ---------- Toast ---------- */
.mkc-wl-toast {
  position: fixed;
  z-index: 1000;
  inset-block-end: calc(24px + env(safe-area-inset-bottom));
  inset-inline-start: 50%;
  padding: 10px 18px;
  border-radius: 999px;
  background: #3b1430;
  color: #ffffff;
  font-size: var(--text-sm, 1.3rem);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
[dir="rtl"] .mkc-wl-toast { transform: translate(50%, 8px); }
.mkc-wl-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
[dir="rtl"] .mkc-wl-toast.is-visible { transform: translate(50%, 0); }
.mkc-wl-toast:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .mkc-wl-toast { transition: none; } }

/* ---------- Add to cart from the favourites ---------- */
.mkc-wl-card__cta { display: grid; gap: 4px; margin-block-start: 2px; }
.mkc-wl-card__add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--mkc-btn-radius, 6px);
  background: rgb(var(--color-button, 255, 128, 197));
  color: rgb(var(--color-button-text, 59, 20, 48));
  font: inherit;
  font-size: var(--text-sm, 1.3rem);
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.mkc-wl-card__add svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mkc-wl-card__add:hover:not(:disabled) { background: var(--mkc-cta-hover, #F2448B); }
.mkc-wl-card__add:focus-visible { outline: 2px solid #F2448B; outline-offset: 2px; }
.mkc-wl-card__add:disabled { cursor: progress; opacity: 0.75; }
.mkc-wl-card__choose {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 10px;
  border: 1.5px solid #3b1430;
  border-radius: 999px;
  color: #3b1430;
  font-size: var(--text-sm, 1.3rem);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.mkc-wl-card__choose:hover { background: #3b1430; color: #ffffff; }
.mkc-wl-card__hint { font-size: 1.2rem; line-height: 1.35; color: #6b5f64; }
.mkc-wl-card__state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 999px;
  background: #f4f1f2;
  color: #6b5f64;
  font-size: var(--text-sm, 1.3rem);
  font-weight: 700;
}
@media (prefers-reduced-motion: reduce) { .mkc-wl-card__add { transition: none; } }

/* Panel footer: « Tout ajouter au panier » first, sharing as a secondary action. */
.mkc-wl__cta[hidden] { display: none; }
.mkc-wl__foot .mkc-wl__cta { width: 100%; }
.mkc-wl__foot .mkc-wl__cta svg { fill: none; }
.mkc-wl__cta:not([hidden]) ~ .mkc-wl__share { border: 1.5px solid #3b1430; background: #ffffff; color: #3b1430; }
.mkc-wl__cta:not([hidden]) ~ .mkc-wl__share:hover { background: #3b1430; color: #ffffff; }
.mkc-acc__wl-all { justify-self: start; }
.mkc-acc__wl-all[hidden] { display: none; }
@media (max-width: 640px) { .mkc-acc__wl-all { justify-self: stretch; } }

/* Toast with actions (undo, view cart): readable, clickable, stays while hovered or focused. */
.mkc-wl-toast {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  width: max-content;
  max-width: min(92vw, 520px);
  text-align: center;
  line-height: 1.4;
}
.mkc-wl-toast.has-actions { border-radius: 16px; padding: 12px 16px; pointer-events: auto; }
.mkc-wl-toast:not(.is-visible) { pointer-events: none; }
.mkc-wl-toast[data-tone="error"] { background: #8a1c13; }
.mkc-wl-toast__action {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  line-height: 34px;
  text-decoration: none;
  cursor: pointer;
}
.mkc-wl-toast__action:hover { background: rgba(255, 255, 255, 0.16); }
.mkc-wl-toast__action:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
/* Inside the open panel: the toast sits in the panel, above its footer. */
.mkc-wl > .mkc-wl-toast,
[dir="rtl"] .mkc-wl > .mkc-wl-toast {
  position: absolute;
  inset-inline: 16px;
  inset-block-end: 170px;
  width: auto;
  max-width: none;
  transform: translateY(8px);
}
.mkc-wl > .mkc-wl-toast.is-visible,
[dir="rtl"] .mkc-wl > .mkc-wl-toast.is-visible { transform: none; }
