/**
 * AbayaFemme wishlist — the confirmation popup only.
 *
 * Split out of wishlist.css on 2026-08-16. That file's own docblock said the
 * popup loaded globally and the account styles only on the endpoint; the code
 * loaded all 44 Ko on every page, including pages with no wishlist button at
 * all — a policy page, the cart, an article. This half is the part that
 * genuinely has to be there before the customer clicks, because the popup it
 * styles appears in response to that click.
 */

.wd-popup-wishlist-wrap {
  --wd-popup-width: min(31rem, calc(100vw - 2rem));
}

.wd-popup-wishlist-wrap .mfp-content {
  max-width: var(--wd-popup-width);
  font-family: var(--af-font-ui);
}

.wd-popup-wishlist-wrap .mfp-container {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.wd-popup-wishlist {
  position: relative;
  padding: 2.75rem 3rem 2.5rem;
  overflow: hidden;
  color: var(--af-text-default);
  background: var(--af-color-ivory);
  border: 1px solid var(--af-color-border-strong);
  border-radius: 0.125rem;
  box-shadow: var(--af-shadow-lg);
}

.wd-popup-wishlist::after {
  position: absolute;
  inset: 0 0 auto;
  height: 0.25rem;
  content: "";
  background: var(--af-color-olive-600);
}

.wd-popup-wishlist-wrap .mfp-close {
  top: 0.75rem;
  right: 0.75rem;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--af-text-default);
  background: transparent;
  border: 0;
  opacity: 1;
}

.wd-popup-wishlist-wrap .wd-popup-close {
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
}

.wd-popup-wishlist-wrap .wd-popup-close > a {
  --wd-action-color: var(--af-text-default);
  --wd-action-color-hover: var(--af-color-olive-700);
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
}

.wd-popup-wishlist-wrap .wd-wishlist-add-success {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

.wd-popup-wishlist-wrap .wd-wishlist-add-success::before {
  width: 9rem;
  height: 9rem;
  margin: 0 auto 1.25rem;
  content: "";
  background-image: url("../images/wishlist/wishlist-couture-heart.webp");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.wd-popup-wishlist-wrap .wd-wishlist-add-success .title {
  display: block;
  max-width: 21rem;
  margin: 0 auto 1.75rem;
  color: var(--af-text-default);
  font-family: var(--af-font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 500;
  line-height: 1.1;
  text-transform: none;
}

.wd-popup-wishlist-wrap .wd-wishlist-add-success .title::before {
  display: block;
  margin-bottom: 0.65rem;
  content: "Votre sélection";
  color: var(--af-color-olive-700);
  font-family: var(--af-font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  line-height: 1.2;
  text-transform: uppercase;
}

.wd-popup-wishlist-wrap .wd-popup-wishlist .btn {
  min-height: 3.25rem;
  padding: 0.85rem 1.25rem;
  border-radius: 0;
  font-family: var(--af-font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--af-duration-base) var(--af-ease), background-color var(--af-duration-base) var(--af-ease), border-color var(--af-duration-base) var(--af-ease);
}

.wd-popup-wishlist-wrap .wd-popup-wishlist .wd-wishlist-back-to-lists,
.wd-popup-wishlist-wrap .wd-popup-wishlist .wd-wishlist-save-btn {
  --btn-color: var(--af-text-inverse);
  --btn-color-hover: var(--af-text-inverse);
  --btn-bgcolor: var(--af-action-bg);
  --btn-bgcolor-hover: var(--af-action-bg-hover);
  --btn-brd-color: var(--af-action-bg);
  --btn-brd-color-hover: var(--af-action-bg-hover);
  color: var(--af-text-inverse);
  background: var(--af-action-bg);
  border: 1px solid var(--af-action-bg);
}

.wd-popup-wishlist-wrap .wd-popup-wishlist .wd-wishlist-back-to-lists:hover,
.wd-popup-wishlist-wrap .wd-popup-wishlist .wd-wishlist-save-btn:hover {
  color: var(--af-text-inverse);
  background: var(--af-action-bg-hover);
  border-color: var(--af-action-bg-hover);
}

.wd-popup-wishlist-wrap .wd-popup-wishlist .wd-wishlist-back-to-shop,
.wd-popup-wishlist-wrap .wd-popup-wishlist .wd-wishlist-back-btn {
  min-height: 2.5rem;
  margin-top: 0.55rem;
  color: var(--af-text-link);
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.wd-wishlist-group-list {
  margin-top: 0.75rem;
  margin-bottom: 1.25rem;
  border-block: 1px solid var(--af-color-border);
}

.wd-wishlist-group-list li + li {
  border-top: 1px solid var(--af-color-border);
}

.wd-wishlist-group-list label,
.wd-wishlist-add-group > a {
  min-height: 3rem;
  padding-block: 0.8rem;
  color: var(--af-text-default);
  font-size: 0.9rem;
}

.wd-wishlist-create-group label {
  color: var(--af-text-default);
  font-size: 0.82rem;
  font-weight: 600;
}

.wd-wishlist-create-group input {
  min-height: 3.1rem;
  margin-top: 0.5rem;
  background: var(--af-surface-raised);
  border: 1px solid var(--af-color-border-strong);
  border-radius: 0;
}

.af-wishlist-error {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  margin-top: 1rem;
  color: var(--af-color-danger);
  text-align: left;
  background: color-mix(in srgb, var(--af-color-danger) 8%, var(--af-color-ivory));
  border-inline-start: 3px solid var(--af-color-danger);
}

.af-wishlist-error strong {
  font-size: 0.9rem;
}

.af-wishlist-error span {
  color: var(--af-text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.af-wishlist-failed .wd-wishlist-save-btn {
  display: flex;
}

@media (max-width: 640px) {
  .wd-popup-wishlist-wrap {
    --wd-popup-width: 100vw;
  }

  .wd-popup-wishlist-wrap .mfp-container {
    display: flex;
    align-items: flex-end;
    padding: 0;
  }

  .wd-popup-wishlist-wrap .mfp-content {
    margin: 0;
  }

  .wd-popup-wishlist {
    width: 100vw;
    max-height: min(88vh, 46rem);
    padding: 2.25rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
    overflow-y: auto;
    border-inline: 0;
    border-bottom: 0;
  }

  .wd-popup-wishlist-wrap .wd-wishlist-add-success::before {
    width: 6.25rem;
    height: 6.25rem;
    margin-bottom: 1rem;
  }

  .wd-popup-wishlist-wrap .wd-wishlist-add-success .title {
    margin-bottom: 1.25rem;
    font-size: 1.85rem;
  }

  .wd-popup-wishlist-wrap .wd-popup-wishlist .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wd-popup-wishlist,
  .wd-wishlist-add-success {
    animation: none;
  }
}
