:root {
    --dark: #002f34;
    --yellow: #ffce32;
    --cyan: #23e5db;
    --green: #23e5db;
    --gray-bg: #f7f7f7;
    --gray-line: #e2e2e2;
    --text: #406367;
    --red: #d14d3d;
    --white: #ffffff;
    --radius: 6px;
}

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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--gray-bg);
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
    width: min(1200px, 94%);
    margin: 0 auto;
}

/* ---------- Topbar ---------- */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-line);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar__inner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 0;
}

.logo { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.logo__img { height: 52px; width: auto; object-fit: contain; }
.logo__text { font-size: 22px; font-weight: 400; color: var(--dark); }
.logo__text b { font-weight: 800; }

.search-form { flex: 1; display: flex; min-width: 200px; }
.search-form__field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--dark);
    border-radius: var(--radius);
    padding: 0 6px 0 10px;
    background: var(--white);
}
.search-form__field input {
    border: none;
    outline: none;
    width: 100%;
    padding: 10px 0;
    font-size: 14px;
}
.search-form__icon {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    font-size: 15px;
    border-radius: var(--radius);
    transition: color .15s ease, background-color .15s ease;
}
.search-form__icon:hover { color: var(--cyan); background: var(--gray-bg); }

.topbar__nav { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--dark);
    font-size: 14px;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.nav-link--icon svg, .nav-link--icon i { color: var(--dark); }
.nav-link:hover { color: #406367; }

.btn-sell {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--dark);
    border-bottom: 4px solid var(--dark);
    border-radius: 24px;
    padding: 7px 16px 7px 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
}
.btn-sell__plus {
    background: var(--yellow);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
}
.btn-sell:hover { background: #f7f7f7; }

/* ---------- Location control ---------- */
.loc { position: relative; flex-shrink: 0; }
.loc__btn {
    display: flex; align-items: center; gap: 6px;
    border: 1px solid var(--gray-line);
    background: var(--white);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 14px; font-weight: 600; color: var(--dark);
    cursor: pointer; max-width: 180px;
}
.loc__btn:hover { border-color: var(--dark); }
.loc__city { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc__panel {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
    width: 260px; background: var(--white); border: 1px solid var(--gray-line);
    border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 10px;
}
.loc.open .loc__panel { display: block; }
.loc__gps {
    width: 100%; display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--cyan); background: #e6f9f7; color: var(--dark);
    padding: 9px 12px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
    cursor: pointer;
}
.loc__gps:hover { background: #d5f3ef; }
.loc__gps:disabled { opacity: .6; cursor: progress; }
.loc__divider { font-size: 12px; color: var(--text); margin: 10px 0 6px; text-align: center; text-transform: uppercase; letter-spacing: .4px; }
.loc__list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.loc__item {
    text-align: left; border: none; background: none; padding: 8px 10px;
    border-radius: var(--radius); font-size: 14px; cursor: pointer; color: var(--dark);
}
.loc__item--link { display: block; width: 100%; text-decoration: none; }
.loc__item:hover { background: var(--gray-bg); }
.loc__loading, .loc__empty { font-size: 13px; color: var(--text); padding: 8px 10px; }
.loc__error { font-size: 12px; color: var(--red); padding: 8px 10px; }

/* ---------- Header category dropdown ---------- */
.cat-drop { position: relative; flex-shrink: 0; }
.cat-drop .loc__btn { max-width: 200px; }
.cat-drop .loc__panel { width: 520px; max-width: calc(100vw - 24px); padding: 12px; }
.cat-drop .loc__list { max-height: 380px; }
.cat-drop.open .loc__panel { display: block; }
.cat-mega__cols { display: flex; gap: 8px; }
.cat-mega__list { flex: 0 0 220px; border-right: 1px solid var(--gray-line); padding-right: 8px; }
.cat-mega__subs { flex: 1; min-width: 0; }
.cat-mega__trigger {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%;
}
.cat-mega__trigger i { font-size: 11px; color: var(--text); opacity: .6; transition: transform .15s ease; }
.cat-mega__trigger:hover i, .cat-mega__trigger.active i { transform: translateX(2px); opacity: 1; color: var(--dark); }
.cat-mega__trigger.active { background: var(--gray-bg); font-weight: 600; }
.loc__item--hint { font-size: 13px; color: var(--text); }

/* ---------- Category tabs (OLX style) ---------- */
.cat-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    border-bottom: 2px solid var(--gray-line);
    margin-bottom: 20px;
    background: var(--white);
    padding: 0 4px;
}
.cat-tabs__tab {
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}
.cat-tabs__tab:hover { color: var(--dark); }
.cat-tabs__tab--active {
    color: var(--dark);
    border-bottom-color: var(--dark);
    font-weight: 700;
}

.listing-card__distance { color: #107a4a; font-weight: 600; }

/* ---------- Inputs with icons ---------- */
.field { position: relative; }
.field > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9aa6a7; font-size: 14px; pointer-events: none; }
.form-group .field > input, .form-group .field > select { padding-left: 36px; }

/* ---------- Flash ---------- */

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--cyan);
    color: var(--dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown__menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--white);
    border: 1px solid var(--gray-line);
    border-radius: var(--radius);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    min-width: 180px;
    padding: 6px 0;
}
.dropdown.open .dropdown__menu { display: block; }
.dropdown__menu a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
}
.dropdown__menu a:hover { background: var(--gray-bg); }
.dropdown__logout {
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    color: var(--red);
}
.dropdown__logout:hover { background: var(--gray-bg); }

