:root {
    --apple-bg: #fbfbfd;
    --apple-text: #1d1d1f;
    --apple-text-muted: #86868b;
    --apple-blue: #0066cc;
    --apple-blue-hover: #0077ed;
    --apple-border: #d2d2d7;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.08);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    background-color: var(--apple-bg);
    color: var(--apple-text);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--apple-text);
}

a { color: var(--apple-blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--apple-blue-hover); }

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar-brand {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
}

/* Premium Buttons */
.btn-apple {
    background-color: var(--apple-blue);
    color: #fff;
    border-radius: 980px; /* pill shape */
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    transition: var(--transition);
}
.btn-apple:hover {
    background-color: var(--apple-blue-hover);
    transform: scale(1.02);
    color: #fff;
}
.btn-apple-outline {
    background-color: transparent;
    color: var(--apple-blue);
    border: 1px solid var(--apple-blue);
    border-radius: 980px;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
}
.btn-apple-outline:hover {
    background-color: var(--apple-blue);
    color: #fff;
}
.btn-whatsapp { background-color: #25D366; color: white; border-radius: 980px; padding: 12px 24px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; border:none; transition: var(--transition); }
.btn-whatsapp:hover { background-color: #128C7E; transform: scale(1.02); color:white; }

/* Filter Tabs */
.filter-tabs {
    display: flex;
    background: #e5e5ea;
    border-radius: 980px;
    padding: 4px;
    max-width: 300px;
    margin: 0 auto 30px auto;
}
.filter-tab {
    flex: 1;
    text-align: center;
    padding: 8px 16px;
    border-radius: 980px;
    font-size: 14px;
    font-weight: 600;
    color: var(--apple-text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.filter-tab.active {
    background: #fff;
    color: var(--apple-text);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Listing Cards */
.listing-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.02);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.listing-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-4px);
}
.listing-img-container {
    position: relative;
    width: 100%;
    padding-top: 66.66%; /* 3:2 Aspect Ratio */
    overflow: hidden;
    background-color: #f5f5f7;
}
.listing-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.listing-card:hover .listing-img {
    transform: scale(1.05);
}
.listing-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    color: var(--apple-text);
    padding: 4px 12px;
    border-radius: 980px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.featured-badge { right: 12px; left: auto; color: #f59e0b; }

.listing-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.listing-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--apple-blue);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}
.listing-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--apple-text);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.listing-meta {
    font-size: 13px;
    color: var(--apple-text-muted);
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-weight: 500;
}
.listing-meta span { display: flex; align-items: center; gap: 4px; }
.listing-location {
    font-size: 13px;
    color: var(--apple-text-muted);
    margin-top: auto; /* push to bottom */
}

/* Detail Page */
.detail-hero { margin-top: 20px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--card-shadow); }
.detail-price { font-size: 32px; font-weight: 700; color: var(--apple-blue); letter-spacing: -0.03em; }
.spec-box { background: #f5f5f7; padding: 16px; border-radius: var(--radius-md); text-align: center; }
.spec-value { font-size: 18px; font-weight: 600; color: var(--apple-text); }
.spec-label { font-size: 12px; font-weight: 500; color: var(--apple-text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Filter Container */
.filter-container {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 40px;
}
.filter-step { display: none; animation: fadeIn 0.4s ease; }
.filter-step.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.option-btn {
    background: #f5f5f7;
    border: 1px solid transparent;
    padding: 16px;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 500;
    color: var(--apple-text);
    cursor: pointer;
    transition: var(--transition);
}
.option-btn:hover { background: #e8e8ed; }
.option-btn.selected {
    background: rgba(0, 102, 204, 0.1);
    border-color: var(--apple-blue);
    color: var(--apple-blue);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .btn-apple { width: 100%; text-align: center; }
    .listing-price { font-size: 20px; }
    .step-options { grid-template-columns: 1fr 1fr; }
    .navbar-brand { font-size: 18px; }
}
