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

:root {
    --white: #ffffff;
    --off-white: #f9f9f9;
    --border: #e5e5e5;
    --text: #1a1a1a;
    --text-muted: #6b6b6b;
    --accent: #1a1a1a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.10);
    --radius: 10px;
    --radius-sm: 6px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--off-white);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ─────────────────────────────── */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    text-align: center;
    padding: 32px 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.logo-placeholder {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 18px;
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
}

.tagline {
    font-size: 15px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Main ──────────────────────────────── */
.main {
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

/* ── Filters ───────────────────────────── */
.filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

.occupation-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.input-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.occupation-wrapper {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 360px;
}

.occupation-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
    background: var(--white);
}

.occupation-input:focus {
    border-color: var(--accent);
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    display: none;
    z-index: 200;
    max-height: 200px;
    overflow-y: auto;
}

.suggestions-dropdown.visible {
    display: block;
}

.suggestion-item {
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    text-transform: capitalize;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: var(--off-white);
}

.selected-chip {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chip-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--accent);
    color: var(--white);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-transform: capitalize;
}

.chip-tag .remove-chip {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

/* ── Budget pills ──────────────────────── */
.budget-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.budget-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pill {
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--white);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.12s;
}

.pill:hover {
    border-color: var(--accent);
}

.pill.active {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

/* ── Controls row ──────────────────────── */
.controls-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.search-input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    width: 100%;
    max-width: 300px;
    outline: none;
    background: var(--white);
    transition: border-color 0.15s;
}

.search-input:focus {
    border-color: var(--accent);
}

.result-count {
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Product Grid ──────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
    font-size: 15px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 6px;
}

/* ── Card ──────────────────────────────── */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-img-wrap {
    position: relative;
    width: 100%;
    height: 180px;
    background: var(--off-white);
    overflow: hidden;
    flex-shrink: 0;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #bbb;
    font-size: 40px;
}

.source-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.card-body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 12px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.card-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.card-link {
    display: inline-block;
    padding: 7px 16px;
    background: var(--accent);
    color: var(--white);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.15s;
}

.card-link:hover {
    opacity: 0.85;
}

/* ── Footer ────────────────────────────── */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 16px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.8;
    margin-top: auto;
}

.footer-small {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ── Responsive ────────────────────────── */
@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }
    .card-img-wrap {
        height: 140px;
    }
    .logo-text {
        font-size: 22px;
    }
    .occupation-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .occupation-wrapper {
        max-width: 100%;
        width: 100%;
    }
}