/* Lender Map Styles */

/* Styles from page-mortgage-lenders.php */
#lender-map-container {
    display: flex;
    gap: 0px;
    margin: 20px 0;
}

#lender-sidebar {
    width: 30%;
    min-width: 300px;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px 0px 0px 8px;
    padding: 16px;
    box-sizing: border-box;
    height: 500px; 
    overflow: clip;
}

#lender-search {
    width: 100%;
    font-size: 16px;    
    background-color: #EFEFEF;
    border-radius: 6px;
    border: none;
    padding: 12px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

#lender-map {
    height: 500px;
    width: 70%;
    border-radius: 0px 8px 8px 0px;
}

/* Styles from lender-map.js */

/* Error message for when lender data is not available */
#lender-map .lender-data-error-message p {
    text-align: center;
    padding: 20px;
}
#lender-list{
    height: 450px;
    overflow-y: auto;
    /* Webkit scrollbar styling */
    &::-webkit-scrollbar {
        width: 8px;
    }
    &::-webkit-scrollbar-track {
        background: white;
    }
    &::-webkit-scrollbar-thumb {
        background: #e3e3e3;
        border-radius: 4px;
    }
    /* Firefox scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: #e3e3e3 white;
}
/* Lender list item styles */
.lender-list-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f7f7f7;
    display: flex;
    flex-direction: column;
    align-items: start;
}

.lender-image-name{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.lender-list-item img {
    width: 48px;
    height: auto; /* Maintain aspect ratio */
    min-height: 48px; /* Ensure consistent height if image is smaller */
    object-fit: cover; /* Crop image to fit if aspect ratio differs */
    float: left; /* Retained for compatibility, but flex handles alignment */
    margin-right: 12px;
    border-radius: 50%;
}

.lender-list-item .lender-details {
    overflow: hidden; /* To contain floated elements if any, and for text overflow */
    flex-grow: 1; /* Allow text div to take remaining space */
}

.lender-list-item .lender-details strong {
    display: block; /* Ensure it takes full width */
    line-height: 1.2;
    font-family: 'Glober', sans-serif;
    color: #133156;
}

.lender-list-item .lender-details small {
    display: block; /* Ensure it takes full width */
    line-height: 1.2;
    font-family: 'Inter', sans-serif;
    font-weight: 400;    
    font-size: 14px;
    color: #425466;
}

/* InfoWindow Styles */
.lender-info-window {
    width: 100%;
    padding: 5px;
    padding-top: 16px;
}

.lender-info-window .info-window-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.lender-img-name-title{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}
.lender-info-window img {
    width: 80px;
    height: auto; /* Maintain aspect ratio */
    min-height: 80px; /* Ensure consistent height */
    object-fit: cover; /* Crop image */
    float: left; /* Retained for compatibility */
    margin-right: 10px;
    border-radius: 5px; /* Optional: slightly rounded corners for info window image */
}

.lender-info-window h3 {
    margin: 0;
    padding: 0;
    font-size: 20px;
    font-family: 'Glober', sans-serif;
    color: #133156;
}

.lender-info-window p {
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
    color: #425466;
    line-height: 1.2;
    text-wrap: balance;
}

.lender-info-window p:last-child {
    margin-bottom: 0;
}

.lender-info-window a {
    color: #0073aa; /* Standard WordPress link color */
    text-decoration: none;
}

.lender-info-window a:hover {
    text-decoration: underline;
}

/* Google Maps API loading error */
#lender-map.maps-api-error-message {
    text-align: center;
    padding: 20px;
    border: 1px dashed #f00;
    background-color: #fff5f5;
}

/* No lenders found message in list */
#lender-list .no-lenders-found {
    padding: 10px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #425466;
}

/* Styling for the main map container if no valid locations are found */
#lender-map .no-valid-locations-message {
    position: absolute;
    width: 80%;
    top: 15%;
    left: 50%;
    transform: translate(-50%);
    background-color: #ffffff;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(149, 155, 189, 0.25);
    text-align: center;
    z-index: 1000; /* Ensure it's above map tiles */
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #425466;
}

/* Lender List Item Action Buttons */
.lender-actions {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding-top: 10px;    
}

.lender-action-button {
    padding: 4px 12px;    
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: #005A8B;
    cursor: pointer;    
    border: 1px solid #005a8b35;
    background-color: #fff;
    border-radius: 6px;
    text-align: center;
    flex-grow: 1;
    margin: 0 5px;
    transition: all 0.3s ease;
}
.view-on-map-btn{
    background-color: #fffbfb;
    border: 1px solid #efefef;
    color: #333;
}
.lender-action-button:hover {
    background-color: #ddeff9;
    color: #005A8B; 
    border: 1px solid #005a8b35;
}
/* Info Window Action Buttons */
.info-window-actions{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 12px;
    padding-top: 12px;
}
.info-window-action-button.get-in-contact-btn{
    background-color: #005A8B;
    border: 1px solid #efefef;
    color: #fff;
    height: 40px;
    padding: 0 20px;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    cursor: pointer;
    text-align: center;
    flex-grow: 1;    
    transition: all 0.3s ease;
}
.info-window-action-button.close-info-window-btn{
    background-color: #fffbfb;
    border: 1px solid #efefef;
    color: #333;
    height: 40px;
    padding: 0 20px;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    cursor: pointer;
    text-align: center;
    flex-grow: 1;    
    transition: all 0.3s ease;
}
.info-window-action-button:hover {
    background-color: #ddeff9;
    color: #005A8B;
    border: 1px solid #005a8b35;
}
/* Hide default Google Maps InfoWindow close button */
.gm-style-iw-chr{
    display: none;
}

@media (max-width: 768px) {
    #lender-map-container {
        display: flex;        
        flex-direction: column-reverse;
        gap: 0px;
        margin: 20px 0;
    }
    #lender-sidebar {
        width: 100%;
        border-radius: 0px 0px 8px 8px;
    }
    #lender-map {
        width: 100%;
        height: 250px;
        border-radius: 8px 8px 0px 0px;
    }
    .gm-style .gm-style-iw-c{
        max-width: 300px !important;
    }
}