/* Filtered Layout Styles - Applied only when filters are active */

/* Filtered Category Navigation */
.filtered-category-nav {
    background: #553513 !important;
    margin-top: 70px;
    padding: 10px 0;
}

.filtered-desktop-nav {
    background: white;
    border-bottom: 1px solid #e9ecef;
    margin-top: 80px;
    padding: 10px 0;
}

.filtered-desktop-nav .container {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.filtered-layout {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin-top: 0px; /* Reduced since category nav is above */
    max-width: 100%;
}

.filtered-listings {
    flex: 0 0 60%; /* Increased from 45% to 60% to show 3 properties properly */
    max-width: 60%;
}

.filtered-map {
    flex: 0 0 40%; /* Reduced from 55% to 40% */
    max-width: 40%;
    position: sticky;
    top: 100px;
    height: calc(100vh - 120px);
}

#listing-map {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Grid layout for filtered properties - 3 columns */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px; /* Reduced gap slightly for better fit */
}

.property-container {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
}

/* Listing header styles */
.listing-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.listing-count {
    color: #666;
    font-size: 14px;
    margin-bottom: 24px;
}

/* Property card enhancements for filtered view */
.property-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.property-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.property-image-container {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

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

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

.property-details,
.property-info {
    padding: 16px;
}

.property-location {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.property-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.property-features {
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.property-features span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.property-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.stars {
    display: flex;
    gap: 2px;
}

.stars i {
    color: #ffc107;
    font-size: 12px;
}

.stars i.empty {
    color: #ddd;
}

.rating-count {
    font-size: 12px;
    color: #666;
}

.property-price {
    border-top: 1px solid #eee;
    padding-top: 12px;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.price {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.price-period {
    font-size: 14px;
    color: #666;
}

.total-price {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Mobile Map Toggle Button - Hidden on Desktop */
.mobile-map-toggle {
    display: none !important;
}

.map-close-mobile {
    display: none !important;
}

/* Back to home button */
.back-to-map-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    margin-bottom: 20px;
    transition: background-color 0.3s ease;
}

.back-to-map-btn:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

.back-to-map-btn i {
    margin-right: 8px;
}

/* Pagination styles */
.pagination-wrapper {
    margin-top: 40px;
    text-align: center;
}

/* No results styles */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.no-results i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 16px;
}

.no-results h3 {
    margin-bottom: 8px;
    color: #333;
}

.no-results p {
    color: #666;
    margin-bottom: 20px;
}

.no-results .btn {
    display: inline-block;
    padding: 12px 24px;
    background: #ff5a5f;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.no-results .btn:hover {
    background: #e04347;
}

/* Mobile Styles for Filtered Layout - Simple Design */
@media (max-width: 768px) {
    /* Mobile category nav adjustments for filtered layout */
    .filtered-category-nav {
        margin-top: 60px;
    }
    
    .filtered-desktop-nav {
        display: none; /* Hide desktop nav on mobile */
    }
    
    .filtered-layout {
        flex-direction: column;
        padding: 0;
        margin-top: 0px; /* No margin since category nav is above */
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Map at top - 80% of screen height */
    .filtered-map {
        display: block !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        max-width: 100% !important;
        width: 100% !important;
        height: 80vh !important;
        z-index: 1 !important;
        order: 1; /* Show at top */
        border-bottom: 1px solid #e0e0e0;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden;
    }
    
    /* Map container styling */
    #listing-map {
        width: 100% !important;
        height: 450px !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    
    /* Listings below map - simple scrollable */
    .filtered-listings {
        flex: 1;
        max-width: 100%;
        width: 100%;
        padding: 0;
        margin: 0;
        order: 2; /* Show after map */
        background: white;
        position: relative;
    }
    
    /* Mobile grid layout - full width single column */
    .listing-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .property-container {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        width: 100%;
        padding: 16px;
        margin: 0;
        background: white;
    }
    
    /* Mobile property card - full width like Airbnb */
    .property-card {
        width: 100%;
        max-width: 100%;
        margin: 0 0 16px 0;
        padding: 0;
        box-sizing: border-box;
        border-radius: 12px;
        overflow: hidden;
        background: white;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    /* Mobile image container */
    .property-image-container {
        width: 100%;
        height: 200px; /* Fixed height like Airbnb */
        position: relative;
        overflow: hidden;
        border-radius: 12px 12px 0 0;
    }
    
    .property-image-container img,
    .property-images img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Mobile property details */
    .property-details,
    .property-info {
        padding: 16px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .property-card h3 {
        font-size: 16px;
        font-weight: 600;
        margin: 0 0 8px 0;
        line-height: 1.3;
        color: #333;
    }
    
    .property-location {
        font-size: 14px;
        color: #666;
        margin-bottom: 4px;
        display: flex;
        align-items: center;
        gap: 4px;
    }
    
    .property-features {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 8px 0;
        font-size: 14px;
        color: #666;
    }
    
    .property-features span {
        display: flex;
        align-items: center;
        gap: 3px;
    }
    
    .property-rating {
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 8px 0;
    }
    
    .property-price {
        border-top: 1px solid #eee;
        padding-top: 12px;
        margin-top: 12px;
    }
    
    .price-row {
        display: flex;
        align-items: baseline;
        gap: 4px;
    }
    
    .price {
        font-size: 16px;
        font-weight: 600;
        color: #333;
    }
    
    .price-period {
        font-size: 14px;
        color: #666;
    }
    
    /* Hide mobile map toggle - map is always visible at top */
    .mobile-map-toggle {
        display: none !important;
    }
    
    .mobile-map-toggle i {
        display: none !important;
    }
    
    .map-close-mobile {
        display: none !important;
    }
    
    
    .popup-rating {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 16px;
    }
    
    .popup-stars {
        display: flex;
        gap: 2px;
    }
    
    .popup-stars i {
        color: #ffc107;
        font-size: 12px;
    }
    
    .popup-stars i.empty {
        color: #ddd;
    }
    
    .popup-rating-text {
        font-size: 14px;
        color: #666;
    }
    
    .popup-price {
        border-top: 1px solid #eee;
        padding-top: 12px;
        margin-bottom: 16px;
    }
    
    .popup-price-row {
        display: flex;
        align-items: baseline;
        gap: 4px;
    }
    
    .popup-price-amount {
        font-size: 20px;
        font-weight: 600;
        color: #333;
    }
    
    .popup-price-period {
        font-size: 16px;
        color: #666;
    }
    
    /* View details button */
    .popup-view-details {
        width: 100%;
        padding: 14px;
        background: #ff5a5f;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }
    
    .popup-view-details:hover {
        background: #e04347;
    }
    
    /* Mobile listing header - simple style */
    .listing-header {
        background: white;
        padding: 16px;
        border-bottom: 1px solid #eee;
        margin: 0;
    }
    
    .listing-header h2 {
        font-size: 18px;
        margin-bottom: 4px;
        font-weight: 600;
        color: #333;
    }
    
    .listing-count {
        font-size: 14px;
        color: #666;
        margin-bottom: 0;
    }
    
    /* Mobile back button */
    .back-to-map-btn {
        margin: 0 0 16px 0;
        padding: 8px 16px;
        font-size: 14px;
    }
    
    /* Remove any additional margins or padding that might cause issues */
    * {
        box-sizing: border-box;
    }
    
    /* Ensure no overflow on mobile */
    body {
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 12px;
        max-width: 100%;
        margin: 0 auto;
    }
    
    /* Remove any inherited styles that might cause issues */
    .property-card * {
        box-sizing: border-box;
    }
    
    /* Ensure images don't break out */
    .property-images {
        width: 100%;
        height: 100%;
        position: relative;
        overflow: hidden;
    }
    
    .property-images img:first-child {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    
    /* Hide additional images on mobile for cleaner look */
    .property-images img:not(:first-child) {
        display: none;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .filtered-listings {
        flex: 0 0 65%;
        max-width: 65%;
    }
    
    .filtered-map {
        flex: 0 0 35%;
        max-width: 35%;
    }
    
    .listing-grid,
    .property-container {
        gap: 14px;
    }
}

/* Large desktop adjustments */
@media (min-width: 1024px) {
    .filtered-layout {
        padding: 30px;
        padding-top:50px;
        gap: 30px;
    }
    
    .listing-grid,
    .property-container {
        gap: 20px;
    }
}