/* ====== PropertyGalleryModal Styles ====== */

/* Full-screen modal overlay */
.pgm_modal {
    z-index: 1400 !important;
}

.pgm_modal .MuiBox-root {
    border: none;
    outline: none;
    width: 100vw;
    height: 100vh;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.pgm_topbar_main {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ---- Top Bar ---- */
.pgm_topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    min-height: auto;
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: nowrap;
}

.pgm_topbar_left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-shrink: 1;
    overflow: hidden;
    min-width: 0;
    flex: 1;
    white-space: nowrap;
}

.pgm_topbar_address_text {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pgm_topbar_divider {
    color: #bbb;
    font-size: 14px;
    flex-shrink: 0;
}

.pgm_topbar_icon_item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}

.pgm_topbar_icon_item svg {
    font-size: 18px;
    color: #555;
}

/* Mobile Price and Specs Wrapper */
.pgm_price_specs_wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.pgm_price_label {
    font-weight: 400;
    color: #555;
}

.pgm_price_value {
    font-weight: 700;
    color: #1a1a2e;
}

.pgm_price_value.pgm_price_crossed {
    text-decoration: line-through;
    color: #999;
}

.pgm_mobile_spec_item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #555;
}

.pgm_mobile_spec_item svg {
    color: #666;
    flex-shrink: 0;
}

/* Sold Price Wrapper */
.pgm_sold_price_wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 500;
}

.pgm_sold_price_value {
    font-weight: 700;
    color: #D0191D;
}

/* ---- Desktop price row ---- */
.pgm_topbar_price_row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    flex-wrap: wrap;
}

/* ---- Mobile Header (<=500px) ---- */
.pgm_mobile_header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding-left: 8px;
}

.pgm_mobile_address {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    line-height: 1.3;
}

.pgm_mobile_info_row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    font-size: 13px;
    color: #333;
    row-gap: 4px;
}

.pgm_info_label {
    font-weight: 400;
    color: #555;
    font-size: 13px;
}

.pgm_info_price {
    font-weight: 700;
    color: #1a1a2e;
    font-size: 14px;
}

.pgm_info_price.pgm_price_crossed {
    text-decoration: line-through;
    color: #999;
    font-weight: 400;
}

.pgm_info_sold {
    font-weight: 700;
    color: #D0191D;
    font-size: 14px;
}

.pgm_info_spec {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

/* ---- Tabs ---- */
.pgm_topbar_center {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.pgm_tab_btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    background: #f5f5f5;
    border: 1px solid #ddd;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex: 0 0 auto;
}

.pgm_tab_btn:first-child {
    /* border-radius: 20px 0 0 20px; */
}

.pgm_tab_btn:last-child {
    /* border-radius: 0 20px 20px 0; */
}

.pgm_tab_btn svg {
    font-size: 16px;
    flex-shrink: 0;
}

.pgm_tab_btn.pgm_tab_active {
    background: #fff;
    color: #1a1a2e;
    border-color: #ccc;
    font-weight: 600;
    border-bottom: 2px solid #D0191D;
}

.pgm_tab_btn:hover {
    background: #eee;
}

/* ---- Top Bar Right ---- */
.pgm_topbar_right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.pgm_contact_btn {
    background: #D0191D !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 6px 18px !important;
    border-radius: 4px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pgm_contact_btn:hover {
    background: #D0191D !important;
}

.pgm_share_btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pgm_share_btn svg {
    font-size: 18px;
    color: #555;
}

.pgm_share_btn:hover {
    background: #eee;
}

.pgm_close_btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #ccc;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.pgm_close_btn svg {
    font-size: 20px;
    color: #555;
}

.pgm_close_btn:hover {
    background: #ffebee;
}

.pgm_close_btn:hover svg {
    color: #D0191D;
}

/* Map/Street view: leave room for fixed 80px Contact Agent bar on mobile */
@media screen and (max-width: 768px) {
    .pgm_content_map {
        padding-bottom: 80px !important;
    }
}

/* ---- Main Content ---- */
.pgm_content {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 15px;
    gap: 15px;

}

/* Map / Street View: no padding so component fills full area */
.pgm_content_map {
    padding: 0;
    gap: 0;
}

/* ---- Left: Main Image ---- */
.pgm_main_image_wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f7f7;
    border-radius: 8px;
    overflow: hidden;
    min-width: 0;
}

.pgm_main_image_wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

/* Nav Arrows */
.pgm_nav_arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s ease;
}

.pgm_nav_arrow:hover {
    background: #fff;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
}

.pgm_nav_arrow svg {
    font-size: 28px;
    color: #333;
}

.pgm_nav_prev {
    left: 12px;
}

.pgm_nav_next {
    right: 12px;
}

/* Image Counter */
.pgm_image_counter {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 5;
    pointer-events: none;
}

/* Virtual Tour Button */
.pgm_virtual_tour {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 5;
    cursor: pointer;
}

.pgm_virtual_tour img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.pgm_virtual_tour:hover img {
    transform: scale(1.1);
}

/* ---- Right: Thumbnail Grid ---- */
.pgm_thumbs_panel {
    width: 260px;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 8px;
    background: #fff;
    padding: 10px;
}

.pgm_thumbs_panel::-webkit-scrollbar {
    width: 6px;
}

.pgm_thumbs_panel::-webkit-scrollbar-track {
    background: #333;
    border-radius: 3px;
}

.pgm_thumbs_panel::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 3px;
}

.pgm_thumbs_grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.pgm_thumb_item {
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    position: relative;
}

.pgm_thumb_item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
}

.pgm_thumb_item:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.pgm_thumb_item:hover img {
    opacity: 0.85;
}

