/* ============================================================
   FLEXXISTAY WISHLIST STYLES (wishlist.css)
   Device-agnostic styles for the account wishlist: hearts,
   header control, slide-over panel and toasts. Works on desktop
   and mobile; the mobile rules only refine sizing/positioning.
   ============================================================ */

/* ---------- Hearts ---------- */
.flexxi-heart {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.94);
  color: #64748b;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 6px 16px -6px rgba(15, 23, 42, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.flexxi-heart:hover { transform: scale(1.06); color: #ef4444; border-color: rgba(239, 68, 68, 0.35); }
.flexxi-heart:active { transform: scale(0.94); }
.flexxi-heart i { pointer-events: none; }
.flexxi-heart--saved { color: #ef4444; background: #fff1f2; border-color: rgba(239, 68, 68, 0.35); }
.flexxi-heart--saved:hover { background: #ffe4e6; }

/* Detail-page heart (title area) */
.flexxi-heart--detail {
  position: static;
  width: 42px;
  height: 42px;
  margin: 10px 0 2px;
  border-radius: 14px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 1.1rem;
}
.flexxi-heart--detail.flexxi-heart--saved { background: #fff1f2; }

/* Mobile title area: anchor the heart to the card corner */
@media (max-width: 768px) {
  .mobile-hotel-name-section { position: relative; }
  .mobile-hotel-name-section .flexxi-heart--detail {
    position: absolute;
    top: 12px;
    right: 14px;
    margin: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
  }
  .hotel-card-modern .flexxi-heart,
  .hotel-card .flexxi-heart { top: 10px; right: 10px; width: 36px; height: 36px; }
}

/* ---------- Header control ---------- */
.flexxi-wishlist-header-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #6366f1;
  font-size: 1.05rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.flexxi-wishlist-header-btn:hover { border-color: #6366f1; color: #ef4444; }
.flexxi-wishlist-header-btn--has-items { color: #ef4444; border-color: #fecaca; background: #fff7f7; }
.flexxi-wishlist-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 19px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
}

/* ---------- Panel ---------- */
body.flexxi-wishlist-open { overflow: hidden; }

.flexxi-wishlist-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100050;
  background: rgba(15, 23, 42, 0.5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.flexxi-wishlist-backdrop.show { opacity: 1; }

.flexxi-wishlist-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 420px;
  max-width: 92vw;
  z-index: 100051;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -16px 0 48px -12px rgba(15, 23, 42, 0.35);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.flexxi-wishlist-panel.open { transform: translateX(0); }

.flexxi-wishlist-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  border-bottom: 1px solid #eef1f6;
  flex-shrink: 0;
}
.flexxi-wishlist-panel-head h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}
.flexxi-wishlist-panel-head h3 i { color: #ef4444; }
.flexxi-wishlist-close {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}
.flexxi-wishlist-close:hover { background: #e2e8f0; color: #0f172a; }

.flexxi-wishlist-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 16px;
  -webkit-overflow-scrolling: touch;
}

.flexxi-wishlist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
  transition: background 0.15s ease;
}
.flexxi-wishlist-row:hover { background: #f8fafc; }
.flexxi-wishlist-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}
.flexxi-wishlist-row-img,
.flexxi-wishlist-row-ic {
  width: 62px;
  height: 62px;
  flex-shrink: 0;
  border-radius: 14px;
  object-fit: cover;
  display: block;
}
.flexxi-wishlist-row-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  color: #6366f1;
  font-size: 1.25rem;
}
.flexxi-wishlist-row-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.flexxi-wishlist-row-text strong {
  font-size: 0.94rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.flexxi-wishlist-row-text small {
  font-size: 0.76rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}
.flexxi-wishlist-row-text small i { color: #6366f1; font-size: 0.7rem; }
.flexxi-wishlist-row-remove {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}
.flexxi-wishlist-row-remove:hover { background: #fee2e2; }

.flexxi-wishlist-empty {
  text-align: center;
  padding: 56px 24px;
  color: #94a3b8;
}
.flexxi-wishlist-empty i {
  font-size: 2.4rem;
  color: #cbd5e1;
  display: block;
  margin-bottom: 14px;
}
.flexxi-wishlist-empty p { margin: 0; font-size: 0.92rem; line-height: 1.6; }

.flexxi-wishlist-panel-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid #eef1f6;
  background: #fbfcfe;
}
.flexxi-wishlist-sync-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
}
.flexxi-wishlist-sync-note i { color: #6366f1; }
.flexxi-wishlist-view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 11px;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease;
}
.flexxi-wishlist-view-all:hover { transform: translateY(-1px); }

/* ---------- Toast ---------- */
.flexxi-wishlist-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 18px);
  z-index: 100060;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 18px 40px -12px rgba(15, 23, 42, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.flexxi-wishlist-toast.show { opacity: 1; transform: translate(-50%, 0); }
.flexxi-wishlist-toast--success i { color: #fb7185; }
.flexxi-wishlist-toast--info i { color: #93c5fd; }

/* ---------- Mobile: bottom sheet ---------- */
@media (max-width: 768px) {
  .flexxi-wishlist-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 84vh;
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
  }
  .flexxi-wishlist-panel.open { transform: translateY(0); }
  .flexxi-wishlist-panel-head { padding: 18px 18px 14px; }
  .flexxi-wishlist-panel-head::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: #e2e8f0;
  }
  .flexxi-wishlist-panel-head { position: relative; }
  .flexxi-wishlist-panel-foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .flexxi-wishlist-toast { bottom: 84px; }
}

/* The header heart is desktop-only: mobile already has a dedicated Wishlist
   tab in the bottom navigation, so hide the header control on small screens. */
@media (max-width: 768px) {
  .flexxi-wishlist-header-btn { display: none !important; }
}
