    html.lenis, html.lenis body { height: auto; }
        .lenis.lenis-smooth { scroll-behavior: auto !important; }
        .lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
        .lenis.lenis-stopped { overflow: hidden; }
        .lenis.lenis-smooth iframe { pointer-events: none; }
        
        /* Base Reset & Variables */
        * { box-sizing: border-box; }
        :root { --gold: #D4AF37; --black: #111111; --white: #FFFFFF; --bg-color: #F8F9FA; }
        body { margin: 0; padding: 0; font-family: 'Times New Roman', serif; overflow-x: hidden; background-color: var(--bg-color); }

        /* Layout Structure - Card Style */
        .unit-details { 
            display: flex; 
            flex-wrap: wrap; 
            max-width: 1250px; 
            margin: 40px auto; 
            padding: 30px; 
            gap: 40px; 
            background: var(--white);
            border-radius: 30px;
            box-shadow: 0 15px 40px rgba(0,0,0,0.06);
        }

        /* Gallery (Left Side) */
        .gallery-container { 
            flex: 1.2; 
            min-width: 300px; 
            width: 100%; 
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        .main-img-wrapper { 
            width: 100%; 
            height: 450px; 
            border-radius: 24px; 
            overflow: hidden; 
            background: #fafafa;
            position: relative; /* Added for absolute positioning of buttons */
            cursor: pointer;
        }
        #mainImg { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.4s ease; }
        
        /* Image Navigation Buttons */
        .img-nav-btn {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(17, 17, 17, 0.5);
            color: var(--white);
            border: none;
            width: 45px;
            height: 45px;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 1.2rem;
            cursor: pointer;
            transition: 0.3s ease;
            z-index: 10;
        }
        .img-nav-btn:hover { background: var(--gold); }
        .img-nav-btn.prev { left: 15px; }
        .img-nav-btn.next { right: 15px; }

        /* Horizontal Scroll for Thumbnails */
        .thumbnail-row { 
            display: flex; 
            overflow-x: auto; 
            gap: 15px; 
            padding-bottom: 10px;
            scrollbar-width: thin; /* Firefox */
            scrollbar-color: var(--gold) #f1f1f1;
            scroll-behavior: smooth;
        }
        .thumbnail-row::-webkit-scrollbar { height: 6px; }
        .thumbnail-row::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
        .thumbnail-row::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 10px; }
        
        .thumb { 
            flex: 0 0 120px; /* Fixed width for horizontal scrolling */
            height: 90px; 
            cursor: pointer; 
            border-radius: 16px; 
            overflow: hidden; 
            border: 2px solid transparent; 
            opacity: 0.6; 
            transition: 0.3s; 
        }
        .thumb img { width: 100%; height: 100%; object-fit: cover; }
        .thumb.active { border-color: var(--gold); opacity: 1; transform: translateY(-3px); box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3); }

        /* Property Info (Right Side) */
        .unit-info { 
            flex: 1; 
            min-width: 300px; 
            width: 100%; 
            display: flex;
            flex-direction: column;
        }
        
        .info-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 25px; gap: 20px; }
        .title-container { flex: 1; }
        .unit-title { font-size: 2.2rem; margin: 0 0 8px 0; color: var(--black); line-height: 1.2; }
        .unit-location { color: #000000; font-size: 0.95rem; margin: 0; display: flex; align-items: center; gap: 6px; }
        .price-container { text-align: right; }
        .unit-price { font-size: 1.8rem; color: var(--black); font-weight: bold; margin: 0 0 8px 0; }
        .desc-section { margin-bottom: 30px; }
        .desc-heading { font-weight: bold; font-size: 1.1rem; color: var(--black); margin: 0 0 10px 0; }
        .unit-description { 
            color: #555; 
            line-height: 1.6; 
            font-size: 0.95rem; 
            max-height: 200px; 
            overflow-y: auto; 
            padding-right: 10px;
        }
        .unit-description::-webkit-scrollbar { width: 6px; }
        .unit-description::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px;}
        .unit-description::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 10px; }

        .specs-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
        .spec-item { 
            display: inline-flex; 
            align-items: center; 
            gap: 8px; 
            background: #F3F4F6; 
            padding: 10px 18px; 
            border-radius: 20px; 
            font-size: 0.9rem; 
            color: var(--black);
        }
        .spec-item i { color: #555; }

        .action-row { display: flex; gap: 15px; margin-top: auto; }
        .btn-inquire { 
            flex: 1; 
            background: var(--gold); 
            color: var(--white); 
            border: 2px solid var(--gold);
            padding: 16px; 
            border-radius: 30px; 
            cursor: pointer; 
            font-size: 1.1rem; 
            font-weight: bold;
            transition: 0.3s; 
            font-family: inherit;
        }
        
        .btn-inquire:hover { 
            background: var(--black); 
            color: var(--gold); 
            border-color: var(--black); 
        }
        .main-img-wrapper img, 
        .fullscreen-modal img {
            user-select: none;
            -webkit-user-drag: none;
            touch-action: pan-y; /* Allows vertical scrolling while enabling horizontal swipes */
        }
        .btn-heart { 
            width: 58px; 
            height: 58px; 
            border-radius: 50%; 
            border: none; 
            background: #F3F4F6; 
            color: var(--black); 
            display: flex; 
            justify-content: center; 
            align-items: center; 
            font-size: 1.3rem; 
            cursor: pointer; 
            transition: 0.3s; 
        }
        .btn-heart:hover { background: #E5E7EB; color: var(--gold); }

        /* Fullscreen Modal */
        .fullscreen-modal {
            display: none;
            position: fixed;
            top: 0; left: 0;
            width: 100vw; height: 100vh;
            background: rgba(0, 0, 0, 0.95);
            z-index: 3000;
            justify-content: center;
            align-items: center;
            backdrop-filter: blur(10px);
        }
        .fullscreen-modal img {
            max-width: 90%;
            max-height: 90%;
            object-fit: contain;
            border-radius: 10px;
            user-select: none;
        }
        .close-fullscreen {
            position: absolute;
            top: 25px;
            right: 35px;
            color: white;
            font-size: 40px;
            font-weight: bold;
            cursor: pointer;
            z-index: 3010;
            transition: 0.3s;
        }
        .close-fullscreen:hover { color: var(--gold); }

        /* --- Professional Inquiry Popup --- */
        .professional-popup {
            background: var(--white);
            border-radius: 16px;
            width: 90%;
            max-width: 520px;
            overflow: hidden;
            box-shadow: 0 25px 50px rgba(0,0,0,0.25);
            position: relative;
            font-family: 'Times New Roman', serif;
            animation: popupFadeIn 0.3s ease-out forwards;
        }

        @keyframes popupFadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .popup-header {
            position: relative;
            height: 140px;
            /* Using the first property image as the banner */
            background-image: url('<?php echo isset($dbImages[0]) ? htmlspecialchars($dbImages[0]) : "https://via.placeholder.com/800x400"; ?>');
            background-size: cover;
            background-position: center;
        }

        .popup-header-overlay {
            position: absolute;
            inset: 0;
            background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.8));
        }

        .close-popup {
            position: absolute;
            top: 15px;
            right: 15px;
            color: var(--white);
            font-size: 1.2rem;
            cursor: pointer;
            z-index: 10;
            background: rgba(0,0,0,0.4);
            border-radius: 50%;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: 0.3s;
            backdrop-filter: blur(4px);
        }

        .close-popup:hover { background: var(--gold); color: var(--white); }

        .popup-body {
            padding: 35px;
            text-align: left;
        }

        .popup-body h2 {
            margin: 0 0 12px 0;
            font-size: 1.8rem;
            color: var(--black);
            letter-spacing: 0.5px;
        }

        .popup-body p {
            color: #555;
            line-height: 1.6;
            margin-bottom: 25px;
            font-size: 1rem;
            font-family: sans-serif; /* Cleaner readability for paragraphs */
        }

        .popup-property-box {
            display: flex;
            align-items: center;
            gap: 12px;
            background: #F8F9FA;
            padding: 15px;
            border-left: 4px solid var(--gold);
            border-radius: 0 8px 8px 0;
            margin-bottom: 30px;
        }

        .popup-property-box i {
            color: var(--gold);
            font-size: 1.2rem;
        }

        .popup-property-title {
            font-weight: bold;
            color: var(--black);
            font-size: 1.05rem;
            margin: 0;
        }

        .popup-actions {
            display: flex;
            gap: 15px;
            justify-content: flex-end;
        }

        .popup-btn-cancel {
            padding: 12px 24px;
            border: 1px solid #ddd;
            background: transparent;
            color: #666;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
            font-weight: bold;
            transition: 0.2s;
            font-family: inherit;
        }

        .popup-btn-cancel:hover { background: #f1f1f1; color: var(--black); }

        .popup-btn-proceed {
            padding: 12px 28px;
            background: var(--black);
            color: var(--gold);
            border: 2px solid var(--black);
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
            font-weight: bold;
            transition: 0.3s;
            font-family: inherit;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .popup-btn-proceed:hover { background: var(--gold); color: var(--white); border-color: var(--gold); }

        /* Recommended Properties */
        .recommended-section { max-width: 1250px; margin: 20px auto 60px; padding: 20px; }
        .rec-title { font-family: 'Times New Roman', serif; font-size: 1.8rem; text-transform: uppercase; text-align: center; margin-bottom: 30px; color: var(--black); }
        .rec-title::after { content: ''; display: block; width: 60px; height: 3px; background: var(--gold); margin: 15px auto 0; }
        .rec-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 25px; }
        .rec-card { background: white; border-radius: 20px; overflow: hidden; transition: 0.3s ease; display: block; box-shadow: 0 4px 15px rgba(0,0,0,0.05); text-decoration: none; border: 1px solid transparent; }
        .rec-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); border-color: var(--gold); }
        .rec-card img { width: 100%; height: 180px; object-fit: cover; }
        .rec-card-content { padding: 18px; }
        .rec-card-content h3 { font-size: 1.1rem; margin: 0 0 8px; color: var(--black); }
        .rec-location { color: #777; font-size: 0.85rem; margin: 0 0 10px; }
        .rec-price { color: var(--gold); font-weight: bold; font-size: 1.1rem; margin: 0; }

        @media (max-width: 992px) {
            .unit-details { gap: 30px; padding: 25px; }
            .main-img-wrapper { height: 380px; }
            .info-header { flex-direction: column; gap: 10px; }
            .price-container { text-align: left; }
        }
        @media (max-width: 768px) { 
            .unit-details { flex-direction: column; margin: 20px; padding: 20px; }
            .main-img-wrapper { height: 320px; }
        }
        @media (max-width: 480px) {
            .unit-details { margin: 10px; border-radius: 20px; }
            .main-img-wrapper { height: 250px; }
            .unit-title { font-size: 1.8rem; }
            .unit-price { font-size: 1.5rem; }
            .specs-grid { gap: 8px; }
            .spec-item { padding: 8px 14px; font-size: 0.85rem; }
            .btn-inquire { padding: 14px; font-size: 1rem; }
            .btn-heart { width: 50px; height: 50px; }
            .img-nav-btn { width: 35px; height: 35px; font-size: 1rem; }
        }
        /* --- Back Button --- */
        .back-button-container {
            max-width: 1250px;
            margin: 20px auto 0;
            padding: 0 30px;
        }
        
        .btn-back {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            text-decoration: none;
            color: var(--black);
            font-size: 1rem;
            font-weight: bold;
            transition: color 0.3s ease;
            cursor: pointer;
            background: none;
            border: none;
            padding: 0;
            font-family: inherit;
        }
        
        .btn-back:hover {
            color: var(--gold);
        }
        .toast-notification {
        position: fixed;
        bottom: 30px;
        right: 30px;
        background: #1A1A1A;
        color: #FFFFFF;
        padding: 14px 22px;
        border-radius: 50px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 0.95rem;
        z-index: 9999;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        pointer-events: none;
        border-left: 4px solid #D4AF37;
    }
    .btn-heart.is-liked {
    background: #fff0f0;
    color: #e74c3c;
    }
    .btn-heart.is-liked i {
        color: #e74c3c;
        transform: scale(1.15);
    }
    .btn-heart.is-liked:hover {
        background: #ffe0e0;
    }
        .toast-notification.show {
            opacity: 1;
            transform: translateY(0);
        }
        @media (max-width: 600px) {
            .toast-notification { right: 15px; left: 15px; bottom: 20px; justify-content: center; }
        }

        /* Update existing media queries to adjust back button padding on smaller screens */
        @media (max-width: 992px) {
            .unit-details { gap: 30px; padding: 25px; }
            .main-img-wrapper { height: 380px; }
            .info-header { flex-direction: column; gap: 10px; }
            .price-container { text-align: left; }
            .back-button-container { padding: 0 25px; } /* Added */
        }
        @media (max-width: 768px) { 
            .unit-details { flex-direction: column; margin: 20px; padding: 20px; }
            .main-img-wrapper { height: 320px; }
            .back-button-container { padding: 0 20px; } /* Added */
        }
        @media (max-width: 480px) {
            .unit-details { margin: 10px; border-radius: 20px; }
            .main-img-wrapper { height: 250px; }
            .unit-title { font-size: 1.8rem; }
            .unit-price { font-size: 1.5rem; }
            .specs-grid { gap: 8px; }
            .spec-item { padding: 8px 14px; font-size: 0.85rem; }
            .btn-inquire { padding: 14px; font-size: 1rem; }
            .btn-heart { width: 50px; height: 50px; }
            .img-nav-btn { width: 35px; height: 35px; font-size: 1rem; }
            .back-button-container { padding: 0 10px; margin-top: 15px; } /* Added */
        }
        /* Hide gallery arrows on mobile devices */
        @media (max-width: 768px) {
            .nav-arrow {
                display: none !important;
            }
        }
        /* Hide both main gallery and fullscreen modal arrows on mobile */
        @media (max-width: 768px) {
            .nav-arrow,
            .fullscreen-modal .prev,
            .fullscreen-modal .next {
                display: none !important;
            }
        }