.pgm_thumb_item.pgm_thumb_active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(208, 25, 29, 0.5);
}

/* ---- Map / Street View Placeholder ---- */
.pgm_map_container {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f7f7f7;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
}

.pgm_streetview_container {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f7f7f7;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
}

@media screen and (max-width: 768px) {
    .pgm_streetview_container {
        margin-bottom: 80px;
    }
}

.pgm_map_container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ====== Responsive ====== */
@media screen and (max-width: 1200px) {
    .pgm_thumbs_panel {
        width: 220px;
    }
}

@media screen and (max-width: 900px) {
    .pgm_topbar {
        padding: 6px 12px;
        gap: 8px;
    }

    .pgm_topbar_icons {
        display: none;
    }

    .pgm_topbar_price {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
    }

    .pgm_thumbs_panel {
        width: 180px;
    }

    .pgm_tab_btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}

@media screen and (max-width: 699px) {
    .pgm_content {
        flex-direction: column;
        padding: 0px;
        gap: 10px;
    }

    .pgm_thumbs_panel {
        width: 100%;
        max-height: 120px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .pgm_thumbs_grid {
        grid-template-columns: repeat(auto-fill, 100px);
        grid-auto-flow: column;
        grid-template-rows: 1fr;
        overflow-x: auto;
    }

    .pgm_thumb_item {
        width: 100px;
        min-width: 100px;
    }

    .pgm_topbar {
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 10px;
        min-height: auto;
        align-items: flex-start;
        justify-content: center;
    }

    .pgm_topbar_left {
        display: flex;
        flex: 1 0 100%;
        order: 1;
    }

    .pgm_mobile_header {
        order: 1;
        flex: 1 0 100%;
    }

    .pgm_topbar_center {
        flex: 1 0 100%;
        order: 3;
        margin-top: 4px;
    }

    .pgm_topbar_right {
        order: 2;
        position: static;
        top: auto;
        right: auto;
    }

    .pgm_tab_btn {
        padding: 8px 12px;
        font-size: 12px;
        font-size: 22px;
    }

    .pgm_nav_prev {
        left: 6px;
    }

    .pgm_nav_next {
        right: 6px;
    }

    .pgm_map_container {

        background: #fff;

    }
}

@media screen and (max-width: 599px) {
    .pgm_topbar {
        padding: 20px 10px;
        padding-top: 30px;
        gap: 10px;
    }

    .pgm_mobile_header {
        padding-right: 48px;
    }

    .pgm_mobile_address {
        font-size: 16px;
        text-transform: capitalize;
        font-weight: 600;
    }

    .pgm_mobile_info_row {
        gap: 5px;
        font-size: 12px;
    }

    .pgm_info_label {
        font-size: 12px;
    }

    .pgm_info_price,
    .pgm_info_sold {
        font-size: 13px;
    }

    .pgm_info_spec {
        font-size: 12px;
    }

    .pgm_info_spec svg {
        width: 14px;
        height: 14px;
    }

    .pgm_tab_btn {
        padding: 8px 12px;
        font-size: 12px;
        gap: 4px;
        border-radius: 15px;
    }

    .pgm_contact_btn {
        padding: 6px 12px !important;
        font-size: 11px !important;
    }

    .pgm_share_btn {
        width: 30px;
        height: 30px;
    }

    /* Close button: restore absolute position on mobile so it's always visible */
    .pgm_close_btn {
        width: 32px;
        height: 32px;
    }

    /* Contact Agent row: full-width and centered on mobile */
    .pgm_topbar_right {
        width: 100%;
        justify-content: center;
        order: 2;
    }
}

/* ---- Override conflicting propertydetails.css rules ---- */
.pgm_modal .MuiBox-root {
    background: #f7f7f7 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

.pgm_topbar_main {
    margin: 0 !important;
    margin-top: 0 !important;
}


/* Mobile-only close button (rendered via mobileWindowWidth) */
.pgm_close_btn_mobile {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid #ccc;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pgm_close_btn_mobile svg {
    font-size: 20px;
    color: #555;
}

.pgm_close_btn_mobile:hover {
    background: #ffebee;
}

.pgm_close_btn_mobile:hover svg {
    color: #D0191D;
}

.pgm_mobile_image_list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}

@media screen and (max-width: 699px) {
    .pgm_mobile_image_list {
        padding-bottom: 100px;
    }

    .pgm_topbar_center {
        margin-top: 0 !important;
        gap: 0 !important;
    }

    .pgm_mobile_image_list::-webkit-scrollbar {
        display: none;
    }
}

/* Mobile: vertical stacked image list */


.pgm_mobile_image_item {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* ====== Mobile Fullscreen Viewer Styles ====== */
.mobile_fullscreen_viewer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 9999;
}

.m_pgm_fullscreen_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.4);
    height: 50px;
    z-index: 10;
}

.m_pgm_fullscreen_close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
}

.m_pgm_fullscreen_counter {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.m_pgm_fullscreen_spacer {
    width: 38px;
}

.m_pgm_fullscreen_viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 100%;
    background: #000;
}

.m_pgm_fullscreen_thumbs_panel {
    background: rgba(0, 0, 0, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    box-sizing: border-box;
    overflow-x: auto;
    width: 100%;
}

.m_pgm_fullscreen_thumbs_panel::-webkit-scrollbar {
    display: none;
}

.m_pgm_fullscreen_thumbs_grid {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: max-content;
}

.m_pgm_fullscreen_thumb_item {
    width: 90px;
    height: 68px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.m_pgm_fullscreen_thumb_item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.m_pgm_fullscreen_thumb_item.m_pgm_thumb_active {
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px rgba(208, 25, 29, 0.5);
}