
        /* --- BASE VARIABLES --- */
        :root { 
            --primary: #0C0020; 
            --bg: #f9f9f9; 
            --white: #ffffff; 
            --border: #E1E0E4; 
            --text-muted: #666; 
            --text-main: #333333;
            --remax-blue: #003DA5;
            --remax-red: #E11B22;
        }
        
        * { box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
        body { margin: 0; background-color: var(--bg); color: var(--primary); line-height: 1.6; }
        a { text-decoration: none; color: var(--remax-blue); }
        
        .container { max-width: 1450px; margin: 0 auto; padding: 2rem; }
        /* --- MOBILE STICKY FOOTER (Hidden on Desktop) --- */
        .mobile-sticky-footer { display: none; }
        
        /* --- TOP HEADER & ACTIONS --- */
        .property-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
        .property-title h1 { margin: 0 0 10px 0; font-size: 2rem; color: var(--primary); }
        .property-address { color: var(--text-muted); font-size: 1.1rem; display: flex; align-items: center; gap: 5px; }
        .property-price { font-size: 2.2rem; font-weight: 700; color: var(--primary); }
        
        .action-buttons { display: flex; gap: 15px; margin-top: 10px; justify-content: flex-end;}
        .btn-action { display: flex; align-items: center; gap: 8px; background: white; border: 1px solid var(--border); padding: 10px 15px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 0.95rem; color: var(--primary); transition: 0.2s; }
        .btn-action:hover { border-color: var(--remax-blue); color: var(--remax-blue); }
        .btn-action svg { width: 20px; height: 20px; }

        /* --- CSS GRID GALLERY --- */
        .gallery-grid { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 250px 250px; gap: 15px; margin-bottom: 40px; border-radius: 12px; overflow: hidden; }
        .gallery-main { grid-row: 1 / -1; }
        .gallery-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; cursor: pointer; }
        .gallery-img:hover { transform: scale(1.03); }
        .img-wrapper { overflow: hidden; position: relative; }
        .view-all-btn { position: absolute; bottom: 20px; right: 20px; background: rgba(255,255,255,0.9); padding: 8px 15px; border-radius: 6px; font-weight: bold; cursor: pointer; border: none; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }

        /* --- LAYOUT: MAIN + SIDEBAR --- */
        .layout-split { display: flex; gap: 40px; align-items: flex-start; }
        .main-content { flex: 1; min-width: 0; }
        .sidebar { 
                width: 380px; 
                flex-shrink: 0; 
                position: sticky; 
                top: 100px; 
                
                /* NEW: Prevent it from growing taller than the screen */
                max-height: calc(100vh - 120px); 
                
                /* NEW: Add an internal scrollbar if it gets too tall */
                overflow-y: auto; 
                
                /* Optional: Adds a tiny bit of padding so the scrollbar doesn't hug the edge */
                padding-right: 5px;
            }
            
            /* Optional: Make the scrollbar sleek and modern so it doesn't look clunky */
            .sidebar::-webkit-scrollbar {
                width: 6px;
            }
            .sidebar::-webkit-scrollbar-thumb {
                background-color: var(--border);
                border-radius: 10px;
            }

        /* --- CONTENT SECTIONS --- */
        .overview-grid { 
            display: grid; 
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* Slightly smaller columns */
            gap: 15px 10px; /* Tighter vertical and horizontal spacing */
            margin-bottom: 0; /* Removed wasted bottom margin */
        }
        .overview-item { display: flex; flex-direction: column; gap: 0px; /* Zero gap between label and value */ }
        .overview-item span:first-child { color: var(--text-muted); font-size: 0.85rem; }
        .overview-item span:last-child { font-weight: bold; font-size: 1.05rem; color: var(--primary); }
        
        /* --- DESCRIPTION TRUNCATION --- */
        .section-title { 
            font-size: 1.6rem; 
            font-weight: 800; 
            color: var(--primary); 
            margin-top: 1.5rem;   /* INCREASED: Adds breathing room above the title */
            margin-bottom: 15px;  /* DECREASED: Pulls the content below closer to the line */
            padding-bottom: 6px;  /* DECREASED: Pulls the red line up closer to the text */
            border-bottom: 2px solid var(--border); 
            position: relative;
        }
        /* Pro-tip: This prevents the very first title inside a white card from having awkward extra space at the top! */
        .section-card > .section-title:first-child {
            margin-top: 0;
        }
        
        .section-title::after {
            content: ""; position: absolute; bottom: -2px; left: 0;
            width: 60px; height: 2px; background: var(--remax-red);
        }
        
        .desc-wrapper h3 { 
            font-size: 1.6rem; 
            font-weight: 800; 
            color: var(--primary);
            margin-top: 1.5rem;   /* INCREASED: Adds breathing room above the title */
            margin-bottom: 10px;  /* DECREASED: Pulls the description text up closer to the line */
            padding-bottom: 6px;  /* DECREASED: Pulls the red line up closer to the text */
            border-bottom: 2px solid var(--border);
            position: relative;
        }
        .desc-wrapper h3::after {
            content: ""; position: absolute; bottom: -2px; left: 0;
            width: 60px; height: 2px; background: var(--remax-red);
        }        
        .desc-content {
            display: -webkit-box;
            -webkit-line-clamp: 5; /* Forces the 5-line cutoff */
            -webkit-box-orient: vertical;
            overflow: hidden;
            color: var(--text-main); 
            font-size: 1.05rem;
        }
        .desc-content.expanded {
            display: block;
            -webkit-line-clamp: unset;
        }
        .read-more-btn {
            background: none; border: none; color: var(--remax-blue);
            font-weight: bold; cursor: pointer; padding: 0; margin-top: 10px;
            font-size: 1rem; text-decoration: underline; text-underline-offset: 4px;
        }
        .read-more-btn:hover { color: var(--remax-red); }
        
        .feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; margin: 0; list-style: none; }
        .feature-list li { position: relative; padding-left: 20px; color: var(--text-main); }
        .feature-list li::before { content: "•"; color: var(--remax-blue); position: absolute; left: 0; font-weight: bold; font-size: 1.2rem; line-height: 1; }

        /* --- PROPERTY DETAILS 3-COLUMN GRID --- */
        .details-section { margin-bottom: 25px; }
        .details-section:last-child { margin-bottom: 0; }
        .details-section h3 { border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 15px; font-size: 1.25rem; color: var(--primary); }
        .details-grid { display: grid; grid-template-columns: 1fr; gap: 12px 20px; }
        @media (min-width: 768px) {
            .details-grid { grid-template-columns: repeat(3, 1fr); }
        }
        .detail-item { font-size: 0.95rem; color: var(--text-main); }
        .detail-item span { color: var(--text-muted); margin-right: 5px; }
        
