/* ─── Single product gallery ─── */
.product-gallery-meta {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.product-gallery-album {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.125rem;
  background-color: var(--white);
  color: var(--text);
  font-size: 1.125rem;
  line-height: 1.9;
}

.product-gallery .wishlist-link {
  position: relative;
  width: 4rem;
  height: 4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background-color: var(--white);
  color: var(--text);
  cursor: pointer;
  border-radius: 50%;
  transition:
    color 0.3s ease,
    transform 0.3s ease;
}

.product-gallery .wishlist-link:hover,
.product-gallery .wishlist-link.wished {
  color: var(--color1);
}

.product-gallery .wishlist-link:hover {
  transform: scale(1.06);
}

.product-gallery .wishlist-link .loding-wishlist {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  opacity: 0;
  pointer-events: none;
  stroke: currentColor;
  transition: opacity 0.15s ease;
}

.product-gallery .wishlist-link .loding-wishlist circle {
  stroke-dasharray: 90;
  stroke-dashoffset: 60;
}

.product-gallery .wishlist-link .wishlist-link__icon {
  font-size: 1.75rem;
  line-height: 1;
  transition: opacity 0.15s ease;
}

.product-gallery .wishlist-link.loading {
  pointer-events: none;
  cursor: wait;
}

.product-gallery .wishlist-link.loading .wishlist-link__icon {
  opacity: 0;
}

.product-gallery .wishlist-link.loading .loding-wishlist {
  opacity: 1;
  animation: wishlist-spin 0.8s linear infinite;
}

@keyframes wishlist-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Header link (desktop) ─── */
.header-wishlist-link {
  display: none;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
  transition: color 0.3s ease;
}

body:not(.home) .header-wishlist-link {
  color: var(--text);
}

.header-wishlist-link:hover {
  color: var(--color1);
}

.header-wishlist-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-wishlist-icon {
  font-size: 1.375rem;
  line-height: 1;
}

.header-wishlist-text {
  font-size: 0.875rem;
  line-height: 1;
  white-space: nowrap;
}

.header-wishlist-count {
  position: absolute;
  top: -3px;
  right: -5px;
  min-width: 13px;
  height: 13px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color1);
  color: var(--white);
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
  font-family: var(--en_font);
}

.header-wishlist-count.is-empty {
  display: none;
}

.header-top-divider {
  display: none;
  width: 1px;
  height: 1.25rem;
  background: var(--color3);
  flex: 0 0 auto;
  align-self: center;
}

body:not(.home) .header-top-divider {
  background: var(--color3);
}

/* ─── Wishlist page layout ─── */
.wishlist-page-body {
  margin: 25px 0 var(--space-section);
  position: relative;
}

.wishlist-page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 0.75rem;
}

.wishlist-page-grid .product-item-arch,
.wishlist-page-grid .product-item-arch--wishlist {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

@media (width >= 768px) {
  .wishlist-page-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem 1rem;
  }
}

@media (width >= 1200px) {
  .wishlist-page-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ─── Wishlist cards = this theme product card + remove ─── */
.product-item--wishlist {
  height: 100%;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.product-item--wishlist .product-image-wrap {
  position: relative;
}

.product-item--wishlist .product-image {
  border-radius: 1.5rem;
}

.wishlist-page-remove {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 4;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease;
}

.wishlist-page-remove:hover {
  background: var(--color1);
  color: var(--white);
  transform: scale(1.05);
}

.wishlist-page-remove.loading {
  opacity: 0.65;
  pointer-events: none;
}

.wishlist-page-remove .icon-favorite {
  font-size: 1.125rem;
  line-height: 1;
}

@media (width >= 768px) {
  .wishlist-page-remove {
    top: 1rem;
    left: 1rem;
    width: 2.75rem;
    height: 2.75rem;
  }

  .product-item--wishlist .product-image {
    border-radius: 1.75rem;
  }
}

/* ─── Empty state ─── */
.wishlist-empty-state {
  grid-column: 1 / -1;
  max-width: 440px;
  margin: 2rem auto 0;
  padding: clamp(2rem, 5vw, 3rem) clamp(1.25rem, 4vw, 2rem);
  text-align: center;
  background: var(--white);
  border: 1px solid var(--color3);
  border-radius: 1.5rem;
}

.wishlist-empty-state__icon {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color1) 10%, transparent);
  color: var(--color1);
}

.wishlist-empty-state__icon .icon-favorite {
  font-size: 1.75rem;
  line-height: 1;
}

.wishlist-empty-state__title {
  margin: 0 0 0.65rem;
  color: var(--text);
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  line-height: 1.5;
  font-variation-settings: "wght" 650;
}

.wishlist-empty-state__desc {
  margin: 0 0 1.5rem;
  color: var(--gray);
  font-size: 0.9375rem;
  line-height: 1.8;
}

.wishlist-empty-state__btn.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0 1.5rem;
  border-radius: 999px;
}

.wishlist-empty-state__btn i {
  font-size: 0.875rem;
}

/* ─── Mobile FAB ─── */
.wishlist-mobile-fab {
  display: none;
  position: fixed;
  left: 0;
  bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 9990;
  color: var(--white);
  text-decoration: none;
  transition: bottom 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

body.product-actions-fixed .wishlist-mobile-fab {
  bottom: calc(
    var(--product-actions-bar-h, 4.5rem) + 0.5rem +
      env(safe-area-inset-bottom, 0px)
  );
}

.wishlist-mobile-fab__body {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 8px;
  border-radius: 0 999px 999px 0;
  background: var(--text);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  transition:
    background 0.3s ease,
    box-shadow 0.3s ease,
    bottom 0.25s ease;
}

.wishlist-mobile-fab.has-items .wishlist-mobile-fab__body {
  background: var(--color1);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--color1) 40%, transparent);
}

.wishlist-mobile-fab__icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  flex: 0 0 auto;
}

.wishlist-mobile-fab__icon .icon-favorite {
  font-size: 16px;
  color: #fff;
  line-height: 1;
}

.wishlist-mobile-fab__label {
  font-size: 13px;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
}

.wishlist-mobile-fab__count {
  min-width: 20px;
  height: 20px;
  padding: 0 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--white);
  color: var(--color1);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
  font-family: var(--en_font);
}

.wishlist-mobile-fab__count.is-empty {
  display: none;
}

/* ─── Toast ─── */
.wbs-wishlist-alert {
  position: fixed;
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  color: var(--white);
  font-size: 0.875rem;
  z-index: 10002;
  max-width: calc(100vw - 2rem);
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  animation: wishlistToastIn 0.35s ease;
}

@keyframes wishlistToastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.wbs-wishlist-alert.success {
  background: var(--text);
}

.wbs-wishlist-alert.danger {
  background: var(--color1);
}

/* ─── Desktop ─── */
@media screen and (min-width: 992px) {
  .header-wishlist-link,
  .header-top-divider {
    display: inline-flex;
  }
}

/* ─── Mobile ─── */
@media screen and (max-width: 991.98px) {
  .wishlist-mobile-fab {
    display: block;
  }

  .product-gallery-meta {
    top: 0.75rem;
    left: 0.75rem;
  }

  .product-gallery .wishlist-link {
    width: 3rem;
    height: 3rem;
  }

  .product-gallery .wishlist-link .wishlist-link__icon {
    font-size: 1.35rem;
  }
}
