/**
 * ALJT Archive Real Estate - responsive polish
 * Desktop: 2-column layout
 * Tablet: lighter sidebar
 * Mobile: bottom-sheet filters + fixed CTA
 */

:root {
    --aljt-green: #b9cc43;
    --aljt-green-hover: #a3b435;
    --aljt-text: #111827;
    --aljt-muted: #6b7280;
    --aljt-border: #e5e7eb;
    --aljt-bg: #f8fafc;
    --aljt-card-bg: #ffffff;
    --map-height: 340px;
    --admin-bar-height: 0px;
    --aljt-overlay-min-ms: 800ms;
    --aljt-fade-out-ms: 220ms;
    --aljt-fade-in-ms: 280ms;
}

body.admin-bar {
    --admin-bar-height: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar {
        --admin-bar-height: 46px;
    }
}

.aljt-content-grid,
.aljt-content-grid *,
.aljt-map-header,
.aljt-map-header * {
    box-sizing: border-box;
}

body.post-type-archive-real-estate .template-debug,
body.tax-neighborhood .template-debug {
    display: none;
}

/* ==========================================================================
   PAGE LAYOUT
   ========================================================================== */

.aljt-content-grid {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    align-items: start;
    width: min(1400px, calc(100% - 32px));
    min-height: calc(100vh - var(--admin-bar-height));
    margin: 0 auto;
    gap: 20px;
    position: relative;
    z-index: 9;
}

.aljt-filters-column {
    position: sticky;
    top: calc(var(--admin-bar-height) + 20px);
    /*height: calc(100vh - var(--admin-bar-height) - 20px);*/
    overflow: hidden;
    z-index: 20 !important;
    border: 1px solid var(--aljt-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
}

.aljt-filters-inner {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--aljt-green) #f1f1f1;
}

.aljt-filters-inner::-webkit-scrollbar {
    width: 6px;
}

.aljt-filters-inner::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.aljt-filters-inner::-webkit-scrollbar-thumb {
    background: var(--aljt-green);
    border-radius: 999px;
}

.aljt-results-column {
    min-width: 0;
    min-height: calc(100vh - var(--admin-bar-height));
    padding: 0 0 32px;
    background: transparent;
}

/* ==========================================================================
   MAP HEADER
   ========================================================================== */

.aljt-map-header {
    position: relative;
    width: 100%;
    height: var(--map-height);
    margin: 0 0 18px;
    overflow: hidden;
    border: 1px solid var(--aljt-border);
    border-radius: 16px;
    background: #f5f5f5;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.05);
}

#aljt-map {
    width: 100%;
    height: 100%;
    z-index: 1 !important;
}

/* ==========================================================================
   LEAFLET LAYERS
   ========================================================================== */

.leaflet-container { z-index: 1 !important; }
.leaflet-tile-pane { z-index: 10 !important; }
.leaflet-overlay-pane { z-index: 20 !important; }
.leaflet-shadow-pane { z-index: 25 !important; }
.leaflet-marker-pane { z-index: 30 !important; }
.leaflet-tooltip-pane { z-index: 35 !important; }
.leaflet-popup-pane,
.leaflet-popup,
.leaflet-popup-tip-container { z-index: 700 !important; }
.leaflet-control-container,
.leaflet-top,
.leaflet-bottom,
.leaflet-control,
.leaflet-control-zoom { z-index: 80 !important; }

/* ==========================================================================
   POPUPS / TOOLTIPS
   ========================================================================== */

.leaflet-popup-content-wrapper {
    width: auto !important;
    min-width: 280px !important;
    max-width: min(380px, calc(100vw - 40px)) !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.25) !important;
}

