/* ===================================================
   FACEBOOK MARKETPLACE STYLE
   =================================================== */

/* Layout wrapper */
.mp-wrap {
    display: flex;
    gap: 20px;
    padding: 16px;
    max-width: 1400px;
    margin: auto;
}

/* ---------- Sidebar ---------- */
.mp-side {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 76px;
    height: calc(100vh - 90px);
    overflow-y: auto;
    padding-right: 8px;
}
.mp-side::-webkit-scrollbar { width: 6px; }
.mp-side::-webkit-scrollbar-thumb { background: #ddd; border-radius: 6px; }

.mp-side h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Search */
.mp-search {
    position: relative;
    margin-bottom: 14px;
}
.mp-search input {
    width: 100%;
    background: #f0f2f5;
    border: none;
    padding: 10px 16px 10px 40px;
    border-radius: 22px;
    font-size: .9rem;
    outline: none;
}
.mp-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8e8e8e;
    font-size: .9rem;
}

/* Section heading */
.mp-label {
    font-size: .78rem;
    font-weight: 700;
    color: #65676b;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin: 14px 8px 6px;
}

/* Link items */
.mp-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: .92rem;
    color: #050505;
    text-decoration: none;
    transition: .15s;
}
.mp-link:hover { background: #f0f2f5; color: #050505; }
.mp-link.active { background: #e7f3ff; color: #1877f2; font-weight: 600; }
.mp-link i { width: 22px; font-size: 1.05rem; }
.mp-link .count {
    margin-left: auto;
    font-size: .75rem;
    color: #8e8e8e;
}

/* Create listing button */
.mp-create-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #e7f3ff;
    color: #1877f2;
    border: none;
    padding: 12px;
    border-radius: 8px;
    width: 100%;
    font-weight: 600;
    text-decoration: none;
    margin: 6px 0 14px;
    transition: .15s;
}
.mp-create-btn:hover { background: #d4e8ff; color: #166fe5; }

/* Divider */
.mp-divider { height: 1px; background: #e4e6eb; margin: 12px 8px; }

/* Location chip */
.mp-loc {
    font-size: .82rem;
    color: #1877f2;
    padding: 6px 10px;
    cursor: pointer;
}
.mp-loc b { color: #050505; }

/* ===================================================
   Main content
   =================================================== */
.mp-main { flex: 1; min-width: 0; }

.mp-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.mp-head h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.mp-head .loc-pill {
    background: #e7f3ff;
    color: #1877f2;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.mp-head .loc-pill:hover { background: #d4e8ff; color: #166fe5; }

/* Section tabs (Today's picks / etc.) */
.mp-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 14px;
}
.mp-tabs::-webkit-scrollbar { display: none; }
.mp-tab {
    padding: 7px 16px;
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 20px;
    font-size: .85rem;
    color: #050505;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 500;
    transition: .15s;
}
.mp-tab:hover { background: #f0f2f5; color: #050505; }
.mp-tab.active { background: #1877f2; color: #fff; border-color: #1877f2; }

/* ===================================================
   Product grid
   =================================================== */
.mp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.mp-card {
    background: transparent;
    text-decoration: none;
    color: #050505;
    display: flex;
    flex-direction: column;
    transition: transform .15s;
}
.mp-card:hover { transform: translateY(-2px); color: #050505; }

.mp-thumb {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* square */
    background: #f0f2f5;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}
.mp-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s;
}
.mp-card:hover .mp-thumb img { transform: scale(1.04); }

/* Placeholder for no-image posts */
.mp-thumb .ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #fff;
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: .85;
}

/* "Just listed" badge */
.mp-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #fff;
    color: #050505;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: .68rem;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.mp-badge.new { background: #1877f2; color: #fff; }

/* Media type badge (top-right) */
.mp-media-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,.6);
    color: #fff;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    backdrop-filter: blur(4px);
}

/* Play icon for videos */
.mp-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    text-shadow: 0 2px 8px rgba(0,0,0,.7);
    pointer-events: none;
}

/* Product info */
.mp-info { padding: 0 4px; }

.mp-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: #050505;
    margin-bottom: 2px;
    line-height: 1.2;
}
.mp-title {
    font-size: .88rem;
    color: #050505;
    margin-bottom: 3px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mp-place {
    font-size: .78rem;
    color: #65676b;
}

/* ===================================================
   Filters bar (mobile only)
   =================================================== */
.mp-filter-bar {
    display: none;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #e4e6eb;
    margin: -16px -16px 16px;
}
.mp-filter-bar::-webkit-scrollbar { display: none; }
.mp-filter-chip {
    padding: 6px 14px;
    background: #f0f2f5;
    border-radius: 20px;
    font-size: .82rem;
    white-space: nowrap;
    color: #050505;
    text-decoration: none;
    font-weight: 500;
}
.mp-filter-chip.active { background: #1877f2; color: #fff; }

/* ===================================================
   Empty state
   =================================================== */
.mp-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 12px;
}
.mp-empty i { font-size: 3.5rem; color: #ccc; margin-bottom: 14px; }

/* ===================================================
   Load more
   =================================================== */
.mp-loadmore {
    display: block;
    text-align: center;
    padding: 20px;
    color: #1877f2;
    font-weight: 600;
    text-decoration: none;
}

/* ===================================================
   Responsive
   =================================================== */
@media (max-width: 991px) {
    .mp-wrap { padding: 0; gap: 0; }
    .mp-side { display: none; }
    .mp-main { padding: 12px; }
    .mp-filter-bar { display: flex; }
    .mp-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    .mp-head h1 { font-size: 1.15rem; }
    .mp-price { font-size: .95rem; }
    .mp-title { font-size: .82rem; }
    .mp-thumb { border-radius: 8px; margin-bottom: 8px; }
}

@media (max-width: 480px) {
    .mp-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}