/**
 * Saved Properties (favorites) — heart button + saved page bits.
 * All selectors are feature-scoped (.invest-save-btn / .invest-sp-hp);
 * no global styles are modified.
 */

/* Anchor context for the heart: the card photo. position:relative on a figure
   with no other positioned children is visually inert. */
.archive-property-item figure {
    position: relative;
}

.archive-property-item .invest-save-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 5;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    color: #1a2e3f;
    font-size: 1.05rem;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.archive-property-item .invest-save-btn:hover,
.archive-property-item .invest-save-btn:focus {
    transform: scale(1.12);
    outline: none;
}

.archive-property-item .invest-save-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(31, 135, 157, 0.5);
}

.archive-property-item .invest-save-btn.is-saved {
    background: #dc3545;
    color: #fff;
}

.archive-property-item .invest-save-btn .invest-save-btn__icon {
    display: inline-block;
}

/* Pop animation on toggle */
@keyframes invest-save-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.archive-property-item .invest-save-btn--pop .invest-save-btn__icon {
    animation: invest-save-pop 0.35s ease;
}

/* Header nav link: heart + live count badge */
.invest-saved-nav .nav-link {
    position: relative;
    white-space: nowrap; /* keep "Saved Properties" on one line */
}

.invest-saved-nav .invest-saved-nav__count {
    position: absolute;
    top: 2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #dc3545;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

/* ── Nav breakpoint shift ─────────────────────────────────────────────────
   The "Saved Properties" menu item crowds the header below ~1320px: the
   logo shrinks and then disappears. The header nav uses .navbar-expand-custom
   (swapped from Bootstrap's .navbar-expand-lg in header.php) so the expand
   breakpoint is ours: hamburger below 1320px, full menu at 1320px and up.
   These rules mirror Bootstrap 4's compiled .navbar-expand-* block. */
@media (min-width: 1320px) {
    .navbar-expand-custom {
        flex-flow: row nowrap;
        justify-content: flex-start;
    }
    .navbar-expand-custom .navbar-nav {
        flex-direction: row;
    }
    .navbar-expand-custom .navbar-nav .dropdown-menu {
        position: absolute;
    }
    .navbar-expand-custom .navbar-nav .nav-link {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }
    .navbar-expand-custom > .container,
    .navbar-expand-custom > .container-fluid {
        flex-wrap: nowrap;
    }
    .navbar-expand-custom .navbar-collapse {
        display: flex;
        flex-basis: auto;
    }
    .navbar-expand-custom .navbar-toggler {
        display: none;
    }
}

/* ── Undo toast (saved page) ─────────────────────────────────────────────── */
.invest-sp-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 1050;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 6px;
    background: #1a2e3f;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translate(-50%, 8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.invest-sp-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    .invest-sp-toast {
        transition: none;
    }
}

/* Honeypot: visually removed, still in the DOM for bots */
.invest-sp-hp {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .archive-property-item .invest-save-btn,
    .archive-property-item .invest-save-btn--pop .invest-save-btn__icon {
        transition: none;
        animation: none;
    }
}