.leaflet-popup-content {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

.leaflet-popup-tip {
    background: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-popup-close-button {
    top: 12px !important;
    right: 12px !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #666 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
}

.leaflet-popup-close-button:hover {
    color: #333 !important;
    background: #fff !important;
    transform: scale(1.08) !important;
}

.leaflet-tooltip {
    z-index: 600 !important;
    padding: 10px 14px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: rgba(17, 24, 39, 0.95) !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-tooltip::before { border-top-color: rgba(17, 24, 39, 0.95) !important; }
.leaflet-tooltip-bottom::before { border-bottom-color: rgba(17, 24, 39, 0.95) !important; }
.leaflet-tooltip-left::before { border-left-color: rgba(17, 24, 39, 0.95) !important; }
.leaflet-tooltip-right::before { border-right-color: rgba(17, 24, 39, 0.95) !important; }

.aljt-popup {
    overflow: visible !important;
    max-height: none !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Image masquée volontairement dans la popup pour gagner en hauteur.
   On conserve le markup/código côté JS pour pouvoir la réactiver facilement plus tard. */
.aljt-popup-image,
.aljt-popup-image-fallback {
    display: none !important;
    width: 100%;
    height: 140px;
}

.aljt-popup-image {
    object-fit: cover;
}

.aljt-popup-image-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--aljt-green) 0%, #8fa832 100%);
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
}

.aljt-popup-content {
    padding: 14px 16px 16px;
}

.aljt-popup-brand {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--aljt-green);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aljt-popup-title {
    margin: 0 0 8px;
    color: var(--aljt-text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.aljt-popup-address {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0 0 12px;
    color: var(--aljt-muted);
    font-size: 13px;
    line-height: 1;
}

.aljt-popup-address i,
.aljt-popup-meta-item i {
    color: var(--aljt-green);
}

.aljt-popup-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--aljt-border);
}

.aljt-popup-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4b5563;
    font-size: 12px;
    line-height: 1;
}

.aljt-popup-transport {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.aljt-popup-transport-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.aljt-popup-transport-badge.metro { background: #003ca6; }
.aljt-popup-transport-badge.rer { background: #d63e2a; }
.aljt-popup-transport-badge.bus { background: #9b59b6; }
.aljt-popup-transport-badge.tram { background: #f39c12; }

.aljt-popup-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.aljt-popup-price {
    display: flex;
    flex-direction: column;
}

.aljt-popup-price-label {
    margin-bottom: 2px;
    color: #9ca3af;
    font-size: 11px;
}

.aljt-popup-price-amount {
    color: var(--aljt-green);
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
}

.aljt-popup-price-period {
    color: var(--aljt-muted);
    font-size: 13px;
}

.aljt-popup-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--aljt-green);
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(185, 204, 67, 0.4);
    transition: all 0.2s ease;
}

.aljt-popup-btn:hover {
    background: var(--aljt-green-hover);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(185, 204, 67, 0.5);
}

.aljt-marker-tooltip {
    min-width: 180px !important;
    padding: 12px 16px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35) !important;
}

.aljt-tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aljt-tooltip-title {
    margin: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.aljt-tooltip-price {
    color: var(--aljt-green);
    font-size: 16px;
    font-weight: 800;
}

.aljt-tooltip-hint {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 11px;
}

/* ==========================================================================
   MAP MARKERS / TRANSPORTS
   ========================================================================== */

.aljt-custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--aljt-green);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.aljt-custom-marker:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(185, 204, 67, 0.5);
}

.aljt-custom-marker i {
    color: #fff;
    font-size: 16px;
}

.aljt-custom-marker.highlighted {
    background: #f59e0b;
    transform: scale(1.3);
    animation: markerPulse 1s ease-in-out infinite;
}

.aljt-custom-marker.flying {
    animation: markerBounce 0.6s ease-out;
}

@keyframes markerPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 6px 30px rgba(245, 158, 11, 0.8); }
}

@keyframes markerBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.5); }
    50% { transform: scale(1.2); }
    70% { transform: scale(1.4); }
    100% { transform: scale(1.3); }
}

.custom-transport-marker > div {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
    cursor: pointer;
}

.custom-transport-marker > div:hover {
    transform: scale(1.2);
}

