input[type="radio"] {
    display: none;
}

.radio-container {
    display: flex;
    gap: 12px;
}

.label-listing {
    width: 48px;
    height: 48px;
    border: 2px solid #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background-color: #fff;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.label-listing:hover {
    border-color: #01236a;
    transform: translateY(-2px);
}

input[type="radio"]:checked + label {
    background-color: #01236a;
    color: #fff;
    border-color: #01236a;
    box-shadow: 0 4px 12px rgba(1, 35, 106, 0.2);
}

.label-listing .fa,
.label-listing .fas {
    font-size: 20px;
    color: #6b7280;
    transition: color 0.3s ease;
}

input[type="radio"]:checked + label .fa,
input[type="radio"]:checked + label .fas {
    color: #fff;
}

.result-listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border: none;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-options label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.sort-options select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background-color: #fff;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-options select:hover {
    border-color: #01236a;
}

.sort-options select:focus {
    outline: none;
    border-color: #01236a;
    box-shadow: 0 0 0 3px rgba(1, 35, 106, 0.1);
}

.separator {
    color: #d1d5db;
    font-weight: 300;
}

.result-listing {
    display: flex;
    flex-direction: column;
}

.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-card {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: row;
    padding: 0;
    border: 1px solid #f3f4f6;
}

.result-hr {
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

.grid-view .result-card {
    flex-direction: column;
}

.result-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(1, 35, 106, 0.15);
    border-color: #01236a;
}

.favorite-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-icon:hover {
    color: #ef4444;
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.1);
}

.grid-view .favorite-icon {
    display: flex;
}

.result-image {
    position: relative;
    overflow: hidden;
    width: 400px;
    height: 300px;
    box-sizing: border-box;
    padding: 0;
    flex-shrink: 0;
}

.result-image a {
    overflow: hidden;
    display: block;
    width: 100%;
    height: 100%;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.grid-view .result-image {
    width: 100%;
    height: 280px;
}

.result-card:hover > .result-image img {
    transform: scale(1.15);
}

.result-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px;
    width: 100%;
}

.result-title h2 {
    font-size: 1.5em;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    line-height: 1.3;
}

.result-title h3 {
    font-size: 1.4em;
    font-weight: 700;
    color: #01236a;
    margin-top: 4px;
}

.result-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.result-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.result-details > div {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.result-details i {
    color: #01236a;
    font-size: 16px;
}

.result-actions {
    position: absolute;
    right: 24px;
    bottom: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    font-size: 22px;
    z-index: 5;
}

.result-actions a,
.result-actions span {
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f9fafb;
}

.result-actions a:hover,
.result-actions span:hover {
    color: #01236a;
    background: #e0e7ff;
    transform: translateY(-2px);
}

.result-content p {
    margin-top: 16px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #4b5563;
    line-height: 1.6;
    font-size: 15px;
}

.grid-view .result-content p {
    -webkit-line-clamp: 2;
}

.result-town {
    display: flex;
    align-items: center;
    gap: 8px;
}

.criteria-ville {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 15px;
}

.criteria-ville i {
    color: #01236a;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 16px;
}

.pagination-button {
    padding: 12px 24px;
    border: 2px solid #e5e7eb;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.pagination-button:hover:not(:disabled) {
    background-color: #01236a;
    color: #fff;
    border-color: #01236a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 35, 106, 0.2);
}

.pagination-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    margin: 0 20px;
    font-weight: 600;
    color: #374151;
    font-size: 15px;
}

@media (max-width: 768px) {
    .collapse-content li {
        flex: 1 1 100%;
        padding: 10px 15px;
    }
}

@media (min-width: 576px) {
    .list-view .result-actions > .result-action-heart {
        display: none;
    }
}

@media (max-width: 576px) {
    .result-listing-header {
        flex-direction: column;
        align-items: normal;
        padding: 16px;
        gap: 16px;
    }
    
    .sort-options {
        flex-direction: column;
        align-items: normal;
        width: 100%;
        gap: 12px;
    }

    .sort-options .separator {
        display: none;
    }
    
    .list-view .result-listing-container .result-card {
        flex-direction: column;
    }
    
    .list-view .result-image {
        width: 100%;
        height: 240px;
    }
    
    .result-body {
        padding: 20px;
    }
    
    .result-title h2 {
        font-size: 1.3em;
    }
    
    .result-title h3 {
        font-size: 1.2em;
    }
}

/* Map View Styles */
#map-container {
    display: none;
    width: 100%;
    min-height: 600px;
    height: 600px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-top: 24px;
    position: relative;
    z-index: 1;
}

#map-container.active {
    display: block !important;
    height: 600px !important;
    min-height: 600px !important;
}

/* Fix pour les conteneurs Bootstrap qui peuvent écraser la hauteur */
.col-xs-12 #map-container,
.col-md-10 #map-container {
    height: 600px !important;
}

#map-container .leaflet-container {
    height: 100%;
    width: 100%;
    border-radius: 16px;
}

#result_listing.hidden {
    display: none;
}

.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    width: 280px !important;
}

.map-popup-card {
    background: #fff;
    overflow: hidden;
}

.map-popup-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.map-popup-body {
    padding: 16px;
}

.map-popup-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    line-height: 1.3;
}

.map-popup-price {
    font-size: 18px;
    font-weight: 700;
    color: #01236a;
    margin-bottom: 12px;
}

.map-popup-details {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #6b7280;
}

.map-popup-details i {
    color: #01236a;
    font-size: 14px;
}

.map-popup-link {
    display: inline-block;
    background: #01236a;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.map-popup-link:hover {
    background: #012a5e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 35, 106, 0.3);
}

.leaflet-marker-icon {
    background: #01236a;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(1, 35, 106, 0.3);
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(1, 35, 106, 0.6);
    border-radius: 50%;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: rgba(1, 35, 106, 0.8);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
}