/* Lista "Salva per il negozio". Il link in header sta in mg-nav.css. */

/* alux.min.css veste ogni <button> (colore, hover, maiuscolo): i selettori qualificati per elemento vincono su quelle regole. */

.mg-wl { position: relative; }

button.mg-wl-btn,
a.mg-wl-btn {
  --wl-bg: var(--surface);
  --wl-fg: var(--ink);
  --wl-bd: var(--ink);
  --wl-sh: var(--accent);
  --wl-off: 2px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 6px 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  text-shadow: none;
  color: var(--wl-fg);
  background: var(--wl-bg);
  border: 2px solid var(--wl-bd);
  border-radius: 9px;
  box-shadow: var(--wl-off) var(--wl-off) 0 var(--wl-sh);
  cursor: pointer;
  transition: transform .1s, box-shadow .1s, background .14s;
}

button.mg-wl-btn:hover,
a.mg-wl-btn:hover {
  color: var(--wl-fg);
  background: var(--wl-bg);
  transform: translate(-1px, -1px);
  box-shadow: calc(var(--wl-off) + 1px) calc(var(--wl-off) + 1px) 0 var(--wl-sh);
}

button.mg-wl-btn:active,
a.mg-wl-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--wl-sh);
}

.mg-wl-btn:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

.mg-wl-ico {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Salvato: il cuore pieno e aria-pressed dicono lo stato, non solo il colore. */
button.mg-wl-btn[aria-pressed="true"] {
  --wl-bg: var(--accent);
  --wl-fg: var(--accent-ink);
  --wl-sh: var(--ink);
}
button.mg-wl-btn[aria-pressed="true"] .mg-wl-ico { fill: currentColor; }

button.mg-wl-btn[aria-pressed="true"].is-pop {
  animation: pop .7s cubic-bezier(.34, 1.56, .64, 1);
}

button.mg-wl-btn.is-loading {
  opacity: .6;
  cursor: progress;
}
button.mg-wl-btn.is-loading .mg-wl-ico {
  animation: mg-wl-pulse 1s ease-in-out infinite;
}
@keyframes mg-wl-pulse { 50% { transform: scale(1.25); } }

.mg-wl-err { display: none; }
button.mg-wl-btn.is-error {
  --wl-bg: var(--danger);
  --wl-fg: #fff;
  --wl-bd: var(--danger);
}
button.mg-wl-btn.is-error .mg-wl-lbl { display: none; }
button.mg-wl-btn.is-error .mg-wl-err { display: inline; }

/* Da scegliere: focalizzabile ma senza azione; il bordo tratteggiato non e' solo colore. */
button.mg-wl-btn.is-choose {
  --wl-bg: var(--surface-2);
  --wl-fg: var(--ink-2);
  --wl-bd: var(--ink-2);
  border-style: dashed;
  box-shadow: none;
  cursor: not-allowed;
}
button.mg-wl-btn.is-choose:hover,
button.mg-wl-btn.is-choose:active {
  transform: none;
  box-shadow: none;
}

a.mg-wl-btn.mg-wl-btn--choose {
  --wl-bg: transparent;
  border-style: dashed;
  box-shadow: none;
}
a.mg-wl-btn.mg-wl-btn--choose:hover,
a.mg-wl-btn.mg-wl-btn--choose:active {
  --wl-bg: var(--accent-soft);
  transform: none;
  box-shadow: none;
}

/* L'overlay di YITH resta per bloccare i doppi click ma non si vede: il segnale e' .is-loading. */
.mg-wl .blockUI.blockOverlay,
.mg-wl-list .blockUI.blockOverlay {
  background: transparent !important;
  opacity: 0 !important;
}

ul.products li.product .mg-wl { margin: 0 13px 13px; }
.mg-tile-body .mg-wl { margin: 0; }
.mg-wl.yith-wcwl-add-to-wishlist--single { margin: 0 0 20px; }
.variations_form .single_variation_wrap .mg-wl { margin: 12px 0 0; }

.yith-wcwl-add-to-wishlist--single .mg-wl-btn {
  --wl-off: 3px;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}
.yith-wcwl-add-to-wishlist--single .mg-wl-ico { width: 20px; height: 20px; }

@media (min-width: 681px) {
  .yith-wcwl-add-to-wishlist--single .mg-wl-btn { width: auto; }
}

/* Due righe riservate: cambiare stato non sposta la descrizione. */
.mg-wl-note {
  min-height: 2.8em;
  margin: 8px 0 0;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
}
.mg-wl-note a,
.mg-wl-guest a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

/* Scheletro: stessa altezza del pulsante, cosi' la sostituzione non sposta il layout. */
.mg-wl-skel {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 44px;
  background: var(--surface-2) var(--newsprint);
  border: 2px solid var(--line);
  border-radius: 9px;
  animation: mg-wl-skel 1.2s ease-in-out infinite;
}
.yith-wcwl-add-to-wishlist--single .mg-wl-skel {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-sm);
}
@media (min-width: 681px) {
  /* La larghezza del pulsante a contenuto non e' nota prima dell'arrivo del frammento. */
  .yith-wcwl-add-to-wishlist--single .mg-wl-skel { width: min(100%, 17rem); }
}
@keyframes mg-wl-skel { 50% { opacity: .6; } }