.transport-popup-wrapper .leaflet-popup-content-wrapper {
    min-width: 200px !important;
    max-width: min(280px, calc(100vw - 40px)) !important;
    width: auto !important;
    overflow: visible !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

.transport-popup {
    padding: 14px 16px;
    overflow: visible !important;
    max-height: none !important;
    text-align: center;
}

.transport-popup-title {
    margin-bottom: 6px;
    color: var(--aljt-text);
    font-size: 15px;
    font-weight: 700;
}

.transport-popup-line {
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
}

.transport-popup-distance {
    margin-top: 8px;
    color: var(--aljt-muted);
    font-size: 12px;
    font-style: italic;
}

/* ==========================================================================
   MAP CONTROLS / OVERLAYS
   ========================================================================== */

.aljt-map-controls {
    position: absolute;
    right: 20px;
    bottom: 20px;
    z-index: 90 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

.aljt-map-controls button,
.aljt-clear-filters-btn,
.aljt-btn-reset,
.aljt-mobile-filters-trigger {
    border: 0;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.aljt-map-controls button {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--aljt-green);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(185, 204, 67, 0.35);
}

.aljt-map-controls button:hover {
    background: var(--aljt-green-hover);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(185, 204, 67, 0.5);
}

.aljt-map-controls button i {
    margin-right: 6px;
    font-size: 11px;
}

.aljt-map-updating {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 95 !important;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--aljt-text);
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%);
}

.aljt-map-updating.visible {
    display: flex;
}

.aljt-map-updating .spinner,
.aljt-overlay-spinner {
    border-radius: 50%;
    border-style: solid;
    animation: spin 0.8s linear infinite;
}

.aljt-map-updating .spinner {
    width: 20px;
    height: 20px;
    border-width: 3px;
    border-color: #eee;
    border-top-color: var(--aljt-green);
}

.aljt-listing-wrapper {
    position: relative;
}

.aljt-listing-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(255, 255, 255, 0.88);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(2px);
    transition: opacity 180ms ease;
}

.aljt-listing-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.aljt-overlay-inner {
    display: flex;
    align-items: center;
    gap: 15px;
    width: min(400px, 90%);
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(17, 24, 39, 0.12);
}

.aljt-overlay-spinner {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-width: 3px;
    border-color: #eef2f7;
    border-top-color: var(--aljt-green);
}

.aljt-overlay-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.aljt-overlay-title {
    color: var(--aljt-text);
    font-size: 14px;
    font-weight: 700;
}

.aljt-overlay-subtitle {
    color: var(--aljt-muted);
    font-size: 13px;
}

#properties-grid.aljt-fade-out {
    opacity: 0.3;
    filter: blur(1px);
    transition: opacity var(--aljt-fade-out-ms) ease, filter var(--aljt-fade-out-ms) ease;
}

#properties-grid.aljt-fade-in {
    animation: aljtFadeIn var(--aljt-fade-in-ms) ease both;
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes aljtFadeIn {
    from {
        opacity: 0.3;
        filter: blur(1px);
        transform: translateY(2px);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

/* ==========================================================================
   FILTERS
   ========================================================================== */

.aljt-sidebar-title {
    margin: 0 0 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--aljt-green);
    color: var(--aljt-text);
    font-size: 16px;
    font-weight: 700;
}

.aljt-sidebar-title i,
.aljt-other-title i {
    margin-right: 8px;
    color: var(--aljt-green);
}

.aljt-filter-group {
    margin-bottom: 20px;
}

.aljt-filter-group > label {
    display: block;
    margin-bottom: 8px;
    color: var(--aljt-text);
    font-size: 14px;
    font-weight: 600;
}

.aljt-filter-group select {
    width: 100%;
    min-height: 46px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.aljt-filter-group select:focus,
.aljt-filter-group input[type="range"]:focus {
    outline: none;
}

.aljt-filter-group select:focus {
    border-color: var(--aljt-green);
    box-shadow: 0 0 0 3px rgba(185, 204, 67, 0.18);
}

.aljt-filter-group input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.aljt-checkbox-list {
    max-height: 180px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
}

.aljt-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0px 4px;
}

.aljt-checkbox-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    margin: 0;
    padding: 0;
    position: relative;
    flex-shrink: 0;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.aljt-checkbox-item input[type="checkbox"]:checked {
    border-color: var(--aljt-green);
    background: var(--aljt-green);
}

.aljt-checkbox-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -55%) rotate(45deg);
    display: none;
}

.aljt-checkbox-item input[type='checkbox']:before {
    content: '';
    left: 7px;
    top: 5px;
    width: 7px;
}

.aljt-checkbox-item label {
    color: #555;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 10px 0px 0px 0px;
}

.aljt-btn-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    border-radius: 10px;
    background: #6c757d;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.aljt-btn-reset:hover,
