/* ===========================================
   Wishlist — Heart Button on Service Cards
   =========================================== */

.wishlist-heart-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    /* Modern glassmorphism — frosted translucent pill that reads on any image */
    background: rgba(17, 24, 39, 0.30);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.25s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.wishlist-heart-btn:hover {
    background: rgba(17, 24, 39, 0.45);
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.wishlist-heart-btn:active {
    transform: scale(0.9);
}

.wishlist-heart-btn:focus-visible {
    outline: 2px solid #f43f5e;
    outline-offset: 2px;
}

.wishlist-heart-icon {
    font-size: 16px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    transition: color 0.2s ease, transform 0.2s ease;
    pointer-events: none; /* clicks bubble to the button itself */
    line-height: 1;
}

/* Active state — service is in wishlist (toggled by Phase 3 JS) */
.wishlist-heart-btn.is-active {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 18px rgba(244, 63, 94, 0.35);
}

.wishlist-heart-btn.is-active .wishlist-heart-icon,
.wishlist-heart-btn.is-active .wishlist-heart-icon.fas {
    color: #f43f5e;
    text-shadow: none;
    animation: wishlist-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes wishlist-pop {
    0% { transform: scale(0.6); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ===========================================
   Wishlist — Gallery variant (service detail page)
   =========================================== */

.wishlist-heart-btn--gallery {
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
}

.wishlist-heart-btn--gallery .wishlist-heart-icon {
    font-size: 17px;
}

/* ===========================================
   Wishlist Page — scoped under .wishlist-page
   =========================================== */
.wishlist-page {
    --wl-ink: #0f172a;
    --wl-muted: #64748b;
    --wl-line: #e5e9f2;
    --wl-brand: #5b6ef5;
    --wl-brand-dark: #4453d6;
    --wl-rose: #f43f5e;
    --wl-surface: #fff;
    padding: 0 0 72px;
    color: var(--wl-ink);
}

/* --- Hero header --- */
.wishlist-hero {
    position: relative;
    overflow: hidden;
    padding: 54px 0 44px;
    margin-bottom: 34px;
    background:
        radial-gradient(1100px 320px at 12% -10%, rgba(91, 110, 245, 0.18), transparent 60%),
        radial-gradient(900px 320px at 88% 0%, rgba(244, 63, 94, 0.14), transparent 62%),
        linear-gradient(180deg, #f7f8fd 0%, #fdfdff 100%);
    border-bottom: 1px solid var(--wl-line);
}

.wishlist-hero__inner {
    text-align: center;
    position: relative;
    z-index: 1;
}

.wishlist-page__title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.wishlist-page__title-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    background: linear-gradient(135deg, #f43f5e, #fb7185);
    box-shadow: 0 10px 24px rgba(244, 63, 94, 0.32);
    animation: wl-heartbeat 2.8s ease-in-out infinite;
}

@keyframes wl-heartbeat {
    0%, 72%, 100% { transform: scale(1); }
    78% { transform: scale(1.09); }
    84% { transform: scale(1); }
    90% { transform: scale(1.06); }
}

.wishlist-page__subtitle {
    color: var(--wl-muted);
    font-size: 16px;
    margin: 0 0 14px;
}

.wishlist-page__count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(91, 110, 245, 0.10);
    border: 1px solid rgba(91, 110, 245, 0.18);
    color: var(--wl-brand-dark);
    font-size: 13px;
    font-weight: 600;
}

.wishlist-page__count:empty {
    display: none;
}

/* --- Filters --- */
.wishlist-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 32px;
}

.wishlist-filter-btn {
    padding: 0 20px;
    min-height: 46px;
    border: 1.5px solid var(--wl-line);
    background: var(--wl-surface);
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: border-color 0.22s, color 0.22s, background 0.22s, box-shadow 0.22s, transform 0.22s;
    -webkit-tap-highlight-color: transparent;
}

.wishlist-filter-btn i {
    font-size: 13px;
    opacity: 0.75;
}

.wishlist-filter-btn:hover {
    border-color: rgba(91, 110, 245, 0.55);
    color: var(--wl-brand-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.07);
}

.wishlist-filter-btn.is-active {
    background: linear-gradient(135deg, var(--wl-brand), #7b8bff);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 22px rgba(91, 110, 245, 0.34);
}

.wishlist-filter-btn.is-active i { opacity: 1; }

/* Filter buttons for categories with nothing saved are hidden by JS */
.wishlist-filter-btn[hidden] { display: none; }

/* --- Grid --- */
.wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}

/* --- Card --- */
.wl-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--wl-surface);
    border: 1px solid var(--wl-line);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    animation: wl-card-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes wl-card-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.wl-card.is-leaving {
    animation: wl-card-out 0.28s ease forwards;
    pointer-events: none;
}

@keyframes wl-card-out {
    to { opacity: 0; transform: scale(0.94); }
}

.wl-card:hover {
    transform: translateY(-6px);
    border-color: rgba(91, 110, 245, 0.35);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.13);
}

/* Media */
.wl-card__media {
    position: relative;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background: #eef1f7;
}

.wl-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.wl-card:hover .wl-card__image { transform: scale(1.06); }

.wl-card__media-veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.28) 0%, rgba(15, 23, 42, 0) 42%, rgba(15, 23, 42, 0.05) 100%);
    pointer-events: none;
}