/* --- ROOMS TABLE --- */
        .rooms-table-wrapper { 
            width: 100%; 
            border: 1px solid var(--border); 
            border-radius: 8px; 
            overflow: hidden; 
            background: var(--white); 
        }
        .rooms-table { 
            width: 100%; 
            border-collapse: collapse; 
            text-align: left; 
        }
        .rooms-table th, .rooms-table td { 
            padding: 12px 15px; 
            border-bottom: 1px solid var(--border); 
        }
        .rooms-table th { 
            background: var(--bg); 
            font-weight: bold; 
            color: var(--primary); 
            font-size: 0.95rem; 
        }
        .rooms-table td { 
            font-size: 0.95rem; 
            color: var(--text-main); 
        }
        .rooms-table tr:last-child td { border-bottom: none; }
        
        /* Hiding Logic */
        .rooms-table tr.hidden-room { display: none; }
        .rooms-table tr.hidden-room.expanded { display: table-row; }
        
        .expand-rooms-btn { 
            width: 100%; 
            padding: 14px; 
            background: var(--bg); 
            color: var(--remax-blue); 
            border: none; 
            font-weight: bold; 
            cursor: pointer; 
            border-top: 1px solid var(--border); 
            transition: 0.2s; 
            font-size: 1rem;
        }
        .expand-rooms-btn:hover { background: #f0f4ff; }
        
        #propertyMap { height: 400px; width: 100%; border-radius: 8px; border: 1px solid var(--border); z-index: 1; }

        /* --- MORTGAGE CALCULATOR --- */
        .calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
        .calc-input-group { margin-bottom: 15px; }
        .calc-input-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 0.9rem; }
        .calc-input-wrapper { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #fff; }
        .calc-input-wrapper span { padding: 10px 15px; background: var(--bg); border-right: 1px solid var(--border); color: var(--text-muted); font-weight: bold; }
        .calc-input-wrapper input { border: none; padding: 10px; width: 100%; outline: none; font-size: 1rem; }
        
        .calc-results { background: var(--bg); padding: 20px; border-radius: 8px; text-align: center; }
        .calc-total { font-size: 2.5rem; font-weight: bold; color: var(--remax-blue); margin: 10px 0; }
        .calc-breakdown { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 10px 0; font-size: 0.95rem; }
        .calc-breakdown:last-child { border-bottom: none; }

        /* --- SIDEBAR FORMS --- */
        .agent-card { text-align: center; margin-bottom: 20px; }
        .agent-card img { width: 80px; height: 80px; border-radius: 50%; margin-bottom: 10px; }
        .agent-card h4 { margin: 0 0 5px 0; }
        
        .form-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
        .form-tab { flex: 1; text-align: center; padding: 10px; cursor: pointer; font-weight: bold; color: var(--text-muted); transition: 0.2s; border-bottom: 2px solid transparent; margin-bottom: -2px; }
        .form-tab.active { color: var(--remax-blue); border-color: var(--remax-blue); }
        
        .form-content { display: none; }
        .form-content.active { display: block; }
        
        .input-full { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 15px; font-size: 0.95rem; outline: none; font-family: inherit;}
        textarea.input-full { resize: vertical; min-height: 100px; }
        .btn-submit { width: 100%; background: var(--remax-red); color: white; border: none; padding: 14px; border-radius: 6px; font-weight: bold; font-size: 1.1rem; cursor: pointer; transition: 0.2s; }
        .btn-submit:hover { background: #b3151b; }

        /* --- MODALS --- */
        .modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 3000; align-items: center; justify-content: center; }
        .modal-overlay.active { display: flex; }
        .modal-content { background: white; padding: 24px; border-radius: 8px; width: 90%; max-width: 450px; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
        .modal-close { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #999; }
        .modal-close:hover { color: var(--danger); }
        
        /* --- FULLSCREEN PHOTO MODAL --- */
        .photo-modal-overlay {
            display: none; 
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background-color: rgba(0, 0, 0, 0.95);
            z-index: 4000;
            flex-direction: column;
            align-items: center;
            justify-content: space-between;
            padding: 20px 0;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .photo-modal-overlay.active {
            display: flex;
            opacity: 1;
        }

        .photo-modal-top {
            width: 100%;
            display: flex;
            justify-content: space-between;
            padding: 0 30px;
            color: white;
            font-size: 1.2rem;
        }
        .photo-modal-close {
            background: none; border: none; color: white; font-size: 2.5rem;
            cursor: pointer; line-height: 1; transition: color 0.2s;
        }
        .photo-modal-close:hover { color: var(--remax-red); }

        .photo-modal-main {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            flex: 1;
            position: relative;
            overflow: hidden;
        }
        .photo-modal-img {
            max-width: 90vw;
            max-height: 70vh;
            object-fit: contain;
            border-radius: 4px;
        }
        
        .photo-nav-btn {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(255, 255, 255, 0.1);
            color: white;
            border: none;
            padding: 15px 20px;
            cursor: pointer;
            font-size: 2rem;
            border-radius: 50%;
            transition: background 0.2s;
        }
        .photo-nav-btn:hover { background: rgba(255, 255, 255, 0.3); }
        .photo-nav-prev { left: 20px; }
        .photo-nav-next { right: 20px; }

        .photo-modal-thumbs {
            display: flex;
            gap: 10px;
            max-width: 90vw;
            overflow-x: auto;
            padding: 10px;
            -ms-overflow-style: none;  
            scrollbar-width: none;  
        }
        .photo-modal-thumbs::-webkit-scrollbar { display: none; }
        
        .modal-thumb {
            height: 70px;
            width: 100px;
            object-fit: cover;
            border-radius: 4px;
            cursor: pointer;
            opacity: 0.5;
            transition: opacity 0.2s, border 0.2s;
            border: 2px solid transparent;
            flex-shrink: 0;
        }
        .modal-thumb:hover { opacity: 0.8; }
        .modal-thumb.active {
            opacity: 1;
            border-color: white;
        }
        .mobile-img, .mobile-photo-overlays { display: none; }
        
        /* --- TOAST NOTIFICATIONS --- */
        .toast-notification {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%) translateY(100px); /* Starts hidden below the screen */
            background: var(--primary, #0C0020);
            color: white;
            padding: 14px 28px;
            border-radius: 8px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            font-weight: 600;
            font-size: 1rem;
            z-index: 9999;
            opacity: 0;
            transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
            text-align: center;
            max-width: 90%;
        }
        
        /* The class we add with JS to make it slide up */
        .toast-notification.show {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
        }
        
        /* Color variations */
        .toast-notification.success { background: #008040; } /* A nice success green */
        .toast-notification.error { background: var(--remax-red, #E11B22); }
        /* Responsive */
        @media (max-width: 992px) {
            /* 1. Flex container to swap layout order */
            .container { display: flex; flex-direction: column; padding: 0; }
            
            /* 2. Push gallery to the absolute top and make it edge-to-edge */
            .gallery-grid { 
                order: 1; 
                grid-template-columns: 1fr; 
                grid-template-rows: 250px; /* Slightly taller for a nice hero look */
                gap: 0; 
                border-radius: 0; 
                margin-bottom: 0;
                width: 100%;
            }
            .gallery-grid .img-wrapper:not(.gallery-main) { display: none !important; }
            .view-all-btn { display: none !important; }
            
            /* 3. Push header below the image and stack the title/price neatly */
            .property-header { 
                order: 2; 
                flex-direction: column; 
                align-items: flex-start; 
                /* Reduced top padding from 20px to 12px to pull text closer to the photo */
                padding: 12px 20px 0 20px; 
                gap: 0; /* Removed the flex gap to squeeze the price upward */
                margin-bottom: 10px; 
            }
            /* Override the base margins to squeeze the text lines together */
            .property-title h1 { margin-bottom: 2px; }
            .property-address { margin-bottom: 4px; }
            
            .property-price { font-size: 1.8rem; }
            .property-header .action-buttons { display: none !important; }            
            /* 4. Main content flows below the header */
            .layout-split { order: 3; flex-direction: column; padding: 0 20px 20px 20px; }
            .sidebar { width: 100%; }
            .calc-grid { grid-template-columns: 1fr; }
            
            /* Image Swapping (!important ensures it overrides any other styles) */
            .desktop-img { display: none !important; }
            .mobile-img { display: block !important; width: 100%; height: 100%; object-fit: cover; }
            
            /* Mobile Overlays */
            .mobile-photo-overlays { display: block !important; position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 10; }
            
            /* NEW: Container to perfectly align the dynamic badges */
            .badges-top-left { position: absolute; top: 12px; left: 12px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: auto; }
            
            /* FIX: Added the missing pill-shape styles from the search page! */
            .mobile-photo-overlays .tag-new,
            .mobile-photo-overlays .tag-sale {
                position: static !important;
                margin: 0 !important;
                color: white;
                padding: 4px 10px;
                border-radius: 20px;
                font-size: 0.75rem;
                font-weight: 800;
                text-transform: uppercase;
                letter-spacing: 0.5px;
                box-shadow: 0 2px 6px rgba(0,0,0,0.3);
            }
            
            /* Default background for the 'New' tag */
            .mobile-photo-overlays .tag-new { background: #008040; }            
            /* Pull the action buttons back up to the top to align with the badges */
            .actions-top-right { position: absolute; top: 12px; right: 12px; display: flex; gap: 15px; pointer-events: auto; }
            .actions-top-right button { background: none; border: none; color: white; padding: 0; cursor: pointer; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); transition: transform 0.2s; }
            .actions-top-right button:hover { transform: scale(1.1); }
            .actions-top-right svg { width: 26px; height: 26px; stroke: white; }
            
            .photo-count-bottom-right { position: absolute; bottom: 15px; right: 15px; background: rgba(0,0,0,0.6); color: white; padding: 6px 12px; border-radius: 6px; font-size: 0.9rem; font-weight: bold; display: flex; align-items: center; gap: 6px; pointer-events: auto; }
            .photo-count-bottom-right svg { width: 16px; height: 16px; stroke: white; }
            
            
            /* --- MOBILE STICKY FOOTER --- */
            body { padding-bottom: 85px; } 
            
            .mobile-sticky-footer {
                display: flex;
                position: fixed;
                bottom: 0; left: 0; right: 0;
                background: white;
                padding: 12px 15px;
                box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
                z-index: 2500;
                gap: 10px;
            }
            .btn-sticky-outline {
                flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
                background: white; color: var(--remax-blue);
                border: 2px solid var(--remax-blue); text-decoration: none;
                padding: 14px 10px; border-radius: 8px;
                font-weight: bold; font-size: 1rem; cursor: pointer;
            }
            .btn-sticky-solid {
                flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
                background: var(--remax-red); color: white; text-decoration: none;
                border: none; padding: 14px 10px; border-radius: 8px;
                font-weight: bold; font-size: 1rem; cursor: pointer;
            }
            
        }
        
        /* --- FAVORITES HEART FILL --- */
        .fav-btn.is-favorited svg {
            fill: var(--remax-red);
            stroke: var(--remax-red);
            transition: all 0.2s ease;
        }
        
        /* --- OPEN HOUSE BANNER --- */
        .open-house-banner {
            background: #fff8f8;
            border: 2px solid var(--remax-red);
            border-radius: 8px;
            padding: 15px 20px;
            margin-bottom: 25px;
            display: flex;
            align-items: center;
            gap: 15px;
            box-shadow: 0 4px 12px rgba(225, 27, 34, 0.1);
        }
        .open-house-icon {
            background: var(--remax-red);
            color: white;
            padding: 12px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .open-house-icon svg { width: 28px; height: 28px; }
        .open-house-details h3 { margin: 0 0 5px 0; color: var(--remax-red); font-size: 1.25rem; font-weight: 800; text-transform: uppercase; }
        .open-house-details p { margin: 0; font-size: 1.1rem; color: var(--primary); font-weight: 600; }
      