.aljt-clear-filters-btn:hover {
    background: #5a6268;
}

.aljt-other-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.aljt-other-title {
    margin: 0 0 15px;
    color: var(--aljt-text);
    font-size: 16px;
    font-weight: 700;
}

.aljt-other-item {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

.aljt-other-item:hover {
    border-color: var(--aljt-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(185, 204, 67, 0.2);
}

.aljt-other-item img {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: cover;
}

.aljt-other-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.aljt-other-info .title {
    margin-bottom: 4px;
    overflow: hidden;
    color: var(--aljt-text);
    font-size: 13px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.aljt-other-info .price {
    color: var(--aljt-green);
    font-size: 15px;
    font-weight: 700;
}

/* ==========================================================================
   ACTIVE FILTERS BANNER
   ========================================================================== */

.aljt-active-filters-banner {
    display: none;
    margin: 0 0 18px;
    padding: 15px 20px;
    border-bottom: 2px solid var(--aljt-green);
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
    position: relative;
    z-index: 4;
}

.aljt-active-filters-banner.visible {
    display: block;
}

.aljt-active-filters-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.aljt-active-filters-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.aljt-active-filters-list .label {
    color: #374151;
    font-size: 14px;
    font-weight: 800;
}

.aljt-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--aljt-green);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.aljt-filter-tag .x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 999px;
    background: rgba(255,255,255,0.22);
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
    user-select: none;
}

.aljt-filter-tag .x:hover {
    background: rgba(255,255,255,0.3);
}

.aljt-clear-filters-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    background: #6c757d;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

/* ==========================================================================
   RESULTS / GRID / PAGINATION
   ========================================================================== */

.aljt-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--aljt-green);
}

.aljt-results-count {
    color: var(--aljt-text);
    font-size: 24px;
    font-weight: 700;
}

.aljt-sort-select {
    min-width: 200px;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
}

.aljt-sort-select:focus {
    outline: none;
    border-color: var(--aljt-green);
}

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

.aljt-property-card {
    overflow: hidden;
    border: 1px solid #eee;
    border-radius: 16px;
    background: var(--aljt-card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.aljt-property-card.hidden {
    display: none;
}

.aljt-property-card:hover,
.aljt-property-card.highlighted {
    transform: translateY(-6px);
    border-color: var(--aljt-green);
    box-shadow: 0 12px 24px rgba(185, 204, 67, 0.2);
}

.aljt-property-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.aljt-property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.aljt-property-card:hover .aljt-property-image img {
    transform: scale(1.05);
}

.aljt-property-image-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--aljt-green) 0%, var(--aljt-green-hover) 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1px;
}

