/* ============================================================
   MARTAL — Wishlist Page
   wishlist.css | Mobile-First RTL
   New selectors ONLY.
   Inherits from:
     style.css          — global vars, buttons, products-grid, section,
                          hero__eyebrow, eyebrow-line, fade-in-up
     product-details.css — pd-breadcrumb
     shop.css            — shop-empty (empty state reuse)
     search.css          — search overlay
   ============================================================ */


/* ── 1. WISHLIST HERO ─────────────────────────────────────────── */
.wl-hero {
  position: relative;
  background: linear-gradient(160deg, var(--clr-rose) 0%, var(--clr-bg) 55%);
  padding-block: var(--sp-8) var(--sp-6);
  overflow: hidden;
}

.wl-hero__accent {
  position: absolute;
  inset-inline-end: -100px;
  top: -60px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--clr-nude) 0%, transparent 70%);
  opacity: 0.3;
  pointer-events: none;
}

.wl-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.wl-hero__content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.wl-hero__title {
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 900;
  color: var(--clr-text);
  line-height: 1.2;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.wl-hero__heart-icon {
  color: var(--clr-red);
  font-size: clamp(22px, 4vw, 30px);
  animation: heartBeat 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  14%       { transform: scale(1.18); }
  28%       { transform: scale(1); }
  42%       { transform: scale(1.12); }
  56%       { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .wl-hero__heart-icon { animation: none; }
}

.wl-hero__sub {
  font-size: clamp(13px, 2vw, 15px);
  color: var(--clr-muted);
  line-height: 1.7;
  max-width: 480px;
}

.wl-hero__count {
  font-size: 14px;
  color: var(--clr-muted);
  font-weight: 600;
}

.wl-hero__count strong {
  color: var(--clr-red);
  font-weight: 900;
}


/* ── 2. WISHLIST BODY ─────────────────────────────────────────── */
.wl-body {
  padding-block: var(--sp-8) var(--sp-10);
}


/* ── 3. TOOLBAR ───────────────────────────────────────────────── */
.wl-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  padding: var(--sp-4) var(--sp-5);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
}

.wl-toolbar__count {
  font-size: 14px;
  font-weight: 700;
  color: var(--clr-muted);
}

.wl-toolbar__count strong {
  color: var(--clr-text);
  font-weight: 900;
}

.wl-toolbar__actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* On very small screens, toolbar stacks */
@media (max-width: 479px) {
  .wl-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .wl-toolbar__actions {
    width: 100%;
  }
  .wl-toolbar__actions .btn {
    flex: 1;
  }
}


/* ── 4. WISHLIST GRID ─────────────────────────────────────────── */
/* .products-grid is fully defined in style.css — no override needed */

/* Card remove button — layered on top of the existing product card */
.wl-card-remove-btn {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);  /* RTL: right = visual left for the close corner */
  z-index: 4;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--clr-border-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--clr-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-fast), background var(--t-fast),
              color var(--t-fast), transform var(--t-fast);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Show on card hover via JS-applied .wl-card wrapper class,
   but also show always on touch devices */
@media (hover: none) {
  .wl-card-remove-btn { opacity: 1; }
}

.wl-card-remove-btn:hover {
  background: var(--clr-rose);
  color: var(--clr-red);
  transform: rotate(90deg) scale(1.1);
}

.wl-card-remove-btn:focus-visible {
  outline: 3px solid var(--clr-red);
  outline-offset: 2px;
  opacity: 1;
}

/* Show remove button when parent card is hovered */
.product-card:hover .wl-card-remove-btn {
  opacity: 1;
}

/* Removing animation */
.product-card.wl-removing {
  animation: wlCardOut var(--t-slow) ease forwards;
  pointer-events: none;
}

@keyframes wlCardOut {
  0%   { opacity: 1; transform: scale(1)    translateY(0); }
  100% { opacity: 0; transform: scale(0.88) translateY(-12px); }
}

@media (prefers-reduced-motion: reduce) {
  .product-card.wl-removing { animation: none; opacity: 0; }
}


/* ── 5. EMPTY STATE ───────────────────────────────────────────── */
/* .shop-empty from shop.css is fully reused — only delta here */

.wl-empty {
  padding-block: var(--sp-16);
}

.wl-empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: center;
  margin-top: var(--sp-2);
}


/* ── 6. NAVBAR: WISHLIST ICON ACTIVE STATE ────────────────────── */
/* .wishlist-nav-btn, .wishlist-nav-btn.active-page, .wl-nav-badge
   moved to style.css §22 — needed on every page, not just wishlist. */


/* ── 7. CONFIRM CLEAR DIALOG ──────────────────────────────────── */
/* Lightweight inline confirm — no separate modal needed */
.wl-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
}

.wl-confirm-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.wl-confirm-dialog {
  background: var(--clr-surface);
  border-radius: var(--r-xl);
  padding: var(--sp-8) var(--sp-6);
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.16);
  transform: scale(0.94) translateY(12px);
  transition: transform var(--t-slow);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.wl-confirm-overlay.open .wl-confirm-dialog {
  transform: scale(1) translateY(0);
}

.wl-confirm-dialog__icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--clr-rose);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 26px;
  color: var(--clr-red);
}

.wl-confirm-dialog__title {
  font-size: 18px;
  font-weight: 900;
  color: var(--clr-text);
}

.wl-confirm-dialog__text {
  font-size: 14px;
  color: var(--clr-muted);
  line-height: 1.7;
}

.wl-confirm-dialog__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}


/* ── 8. PAGE BOTTOM PADDING ───────────────────────────────────── */
@media (max-width: 1023px) {
  main { margin-bottom: 68px; }
}

@media (min-width: 1024px) {
  main { margin-bottom: 0; }

  .wa-fab { bottom: var(--sp-8); }
}


/* ── 9. PRINT ─────────────────────────────────────────────────── */
@media print {
  .announce-bar,
  .wa-fab,
  .mobile-bottom-nav,
  .wl-toolbar,
  .wl-confirm-overlay { display: none !important; }
}
