/**
 * @package     Joomla.Site
 * @subpackage  com_jrre
 *
 * @copyright   Copyright (C) 2026 JR Web Development. All rights reserved.
 * @license     GNU General Public License version 2 or later
 *
 * JRRE Frontend Styles
 */

/* ========================================
   CSS Custom Properties (Defaults)
   These can be overridden by component settings
   ======================================== */
:root {
    --jrre-featured-color: #ff9800;
    --jrre-standard-color: #3388ff;
}

/* ========================================
   Component Width - Inherit from Theme
   ======================================== */

/*
 * These rules ensure JRRE pages respect the theme's width settings.
 * The component containers inherit width from their parent, allowing
 * the Joomla template to control the overall page layout.
 */
.com-jrre-properties,
.com-jrre-search,
.com-jrre-property,
.com-jrre-agent,
.com-jrre-agency {
    width: 100%;
    max-width: none;
}

/* ========================================
   Scroll Margin for Sticky Headers
   Ensures anchor links don't scroll content under sticky headers
   ======================================== */
#results,
#search-results-anchor,
#gridView,
#listView {
    scroll-margin-top: 100px;
}

/* ========================================
   Property Detail Page Styles
   ======================================== */

/* Sticky Header */
.com-jrre-property .property-sticky-header {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 1rem 0;
    margin: -1rem 0 1rem 0;
    border-bottom: 1px solid #e9ecef;
    z-index: 100;
}

.com-jrre-property .property-title {
    color: #212529;
    line-height: 1.2;
}

.com-jrre-property .property-price {
    color: #198754;
}

.com-jrre-property .property-quick-facts {
    font-size: 0.9rem;
}

/* Photo Slider */
.com-jrre-property .photo-slider-container {
    position: relative;
    max-width: 100%;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
}

.com-jrre-property .photo-slider {
    display: flex;
    transition: transform 0.3s ease;
}

.com-jrre-property .photo-slide {
    flex: 0 0 100%;
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.com-jrre-property .photo-slide img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.com-jrre-property .slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
    font-size: 1.1rem;
    color: #333;
}

.com-jrre-property .slider-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.05);
}

.com-jrre-property .slider-nav.prev {
    left: 15px;
}

.com-jrre-property .slider-nav.next {
    right: 15px;
}

.com-jrre-property .slider-counter {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10;
}

.com-jrre-property .slider-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: pointer;
    z-index: 5;
}

/* Photo Thumbnails */
.com-jrre-property .photo-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
}

.com-jrre-property .photo-thumbnail {
    flex: 0 0 80px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, opacity 0.2s;
    opacity: 0.7;
}

.com-jrre-property .photo-thumbnail:hover,
.com-jrre-property .photo-thumbnail.active {
    border-color: #0d6efd;
    opacity: 1;
}

.com-jrre-property .photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Key Facts Bar */
.com-jrre-property .property-key-facts {
    border: 1px solid #e9ecef;
}

.com-jrre-property .key-fact {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.com-jrre-property .key-fact i {
    display: block;
}

/* Feature Cards */
.com-jrre-property .card {
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.com-jrre-property .card-header {
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

.com-jrre-property .card-header h2,
.com-jrre-property .card-header h3 {
    font-weight: 600;
}

/* Property Details Table */
.com-jrre-property .property-details-card .table {
    margin-bottom: 0;
}

.com-jrre-property .property-details-card .table th {
    font-weight: 500;
    border: none;
    padding: 0.5rem 0;
    width: 50%;
}

.com-jrre-property .property-details-card .table td {
    border: none;
    padding: 0.5rem 0;
}

.com-jrre-property .property-details-card .table tr {
    border-bottom: 1px solid #f1f3f5;
}

.com-jrre-property .property-details-card .table tr:last-child {
    border-bottom: none;
}

/* Map Container */
.com-jrre-property .property-map-container {
    border-radius: 0 0 0.375rem 0.375rem;
    overflow: hidden;
}

/* Share Buttons */
.com-jrre-property .property-share .btn {
    padding: 0.5rem;
}

.com-jrre-property .property-share .btn i {
    font-size: 1.1rem;
}

/* Lightbox Overlay */
.jrre-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.jrre-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.jrre-lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.jrre-lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.jrre-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    padding: 0;
    line-height: 1;
}

.jrre-lightbox-close:hover {
    opacity: 1;
}

.jrre-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #333;
    transition: background 0.2s, transform 0.2s;
}

.jrre-lightbox-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.05);
}

.jrre-lightbox-prev {
    left: -70px;
}

.jrre-lightbox-next {
    right: -70px;
}

.jrre-lightbox-caption {
    color: #fff;
    text-align: center;
    padding: 1rem 0 0.5rem 0;
    font-size: 0.9rem;
}

.jrre-lightbox-counter {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-size: 0.85rem;
}

/* Responsive adjustments for property detail */
@media (max-width: 991.98px) {
    .com-jrre-property .property-sticky-header {
        position: relative;
        margin: 0 0 1rem 0;
    }
}