.aljt-property-logo {
    position: absolute;
    top: 12px;
    left: 12px;
    max-width: 100px;
    max-height: 40px;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Logo propriétaire (bailleur) : positionné en bas à gauche de l'image */
.aljt-proprietaire-logo {
    top: auto;
    bottom: 12px;
    left: 12px;
    max-width: 80px;
    max-height: 32px;
}

.aljt-property-content {
    padding: 20px;
}

.aljt-property-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.aljt-property-title a {
    color: var(--aljt-text);
    text-decoration: none;
}

.aljt-property-title a:hover {
    color: var(--aljt-green);
}

.aljt-property-address,
.aljt-property-meta {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: #666;
    font-size: 13px;
}

.aljt-property-address {
    margin-bottom: 15px;
}

.aljt-property-meta {
    margin-bottom: 12px;
    align-items: center;
}

.aljt-property-address i,
.aljt-property-meta i {
    margin-top: 2px;
    color: var(--aljt-green);
}

.aljt-property-financement {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    margin-bottom: 4px;
}

.aljt-financement-badge {
    display: inline-block;
    background: var(--aljt-green, #b9cc43);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}

.aljt-property-price {
    margin-top: 15px;
}

.aljt-property-price .from {
    display: block;
    margin-bottom: 2px;
    color: #666;
    font-size: 12px;
    font-weight: 500;
}

.aljt-property-price .amount {
    color: var(--aljt-green);
    font-size: 22px;
    font-weight: 800;
}

.aljt-property-price .period {
    color: #999;
    font-size: 14px;
    font-weight: 400;
}

.aljt-empty-state {
    margin-top: 30px;
    padding: 60px 20px;
    border: 1px solid #eee;
    border-radius: 16px;
    background: #fff;
    text-align: center;
}

.aljt-empty-state i {
    margin-bottom: 20px;
    color: #ddd;
    font-size: 60px;
}

.aljt-empty-state h3 {
    margin: 0 0 10px;
    color: var(--aljt-text);
    font-size: 16px;
}

.aljt-empty-state p {
    margin: 0;
    color: #666;
}

.aljt-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.aljt-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #fff;
    color: var(--aljt-text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aljt-pagination-btn:hover:not(.disabled):not(.active) {
    border-color: var(--aljt-green);
    background: rgba(185, 204, 67, 0.1);
    color: var(--aljt-green);
}

.aljt-pagination-btn.active {
    border-color: var(--aljt-green);
    background: var(--aljt-green);
    color: #fff;
}

.aljt-pagination-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}

.aljt-pagination-info {
    margin: 0 15px;
    color: #666;
    font-size: 13px;
}

.aljt-pagination-ellipsis {
    padding: 0 5px;
    color: #999;
    font-size: 16px;
}

/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 1180px) {
    .aljt-content-grid {
        grid-template-columns: 300px minmax(0, 1fr);
        width: min(100%, calc(100% - 24px));
        gap: 16px;
    }

    .aljt-properties-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 991px) {
    :root {
        --map-height: 300px;
    }

    .aljt-content-grid {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .aljt-filters-inner,
    .aljt-property-content {
        padding: 16px;
    }

    .aljt-results-count {
        font-size: 21px;
    }
}

/* ==========================================================================
   MOBILE BOTTOM SHEET FILTERS
   ========================================================================== */

.aljt-mobile-filters-trigger,
.aljt-mobile-filters-backdrop,
.aljt-mobile-filters-close {
    display: none;
}

@media (max-width: 768px) {
    :root {
        --map-height: 220px;
    }

    html,
    body {
        overflow-x: hidden;
    }

    .aljt-content-grid {
        display: block;
        width: 100%;
        max-width: none;
        margin: 0;
        z-index: auto;
    }

    .aljt-results-column {
        width: 100%;
        min-width: 0;
        padding: 0 16px 96px;
    }

    .aljt-map-header,
    .aljt-active-filters-banner,
    .aljt-empty-state {
        border-radius: 14px;
    }

    .aljt-map-header {
        margin-bottom: 16px;
    }

    .aljt-results-header {
        gap: 12px;
        margin-bottom: 18px;
        padding-bottom: 14px;
    }

    .aljt-results-count {
        font-size: 18px;
    }

    .aljt-properties-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .aljt-property-card {
        border-radius: 14px;
    }

    .aljt-property-image {
        height: 190px;
    }

    .aljt-property-content {
        padding: 16px;
    }

    .aljt-property-title {
        font-size: 17px;
    }

    .aljt-property-logo {
        top: 10px;
        left: 10px;
        max-width: 88px;
        max-height: 34px;
    }

    .aljt-map-controls {
        right: 10px;
        bottom: 10px;
        gap: 6px;
        padding: 8px;
        border-radius: 10px;
    }

    .aljt-map-controls button {
        padding: 8px 10px;
        font-size: 11px;
    }

    .leaflet-popup-content-wrapper {
        min-width: 0 !important;
        max-width: calc(100vw - 32px) !important;
    }

    .aljt-popup-image,
    .aljt-popup-image-fallback {
        height: 110px;
    }

    .aljt-popup-content {
        padding: 14px;
    }

    .aljt-popup-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .aljt-popup-btn {
        width: 100%;
        justify-content: center;
    }

    .aljt-filters-column {
        position: fixed;
        right: 0;
        left: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        height: min(90dvh, 860px);
        max-height: min(90dvh, 860px);
        border: 0;
        border-top: 1px solid var(--aljt-border);
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
        transform: translateY(100%);
        transition: transform 0.28s ease;
        z-index: 10040 !important;
        overflow: hidden;
        overscroll-behavior: contain;
    }

    .aljt-filters-column.is-open {
        transform: translateY(0);
    }

    .aljt-filters-inner {
        height: 100%;
        padding: 18px 16px calc(24px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .aljt-filters-inner::before {
        content: "";
        display: block;
        width: 52px;
        height: 5px;
        margin: 0 auto 14px;
        border-radius: 999px;
        background: #d1d5db;
    }

    .aljt-sidebar-title {
        position: sticky;
        top: 0;
        z-index: 2;
        padding: 4px 0 12px;
        margin-bottom: 16px;
        background: #fff;
    }

    .aljt-checkbox-list {
        max-height: none;
    }

    .aljt-other-section {
        margin-top: 24px;
        padding-bottom: 24px;
    }

    .aljt-mobile-filters-backdrop {
        position: fixed;
        inset: 0;
        display: block;
        z-index: 10010;
        background: rgba(17, 24, 39, 0.45);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .aljt-mobile-filters-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .aljt-mobile-filters-trigger {
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        z-index: 10030;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        height: 52px;
        padding: 0 18px;
        border-radius: 14px;
        background: var(--aljt-green);
        color: #fff;
        font-size: 15px;
        font-weight: 800;
        box-shadow: 0 10px 30px rgba(185, 204, 67, 0.35);
    }

    .aljt-mobile-filters-trigger i {
        font-size: 14px;
    }

    body.aljt-mobile-filters-open,
    html.aljt-mobile-filters-open {
        overflow: hidden;
    }

    body.aljt-mobile-filters-open .aljt-mobile-filters-trigger,
    html.aljt-mobile-filters-open .aljt-mobile-filters-trigger {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(12px);
    }

    body.aljt-mobile-filters-open .aljt-results-column,
    html.aljt-mobile-filters-open .aljt-results-column {
        pointer-events: none;
    }

    body.aljt-mobile-filters-open .aljt-content-grid,
    html.aljt-mobile-filters-open .aljt-content-grid {
        z-index: auto;
    }

    body.aljt-mobile-filters-open .aljt-filters-column,
    body.aljt-mobile-filters-open .aljt-mobile-filters-backdrop,
    html.aljt-mobile-filters-open .aljt-filters-column,
    html.aljt-mobile-filters-open .aljt-mobile-filters-backdrop {
        pointer-events: auto;
    }

    .aljt-active-filters-banner {
        margin-bottom: 16px;
        padding: 14px;
    }

    .aljt-active-filters-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .aljt-filter-tag {
        max-width: 100%;
        font-size: 12px;
        line-height: 1.2;
    }

    .aljt-pagination {
        margin-top: 28px;
        padding-top: 22px;
        gap: 6px;
    }

    .aljt-pagination-info {
        width: 100%;
        margin: 8px 0 0;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aljt-listing-overlay,
    #properties-grid.aljt-fade-out,
    #properties-grid.aljt-fade-in,
    .aljt-filters-column,
    .aljt-mobile-filters-backdrop {
        transition: none !important;
        animation: none !important;
    }

    .aljt-overlay-spinner,
    .aljt-map-updating .spinner,
    .aljt-custom-marker.highlighted,
    .aljt-custom-marker.flying {
        animation: none !important;
    }
}


body.aljt-map-pip .aljt-map-controls,
body.aljt-map-pip #aljt-map-pip-controls{
  display: none !important;
}

.aljt-results-column .aljt-map-header #aljt-map-pip-controls {
    display: none !important;
}

body.aljt-map-pip .leaflet-popup-content-wrapper{
  border-radius: 10px !important;
}

@media (max-width: 768px){
  body.aljt-map-pip .leaflet-popup-content-wrapper{
    max-width: min(300px, calc(100vw - 40px)) !important;
    min-width: 220px !important;
  }

  body.aljt-map-pip .aljt-popup-image,
  body.aljt-map-pip .aljt-popup-image-fallback{
    height: 96px;
  }

  body.aljt-map-pip .aljt-popup-content{
    padding: 12px;
  }

  body.aljt-map-pip .aljt-popup-meta,
  body.aljt-map-pip .aljt-popup-transport{
    margin-bottom: 10px;
    padding-bottom: 10px;
  }

  body.aljt-map-pip .aljt-popup-title{
    font-size: 15px;
  }

  body.aljt-map-pip .aljt-popup-price-amount{
    font-size: 18px;
  }
}