/* ---------- Flash ---------- */
.flash { padding: 14px 16px; border-radius: var(--radius); margin-top: 16px; font-size: 14px; }
.flash--success { background: #e6f9f7; border: 1px solid var(--cyan); color: #0a4b52; }
.flash--error { background: #fdecea; border: 1px solid #f5c6bb; color: var(--red); }

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, var(--dark) 0%, #0a4b52 100%);
    color: var(--white);
    text-align: center;
    padding: 48px 16px;
}
.hero h1 { font-size: 30px; margin-bottom: 8px; }
.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--yellow);
    color: var(--dark);
    font-size: 13px;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.hero p { color: #bfe9e4; margin-bottom: 24px; }
.hero__search {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.hero__search input {
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius);
    width: min(420px, 100%);
    font-size: 15px;
}
.hero__search button {
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius);
    background: var(--yellow);
    color: var(--dark);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
}

/* ---------- Categories ---------- */
.section { padding: 28px 0; }
.section__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section__head h2 { font-size: 22px; }
.section__head a { color: var(--dark); font-size: 14px; font-weight: 700; text-decoration: underline; }

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}
.category-tile {
    background: var(--white);
    border: 1px solid var(--gray-line);
    border-radius: var(--radius);
    padding: 18px 12px;
    text-align: center;
    transition: box-shadow .15s, transform .15s;
}
.category-tile:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-2px); }
.category-tile__icon {
    width: 46px; height: 46px;
    margin: 0 auto 10px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    background: var(--cyan);
    color: var(--white);
}
.category-tile h3 { font-size: 14px; margin-bottom: 4px; }
.category-tile span { font-size: 12px; color: var(--text); }

/* ---------- Category icon strip (OLX style) ---------- */
.section--white { background: var(--white); }
.cat-strip {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 6px 2px 12px;
    scrollbar-width: thin;
}
.cat-strip__item {
    flex: 0 0 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}
