main {
    padding: 0px;
    padding-bottom: 48px;
    position: relative;
}

#feedback_app .feed-from {
    z-index: 9999;
}

.floorplan-wrap {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: #000;
    padding: 2px 10px;
    color: #fff;
    z-index: 1000;
}

.a_d-detail-max-width {
    max-width: 1172px;
    margin-left: auto;
    margin-right: auto;
}

/* Container for the slider - OPTIMIZED FOR PERFORMANCE */
.mega-container,
.mega-default-container {
    position: relative;
    width: 100%;
    /* Set explicit height to prevent layout shifts */
    height: 420px;
    overflow: hidden;
    /* background: #f5f5f5; */
    padding: 0;
    contain: layout style paint;
    /* Performance optimization */
}

.mega-container {
    height: auto;
}

.mega-default-container {
    display: flex;
    justify-content: center;
}

/* Row of images (slider track) - OPTIMIZED */
.listing-photo-row {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 6px;
    /* Explicit height to prevent layout shifts */
    height: 420px;
    /* Performance optimizations */
    contain: layout style;
    will-change: scroll-position;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.listing-photo-row::-webkit-scrollbar {
    display: none;
}

.listing-photo-row {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.listing-photo-row a {
    flex: 0 0 auto;
    position: relative;
    overflow: hidden;
    /* Remove transform transition to prevent layout shifts */
    /* transition: transform 0.2s; */
    /* Set explicit dimensions */
    width: auto;
    height: 420px;
    contain: layout style paint;
}

/* CRITICAL: Optimized image styles for Core Web Vitals */
.listing-photos.img-responsive,
.mega-default-container .listing-default-photo {
    display: block;
    /* Explicit dimensions to prevent layout shifts */
    width: auto;
    height: 420px;
    /* Use aspect-ratio for better layout stability */
    aspect-ratio: 3/2;
    object-fit: cover;
    background: #f5f5f5;
    /* Remove transitions that can cause layout shifts */
    /* transition: box-shadow 0.2s; */
    /* Performance optimizations */
    contain: layout style paint;
    content-visibility: auto;
}

/* Add skeleton loading state */
.listing-photos.img-responsive::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    z-index: -1;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Ensure first image loads immediately (critical for LCP) */
.listing-photo-row a:first-child .listing-photos.img-responsive {
    /* Priority hint for first image */
    content-visibility: visible;
}

.video-iframe-slideshow,
.matterport-link-container {
    width: 630px;
    height: 420px;
    contain: layout style;
}

.pdf-icon-container {
    width: 630px;
    height: 420px;
    text-decoration: none;
    contain: layout style;
}

.pdf-icon-container div {
    display: flex !important;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

/* OPTIMIZED: Thumbnail containers */
.pdf-image-container-thumbnail,
.video-thumbnail-container {
    flex: 0 0 auto;
    height: 54px;
    width: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    contain: layout style;
}

.pdf-image-container-thumbnail div,
.video-thumbnail-container img {
    display: flex !important;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.listing_photo_descr {
    width: fit-content;
    position: absolute;
    left: 22px;
    right: 0;
    bottom: 12px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 12px;
    padding: 4px 12px;
    pointer-events: none;
    border-radius: 12px;
    /* Prevent layout shifts */
    contain: layout style;
}

.slider-arrow {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    width: 33px;
    height: 33px;
    font-size: 28px;
    color: #333;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    contain: layout style;
}

.slider-arrow.left {
    left: 10px;
}

.slider-arrow.right {
    right: 10px;
}

.slider-arrow:hover {
    background: #f0f0f0;
}

/* --- Thumbnails Row - OPTIMIZED --- */
.slider-thumbnails {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    flex-direction: row;
    gap: 8px;
    justify-content: flex-start;
    margin-top: 12px;
    margin-bottom: 10px;
    scrollbar-width: thin;
    /* Set explicit height to prevent layout shifts */
    height: 60px;
    contain: layout style;
}

/* WebKit (Chrome, Safari) */
.slider-thumbnails::-webkit-scrollbar {
    height: 4px;
    /* Make it thin (horizontal) */
}

.slider-thumbnails::-webkit-scrollbar-thumb {
    background-color: #888;
    /* Customize thumb color */
    border-radius: 10px;
    /* Optional: rounded edges */
}

.slider-thumbnails::-webkit-scrollbar-track {
    background: transparent;
    /* Or use a subtle color */
}

/* OPTIMIZED: Thumbnail images */
.slider-thumbnail {
    flex: 0 0 auto;
    width: 80px;
    height: 54px;
    /* Add aspect ratio for layout stability */
    aspect-ratio: 80/54;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    /* Reduce transition duration for better performance */
    transition: border 0.1s, opacity 0.1s;
    contain: layout style paint;
    /* Add background for loading state */
    background: #f5f5f5;
}

.slider-thumbnail.active,
.slider-thumbnail:hover {
    border: 2px solid #707070;
    opacity: 1;
}

.a_d-detail-disclaimer {
    border-radius: 4px;
    background-color: #f9f9f9;
}

.a_d-title {
    font-size: 30px;
}

.a_d-address,
.a_d-price {
    font-size: 21px;
}

.video-tour-btn {
    border-radius: 4px;
    background-color: #e5f3ff;
}

.a_d-info-box {
    border-radius: 4px;
    background-color: #f9f9f9;
    width: 252px;
    padding: 16px;
}

.view-internal-info {
    background-color: #e5f3ff;
    height: 72px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 21px;
    font-weight: 600;
    text-decoration: underline;
    color: #3e75bb;
}

.a_d-info-container-right {
    min-width: 358px;
}

.a_d-detail-container {
    max-width: 1172px;
    margin-left: auto;
    margin-right: auto;
}

.request-info-btn {
    border: solid 1px #3e75bb;
    background-color: #e5f3ff;
    color: #3e75bb;
}

.green-circle {
    width: 6px;
    height: 6px;
    background-color: #49b224;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 8px;
}

.schedule-viewing-btn {
    background-color: #3e75bb;
    color: #fff;
}

.request-info-btn {
    color: #3e75bb;
    background-color: #e5f3ff;
    border: solid 1px #3e75bb;
}

.schedule-viewing-btn,
.request-info-btn {
    font-size: 16px;
    height: 49.5px;
    font-weight: 500;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad_detail_internal a {
    color: #3e75bb;
}

.ad_detail_internal {
    font-size: 14px !important;
}

.ad_detail_internal hr {
    margin: 10px 0px;
}

.twitter-share-button .btn {
    border-radius: 4px !important;
}


.emp-container {
    width: 100%;
}

.emp-flex {
    display: flex;
    gap: 40px;
    justify-content: space-between;
}

.emp-left,
.emp-right {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.emp-left {
    gap: 10px;
}

.emp-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.emp-field label {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}

#desc-long>p:not(:last-child),
#desc-short>p:not(:last-child) {
    margin-bottom: 16px;
}

.actions-container-desktop {
    display: flex;
}

.actions-container-mobile {
    display: none;
}

.floating-action-button {
    display: none;
}

/* Responsive adjustments - OPTIMIZED */
@media (max-width: 768px) {

    /* Update container height for mobile */
    .mega-container,
    .mega-default-container {
        height: 200px;
    }

    .listing-photo-row {
        height: 200px;
        padding: 10px 2px 5px 2px;
        gap: 5px;
    }

    .listing-photo-row a {
        width: calc(100vw - 16px);
        height: 200px;
    }

    .slider-thumbnail {
        width: 48px;
        height: 32px;
        aspect-ratio: 48/32;
    }

    .a_d-detail-container {
        padding: 0px 8px;
    }

    .listing-photos.img-responsive {
        width: calc(100vw - 16px);
        max-width: 100%;
        height: 200px;
        aspect-ratio: 16/9;
    }

    .video-iframe-slideshow,
    .matterport-link-container,
    .pdf-icon-container {
        width: calc(100vw - 16px);
        height: 200px;
    }

    .a_d-info-container {
        flex-direction: column;
    }

    .a_d-info-container-right {
        position: static !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .actions-container-desktop {
        display: none;
    }

    .actions-container-mobile {
        display: flex;
    }

    #context-menu-agent_ads {
        z-index: 1020 !important;
    }

    .a_d-amenities {
        flex-direction: column;
    }

    .a_d-amenities ul {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    }

    .emp-flex {
        flex-direction: column;
    }

    .listing-card {
        width: 100% !important;
    }

    .a_d-info-box {
        width: 100% !important;
    }

    .about-building-container:first-child {
        flex-direction: column;
    }

    /* Floating Action Button Styles */
    .floating-action-button {
        position: fixed;
        bottom: 12px;
        background: #eee;
        padding: 16px;
        border-top: 0.5px solid black;
        /* right: 20px; */
        z-index: 1000;
        display: flex;
        justify-content: center;
        width: 100%;
        gap: 8px;
    }

    .floating-action-button button {
        width: 170px !important;

    }
}