:root {
    --agg-bg:        #0f172a;
    --agg-surface:   #1e293b;
    --agg-border:    rgba(255,255,255,0.08);
    --agg-text:      #e2e8f0;
    --agg-muted:     #94a3b8;
    --agg-accent:    #4f6ef7;
    --agg-accent-h:  #6366f1;
    --agg-green:     #10b981;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--agg-bg);
    color: var(--agg-text);
    font-size: 15px;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ── Navbar ── */
.agg-navbar {
    background: #0a1120;
    border-bottom: 1px solid var(--agg-border);
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.agg-logo { font-size: 1.25rem; font-weight: 700; color: var(--agg-text); }
.agg-logo span { color: var(--agg-accent); }
.agg-nav-cta {
    background: var(--agg-accent);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.15s;
}
.agg-nav-cta:hover { background: var(--agg-accent-h); }

/* ── Hero ── */
.agg-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 3rem 1.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--agg-border);
}
.agg-hero h1 { font-size: 2rem; font-weight: 700; margin: 0 0 0.5rem; }
.agg-hero p { color: var(--agg-muted); margin: 0 0 1.5rem; }
.agg-search {
    display: flex;
    max-width: 520px;
    margin: 0 auto 1rem;
    gap: 0.5rem;
}
.agg-search input {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--agg-border);
    background: var(--agg-surface);
    color: var(--agg-text);
    font-size: 0.9rem;
    outline: none;
}
.agg-search input:focus { border-color: var(--agg-accent); }
.agg-search button {
    padding: 0.75rem 1.25rem;
    background: var(--agg-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}
.agg-hero-meta { font-size: 0.85rem; color: var(--agg-muted); }

/* ── Filter bar ── */
.agg-filters {
    background: var(--agg-surface);
    border-bottom: 1px solid var(--agg-border);
    padding: 0.75rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.agg-filters form { display: contents; }
.agg-filters select,
.agg-filters input[type="number"] {
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--agg-border);
    background: var(--agg-bg);
    color: var(--agg-text);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}
.agg-filters select:focus,
.agg-filters input[type="number"]:focus { border-color: var(--agg-accent); }
.agg-filter-btn {
    padding: 0.45rem 1rem;
    background: var(--agg-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.agg-filter-reset {
    padding: 0.45rem 0.75rem;
    background: transparent;
    color: var(--agg-muted);
    border: 1px solid var(--agg-border);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.agg-filter-reset:hover { color: var(--agg-text); }
.agg-filter-count {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--agg-muted);
    white-space: nowrap;
}

/* ── Main layout ── */
.agg-main { max-width: 1280px; margin: 0 auto; padding: 1.5rem; }

/* ── Listing grid ── */
.agg-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* ── Listing card ── */
.listing-card {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background: var(--agg-surface);
    border: 1px solid var(--agg-border);
    transition: transform 0.15s, box-shadow 0.15s;
    color: var(--agg-text);
}
.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.listing-card-photo {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #0a1120;
}
.listing-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.listing-card-photo-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--agg-muted);
    font-size: 0.85rem;
}
.listing-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    background: var(--agg-accent);
    color: #fff;
}
.listing-card-body { padding: 0.75rem; }
.listing-card-title {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--agg-text);
}
.listing-card-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--agg-accent);
    margin-top: 2px;
}
.listing-card-meta {
    display: flex;
    gap: 0.75rem;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--agg-muted);
}
.listing-card-showroom {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--agg-border);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--agg-muted);
}
.listing-card-showroom-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-card-verified { color: var(--agg-green); }
.listing-card-city { margin-left: auto; white-space: nowrap; }

/* ── Empty state ── */
.agg-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 1rem;
}
.agg-empty p { color: var(--agg-text); font-size: 1.1rem; font-weight: 500; margin: 0 0 0.5rem; }
.agg-empty small { color: var(--agg-muted); }
.agg-empty a { color: var(--agg-accent); display: inline-block; margin-top: 1rem; font-size: 0.9rem; }

/* ── Pagination ── */
.agg-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.agg-pagination a,
.agg-pagination span {
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    border: 1px solid var(--agg-border);
    color: var(--agg-muted);
}
.agg-pagination a:hover { border-color: var(--agg-accent); color: var(--agg-accent); }
.agg-pagination .active { background: var(--agg-accent); color: #fff; border-color: var(--agg-accent); }

/* ── Detail page ── */
.agg-detail { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.agg-breadcrumb { font-size: 0.8rem; color: var(--agg-muted); margin-bottom: 1.5rem; }
.agg-breadcrumb a { color: var(--agg-muted); }
.agg-breadcrumb a:hover { color: var(--agg-accent); }
.agg-detail-grid { display: grid; grid-template-columns: 1fr 380px; gap: 1.5rem; }
.agg-gallery-main { aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; background: var(--agg-surface); }
.agg-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.agg-gallery-thumbs { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.agg-gallery-thumb {
    width: 72px; height: 54px; border-radius: 6px; overflow: hidden;
    border: 2px solid transparent; cursor: pointer; background: var(--agg-surface);
}
.agg-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.agg-gallery-thumb.active { border-color: var(--agg-accent); }
.agg-info-panel {
    background: var(--agg-surface);
    border: 1px solid var(--agg-border);
    border-radius: 12px;
    padding: 1.25rem;
    align-self: start;
}
.agg-info-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 0.25rem; }
.agg-info-price { font-size: 1.5rem; font-weight: 700; color: var(--agg-accent); margin: 0 0 1rem; }
.agg-info-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.agg-spec { font-size: 0.8rem; }
.agg-spec-label { color: var(--agg-muted); display: block; }
.agg-spec-value { font-weight: 600; }
.agg-divider { border: none; border-top: 1px solid var(--agg-border); margin: 1rem 0; }
.agg-showroom-card { }
.agg-showroom-name { font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 4px; }
.agg-showroom-meta { font-size: 0.8rem; color: var(--agg-muted); margin-top: 4px; }
.agg-wa-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.75rem;
    border-radius: 10px;
    font-weight: 600;
    background: #25d366;
    color: #fff;
    margin-top: 1rem;
    font-size: 0.95rem;
}
.agg-wa-btn:hover { background: #1ebe5d; }
.agg-showroom-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.65rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--agg-bg);
    border: 1px solid var(--agg-border);
    color: var(--agg-text);
    margin-top: 0.5rem;
}
.agg-showroom-btn:hover { border-color: var(--agg-accent); color: var(--agg-accent); }
.agg-description { margin-top: 2rem; }
.agg-description h3 { font-size: 1rem; font-weight: 600; margin: 0 0 0.75rem; }
.agg-description p { color: var(--agg-muted); line-height: 1.7; white-space: pre-wrap; }
.agg-features { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.agg-feature-tag {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(79,110,247,0.15);
    color: var(--agg-accent);
    border: 1px solid rgba(79,110,247,0.3);
}

/* ── Footer ── */
.agg-footer {
    background: #0a1120;
    border-top: 1px solid var(--agg-border);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--agg-muted);
    margin-top: 3rem;
}
.agg-footer a { color: var(--agg-accent); }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .agg-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .agg-grid { grid-template-columns: repeat(2, 1fr); }
    .agg-detail-grid { grid-template-columns: 1fr; }
    .agg-hero h1 { font-size: 1.5rem; }
    .agg-filters { padding: 0.75rem 1rem; }
}
@media (max-width: 480px) {
    .agg-grid { grid-template-columns: 1fr; }
    .agg-search { flex-direction: column; }
}
