/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensure header is above other content */
    height: 70px;
}

.header-container {
    max-width: 100%; /* Full width for responsiveness */
    height: 100%;
    padding: 0 var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
}

.logo i {
    font-size: var(--font-size-2xl);
    color: var(--primary);
}

.logo h1 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.025em;
    white-space: nowrap; /* Prevents text wrapping */
}

.header-center {
    flex: 1 1 auto; /* Allow shrinking and growing, but auto basis */
    min-width: 200px; /* Minimum width for search bar area */
    max-width: 500px; /* Max width for search bar */
    margin: 0 var(--space-6); /* Spacing around search bar */
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-shrink: 0;
}

/* Main Layout */
.main-layout {
    display: flex;
    height: calc(100vh - 70px); /* Full viewport height minus header */
    position: relative; /* For positioning children like sidebar */
}

/* Sidebar */
.sidebar {
    width: 380px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto; /* Enable scrolling for sidebar content */
    flex-shrink: 0; /* Prevent sidebar from shrinking */
    transition: var(--transition-slow);
    z-index: 900; /* Below header, above overlay on mobile */
}

.sidebar-content {
    padding: var(--space-6);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.section-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-900);
}

.section-header h4 { /* For active filters title */
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--gray-900);
}

/* Main Content */
.main-content {
    flex: 1; /* Take remaining space */
    position: relative; /* For view containers */
    overflow: hidden; /* Prevent content overflow issues */
}

.view-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
    overflow-y: auto; /* Allow scrolling within views */
}

.view-container.active {
    opacity: 1;
    visibility: visible;
}

/* Specific View Layouts */
.map-view .map-container {
    height: 100%;
}

.list-view .list-container {
    height: 100%;
    padding: var(--space-6);
}

.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-6);
}

/* Mobile specific layout elements */
.mobile-menu-btn {
    display: none; /* Hidden by default, shown in responsive.css */
    background: none;
    border: none;
    font-size: var(--font-size-lg);
    color: var(--gray-600);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius);
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.mobile-overlay {
    position: fixed;
    top: 70px; /* Below header */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 990; /* Below sidebar, above main content */
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}

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

.mobile-only { /* For elements only visible on mobile */
    display: none;
}

.property-list.mobile-only { /* Styles for the mobile-specific property list in the sidebar */
    margin-top: var(--space-6);
}