/* My HERA: wish list hearts, the nav counter, toasts and the sign-in panel.
   Loaded on product pages by tools/products/build.py and on every other page by shared/wishlist.js.
   Tokens fall back to the brand values, since landing pages do not load fitted.css. */
:root {
  --wl-ink: var(--fx-ink, #1A3A4A);
  --wl-body: var(--fx-body, #3B4A52);
  --wl-muted: var(--fx-muted, #56646B);
  --wl-line: var(--fx-line, #CFDDE2);
  --wl-bg: var(--fx-bg, #EEF7F9);
  --wl-teal: var(--fx-teal, #3D8B9E);
  --wl-teal-ink: var(--fx-teal-ink, #2D6E7E);
  --wl-gold: var(--fx-gold, #C8A96E);
  --wl-heart: #D4574A;
  --wl-bad: #B3261E;
  --wl-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wl-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
[data-wl-heart][hidden] { display: none !important; }

/* ── Heart on a product card ─────────────────────────── */
.wl-item, .wl-host { position: relative; }
/* Hearts placed on landing-page cards by shared/wishlist.js: keep the icon clear of the page's own svg rules. */
.wl-host > .wl-heart svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wl-host > .wl-heart[aria-pressed="true"] svg { fill: currentColor; }
.wl-heart {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.92); color: var(--wl-ink);
  box-shadow: 0 2px 10px rgba(26, 58, 74, 0.12);
  transition: transform .16s var(--wl-ease-out), background .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}
.wl-heart svg { width: 20px; height: 20px; transition: fill .2s; }
.wl-heart:active { transform: scale(0.94); }
.wl-heart:focus-visible, .wl-save:focus-visible { outline: 2px solid var(--wl-teal); outline-offset: 2px; }
.wl-heart[aria-pressed="true"] { color: var(--wl-heart); }
.wl-heart[aria-pressed="true"] svg, .wl-save[aria-pressed="true"] svg { fill: currentColor; }
.wl-heart.wl-pop svg, .wl-save.wl-pop svg { animation: wl-pop .38s var(--wl-ease); }
@keyframes wl-pop { 0% { transform: scale(0.7); } 55% { transform: scale(1.18); } 100% { transform: scale(1); } }
@media (hover: hover) and (pointer: fine) { .wl-heart:hover { background: #fff; color: var(--wl-heart); } }

.pd-main { position: relative; }
.wl-heart-lg { top: 14px; right: 14px; width: 48px; height: 48px; }
.wl-heart-lg svg { width: 22px; height: 22px; }

/* ── "Save to wish list" under the product buttons ───── */
.wl-save {
  flex-basis: 100%; display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 0.92rem; font-weight: 600;
  color: var(--wl-teal-ink); -webkit-tap-highlight-color: transparent;
}
.wl-save svg { width: 20px; height: 20px; flex-shrink: 0; transition: fill .2s; }
.wl-save[aria-pressed="true"] { color: var(--wl-heart); }
.wl-save .wl-save-on, .wl-save[aria-pressed="true"] .wl-save-off { display: none; }
.wl-save[aria-pressed="true"] .wl-save-on { display: inline; }

/* ── Nav counter ─────────────────────────────────────── */
.wl-nav { position: relative; display: inline-flex !important; align-items: center; justify-content: center; width: 40px; height: 40px; }
.wl-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wl-nav.has-items svg { fill: var(--wl-heart); stroke: var(--wl-heart); }
.wl-count {
  position: absolute; top: 1px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--wl-ink); color: #fff; font: 600 0.68rem/18px 'DM Sans', system-ui, sans-serif; text-align: center; letter-spacing: 0;
}
.wl-count:empty { display: none; }
.wl-nav-m { position: relative; }
.wl-nav-m svg { fill: none !important; stroke: rgba(255, 255, 255, 0.8); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
nav.scrolled .wl-nav-m svg, body.nav-solid .wl-nav-m svg { stroke: var(--wl-ink); }
.wl-nav-m.has-items svg { fill: var(--wl-heart) !important; stroke: var(--wl-heart) !important; }
.wl-nav-m .wl-count { top: -6px; right: -6px; }

/* ── Toast ───────────────────────────────────────────── */
.wl-toasts {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 95; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none;
}
body.has-sticky .wl-toasts { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
.wl-toast {
  pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px 12px 16px; border-radius: 14px; background: var(--wl-ink); color: #F4FAFB;
  font: 400 0.9rem/1.4 'DM Sans', system-ui, sans-serif; box-shadow: 0 14px 36px rgba(26, 58, 74, 0.28);
  animation: wl-toast-in .26s var(--wl-ease-out);
}
.wl-toast.is-out { opacity: 0; transform: translateY(8px); transition: opacity .18s ease-out, transform .18s ease-out; }
.wl-toast-text { flex: 1; min-width: 0; }
.wl-toast-ok { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #3FA37C; color: #fff; }
.wl-toast-ok svg { width: 12px; height: 12px; }
.wl-toast button {
  flex-shrink: 0; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.3);
  background: none; color: #fff; font: 600 0.84rem 'DM Sans', system-ui, sans-serif; cursor: pointer;
}
.wl-toast button:active { transform: scale(0.97); }
.wl-toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--wl-gold); transform-origin: left; animation: wl-bar linear forwards; }
@keyframes wl-toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes wl-bar { to { transform: scaleX(0); } }

/* ── Sign-in panel ───────────────────────────────────── */
/* Above every floating widget on the site (the reviews badge sits very high), so nothing covers the form. */
.mh-overlay { position: fixed; inset: 0; z-index: 2147483000; background: rgba(15, 35, 45, 0.5); opacity: 0; transition: opacity .25s ease-out; }
.mh-overlay.is-open { opacity: 1; }
.mh-panel {
  position: fixed; z-index: 2147483001; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  display: flex; flex-direction: column; background: #fff; color: var(--wl-body);
  font: 400 0.95rem/1.55 'DM Sans', system-ui, sans-serif; box-shadow: -18px 0 48px rgba(26, 58, 74, 0.18);
  transform: translateX(100%); transition: transform .32s var(--wl-ease);
}
.mh-panel.is-open { transform: none; }
.mh-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.mh-brand { font: 600 0.72rem 'DM Sans', system-ui, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wl-teal-ink); }
.mh-close { width: 44px; height: 44px; margin-right: -10px; display: grid; place-items: center; border: 0; background: none; border-radius: 50%; cursor: pointer; color: var(--wl-ink); }
.mh-close:hover { background: var(--wl-bg); }
.mh-close svg { width: 20px; height: 20px; }
.mh-body { flex: 1; overflow-y: auto; padding: 8px 22px 28px; -webkit-overflow-scrolling: touch; }
.mh-panel h2 { font: 500 1.9rem/1.12 'Cormorant Garamond', Georgia, serif; color: var(--wl-ink); margin: 6px 0 8px; text-wrap: balance; }
.mh-lede { color: var(--wl-muted); margin: 0 0 18px; }
.mh-saved { display: flex; align-items: center; gap: 12px; padding: 10px; margin: 0 0 20px; border-radius: 14px; background: var(--wl-bg); }
.mh-saved img { width: 56px; height: 56px; border-radius: 10px; background: #fff; object-fit: contain; flex-shrink: 0; }
.mh-saved-name { font-weight: 600; color: var(--wl-ink); line-height: 1.3; }
.mh-saved-note { display: flex; align-items: center; gap: 6px; font-size: 0.84rem; color: var(--wl-heart); }
.mh-saved-note svg { width: 14px; height: 14px; fill: currentColor; }
.mh-perks { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 8px; }
.mh-perks li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; }
.mh-perks span[aria-hidden] { flex-shrink: 0; }

.mh-label { display: block; font-weight: 600; color: var(--wl-ink); font-size: 0.88rem; margin: 0 0 6px; }
.mh-field { margin: 0 0 16px; }
.mh-err { min-height: 1.3em; margin: 6px 0 0; font-size: 0.82rem; color: var(--wl-bad); }
.mh-note { font-size: 0.82rem; color: var(--wl-muted); margin: 6px 0 0; }

/* Phone: country picker beside the national number (shared/phone-field.js) */
.pf-search {
  width: 100%; height: 40px; margin: 0 0 8px; padding: 0 12px; border: 1px solid var(--wl-line); border-radius: 10px;
  font: inherit; font-size: 16px; color: var(--wl-ink); background: #fff;
}
.pf-row { display: grid; grid-template-columns: minmax(0, 132px) minmax(0, 1fr); gap: 8px; }
.pf-row select, .pf-row input {
  height: 52px; border: 1px solid var(--wl-line); border-radius: 12px; background-color: #fff; color: var(--wl-ink);
  font: inherit; font-size: 16px; padding: 0 14px; min-width: 0; width: 100%;
}
.pf-row select {
  appearance: none; -webkit-appearance: none; padding-right: 2.5rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A3A4A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 1rem;
}
.pf-row select:focus, .pf-row input:focus, .pf-search:focus { outline: 2px solid var(--wl-teal); outline-offset: 1px; border-color: var(--wl-teal); }
.pf-row input.bad { border-color: var(--wl-bad); }
.pf-msg { min-height: 1.3em; margin: 6px 0 0; font-size: 0.82rem; color: var(--wl-bad); }
.pf-msg.is-info { color: var(--wl-teal-ink); }

.mh-check { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; margin: 4px 0 4px; font-size: 0.88rem; cursor: pointer; }
.mh-check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--wl-teal); cursor: pointer; }
.mh-check a, .mh-body a:not(.mh-btn) { color: var(--wl-teal-ink); text-underline-offset: 3px; }
.mh-ts { min-height: 66px; margin: 14px 0 6px; }
.mh-notice { display: none; margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: #FDF1EF; color: #7A2018; font-size: 0.88rem; }
.mh-notice.show { display: block; }
.mh-link { border: 0; background: none; padding: 0; font: inherit; color: var(--wl-teal-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.mh-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 22px;
  border: 0; border-radius: 999px; background: var(--wl-teal); color: #fff; font: 600 0.96rem 'DM Sans', system-ui, sans-serif;
  cursor: pointer; text-decoration: none; transition: background .2s, transform .16s var(--wl-ease-out);
}
.mh-btn:hover { background: var(--wl-teal-ink); }
.mh-btn:active { transform: scale(0.98); }
.mh-btn[disabled] { opacity: 0.6; cursor: default; }
.mh-btn-line { background: #fff; color: var(--wl-ink) !important; border: 1px solid var(--wl-line); }
.mh-btn-line:hover { background: var(--wl-bg); }
.mh-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.mh-btn + .mh-btn, .mh-stack > * + * { margin-top: 10px; }
.mh-btn-line svg { color: var(--wl-teal); }
.mh-added { display: flex; align-items: center; gap: 12px; margin: 10px 0 0; padding: 12px 16px; border-radius: 14px; background: #E9F5F0; color: #1F5B45; font-size: 0.9rem; line-height: 1.4; }
.mh-added svg { width: 20px; height: 20px; flex-shrink: 0; }
.mh-added strong { font-weight: 600; }
.mh-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--wl-muted); font-size: 0.82rem; }
.mh-or::before, .mh-or::after { content: ""; flex: 1; height: 1px; background: var(--wl-line); }
.mh-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; animation: mh-spin .7s linear infinite; }
.mh-btn-line .mh-spin { border-color: var(--wl-line); border-top-color: var(--wl-teal); }
@keyframes mh-spin { to { transform: rotate(360deg); } }

/* Six code boxes */
.mh-code { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 0 0 6px; }
.mh-code input {
  width: 100%; height: 58px; border: 1px solid var(--wl-line); border-radius: 12px; background: #fff; color: var(--wl-ink);
  font: 600 1.5rem 'DM Sans', system-ui, sans-serif; text-align: center; padding: 0;
}
.mh-code input:focus { outline: 2px solid var(--wl-teal); outline-offset: 1px; border-color: var(--wl-teal); }
.mh-code.bad input { border-color: var(--wl-bad); }
.mh-row { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; font-size: 0.88rem; color: var(--wl-muted); }
.mh-done-mark { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #FBEDEB; color: var(--wl-heart); margin: 10px 0 14px; }
.mh-done-mark svg { width: 26px; height: 26px; fill: currentColor; }

@media (max-width: 640px) {
  .mh-panel {
    top: auto; left: 0; right: 0; width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0;
    transform: translateY(100%); box-shadow: 0 -18px 48px rgba(26, 58, 74, 0.2); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mh-panel h2 { font-size: 1.7rem; }
  .mh-code input { height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  .wl-heart, .wl-heart svg, .mh-panel, .mh-overlay, .wl-toast, .mh-btn { transition: none !important; animation: none !important; }
  .wl-toast-bar { animation: wl-bar linear forwards !important; }
}
@media print { .wl-heart, .wl-save, .wl-toasts, .mh-panel, .mh-overlay, .wl-nav, .wl-nav-m { display: none !important; } }
