/* Design System: Corporate Confidence */
:root {
    /* Colors */
    --primary: #0F172A;
    /* Slate 900 - Headings, Header */
    --primary-light: #334155;

    --accent: #2563EB;
    /* Blue 600 - Action, Links */
    --accent-hover: #1D4ED8;

    --secondary: #64748B;
    /* Slate 500 - Muted text */

    /* Semantic Colors */
    --color-sale: #16A34A;
    /* Green 600 */
    --color-rent: #EA580C;
    /* Orange 600 */
    --color-danger: #EF4444;

    /* Backgrounds */
    --bg-body: #F8FAFC;
    /* Slate 50 */
    --bg-card: #FFFFFF;
    --bg-input: #F1F5F9;
    /* Slate 100 */

    /* Borders */
    --border-color: #E2E8F0;
    /* Slate 200 */

    /* Typography */
    --font-main: 'Roboto Flex', system-ui, -apple-system, sans-serif;

    /* Spacing */
    --space-xs: 0.5rem;
    /* 8px */
    --space-sm: 1rem;
    /* 16px */
    --space-md: 1.5rem;
    /* 24px */
    --space-lg: 2rem;
    /* 32px */
    --space-xl: 3rem;
    /* 48px */

    /* Radius */
    --radius-sm: 0.25rem;
    /* 4px */
    --radius-md: 0.375rem;
    /* 6px */
    --radius-lg: 0.5rem;
    /* 8px */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    color: var(--primary);
    background-color: var(--bg-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.15s ease-in-out;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--secondary);
}

.text-accent {
    color: var(--accent);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    font-size: 1rem;
    line-height: 1.5;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-light);
}

.btn-accent {
    background-color: var(--accent);
    color: white;
}

.btn-accent:hover {
    background-color: var(--accent-hover);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-full {
    width: 100%;
}

/* --- Layout & Header Overhaul --- */

.top-bar {
    background: #1e293b;
    color: #cbd5e1;
    padding: 8px 0;
    font-size: 0.85rem;
}

.top-bar a {
    color: #cbd5e1;
    text-decoration: none;
    margin-left: 10px;
}

.top-bar a:hover {
    color: white;
}

/* Mobile Responsiveness Helpers */
@media (max-width: 768px) {
    .mobile-hide {
        display: none !important;
    }

    .desktop-nav {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .mobile-stack {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.25rem !important;
    }

    .working-hours {
        display: inline-block;
        margin-left: 2px;
    }
}

.mobile-only {
    display: none;
}

/* Hamburger Menu & Drawer */
.menu-toggle {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 5px;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 2000;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.mobile-drawer.active {
    right: 0;
}

.drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.drawer-nav a {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    border-bottom: 1px solid #f8fafc;
}

.drawer-nav a:hover {
    background: #f8fafc;
    color: var(--accent);
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
}

.drawer-overlay.active {
    display: block;
}

.close-drawer {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary);
}

.main-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-nav {
    display: flex;
    gap: var(--space-md);
}

.main-nav a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--accent);
}

.header-actions .btn-outline {
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.header-actions .btn-outline:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    background-color: white;
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: var(--primary);
}

/* Cards & Listings */
.listing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #CBD5E1;
}

.card-image {
    position: relative;
    padding-top: 66.66%;
    /* 16:9 Aspect Ratio */
    background-color: var(--bg-input);
    overflow: hidden;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

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

.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

.badge.sale {
    background-color: var(--color-sale);
}

.badge.rent {
    background-color: var(--color-rent);
}

.price-tag {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.85);
    /* Slightly transparent dark */
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.125rem;
}

.card-content {
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-location {
    color: var(--secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-features {
    display: flex;
    gap: var(--space-sm);
    margin-top: auto;
    /* Push to bottom */
    padding-top: var(--space-sm);
    border-top: 1px solid var(--bg-input);
    font-size: 0.875rem;
    color: var(--primary-light);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Detail Page specific */

.sticky-sidebar {
    position: sticky;
    top: 2rem;
}

.agent-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.agent-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.agent-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-input);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
    }



    .detail-grid {
        /* Layout switch for detail page */
        display: block !important;
    }

    .sticky-sidebar {
        display: none;
        /* Hide sidebar on mobile, use bottom bar */
    }
}