.cat-strip__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.cat-strip__icon i.fa-house { background: #ffce32; color: var(--dark); }
.cat-strip__icon i.fa-car { background: #ff5b26; }
.cat-strip__icon i.fa-mobile-screen-button { background: #23e5db; color: var(--dark); }
.cat-strip__icon i.fa-tv { background: #8f5bff; }
.cat-strip__icon i.fa-couch { background: #3fbf8f; }
.cat-strip__icon i.fa-shirt { background: #ff6b9d; }
.cat-strip__icon i.fa-book-open { background: #8fb339; }
.cat-strip__icon i.fa-briefcase { background: #3b82f6; }
.cat-strip__icon i.fa-screwdriver-wrench { background: #a66a3a; }
.cat-strip__icon i.fa-paw { background: #c274f0; }
.cat-strip__icon i.fa-cart-shopping { background: var(--dark); }
.cat-strip__img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.cat-strip__name { font-size: 12px; font-weight: 700; color: var(--dark); line-height: 1.25; }
.cat-strip__count { font-size: 11px; color: var(--text); }
.cat-strip__item:hover .cat-strip__name { text-decoration: underline; }

/* ---------- Top filter bar (OLX style) ---------- */
.filter-top {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border: 1px solid var(--gray-line);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filter-top select {
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
    padding: 8px 4px;
    outline: none;
}
.filter-top__cat-wrap, .filter-top__city-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 14px;
    border-right: 1px solid var(--gray-line);
}
.filter-top__cat-wrap i, .filter-top__city-wrap i { color: var(--text); font-size: 15px; }
.filter-top__form { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }
.filter-top__search {
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--gray-line);
    border-radius: var(--radius);
    padding: 0 10px;
    background: var(--white);
}
.filter-top__search i { color: var(--text); font-size: 15px; }
.filter-top__search input {
    border: none;
    outline: none;
    width: 100%;
    padding: 9px 0;
    font-size: 14px;
    background: none;
}

/* ---------- Listing grid ---------- */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}
.listing-card {
    background: var(--white);
    border: 1px solid var(--gray-line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .15s, transform .15s;
    display: flex;
    flex-direction: column;
}
.listing-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.1); transform: translateY(-2px); }
.listing-card__img {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--gray-bg);
    overflow: hidden;
}
.listing-card__img img { width: 100%; height: 100%; object-fit: cover; }
.listing-card__badge {
    position: absolute;
    top: 8px; left: 8px;
    background: var(--yellow);
    color: var(--dark);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
}
.listing-card__fav {
    position: absolute;
    top: 8px; right: 8px;
    background: var(--white);
    border: none;
    border-radius: 50%;
    width: 32px; height: 32px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text);
}
.listing-card__fav.active { color: var(--red); }
.listing-card__body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.listing-card__price { font-size: 18px; font-weight: 700; }
.listing-card__title {
    font-size: 14px;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.listing-card__meta {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text);
    border-top: 1px solid var(--gray-bg);
}

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.toolbar select, .toolbar input[type="number"] {
    padding: 8px 10px;
    border: 1px solid var(--gray-line);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 14px;
}
.toolbar .toolbar__spacer { flex: 1; }
.toolbar .field input[type="number"] { padding-left: 36px; }
.free-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--yellow);
    color: var(--dark);
    font-weight: 800;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 999px;
}
.btn {
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
.btn--dark { background: var(--dark); color: var(--white); }
.btn--dark:hover { background: #0a4b52; }
.btn--yellow { background: var(--yellow); color: var(--dark); }
.btn--yellow:hover { background: #f0bc16; }
.btn--outline { background: var(--white); border: 1px solid var(--dark); color: var(--dark); }
.btn--outline:hover { background: var(--gray-bg); }
.btn--danger { background: var(--white); border: 1px solid var(--red); color: var(--red); }
.btn--danger:hover { background: var(--red); color: var(--white); }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 28px 0; }
.pagination a, .pagination span {
    padding: 8px 12px;
    border: 1px solid var(--gray-line);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 14px;
}
.pagination .active span { background: var(--dark); color: var(--white); border-color: var(--dark); }
.pagination .disabled span { color: #bbb; }

/* ---------- Listing detail ---------- */
.detail { padding: 24px 0; }
.detail__grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; }
.detail__card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 18px;
}
.gallery { display: flex; flex-direction: column; gap: 10px; }
.gallery__main {
    aspect-ratio: 4/3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-bg);
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery__thumbs img {
    width: 74px; height: 56px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
}
.gallery__thumbs img.active { border-color: var(--dark); }

.detail__title { font-size: 22px; margin-bottom: 6px; }
.detail__price { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.detail__meta { color: var(--text); font-size: 13px; margin-bottom: 14px; display: flex; gap: 16px; flex-wrap: wrap; }
.detail__desc { color: var(--text); font-size: 14px; line-height: 1.7; white-space: pre-line; }
.detail__label { font-size: 12px; color: var(--text); text-transform: uppercase; letter-spacing: .4px; margin: 14px 0 6px; }

.seller-card { text-align: center; }
.seller-card .avatar { width: 56px; height: 56px; font-size: 22px; margin: 0 auto 10px; }
.seller-card h3 { font-size: 16px; margin-bottom: 4px; }
.seller-card p { font-size: 13px; color: var(--text); margin-bottom: 14px; }
.seller-card .btn { width: 100%; margin-bottom: 8px; }
.fav-row { display: flex; gap: 8px; margin-top: 14px; }
.fav-row .btn { flex: 1; }

.spec-list { list-style: none; }
.spec-list li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--gray-bg); font-size: 14px; }
.spec-list li span:first-child { color: var(--text); }

/* ---------- Forms ---------- */
.form-page { max-width: 560px; margin: 40px auto; padding: 0 16px; }
.form-page--wide { max-width: 720px; }
.form-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.form-card h1 { font-size: 22px; margin-bottom: 4px; }
.form-card .form-sub { color: var(--text); font-size: 14px; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-line);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--dark);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.form-check input { width: auto; }
.form-error { color: var(--red); font-size: 12px; margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.form-hint { font-size: 12px; color: var(--text); margin-top: 4px; }

.auth-alt { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text); }
.auth-alt a { color: var(--dark); font-weight: 700; }

/* Image upload */
.upload-area {
    border: 2px dashed var(--gray-line);
    border-radius: var(--radius);
    padding: 26px;
    text-align: center;
    cursor: pointer;
    color: var(--text);
    font-size: 14px;
    transition: border-color .15s;
}
.upload-area:hover { border-color: var(--dark); }
.upload-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 12px; }
.upload-preview figure { position: relative; border: 1px solid var(--gray-line); border-radius: 4px; overflow: hidden; }
.upload-preview img { width: 100%; height: 80px; object-fit: cover; }
.upload-preview .remove-preview {
    position: absolute; top: 4px; right: 4px;
    background: var(--red); color: #fff;
    border: none; border-radius: 50%;
    width: 20px; height: 20px;
    cursor: pointer; font-size: 12px; line-height: 1;
}
.upload-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.upload-thumbs figure { position: relative; }
.upload-thumbs img { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; }
.upload-thumbs .remove-thumb {
    position: absolute; top: 3px; right: 3px;
    background: var(--red); color: #fff;
    border: none; border-radius: 50%;
    width: 20px; height: 20px; cursor: pointer; font-size: 11px;
}

/* ---------- My ads ---------- */
.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.status-pill--active { background: #e0f7ee; color: #107a4a; }
.status-pill--sold { background: #ececec; color: #555; }
.status-pill--rejected { background: #fdecea; color: var(--red); }
.status-pill--expired { background: #fff4e0; color: #a05a00; }
.status-pill--pending { background: #fff4e0; color: #a05a00; }

.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.card-actions .btn { padding: 7px 12px; font-size: 13px; }

/* ---------- Chats ---------- */
.chats-layout { display: grid; grid-template-columns: 340px 1fr; gap: 0; height: calc(100vh - 140px); background: var(--white); }
.chats-list { border-right: 1px solid var(--gray-line); overflow-y: auto; }
.chats-list__head { padding: 16px; border-bottom: 1px solid var(--gray-line); font-size: 18px; font-weight: 700; }
.chat-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--gray-bg); cursor: pointer; }
.chat-item:hover, .chat-item.active { background: var(--gray-bg); }
.chat-item img { width: 54px; height: 54px; object-fit: cover; border-radius: var(--radius); }
.chat-item__title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.chat-item__msg { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.chat-item__time { font-size: 11px; color: var(--text); margin-left: auto; white-space: nowrap; }
.chat-item__unread {
    background: var(--cyan);
    color: var(--dark);
    border-radius: 50%;
    min-width: 20px; height: 20px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; padding: 0 5px;
}

.chat-window { display: flex; flex-direction: column; }
.chat-window__head { padding: 12px 16px; border-bottom: 1px solid var(--gray-line); display: flex; align-items: center; gap: 12px; }
.chat-window__head img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; }
.chat-window__head strong { font-size: 15px; }
.chat-window__head small { color: var(--text); display: block; }
.chat-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--gray-bg); }
.msg { max-width: 70%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.msg--mine { align-self: flex-end; background: var(--dark); color: var(--white); border-bottom-right-radius: 2px; }
.msg--theirs { align-self: flex-start; background: var(--white); border-bottom-left-radius: 2px; }
.msg__time { display: block; font-size: 11px; margin-top: 4px; opacity: .7; }
.chat-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--gray-line); }
.chat-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--gray-line);
    border-radius: 22px;
    font-size: 14px;
}
.chat-form input:focus { outline: none; border-color: var(--dark); }
.chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text); text-align: center; padding: 24px; }