.wl-card__type,
.wl-card__rating {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
}

.wl-card__type {
    top: 12px;
    left: 12px;
    color: var(--wl-brand-dark);
}

.wl-card__type i { font-size: 11px; }

.wl-card__rating {
    bottom: 12px;
    left: 12px;
    color: #0f172a;
}

.wl-card__rating i { color: #f5a524; font-size: 11px; }

.wl-card__heart { z-index: 4; }

/* Body */
.wl-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 18px 18px;
    gap: 8px;
}

.wl-card__title {
    font-size: 16.5px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin: 0;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wl-card__link {
    color: inherit;
    text-decoration: none;
}

/* Stretched link — the whole card is clickable, the heart sits above it */
.wl-card__link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
}

.wl-card:hover .wl-card__link { color: var(--wl-brand-dark); }

.wl-card__location {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 13.5px;
    color: var(--wl-muted);
}

.wl-card__location i { color: var(--wl-rose); font-size: 12px; }

.wl-card__meta {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 0;
    padding: 0;
}

.wl-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    background: #f4f6fb;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.wl-card__meta-item i { font-size: 11px; color: var(--wl-brand); }

/* Footer pinned to the bottom so prices and CTAs line up across the row */
.wl-card__footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--wl-line);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.wl-card__price-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 1px;
}

.wl-card__price {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--wl-ink);
    line-height: 1.1;
}

.wl-card__currency {
    font-size: 13px;
    font-weight: 700;
    color: var(--wl-muted);
    margin-left: 2px;
}

.wl-card__price-unit {
    font-size: 11.5px;
    color: var(--wl-muted);
    text-transform: lowercase;
}

.wl-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 11px;
    background: rgba(91, 110, 245, 0.10);
    color: var(--wl-brand-dark);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.wl-card__cta i {
    font-size: 11px;
    transition: transform 0.25s ease;
}

.wl-card:hover .wl-card__cta {
    background: linear-gradient(135deg, var(--wl-brand), #7b8bff);
    color: #fff;
    box-shadow: 0 8px 18px rgba(91, 110, 245, 0.34);
}

.wl-card:hover .wl-card__cta i { transform: translateX(3px); }

/* --- Loading (skeleton) --- */
.wishlist-loading {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}

.wishlist-loading__card {
    border: 1px solid var(--wl-line);
    border-radius: 20px;
    overflow: hidden;
    background: var(--wl-surface);
}

.wishlist-loading__media { aspect-ratio: 16 / 11; }

.wishlist-loading__body { padding: 16px 18px 20px; }

.wishlist-loading__line {
    height: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.wishlist-loading__line--sm { width: 55%; }
.wishlist-loading__line--xs { width: 35%; margin-bottom: 0; }

.wishlist-loading__media,
.wishlist-loading__line {
    background: linear-gradient(100deg, #eef1f7 30%, #f7f9fc 50%, #eef1f7 70%);
    background-size: 200% 100%;
    animation: wl-shimmer 1.3s linear infinite;
}

@keyframes wl-shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* --- Empty state --- */
.wishlist-empty {
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
    padding: 56px 24px 64px;
}

.wishlist-empty__icon {
    width: 96px;
    height: 96px;
    margin: 0 auto 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--wl-rose);
    background: radial-gradient(circle at 30% 25%, rgba(244, 63, 94, 0.16), rgba(91, 110, 245, 0.12));
    box-shadow: inset 0 0 0 1px rgba(244, 63, 94, 0.16);
}

.wishlist-empty__title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
}

.wishlist-empty__text {
    color: var(--wl-muted);
    margin: 0 0 26px;
}

.wishlist-empty .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 26px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--wl-brand), #7b8bff);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    border: none;
    box-shadow: 0 12px 26px rgba(91, 110, 245, 0.32);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.wishlist-empty .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(91, 110, 245, 0.4);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .wishlist-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 6px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .wishlist-filters::-webkit-scrollbar { display: none; }
}

@media (max-width: 640px) {
    .wishlist-hero { padding: 34px 0 28px; margin-bottom: 22px; }
    .wishlist-page__title { gap: 10px; }
    .wishlist-page__title-icon { width: 42px; height: 42px; font-size: 18px; border-radius: 13px; }
    .wishlist-page__subtitle { font-size: 14px; }
    .wishlist-grid,
    .wishlist-loading { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .wl-card { border-radius: 16px; }
    .wl-card__body { padding: 12px 12px 14px; gap: 6px; }
    .wl-card__title { font-size: 14px; }
    .wl-card__location { font-size: 12px; }
    .wl-card__meta { display: none; }
    .wl-card__footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-top: 10px;
    }
    .wl-card__price { font-size: 17px; }
    .wl-card__cta { justify-content: center; }
    .wl-card__type { font-size: 11px; padding: 5px 9px; }
}

/* Only the very narrowest phones drop to one column — 375px devices keep two */
@media (max-width: 359px) {
    .wishlist-grid,
    .wishlist-loading { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .wl-card,
    .wl-card__image,
    .wishlist-page__title-icon,
    .wishlist-loading__media,
    .wishlist-loading__line { animation: none !important; transition: none !important; }
}
