body {
    background-color: #E2E8F0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    padding: 0;
    color: #1E232A;
}

/* Mobile Frame Container Styling */
.mobile-frame {
    width: 430px;
    min-height: 100vh;
    margin: 20px auto;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35);
    /* No overflow rule here on purpose: any overflow value on the frame (hidden, or even clip on some iPhone
       browsers) can break the sticky header and make touch scrolling stick. Nothing inside is wider than the frame. */
    position: relative;
    background: #F8F9FB;
    display: flex;
    flex-direction: column;
    border: 8px solid #FFFFFF;
}

@media (max-width: 430px) {
    body {
        background-color: #F8F9FB;
    }
    .mobile-frame {
        width: 100%;
        min-height: 0;
        box-shadow: none;
        margin: 0px;
        border-radius: 0px;
        border: none;
    }
}

/* Hide Scrollbars smoothly */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Subtle Gold Shimmer Effects */
.gold-gradient-bg {
    background: linear-gradient(135deg, #C5A059 0%, #D4AF37 50%, #9B7A38 100%);
}

.gold-gradient-text {
    background: linear-gradient(135deg, #F6E3A8 0%, #EBCB7A 50%, #DDB45A 100%);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.hero-overlay {
    background:
        linear-gradient(to top,
            rgba(23, 26, 31, 0.92) 0%,
            rgba(23, 26, 31, 0.75) 25%,
            rgba(23, 26, 31, 0.35) 50%,
            rgba(23, 26, 31, 0) 75%),
        linear-gradient(to bottom, rgba(23, 26, 31, 0.25) 0%, rgba(23, 26, 31, 0) 25%);
}

/* Modal slide-up animation */
@keyframes slide-up {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slide-up 0.3s ease-out;
}

/* Language toggle: highlight the active language */
.lang-opt {
    color: #9CA3AF;
}

.lang-opt.active {
    color: #8A6A2E;
    font-weight: 700;
}

/* Skeleton loading shimmer */
.skeleton {
    background: linear-gradient(90deg, #E2E6EC 0%, #F4F6F9 45%, #E2E6EC 90%);
    background-size: 240px 100%;
    background-repeat: repeat-x;
    animation: skeleton-shimmer 1.2s linear infinite;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -240px 0;
    }
    100% {
        background-position: 240px 0;
    }
}

/* Images fade in over their shimmer placeholder */
.img-fade {
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.5s ease;
}

.img-fade.loaded {
    opacity: 1;
}

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

/* Detail modal: show the skeleton instead of the content while loading */
#modalSkeleton {
    display: none;
}

#detailModal.is-loading #modalSkeleton {
    display: block;
}

#detailModal.is-loading #modalContent,
#detailModal.is-loading #modalTypeBadge,
#detailModal.is-loading #modalImgCaption {
    display: none;
}

/* Modals are fixed to the viewport (not the tall page frame) and capped to the phone-frame width */
#detailModal,
#valuationModal {
    position: fixed;
}

#detailModal > div,
#valuationModal > div {
    max-width: 430px;
}

/* Bottom navigation: always pinned to the bottom of the screen, aligned with the phone frame */
.bottom-nav {
    max-width: 414px; /* 430px frame minus its 8px borders */
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
}

@media (max-width: 430px) {
    .bottom-nav {
        max-width: none;
    }
}

/* Bottom nav skeleton: hide the real items (keeping the layout) and show shimmer placeholders while loading */
.nav-skeleton {
    display: none;
}

.bottom-nav.is-loading .nav-skeleton {
    display: flex;
}

.bottom-nav.is-loading > :not(.nav-skeleton) {
    visibility: hidden;
}

/* ---------- Modal animations (open + close) ---------- */
@keyframes modal-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modal-fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes sheet-up {
    from { transform: translateY(100%); opacity: 0.7; }
    to   { transform: translateY(0); opacity: 1; }
}

@keyframes sheet-down {
    from { transform: translateY(0); opacity: 1; }
    to   { transform: translateY(100%); opacity: 0.7; }
}

#detailModal,
#valuationModal {
    animation: modal-fade-in 0.25s ease-out;
}

#detailModal > div,
#valuationModal > div {
    animation: sheet-up 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

#detailModal.is-closing,
#valuationModal.is-closing {
    animation: modal-fade-out 0.24s ease-in forwards;
    pointer-events: none; /* ignore clicks while it is closing */
}

#detailModal.is-closing > div,
#valuationModal.is-closing > div {
    animation: sheet-down 0.26s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
    #detailModal,
    #valuationModal,
    #detailModal > div,
    #valuationModal > div {
        animation: none;
    }
}


/* ---- No accidental zooming on phones ---------------------------------------------------------------
   1) iPhone Safari zooms the whole page in when you tap a field whose text is smaller than 16px
      -> form text is 16px on phones AND on any touch screen (landscape phones are wider than 767px).
   2) Tapping a button twice quickly counts as "double-tap to zoom"
      -> touch-action: manipulation switches that off but keeps pinch-zoom for accessibility.
   3) Rotating the phone makes Safari enlarge the text on its own
      -> text-size-adjust: 100%. */
html {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* the owner-service form in the valuation sheet */
@media (max-width: 767px), (pointer: coarse) {
    #valuationModal input:not([type="radio"]):not([type="checkbox"]),
    #valuationModal select,
    #valuationModal textarea {
        font-size: 16px !important;
    }
}

/* small message at the bottom ("link copied") */
.site-toast {
    position: fixed;
    left: 50%;
    bottom: calc(5.5rem + env(safe-area-inset-bottom));
    z-index: 90;
    max-width: calc(100vw - 2rem);
    padding: 0.7rem 1.1rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    background: rgba(23, 26, 31, 0.94);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.3);
    transform: translate(-50%, 0.75rem);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
}
.site-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* sold / rented listing: the "book a viewing" button is greyed out and does nothing */
#modalBookBtn.is-closed { background: #9ca3af; box-shadow: none; pointer-events: none; cursor: default; }