/* ---------- Admin ---------- */
.admin-wrap { display: flex; min-height: calc(100vh - 120px); }
.admin-sidebar {
    width: 230px;
    background: var(--dark);
    color: var(--white);
    flex-shrink: 0;
    padding: 18px 0;
}
.admin-sidebar a {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px;
    font-size: 14px;
    color: #c9d5d6;
}
.admin-sidebar a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-sidebar a.active { background: var(--yellow); color: var(--dark); font-weight: 700; }
.admin-main { flex: 1; padding: 24px; background: var(--gray-bg); overflow-x: auto; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 18px; border-left: 4px solid var(--cyan); }
.stat-card strong { font-size: 26px; display: block; }
.stat-card span { font-size: 13px; color: var(--text); }

.table { width: 100%; background: var(--white); border-collapse: collapse; border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 12px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--gray-bg); }
.table th { background: var(--gray-bg); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--text); }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table .actions .btn { padding: 6px 10px; font-size: 12px; }
.table img.thumb { width: 52px; height: 40px; object-fit: cover; border-radius: 4px; }

.inline-form { display: inline; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-bar input, .filter-bar select {
    padding: 8px 10px;
    border: 1px solid var(--gray-line);
    border-radius: var(--radius);
    font-size: 14px;
}

/* ---------- Footer ---------- */
.footer { background: #fff; color: #444; font-size: 14px; margin-top: 0; }
.footer a { color: #555; text-decoration: none; transition: color .15s ease; }
.footer a:hover { color: var(--yellow); }

.footer__brand { text-align: center; padding: 48px 0 32px; }
.footer__logo-img { height: 32px; width: auto; }
.footer__logo-img:hover { opacity: .8; }
.footer__brand p { font-size: 13px; line-height: 1.7; margin: 14px auto 18px; max-width: 400px; color: #777; }
.footer__social { display: flex; gap: 8px; justify-content: center; }
.footer__social a { width: 36px; height: 36px; border-radius: 50%; background: #f0f0f0; color: #555; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; transition: all .2s; }
.footer__social a:hover { background: var(--yellow); color: #222; transform: translateY(-2px); }

.footer__links-row { border-top: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; padding: 20px 0; }
.footer__links-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: center; }
.footer__links-inner a { font-size: 13px; white-space: nowrap; color: #555; }

.footer__bottom { padding: 16px 0; }
.footer__bottom-inner { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #999; }

@media (max-width: 480px) {
    .footer__links-inner { gap: 6px 16px; }
    .footer__bottom-inner { flex-direction: column; gap: 4px; text-align: center; }
}


/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 48px 16px; color: var(--text); }
.empty h3 { font-size: 20px; margin-bottom: 8px; color: var(--dark); }

/* ---------- Trust badges & seller reviews ---------- */
.trust-badge {
    display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
    margin: 6px 0 10px;
}
.trust-badge--top { background: #e7f7ee; color: #1d7a43; }
.trust-badge--trusted { background: #e8f2ff; color: #1d5fb5; }
.trust-badge--ok { background: #fff4e0; color: #9a6700; }
.trust-badge--new { background: var(--gray-bg); color: var(--text); }
.trust-badge__stars { font-weight: 700; }
.trust-badge__stars i { color: #ffce32; }

.review-summary { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.review-summary > strong { font-size: 28px; color: var(--dark); }
.review-summary__stars { color: #ffce32; font-size: 14px; }
.review-summary > span:last-child { color: var(--text); font-size: 13px; }

.star-input { display: flex; gap: 4px; margin-top: 8px; }
.star-input button {
    border: none; background: none; cursor: pointer; font-size: 22px;
    color: #ffce32; padding: 2px; transition: transform .12s ease;
}
.star-input button:hover { transform: scale(1.2); }

.review-list { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.review-item { border-top: 1px solid var(--gray-line); padding-top: 12px; }
.review-item__head { display: flex; align-items: center; gap: 10px; }
.review-item__head > div { flex: 1; }
.review-item__head strong { font-size: 14px; color: var(--dark); display: block; }
.review-item__stars { color: #ffce32; font-size: 12px; }
.review-item__date { font-size: 12px; color: var(--text); }
.review-item__comment { font-size: 14px; color: var(--text); margin-top: 6px; line-height: 1.6; }
.avatar--sm { width: 32px; height: 32px; font-size: 14px; }

/* ---------- Homepage trust strip ---------- */
.trust-strip { margin-top: 0; }
.trust-strip__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 20px 0; }
.trust-strip__item { display: flex; align-items: center; gap: 12px; }
.trust-strip__item > i { font-size: 22px; color: var(--cyan); }
.trust-strip__item strong { display: block; font-size: 14px; color: var(--dark); }
.trust-strip__item span { font-size: 12px; color: var(--text); }

/* ---------- UX polish: sticky header & motion ---------- */
html { scroll-behavior: smooth; }
.listing-card {
    transition: transform .18s ease, box-shadow .18s ease;
}
.listing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,.1);
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.cat-strip__item, .listing-card {
    animation: fadeUp .3s ease both;
}
.btn, .loc__btn, .nav-link, .cat-strip__item { transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease; }
.loc__panel { animation: fadeUp .18s ease; }

@media (max-width: 900px) {
    .trust-strip__grid { grid-template-columns: repeat(2, 1fr); }
}
.page { max-width: 820px; margin: 40px auto; padding: 0 16px; }
.page h1 { font-size: 28px; margin-bottom: 16px; color: var(--dark); }
.page__body { line-height: 1.7; color: var(--text); font-size: 15px; }
.page__body h2 { color: var(--dark); font-size: 18px; margin: 24px 0 8px; }
.page__body p { margin-bottom: 12px; }
.page__body a { color: var(--cyan); text-decoration: underline; }
.page__list { padding-left: 0; list-style: none; }
.page__list li { padding: 6px 0; }

@media (max-width: 900px) {
    .detail__grid { grid-template-columns: 1fr; }
    .chats-layout { grid-template-columns: 1fr; height: auto; }
    .chats-list { max-height: 300px; }
    .admin-sidebar { width: 190px; }
    .topbar__inner { flex-wrap: wrap; }
    .search-form { order: 3; flex-basis: 100%; }
}

@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
    .topbar__nav .nav-link--icon { display: none; }
    .listings-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ---------- Searchable select ---------- */
.ss-wrap {
    position: relative;
    width: 100%;
}
.ss-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-line);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 14px;
    color: var(--dark);
    outline: none;
}
.ss-input:focus { border-color: var(--yellow); }
.ss-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: var(--white);
    border: 1px solid var(--gray-line);
    border-radius: var(--radius);
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.ss-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}
.ss-item:hover,
.ss-item--active {
    background: var(--gray-bg);
    color: var(--dark);
}

/* ---------- Share bar ---------- */
.share-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0;
    padding: 12px 0;
    border-top: 1px solid var(--gray-line);
    border-bottom: 1px solid var(--gray-line);
}
.share-bar__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-right: 4px;
}
.share-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, opacity 0.15s;
}
.share-btn:hover { transform: scale(1.1); opacity: 0.9; }
.share-btn--whatsapp { background: #25D366; }
.share-btn--facebook { background: #1877F2; }
.share-btn--twitter { background: #000; }
.share-btn--telegram { background: #0088cc; }
.share-btn--copy { background: #6c757d; }

/* ---------- Offer system ---------- */
.offer-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}
.offer-bar input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--gray-line);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
}
.offer-bar input:focus { border-color: var(--yellow); }
.offer-pending {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius);
    padding: 10px 14px;
    margin: 10px 0;
    font-size: 13px;
    color: #856404;
}
.offer-accepted {
    background: #d4edda;
    border: 1px solid #28a745;
    border-radius: var(--radius);
    padding: 10px 14px;
    margin: 10px 0;
    font-size: 13px;
    color: #155724;
}
.offer-rejected {
    background: #f8d7da;
    border: 1px solid #dc3545;
    border-radius: var(--radius);
    padding: 10px 14px;
    margin: 10px 0;
    font-size: 13px;
    color: #721c24;
}

/* ---------- Quick replies ---------- */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}
.quick-reply-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--gray-line);
    background: var(--white);
    font-size: 12px;
    color: var(--dark);
    cursor: pointer;
    transition: background 0.15s;
}
.quick-reply-btn:hover {
    background: var(--gray-bg);
    border-color: var(--yellow);
}

/* ---------- Saved search badge ---------- */
.saved-search-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 14px;
    background: var(--yellow);
    color: var(--dark);
    font-size: 11px;
    font-weight: 600;
}

/* ---------- Skeleton loading ---------- */
.skeleton {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius);
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton--text { height: 14px; margin-bottom: 8px; }
.skeleton--title { height: 22px; width: 60%; margin-bottom: 12px; }
.skeleton--img { height: 180px; }
.skeleton--price { height: 28px; width: 30%; margin-bottom: 12px; }
.skeleton--btn { height: 38px; width: 100px; }

/* ---------- Dark mode ---------- */
body.dark {
    --dark: #e0e0e0;
    --gray-bg: #1a1a2e;
    --gray-line: #2a2a4a;
    --text: #c0c0c0;
    --white: #16213e;
}
body.dark .topbar { background: #16213e; border-color: #2a2a4a; }
body.dark .form-card { background: #16213e; }
body.dark .detail__card { background: #16213e; }
body.dark .listing-card { background: #16213e; }
body.dark input, body.dark select, body.dark textarea {
    background: #1a1a2e;
    color: #e0e0e0;
    border-color: #2a2a4a;
}
body.dark .ss-list { background: #16213e; border-color: #2a2a4a; }
body.dark .ss-item:hover { background: #1a1a2e; }
body.dark footer { background: #0f0f23; border-color: #2a2a4a; }

/* ---------- Infinite scroll ---------- */
.load-more-sentinel {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa6a7;
    font-size: 13px;
}

/* ---------- Relist badge ---------- */
.relist-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--cyan);
    color: var(--dark);
    font-size: 11px;
    font-weight: 600;
}

/* ---------- Trending section ---------- */
.trending-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 14px;
    background: var(--gray-bg);
    border: 1px solid var(--gray-line);
    font-size: 12px;
    color: var(--text);
    margin: 2px;
}
.trending-tag:hover { border-color: var(--yellow); background: #fffbe6; }

/* ---------- Search suggestions ---------- */
#search-suggestions .ss-item {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--dark);
    cursor: pointer;
    border-bottom: 1px solid var(--gray-line);
}
#search-suggestions .ss-item:last-child { border-bottom: none; }
#search-suggestions .ss-item:hover { background: var(--gray-bg); }

/* ---------- Pricing Suggestion ---------- */
.pricing-suggestion {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    margin-top: 6px;
    color: #614700;
}

/* ---------- AI Title Suggestions ---------- */
.ai-title-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: 1px solid var(--gray-line);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    cursor: pointer;
    background: #fff;
    color: var(--dark);
    transition: all 0.15s;
}
.ai-title-option:hover {
    border-color: var(--yellow);
    background: #fffbe6;
}

/* ---------- Saved Search Cards ---------- */
.saved-search-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid var(--gray-line);
    border-radius: 8px;
    margin-bottom: 10px;
    gap: 12px;
}
.saved-search-card__query { font-weight: 600; font-size: 14px; color: var(--dark); }
.saved-search-card__meta { font-size: 12px; color: #9aa6a7; margin-top: 2px; }
.saved-search-card__actions { display: flex; gap: 6px; flex-shrink: 0; }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: var(--gray-bg);
    color: var(--text);
    font-weight: 500;
    margin-left: 6px;
}
.badge--city { background: #e6f7ff; color: #0050b3; }
.badge--green { background: #d4edda; color: #155724; }

/* ---------- Seller Level ---------- */
.seller-level {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}
.seller-level--platinum { background: #f0f0ff; color: #5b21b6; border: 1px solid #c4b5fd; }
.seller-level--gold { background: #fffbe6; color: #805d00; border: 1px solid #ffe58f; }
.seller-level--silver { background: #f5f5f5; color: #595959; border: 1px solid #d9d9d9; }
.seller-level--bronze { background: #fff7e6; color: #873800; border: 1px solid #ffd591; }

/* ---------- Referral Card ---------- */
.referral-card {
    background: #fff;
    border: 1px solid var(--gray-line);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}
.referral-card__header h3 { margin-bottom: 6px; color: var(--dark); }
.referral-card__header p { color: #9aa6a7; font-size: 14px; margin-bottom: 16px; }
.referral-card__code-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.referral-card__code {
    background: var(--dark);
    color: var(--yellow);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 3px;
    font-family: monospace;
}
.referral-card__link-box { margin-bottom: 12px; }
.referral-card__share { display: flex; gap: 8px; margin-top: 12px; }
.btn--whatsapp { background: #25d366; color: #fff; }
.btn--facebook { background: #1877f2; color: #fff; }
.btn--twitter { background: #1da1f2; color: #fff; }

/* ---------- Map ---------- */
.leaflet-popup-content-wrapper { border-radius: 8px !important; }
.leaflet-popup-content { margin: 10px !important; font-size: 13px !important; }
.map-marker { background: none !important; border: none !important; }

/* ---------- Skeleton Loading ---------- */
.skeleton {
    background: linear-gradient(90deg, #e2e2e2 25%, #f0f0f0 50%, #e2e2e2 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite;
    border-radius: 6px;
}
@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card {
    border: 1px solid var(--gray-line);
    border-radius: 10px;
    overflow: hidden;
}
.skeleton-card__img { height: 180px; }
.skeleton-card__text { padding: 12px; }
.skeleton-card__line { height: 14px; margin-bottom: 8px; }
.skeleton-card__line--short { width: 60%; }

/* ---------- Infinite Scroll ---------- */
#infinite-scroll-sentinel { height: 1px; width: 100%; }

/* ---------- Featured Listing Badge in Grid ---------- */
.listing-card--featured { border: 2px solid var(--yellow); position: relative; }
.listing-card--featured::before {
    content: '\f005';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--yellow);
    color: var(--dark);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 2;
}

/* ---------- Video Play Overlay ---------- */
.video-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 2;
}

/* ---------- Dark Mode Enhancements ---------- */
body.dark .saved-search-card { background: #2d3748; border-color: #4a5568; }
body.dark .saved-search-card__query { color: #e2e8f0; }
body.dark .referral-card { background: #2d3748; border-color: #4a5568; }
body.dark .referral-card__header h3 { color: #e2e8f0; }
body.dark .ai-title-option { background: #2d3748; border-color: #4a5568; color: #e2e8f0; }
body.dark .ai-title-option:hover { border-color: var(--yellow); background: #3d4a5c; }
body.dark .pricing-suggestion { background: #3d3000; border-color: #5c4800; color: #ffd666; }
body.dark .badge { background: #4a5568; color: #e2e8f0; }
body.dark .badge--city { background: #1a365d; color: #90cdf4; }