@media (max-width: 767.98px) {
    .com-jrre-property .photo-thumbnail {
        flex: 0 0 60px;
        height: 45px;
    }

    .com-jrre-property .photo-slide img {
        max-height: 300px;
    }

    .com-jrre-property .slider-nav {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .com-jrre-property .slider-nav.prev {
        left: 10px;
    }

    .com-jrre-property .slider-nav.next {
        right: 10px;
    }

    .com-jrre-property .property-key-facts .col-6 {
        border-bottom: 1px solid #e9ecef;
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .com-jrre-property .property-key-facts .col-6:nth-last-child(-n+2) {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .jrre-lightbox-prev {
        left: 10px;
    }

    .jrre-lightbox-next {
        right: 10px;
    }

    .jrre-lightbox-close {
        top: 10px;
        right: 10px;
    }

    .jrre-lightbox-nav {
        width: 40px;
        height: 40px;
    }
}

/* Property Card Styles */
.jrre-property-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.jrre-property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.jrre-property-card .card-img-top {
    transition: opacity 0.2s ease;
}

.jrre-property-card:hover .card-img-top {
    opacity: 0.95;
}

/* Price styling */
.jrre-price {
    color: #198754;
    font-weight: 700;
}

/* Property card title spacing */
.jrre-property-card .card-body h3.card-title {
    margin-top: 0.75rem !important;
}

/* Property details icons */
.jrre-details i {
    opacity: 0.7;
}

/* Search form styles */
.jrre-search-form .card-header {
    border-bottom: none;
}

/* Search button - full width on small, auto on medium+ */
.jrre-search-btn {
    width: 100%;
}

@media (min-width: 768px) {
    .jrre-search-btn {
        width: auto;
    }
}

.jrre-search-form .form-control:focus,
.jrre-search-form .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Multi-select dropdown styling (Joomla choices.js / Bootstrap multiselect) */
.jrre-search-form .choices__inner,
.jrre-search-form .multiselect__tags,
.jrre-search-form .dropdown-toggle {
    padding-left: 0.75rem;
}

/* Fix padding for Joomla 5 enhanced select dropdowns */
.jrre-search-form .choices .choices__inner {
    padding: 0.5rem 0.75rem;
    min-height: calc(1.5em + 1rem + 2px);
}

/* Fix checkbox alignment in dropdown options */
.jrre-search-form .choices__list--dropdown .choices__item,
.jrre-search-form .dropdown-menu .form-check {
    padding-left: 0.5rem;
}

.jrre-search-form .choices__list--dropdown .choices__item input[type="checkbox"],
.jrre-search-form .dropdown-menu .form-check-input {
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Bootstrap Multiselect specific fixes */
.jrre-search-form .multiselect-container > li > a > label {
    padding-left: 0.5rem;
}

.jrre-search-form .multiselect-container > li > a > label > input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Joomla native enhanced select styling */
.jrre-search-form .field-list-fancy-select .choices,
.jrre-search-form [data-field-type="list-fancy-select"] .choices {
    width: 100%;
}

.jrre-search-form .field-list-fancy-select .choices__inner,
.jrre-search-form [data-field-type="list-fancy-select"] .choices__inner {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background-color: #fff;
}

/* Native HTML multi-select with enhanced styling via JS */
.com-jrre-search .dropdown-menu.show {
    padding: 0.5rem 0;
}

.com-jrre-search .dropdown-menu .dropdown-item {
    padding: 0.35rem 1rem 0.35rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.com-jrre-search .dropdown-menu .dropdown-item input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

/* Selected count display padding */
.com-jrre-search .btn.dropdown-toggle,
.com-jrre-search .multiselect.dropdown-toggle {
    text-align: left;
    padding-left: 0.75rem;
}

/* Filter bar styles */
.jrre-filter-bar {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
}

/* Active filters badges */
.jrre-active-filters .badge {
    font-weight: normal;
    font-size: 0.85rem;
}

/* Results count */
.results-count {
    color: #6c757d;
}

/* No properties found message */
.com-jrre-properties .alert-info,
.com-jrre-search .alert-info {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

/* Pagination improvements */
.jrre-pagination .pagination {
    justify-content: center;
}

.jrre-pagination .page-link {
    border-radius: 0;
    margin: 0 0.15rem;
}

/* Grid layout responsive adjustments */
@media (max-width: 767.98px) {
    .jrre-properties-grid .col {
        max-width: 100%;
    }

    .jrre-search-form .btn-lg {
        width: 100%;
    }
}

/* Property image placeholder */
.jrre-property-card .card-img-top-link .bg-secondary {
    background-color: #e9ecef !important;
}

/* Status badge positioning */
.jrre-property-card .position-absolute {
    z-index: 1;
}

/* ========================================
   Our Listing / Featured Property Styling
   ======================================== */

/* Featured property card - no special border, layout differentiates */
.jrre-property-card.jrre-our-listing {
    /* Featured styling handled by layout differences */
}

.jrre-property-card.jrre-our-listing:hover {
    /* Standard hover effect */
}

/* Remove border radius from all badges in JRRE views */
.com-jrre-properties .badge,
.com-jrre-search .badge,
.com-jrre-property .badge,
.com-jrre-homepage .badge,
.jrre-our-listing-badge,
.jrre-sidebar-img-badge,
.jrre-list-img-badge,
.jrre-popup-badge {
    border-radius: 0 !important;
}

/* Our Listing badge styling - ALWAYS uses component's featured color */
/* This ensures featured/our listing badges are consistently branded */
.jrre-our-listing-badge {
    background-color: var(--jrre-badge-featured, var(--jrre-featured-color, #ff9800)) !important;
    border-color: var(--jrre-badge-featured, var(--jrre-featured-color, #ff9800)) !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.7rem;
}

/* Status badge colors - only override when custom color mode is active */
/* In theme mode, Bootstrap/YooTheme default colors are used */

/* Custom color mode: New Listing badges (bg-info) */
[data-color-mode="custom"] .jrre-badge-new-listing,
[data-color-mode="custom"] .badge.bg-info {
    background-color: var(--jrre-badge-new-listing) !important;
    border-color: var(--jrre-badge-new-listing) !important;
}

/* Custom color mode: Pending badges (bg-warning) */
[data-color-mode="custom"] .jrre-badge-pending,
[data-color-mode="custom"] .badge.bg-warning {
    background-color: var(--jrre-badge-pending) !important;
    border-color: var(--jrre-badge-pending) !important;
}

/* Custom color mode: Sold badges (bg-danger) */
[data-color-mode="custom"] .jrre-badge-sold,
[data-color-mode="custom"] .badge.bg-danger {
    background-color: var(--jrre-badge-sold) !important;
    border-color: var(--jrre-badge-sold) !important;
}

/* Custom color mode: Active badges (bg-success) */
[data-color-mode="custom"] .jrre-badge-active,
[data-color-mode="custom"] .badge.bg-success {
    background-color: var(--jrre-badge-active) !important;
    border-color: var(--jrre-badge-active) !important;
}

/* Custom color mode: New Construction badges */
[data-color-mode="custom"] .jrre-badge-new-construction,
[data-color-mode="custom"] .badge.bg-purple {
    background-color: var(--jrre-badge-new-construction) !important;
    border-color: var(--jrre-badge-new-construction) !important;
}

/* List view row - featured styling handled by layout */
.jrre-list-row.jrre-our-listing {
    /* Featured styling handled by layout differences */
}

.jrre-list-row.jrre-our-listing:hover {
    /* Standard hover effect */
}

/* Map sidebar card - featured styling handled by vertical layout */
.jrre-map-sidebar .jrre-property-card.jrre-our-listing {
    /* Featured styling handled by jrre-sidebar-featured class layout */
}

/* Small featured badge on sidebar/list images - ALWAYS uses component's featured color */
.jrre-sidebar-img-badge.jrre-our-listing-badge,
.jrre-list-img-badge.jrre-our-listing-badge,
.jrre-sidebar-img-badge.bg-primary,
.jrre-list-img-badge.bg-primary {
    background-color: var(--jrre-badge-featured, var(--jrre-featured-color, #ff9800)) !important;
    border-color: var(--jrre-badge-featured, var(--jrre-featured-color, #ff9800)) !important;
}

/* ========================================
   List View (Table Format)
   ======================================== */

.jrre-view-list {
    margin-top: 1rem;
}

.jrre-list-table {
    margin-bottom: 0;
}

.jrre-list-table tbody tr {
    transition: background-color 0.15s ease;
}

.jrre-list-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.jrre-list-table tbody td {
    padding: 0.5rem;
    vertical-align: middle;
}

/* List cell with icon */
.jrre-list-cell {
    white-space: nowrap;
}

.jrre-list-cell i {
    opacity: 0.7;
}

/* Photo column */
.jrre-list-th-photo {
    width: 90px;
}

.jrre-list-photo {
    position: relative;
}

.jrre-list-photo img {
    width: 80px;
    height: 62px;
    object-fit: cover;
}

.jrre-list-photo .jrre-list-no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 62px;
    background-color: #e9ecef;
    color: #adb5bd;
    text-decoration: none;
}

/* New listing badge overlay on photo */
.jrre-list-photo .jrre-list-img-badge {
    position: absolute;
    bottom: 2px;
    left: 2px;
    padding: 0.1rem 0.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1;
}

/* Address column */
.jrre-list-address {
    font-weight: 500;
}

.jrre-list-address a {
    color: #212529;
}

.jrre-list-address a:hover {
    color: var(--bs-primary, #0d6efd);
}

.jrre-list-address .badge {
    font-size: 0.65rem;
    vertical-align: middle;
}

/* Location column */
.jrre-list-location {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Price column */
.jrre-list-price {
    white-space: nowrap;
}

/* Beds/Baths/SqFt/Acres/DOM columns */
.jrre-list-beds,
.jrre-list-baths,
.jrre-list-sqft,
.jrre-list-acres,
.jrre-list-dom {
    font-size: 0.9rem;
    color: #495057;
}

/* Status column */
.jrre-list-status .badge {
    font-size: 0.75rem;
}

/* Actions column */
.jrre-list-actions .btn {
    white-space: nowrap;
}

/* Responsive adjustments for list view */
@media (max-width: 1199.98px) {
    .jrre-list-cell:nth-last-of-type(2) {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .jrre-list-cell:nth-last-of-type(3),
    .jrre-list-cell:nth-last-of-type(4) {
        display: none;
    }
}

/* Hide list view on tablets and below - not responsive-friendly */
@media (max-width: 767.98px) {
    .jrre-view-list,
    .jrre-view-switcher button[data-view="list"] {
        display: none !important;
    }
}

/* ========================================
   View Switcher (Map / List / Grid)
   ======================================== */

/* View switcher button group - square buttons */
.jrre-view-switcher .btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.jrre-view-switcher .btn i {
    font-size: 1rem;
}

.jrre-view-switcher .btn.active {
    background-color: var(--bs-primary, #0d6efd);
    border-color: var(--bs-primary, #0d6efd);
    color: #fff;
}

.jrre-view-switcher .btn:focus {
    box-shadow: none;
}

/* ========================================
   Map View Layout (60/40 split)
   ======================================== */

.jrre-view-map {
    display: flex;
    height: calc(100vh - 280px);
    min-height: 500px;
    gap: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.jrre-map-container {
    flex: 0 0 60%;
    position: relative;
    background: #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
}

#propertiesMap,
#searchPropertiesMap {
    width: 100%;
    height: 100%;
}

/* Map buttons container */
.jrre-map-buttons {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 800 !important;
    display: flex;
    gap: 0.5rem;
}

/* Leaflet controls z-index */
.leaflet-top,
.leaflet-bottom {
    z-index: 800 !important;
}

.jrre-map-buttons .btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

/* Map overlay buttons - solid backgrounds for accessibility */
.jrre-map-buttons .btn.btn-secondary,
.jrre-reset-view-btn,
.jrre-toggle-sidebar-btn {
    background-color: #fff !important;
    border-color: #dee2e6 !important;
    color: #495057 !important;
}

.jrre-map-buttons .btn.btn-secondary:hover,
.jrre-map-buttons .btn.btn-secondary:focus,
.jrre-reset-view-btn:hover,
.jrre-reset-view-btn:focus,
.jrre-toggle-sidebar-btn:hover,
.jrre-toggle-sidebar-btn:focus {
    background-color: #e9ecef !important;
    border-color: #dee2e6 !important;
    color: #212529 !important;
}

/* Search This Area button - primary style with solid background */
.jrre-search-area-btn {
    background-color: var(--bs-primary, #0d6efd) !important;
    border-color: var(--bs-primary, #0d6efd) !important;
    color: #fff !important;
}

.jrre-search-area-btn:hover,
.jrre-search-area-btn:focus {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
    color: #fff !important;
}

/* Sidebar collapsed state - map takes full width */
.jrre-view-map.sidebar-collapsed .jrre-map-container {
    flex: 1 1 100%;
}

.jrre-map-sidebar {
    flex: 0 0 calc(40% - 1rem);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.5rem;
}

/* No results message in sidebar */
.jrre-sidebar-no-results {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: 200px;
}

.jrre-sidebar-no-results i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Custom scrollbar for sidebar */
.jrre-map-sidebar::-webkit-scrollbar {
    width: 6px;
}

.jrre-map-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.jrre-map-sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.jrre-map-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Compact cards for map sidebar - base styles */
.jrre-map-sidebar .jrre-property-card {
    height: auto;
    flex-shrink: 0;
}

.jrre-map-sidebar .jrre-property-card:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.jrre-map-sidebar .jrre-property-card .card-body h3.card-title {
    margin-top: 0 !important;
    font-size: 1.25rem;
    line-height: 1.3;
}

.jrre-map-sidebar .jrre-property-card .jrre-price {
    font-size: 1rem;
}

.jrre-map-sidebar .jrre-property-card .jrre-details {
    font-size: 0.75rem;
}

/* Highlighted card (when marker is clicked) */
.jrre-map-sidebar .jrre-property-card.highlighted {
    background-color: rgba(0, 0, 0, 0.04);
}

/* ========================================
   Map Marker Popup Styles
   ======================================== */

.jrre-marker-popup {
    min-width: 220px;
    font-family: inherit;
}

.jrre-marker-popup img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.jrre-marker-popup .popup-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #198754;
    margin-bottom: 0.25rem;
}

.jrre-marker-popup .popup-address {
    font-size: 0.9rem;
    color: #212529;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.jrre-marker-popup .popup-details {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.jrre-marker-popup .popup-details span {
    margin-right: 0.5rem;
}

/* Marker popup button - ensure proper Bootstrap button styling */
.jrre-marker-popup .btn.btn-primary {
    background-color: var(--bs-primary, #0d6efd);
    border-color: var(--bs-primary, #0d6efd);
    color: #fff !important;
    text-decoration: none;
}

.jrre-marker-popup .btn.btn-primary:hover {
    background-color: var(--bs-primary-dark, #0b5ed7);
    border-color: var(--bs-primary-dark, #0a58ca);
    color: #fff !important;
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 0;
}

.leaflet-popup-content {
    margin: 12px;
}

.leaflet-popup-close-button {
    color: #666 !important;
}

/* Override Leaflet default link colors - only for non-button links */
.leaflet-container a:not(.btn) {
    color: var(--bs-primary, #0d6efd);
}

.leaflet-container a:not(.btn):hover {
    color: var(--bs-primary, #0d6efd);
    opacity: 0.8;
}

/* ========================================
   Custom Map Markers
   ======================================== */

/* Base marker container - override Leaflet default div-icon styles */
.leaflet-marker-icon.jrre-map-marker,
.leaflet-div-icon.jrre-map-marker,
.jrre-map-marker {
    background: transparent !important;
    border: none !important;
    width: 30px !important;
    height: 30px !important;
    /* Ensure no default Leaflet styles interfere */
    box-sizing: border-box !important;
    /* DO NOT override transform - Leaflet uses it for positioning markers! */
}

/* Marker pin shape - with full browser support */
.leaflet-marker-icon .jrre-marker-pin,
.leaflet-div-icon .jrre-marker-pin,
.jrre-map-marker .jrre-marker-pin,
.jrre-marker-pin {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    /* Pin shape - three rounded corners, one pointed */
    -webkit-border-radius: 50% 50% 50% 0 !important;
    -moz-border-radius: 50% 50% 50% 0 !important;
    border-radius: 50% 50% 50% 0 !important;
    /* Transform origin at center for proper rotation */
    -webkit-transform-origin: center center !important;
    -moz-transform-origin: center center !important;
    -ms-transform-origin: center center !important;
    transform-origin: center center !important;
    /* Rotation with vendor prefixes */
    -webkit-transform: rotate(-45deg) !important;
    -moz-transform: rotate(-45deg) !important;
    -ms-transform: rotate(-45deg) !important;
    transform: rotate(-45deg) !important;
    position: relative !important;
    -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3) !important;
    display: -webkit-box !important;
    display: -webkit-flex !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-align: center !important;
    -webkit-align-items: center !important;
    -ms-flex-align: center !important;
    align-items: center !important;
    -webkit-box-pack: center !important;
    -webkit-justify-content: center !important;
    -ms-flex-pack: center !important;
    justify-content: center !important;
    /* Ensure the element renders as block-level */
    box-sizing: border-box !important;
    /* Ensure proper rendering on all devices */
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
}

/* Icon inside marker - white with shadow for visibility */
.leaflet-marker-icon .jrre-marker-pin i,
.leaflet-div-icon .jrre-marker-pin i,
.jrre-map-marker .jrre-marker-pin i,
.jrre-marker-pin i {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    /* Counter-rotate the icon with vendor prefixes */
    -webkit-transform: translate(-50%, -50%) rotate(45deg) !important;
    -moz-transform: translate(-50%, -50%) rotate(45deg) !important;
    -ms-transform: translate(-50%, -50%) rotate(45deg) !important;
    transform: translate(-50%, -50%) rotate(45deg) !important;
    color: white !important;
    font-size: 16px !important;
    z-index: 1 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Mobile-specific marker fixes - aggressive specificity to override any conflicts */
@media screen and (max-width: 768px) {
    /* DO NOT override transform on marker container - Leaflet uses it for positioning! */

    .leaflet-marker-icon .jrre-marker-pin,
    .leaflet-div-icon .jrre-marker-pin,
    .jrre-map-marker .jrre-marker-pin,
    div.jrre-marker-pin,
    .jrre-marker-pin {
        /* Ensure transform applies on mobile with transform-origin */
        -webkit-transform-origin: center center !important;
        -moz-transform-origin: center center !important;
        -ms-transform-origin: center center !important;
        transform-origin: center center !important;
        -webkit-transform: rotate(-45deg) !important;
        -moz-transform: rotate(-45deg) !important;
        -ms-transform: rotate(-45deg) !important;
        transform: rotate(-45deg) !important;
        /* Explicit border-radius for mobile */
        -webkit-border-radius: 50% 50% 50% 0 !important;
        -moz-border-radius: 50% 50% 50% 0 !important;
        border-radius: 50% 50% 50% 0 !important;
        /* Ensure display and sizing */
        display: flex !important;
        width: 30px !important;
        height: 30px !important;
    }

    .leaflet-marker-icon .jrre-marker-pin i,
    .leaflet-div-icon .jrre-marker-pin i,
    .jrre-map-marker .jrre-marker-pin i,
    div.jrre-marker-pin i,
    .jrre-marker-pin i {
        -webkit-transform-origin: center center !important;
        -moz-transform-origin: center center !important;
        -ms-transform-origin: center center !important;
        transform-origin: center center !important;
        -webkit-transform: translate(-50%, -50%) rotate(45deg) !important;
        -moz-transform: translate(-50%, -50%) rotate(45deg) !important;
        -ms-transform: translate(-50%, -50%) rotate(45deg) !important;
        transform: translate(-50%, -50%) rotate(45deg) !important;
    }

    /* Ensure icon-only markers have NO rotation on mobile */
    .leaflet-marker-icon.jrre-map-marker .jrre-marker-icon-only,
    .jrre-map-marker .jrre-marker-icon-only,
    div.jrre-marker-icon-only,
    .jrre-marker-icon-only {
        -webkit-transform: none !important;
        -moz-transform: none !important;
        -ms-transform: none !important;
        transform: none !important;
    }

    .leaflet-marker-icon.jrre-map-marker .jrre-marker-icon-only i,
    .jrre-map-marker .jrre-marker-icon-only i,
    div.jrre-marker-icon-only i,
    .jrre-marker-icon-only i {
        -webkit-transform: none !important;
        -moz-transform: none !important;
        -ms-transform: none !important;
        transform: none !important;
    }
}

/* Icon-only marker style */
.leaflet-marker-icon.jrre-map-marker .jrre-marker-icon-only,
.jrre-map-marker .jrre-marker-icon-only,
.jrre-marker-icon-only {
    font-size: 24px !important;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.4),
        0 0 2px rgba(255, 255, 255, 0.8) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
}

.leaflet-marker-icon.jrre-map-marker .jrre-marker-icon-only i,
.jrre-map-marker .jrre-marker-icon-only i,
.jrre-marker-icon-only i {
    font-size: 24px !important;
    /* Ensure no rotation on icon-only markers */
    -webkit-transform: none !important;
    -moz-transform: none !important;
    -ms-transform: none !important;
    transform: none !important;
}

/* Featured markers appear above standard markers */
.leaflet-marker-icon.jrre-map-marker-featured {
    z-index: 1000 !important;
}

/* Featured popup styling - no border, badge overlays image */
.jrre-marker-popup-featured {
    /* Badge overlay handles featured indication */
}

/* Popup image wrapper for badge overlay */
.jrre-popup-img-wrapper {
    position: relative;
    margin-bottom: 0.5rem;
}

.jrre-popup-img-wrapper img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0;
}

/* Badge inside popup for featured listings - overlays image */
.jrre-popup-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--jrre-featured-color, #ff9800);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    z-index: 1;
}

.jrre-popup-badge::before {
    content: '\f005';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.6rem;
}

/* Container for multiple badges in popup */
.jrre-popup-badges {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 1;
}

.jrre-popup-badges .jrre-popup-badge,
.jrre-popup-badges .jrre-popup-status-badge {
    position: relative;
    top: auto;
    left: auto;
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

/* Status badge in popup (no star icon) */
.jrre-popup-status-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

/* Inline badges when no image */
.jrre-popup-badges-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.jrre-popup-badges-inline .jrre-popup-badge,
.jrre-popup-badges-inline .jrre-popup-status-badge {
    position: relative;
    top: auto;
    left: auto;
}

/* ========================================
   Map View Responsive
   ======================================== */

@media (max-width: 991.98px) {
    .jrre-view-map {
        flex-direction: column;
        height: auto;
        min-height: auto;
    }

    .jrre-map-container {
        flex: none;
        height: 350px;
        border-radius: 0.5rem;
    }

    .jrre-map-sidebar {
        flex: none;
        max-height: none;
        padding-right: 0;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 0.75rem;
        padding-bottom: 0.5rem;
    }

    /* Both card types get consistent width on tablet - horizontal scroll */
    .jrre-map-sidebar .jrre-property-card {
        flex-direction: column;
        min-width: 220px;
        max-width: 220px;
        height: auto !important;
        overflow: visible;
    }

    /* Featured cards slightly wider on tablet */
    .jrre-map-sidebar .jrre-sidebar-featured {
        min-width: 240px;
        max-width: 240px;
    }

    .jrre-map-sidebar .jrre-sidebar-featured .jrre-featured-card-img-wrapper,
    .jrre-map-sidebar .jrre-sidebar-featured .card-img-top {
        height: 150px !important;
    }

    /* Standard cards image wrapper on tablet */
    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-img-wrapper {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        height: 140px !important;
        min-height: 140px !important;
    }

    .jrre-map-sidebar .jrre-sidebar-standard .card-img-top,
    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-img img {
        width: 100%;
        height: 140px;
        border-radius: 0;
    }

    .jrre-map-sidebar .jrre-sidebar-standard .card-img-top-link .bg-secondary,
    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-img.bg-secondary {
        width: 100%;
        height: 140px;
        border-radius: 0;
    }

    /* Standard cards go vertical on tablet */
    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-inner {
        flex-direction: column;
        height: auto;
    }

    /* Ensure card body takes full width when stacked vertically */
    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-body {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 0.75rem !important;
    }

    .jrre-map-sidebar .jrre-property-card .card-body {
        padding: 0.75rem !important;
    }

    /* Featured card-body keeps horizontal layout on tablet */
    .jrre-map-sidebar .jrre-sidebar-featured .card-body {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }

    /* Standard card buttons - row layout on tablet */
    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-buttons {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
    }

    /* Featured cards keep their buttons visible on tablet */
    .jrre-map-sidebar .jrre-sidebar-featured .jrre-featured-card-buttons {
        display: flex !important;
    }
}

@media (max-width: 575.98px) {
    .jrre-view-map {
        margin: 0 -0.75rem;
        width: calc(100% + 1.5rem);
        border-radius: 0;
    }

    .jrre-map-container {
        border-radius: 0;
        height: 350px;
    }

    .jrre-map-sidebar {
        padding: 0.5rem 0.75rem;
        min-height: 320px;
        overflow-y: visible !important;
    }

    /* Standard cards on mobile - vertical stacking layout */
    .jrre-map-sidebar .jrre-sidebar-standard {
        min-width: 200px;
        max-width: 200px;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* Make standard card inner flex column to push buttons to bottom */
    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-inner {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
    }

    /* Standard card body grows to push buttons down */
    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-body {
        flex: 1 1 auto !important;
    }

    /* Featured cards on mobile - vertical layout with buttons at bottom */
    .jrre-map-sidebar .jrre-sidebar-featured {
        min-width: 220px;
        max-width: 220px;
        display: flex !important;
        flex-direction: column !important;
    }

    .jrre-map-sidebar .jrre-sidebar-featured .jrre-featured-card-img-wrapper,
    .jrre-map-sidebar .jrre-sidebar-featured .card-img-top {
        height: 130px !important;
    }

    /* Featured card body grows to push buttons down */
    .jrre-map-sidebar .jrre-sidebar-featured .card-body {
        flex: 1 1 auto !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }

    /* Featured card content grows within card-body */
    .jrre-map-sidebar .jrre-sidebar-featured .jrre-featured-card-content {
        flex: 1 1 auto !important;
        text-align: center !important;
        width: 100% !important;
    }

    .jrre-map-sidebar .jrre-sidebar-featured .jrre-details {
        justify-content: center !important;
    }

    .jrre-map-sidebar .jrre-sidebar-featured .jrre-featured-card-buttons {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 0.75rem !important;
        gap: 0.5rem !important;
    }

    .jrre-map-sidebar .jrre-sidebar-featured .jrre-featured-card-buttons .btn {
        width: 100% !important;
        flex: none !important;
        font-size: 0.85rem !important;
        padding: 0.5rem 0.75rem !important;
    }

    /* Standard card buttons - stacked column on mobile */
    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-buttons {
        flex-direction: column !important;
    }

    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-buttons .btn {
        width: 100% !important;
        flex: none !important;
    }

    /* Stack view switcher buttons if needed */
    .jrre-results-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* ========================================
   Sidebar Card Layout
   ======================================== */

/* ----------------------------------------
   Featured Sidebar Cards (Vertical Layout)
   ---------------------------------------- */

/* Featured card - vertical layout with image on top */
.jrre-map-sidebar .jrre-sidebar-featured {
    flex-direction: column;
    min-height: auto;
    width: 100%;
}

.jrre-map-sidebar .jrre-sidebar-featured .jrre-featured-card-img-wrapper {
    width: 100%;
    height: 140px;
    position: relative;
    overflow: hidden;
}

.jrre-map-sidebar .jrre-sidebar-featured .card-img-top {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

/* Featured card-body - mobile-first (vertical stacking) */
.jrre-map-sidebar .jrre-sidebar-featured .card-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.jrre-map-sidebar .jrre-sidebar-featured .jrre-price {
    font-size: 1.1rem;
    color: #198754;
}

.jrre-map-sidebar .jrre-sidebar-featured .card-title {
    margin-top: 0 !important;
    margin-bottom: 0.25rem !important;
    font-size: 1.25rem;
    line-height: 1.3;
}

/* Featured card content */
.jrre-map-sidebar .jrre-sidebar-featured .jrre-featured-card-content {
    width: 100%;
    text-align: center;
}

/* Featured card details row */
.jrre-map-sidebar .jrre-sidebar-featured .jrre-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Featured card buttons - row on mobile */
.jrre-map-sidebar .jrre-sidebar-featured .jrre-featured-card-buttons {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    margin-top: 0.5rem;
    width: 100%;
}

.jrre-map-sidebar .jrre-sidebar-featured .jrre-featured-card-buttons .btn {
    flex: 1;
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* ----------------------------------------
   Standard Sidebar Cards - Base styles (mobile-first)
   ---------------------------------------- */

/* Inner container - column layout by default (mobile) */
.jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Card body - block display for normal text flow */
.jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-body {
    display: block;
    width: 100%;
    padding: 0.75rem;
    text-align: center;
}

/* Details row */
.jrre-map-sidebar .jrre-sidebar-standard .jrre-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Buttons - stacked column on mobile */
.jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
}

.jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-buttons .btn {
    width: 100%;
}

/* Image wrapper */
.jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-img-wrapper {
    width: 100%;
    height: 120px;
    position: relative;
    overflow: hidden;
}

.jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-img {
    display: block;
    width: 100%;
    height: 100%;
}

.jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-img.jrre-no-image {
    background: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ----------------------------------------
   Standard Sidebar Cards - Desktop (horizontal layout)
   ---------------------------------------- */
@media (min-width: 576px) {
    /* Standard card - fixed height for consistent layout */
    .jrre-map-sidebar .jrre-sidebar-standard {
        height: 130px;
        min-height: 130px;
        max-height: 130px;
        overflow: visible;
        width: 100%;
    }

    /* Inner container - row layout on desktop */
    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-inner {
        flex-direction: row !important;
        height: 100% !important;
    }

    /* Image wrapper - fixed width on desktop */
    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-img-wrapper {
        width: 115px !important;
        min-width: 115px !important;
        max-width: 115px !important;
        flex: 0 0 115px !important;
        height: 100% !important;
    }

    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-img {
        position: absolute;
        top: 0;
        left: 0;
    }

    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-img img {
        position: absolute;
        top: 0;
        left: 0;
    }

    /* Card body - flex column, fills middle space */
    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-card-body {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        flex: 1 1 0% !important;
        min-width: 0 !important;
        text-align: left !important;
        padding: 0.5rem 0.75rem !important;
    }

    /* Details - left aligned on desktop */
    .jrre-map-sidebar .jrre-sidebar-standard .jrre-details {
        justify-content: flex-start !important;
    }

    /* Buttons - column on right side */
    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-buttons {
        width: 140px !important;
        min-width: 140px !important;
        max-width: 140px !important;
        flex: 0 0 140px !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: stretch !important;
        padding: 0.5rem 0.4rem !important;
    }

    .jrre-map-sidebar .jrre-sidebar-standard .jrre-sidebar-buttons .btn {
        flex: none !important;
        font-size: 0.75rem !important;
        padding: 0.4rem 0.4rem !important;
        white-space: nowrap !important;
        width: 100% !important;
        text-align: center !important;
        line-height: 1.4 !important;
    }

    /* Card title styling */
    .jrre-map-sidebar .jrre-sidebar-standard .card-body h3.card-title {
        margin-top: 0;
        margin-bottom: 0.25rem;
        font-size: 1.25rem;
        line-height: 1.25;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* ----------------------------------------
       Featured Sidebar Cards - Desktop (horizontal content/buttons)
       ---------------------------------------- */

    /* Featured card-body - horizontal layout on desktop */
    .jrre-map-sidebar .jrre-sidebar-featured .card-body {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
    }

    /* Featured card content - left aligned on desktop */
    .jrre-map-sidebar .jrre-sidebar-featured .jrre-featured-card-content {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        text-align: left !important;
    }

    /* Featured card details - left aligned on desktop */
    .jrre-map-sidebar .jrre-sidebar-featured .jrre-details {
        justify-content: flex-start !important;
    }

    /* Featured card buttons - column on right side on desktop */
    .jrre-map-sidebar .jrre-sidebar-featured .jrre-featured-card-buttons {
        flex: 0 0 auto !important;
        flex-direction: column !important;
        margin-top: 0 !important;
        margin-left: 0.75rem !important;
        width: auto !important;
    }

    .jrre-map-sidebar .jrre-sidebar-featured .jrre-featured-card-buttons .btn {
        flex: none !important;
    }
}

/* Badge overlay on sidebar card image - applies to all screen sizes */
.jrre-map-sidebar .jrre-sidebar-img-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    font-size: 0.55rem;
    padding: 0.2rem 0.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    z-index: 1;
    line-height: 1;
}

/* ========================================
   Search Page - No Border Radius
   ======================================== */

.com-jrre-search .card,
.com-jrre-search .jrre-property-card,
.com-jrre-search .jrre-search-form,
.com-jrre-search .form-control,
.com-jrre-search .form-select,
.com-jrre-search .input-group-text,
.com-jrre-search .btn,
.com-jrre-search .badge,
.com-jrre-search .alert,
.com-jrre-search .page-link,
.com-jrre-search .card-img-top,
.com-jrre-search .jrre-sidebar-card-img img,
.com-jrre-search .jrre-sidebar-card-img,
.com-jrre-search .card-img-top-link .bg-secondary,
.com-jrre-search .jrre-sidebar-card-img.bg-secondary {
    border-radius: 0 !important;
}

.com-jrre-search .jrre-view-map,
.com-jrre-search .jrre-map-container,
.com-jrre-search #searchPropertiesMap {
    border-radius: 0 !important;
}

/* Override any Bootstrap rounded utilities on search page */
.com-jrre-search .rounded,
.com-jrre-search .rounded-1,
.com-jrre-search .rounded-2,
.com-jrre-search .rounded-3,
.com-jrre-search .rounded-pill {
    border-radius: 0 !important;
}

/* Input group corners */
.com-jrre-search .input-group > :first-child,
.com-jrre-search .input-group > :last-child {
    border-radius: 0 !important;
}

/* Button group corners */
.com-jrre-search .btn-group > .btn {
    border-radius: 0 !important;
}

/* Highlighted sidebar card on search page */
.com-jrre-search .jrre-map-sidebar .jrre-property-card.highlighted {
    background-color: rgba(0, 0, 0, 0.04) !important;
}

/* ========================================
   Search Results Header - Responsive
   ======================================== */

/* On smaller screens, when the results header wraps, make the view/sort controls take full width */
@media (max-width: 575.98px) {
    .com-jrre-search .jrre-search-results > .d-flex.flex-wrap,
    .com-jrre-properties .jrre-results-bar {
        flex-direction: column;
        align-items: stretch !important;
    }

    .com-jrre-search .jrre-search-results > .d-flex.flex-wrap > .results-count,
    .com-jrre-properties .jrre-results-bar > .results-count {
        text-align: left;
    }

    .com-jrre-search .jrre-search-results > .d-flex.flex-wrap > .d-flex,
    .com-jrre-properties .jrre-results-bar > .d-flex {
        flex-wrap: wrap;
        justify-content: space-between !important;
        width: 100%;
    }

    /* Save search button takes full width on its own row */
    .com-jrre-search .jrre-search-results .btn[data-bs-target="#saveSearchModal"],
    .com-jrre-properties .jrre-results-bar .btn[data-bs-target="#saveSearchModal"] {
        width: 100%;
        order: -1;
    }
}

/* ========================================
   Property Details Page - No Border Radius
   ======================================== */

.com-jrre-property .card,
.com-jrre-property .form-control,
.com-jrre-property .form-select,
.com-jrre-property .input-group-text,
.com-jrre-property .btn,
.com-jrre-property .badge {
    border-radius: 0 !important;
}

/* Input group corners */
.com-jrre-property .input-group > :first-child,
.com-jrre-property .input-group > :last-child {
    border-radius: 0 !important;
}

/* ========================================
   Property Detail Page - Sidebar Cards
   ======================================== */

/* Consistent card styling for property detail page sidebar */
.com-jrre-property .jrre-sidebar .card {
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.com-jrre-property .jrre-sidebar .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

/* ========================================
   Schedule Tour / Request Showing Card
   ======================================== */

/* Date Picker - Wrapping Button Grid */
.jrre-date-picker-container {
    position: relative;
}

.jrre-date-picker-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.jrre-date-card {
    flex: 0 0 auto;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    background: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    color: #212529;
}

.jrre-date-card:hover {
    border-color: #1a3a5c;
    background: #f8f9fa;
}

.jrre-date-card.active {
    border-color: #1a3a5c;
    background: #1a3a5c;
    color: #fff;
}

/* More Info Section */
.jrre-more-info-section {
    text-align: center;
}

.jrre-more-info-section p {
    margin-bottom: 1rem;
}

/* Request Showing Modal */
.jrre-showing-consent {
    font-size: 0.85rem;
}

.jrre-showing-consent a {
    color: var(--bs-primary, #3f51b5);
}

/* Responsive */
@media (max-width: 767.98px) {
    .jrre-date-card {
        width: 55px;
        padding: 0.4rem 0.2rem;
    }

    .jrre-date-num {
        font-size: 1.1rem;
    }
}

/* ========================================
   Favorite Button Styles
   ======================================== */
.jrre-favorite-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #6c757d;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    z-index: 5;
}

.jrre-favorite-btn:hover {
    background: #fff;
    color: #dc3545;
    transform: scale(1.1);
}

.jrre-favorite-btn:active {
    transform: scale(0.95);
}

.jrre-favorite-btn.is-favorite {
    color: #dc3545;
    background: #fff;
}

.jrre-favorite-btn.is-favorite:hover {
    color: #6c757d;
}

.jrre-favorite-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Small favorite button variant for sidebar cards */
.jrre-favorite-btn.jrre-favorite-btn-sm {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
}

/* List view favorite button - inline with other actions */
.jrre-favorite-btn.jrre-favorite-btn-list {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

/* Favorite button in detail page (inline with share buttons) */
.jrre-favorite-btn-detail {
    transition: all 0.2s ease;
}

.jrre-favorite-btn-detail.is-favorite {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}

.jrre-favorite-btn-detail.is-favorite:hover {
    background-color: transparent !important;
    color: #dc3545 !important;
}

/* Toast Notifications */
.jrre-toast {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

/* ========================================
   JRRE Contact Form Module
   ======================================== */

/* Ensure module container allows proper grid layout */
.mod-jrre-contact {
    width: 100%;
    display: block;
}

/* Ensure form takes full width of module container */
.mod-jrre-contact .jrre-contact-form-module {
    width: 100%;
    display: block;
}

/* Force Bootstrap row to display as flexbox (override any parent flex interference) */
.mod-jrre-contact .jrre-contact-form-module .row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-right: calc(-.5 * var(--bs-gutter-x, 1.5rem));
    margin-left: calc(-.5 * var(--bs-gutter-x, 1.5rem));
}

/* Ensure columns respect their sizing */
.mod-jrre-contact .jrre-contact-form-module .row > [class*="col-"] {
    flex-shrink: 0;
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * .5);
    padding-left: calc(var(--bs-gutter-x, 1.5rem) * .5);
}

/* Override g-3 gutter class */
.mod-jrre-contact .jrre-contact-form-module .row.g-3 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

/* Ensure col-sm-6 works at small breakpoint (576px) */
@media (min-width: 576px) {
    .mod-jrre-contact .jrre-contact-form-module .col-sm-6 {
        flex: 0 0 auto !important;
        width: 50% !important;
    }
}

/* Form control styling consistency */
.mod-jrre-contact .form-control,
.mod-jrre-contact .form-select {
    width: 100%;
}

/* ========================================
   Hero Property Callout
   Subtle overlay showing property info on hero images
   ======================================== */
a.jrre-hero-property-callout,
.jrre-hero-property-callout {
    position: absolute !important;
    bottom: 20px !important;
    right: 20px !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 320px;
    transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    z-index: 50 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto !important;
    cursor: pointer;
}

a.jrre-hero-property-callout:hover,
.jrre-hero-property-callout:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-2px);
    color: #fff;
    text-decoration: none;
    border-color: rgba(255, 255, 255, 0.2);
}

.jrre-hero-property-callout-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.jrre-hero-property-callout-info {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.jrre-hero-property-callout-price {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.jrre-hero-property-callout-address {
    font-size: 0.8rem;
    opacity: 0.85;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jrre-hero-property-callout-details {
    font-size: 0.75rem;
    opacity: 0.7;
    margin: 2px 0 0 0;
}

.jrre-hero-property-callout-arrow {
    flex-shrink: 0;
    opacity: 0.6;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.jrre-hero-property-callout:hover .jrre-hero-property-callout-arrow {
    transform: translateX(3px);
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    a.jrre-hero-property-callout,
    .jrre-hero-property-callout {
        bottom: 10px !important;
        right: 10px !important;
        left: 10px !important;
        max-width: none;
        padding: 10px 14px;
    }

    .jrre-hero-property-callout-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .jrre-hero-property-callout-price {
        font-size: 1rem;
    }
}

/* Light theme variant for light hero styles */
.jrre-hero-style-light a.jrre-hero-property-callout,
.jrre-hero-style-light .jrre-hero-property-callout {
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
    border-color: rgba(0, 0, 0, 0.1);
}

.jrre-hero-style-light a.jrre-hero-property-callout:hover,
.jrre-hero-style-light .jrre-hero-property-callout:hover {
    background: rgba(255, 255, 255, 0.98);
    color: #1a1a2e;
}

.jrre-hero-style-light .jrre-hero-property-callout-icon {
    background: rgba(0, 0, 0, 0.08);
}

/* ========================================
   Agent/Admin Dashboards - No Border Radius
   ======================================== */

.com-jrre-agentdashboard .card,
.com-jrre-agentdashboard .card-header,
.com-jrre-agentdashboard .card-footer,
.com-jrre-agentdashboard .card-img-top,
.com-jrre-dashboard .card,
.com-jrre-dashboard .card-header,
.com-jrre-dashboard .card-footer,
.com-jrre-dashboard .card-img-top,
.com-jrre-agentleads .card,
.com-jrre-agentleads .card-header,
.com-jrre-agentleads .card-footer,
.com-jrre-leadpool .card,
.com-jrre-leadpool .card-header,
.com-jrre-leadpool .card-footer,
.com-jrre-leadmanagement .card,
.com-jrre-leadmanagement .card-header,
.com-jrre-leadmanagement .card-footer,
.com-jrre-agentprofile .card,
.com-jrre-agentprofile .card-header,
.com-jrre-agentprofile .card-footer,
.com-jrre-agencymanagement .card,
.com-jrre-agencymanagement .card-header,
.com-jrre-agencymanagement .card-footer,
.com-jrre-emaillog .card,
.com-jrre-emaillog .card-header,
.com-jrre-emaillog .card-footer,
.com-jrre-agentproperties .card,
.com-jrre-agentproperties .card-header,
.com-jrre-agentproperties .card-footer,
.com-jrre-agentproperties .card-img-top,
.com-jrre-auditlog .card,
.com-jrre-auditlog .card-header,
.com-jrre-auditlog .card-footer {
    border-radius: 0 !important;
}