.mg-wl-timeout {
  visibility: hidden;
  padding: 0 8px;
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  color: var(--danger);
  animation: mg-wl-timeout .01s 6s forwards;
}
.yith-wcwl-add-to-wishlist--single .mg-wl-timeout { font-size: 13px; }
@keyframes mg-wl-timeout { to { visibility: visible; } }

.mg-wl-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 400;
  line-height: 1.05;
  color: var(--ink);
}

/* Il titolo e' l'h1 del tema. */
.mg-wl-page .wishlist-title-container { display: none; }

.mg-wl-intro {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}

.mg-wl-summary {
  margin: 20px 0 12px;
  font-family: var(--font-graff);
  font-size: 20px;
  letter-spacing: 1.5px;
  color: var(--ink);
}

.mg-wl-summary:focus-visible,
.mg-wl-empty-title:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

.mg-wl-error {
  margin: 0 0 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  color: var(--danger);
}

.mg-wl-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mg-wl-list.is-loading {
  opacity: .6;
  cursor: progress;
}

.mg-wl-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  margin: 0;
  padding: 12px;
  list-style: none;
  background: var(--surface);
  border: var(--outline-w) solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.mg-wl-item-media {
  display: block;
  align-self: start;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface-2) var(--newsprint);
  border: 2px solid var(--line);
  border-radius: 9px;
}
.mg-wl-item-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mg-wl-item-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mg-wl-item-name {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
}
.mg-wl-item-name:hover { text-decoration: underline; }

.mg-wl-item-attrs {
  margin: 4px 0 0;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-2);
}

.mg-wl-item-price {
  margin: 8px 0 0;
  font-family: var(--font-graff);
  font-size: 22px;
  line-height: 1;
  letter-spacing: 1.5px;
  color: var(--ink);
}
.mg-wl-item-price del {
  margin-right: 6px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink-3);
  text-decoration: line-through;
}
.mg-wl-item-price ins {
  color: var(--ink);
  text-decoration: none;
  background: none;
}

.mg-wl-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  min-width: 44px;
  min-height: 44px;
  margin-top: auto;
  padding: 0 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  text-decoration: underline;
}
.mg-wl-remove:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

@media (min-width: 681px) {
  .mg-wl-item { grid-template-columns: 112px minmax(0, 1fr); }
  .mg-wl-item-name { font-size: 17px; }
  .mg-wl-item-price { font-size: 24px; }
}

.mg-wl-guest {
  margin: 20px 0 0;
  padding: 12px 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--accent-2-soft);
  border: 2px solid var(--accent-2);
  border-radius: var(--radius-sm);
}

.mg-wl-empty {
  padding: 32px 8px;
  text-align: center;
  border-top: var(--dash);
  border-bottom: var(--dash);
}
.mg-wl-empty-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
}
.mg-wl-empty-text {
  max-width: 44ch;
  margin: 0 auto;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}
.mg-wl-empty .mg-btn { margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  button.mg-wl-btn[aria-pressed="true"].is-pop,
  button.mg-wl-btn.is-loading .mg-wl-ico,
  .mg-wl-skel {
    animation: none;
  }
  button.mg-wl-btn,
  a.mg-wl-btn {
    transition: background .14s;
  }
}
