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

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f5f5f7;
    color: #111827;
}

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

img {
    max-width: 100%;
    display: block;
}

/* ==========
   Layout
   ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.main-content {
    padding: 86px 0 40px;
}

/* ==========
   Header
   ========== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo-link img {
    display: block;
}

.logo-text {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: .02em;
}

.nav a {
    margin-left: 18px;
    font-size: 14px;
    color: #555;
}

.nav a:hover {
    color: #0077c2;
}

/* MAIN CATEGORIES (OLX STYLE) */
.home-main-categories {
    background: #ffffff;
    padding: 32px 16px;
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.home-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 28px 18px; /* ROW | COLUMN spacing */
    justify-items: center;
}

.home-category-item {
    text-align: center;
    font-size: 14px;
    color: #111827;
    width: 110px;
}

.home-category-icon {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: #f4f6f8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
    transition: transform .2s ease, box-shadow .2s ease;
}

.home-category-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.home-category-item:hover .home-category-icon {
    transform: translateY(-4px);
    box-shadow: 0 12px 26px rgba(0,0,0,0.18);
}

.home-category-label {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    min-height: 34px;   /* fixes text alignment */
    text-align: center;
}

/* Emoji fallback */
.home-category-icon .category-emoji {
    display: none;
    font-size: 32px;
}

.home-category-icon.emoji-fallback .category-emoji {
    display: block;
}

.home-category-icon.emoji-fallback img {
    display: none;
}

.category-icon-wrapper{
    height:45px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.category-icon{
    width:40px;
    height:40px;
    object-fit:contain;
}


/* ==========
   Discover Tags
   ========== */
.discover-tags-section {
    margin: 22px 0 10px;
}

.bottom-discover {
    margin-top: 40px;
}

.discover-tags-title {
    font-size: 14px;
    color: #777;
    margin-bottom: 8px;
}

.discover-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.discover-tag {
    font-size: 12px;
    color: #0077c2;
    border-radius: 999px;
    border: 1px solid #dbeafe;
    padding: 4px 10px;
    background: #eff6ff;
    cursor: pointer;
}

/* ==========
   Listings Section
   ========== */
.listings-section {
    margin-top: 24px;
}

.listings-header {
    text-align: center;
    margin-bottom: 12px;
}

.listings-title {
    font-size: 20px;
    letter-spacing: 0.08em;
    color: #111827;
}

/* Toolbar */
.listings-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.listings-filter-buttons {
    display: inline-flex;
    border-radius: 999px;
    background: #e5e7eb;
    padding: 2px;
}

.listings-filter-btn {
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    background: transparent;
    border-radius: 999px;
    cursor: pointer;
    color: #374151;
}

.listings-filter-btn.active {
    background: #00a4ff;
    color: #fff;
}

.listings-view-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

/* Listings grid */
.listings-container {
    min-height: 120px;
}

.listings-grid-home {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

/* list view */
.listings-grid-home.list-view {
    display: flex;
    flex-direction: column;
}

/* Card */
.home-listing-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
}

.home-listing-card.list-view {
    flex-direction: row;
    height: 170px;
}

.home-listing-card.list-view .home-listing-image-wrapper {
    flex: 0 0 200px;
    padding-top: 0;
    height: 100%;
}

.home-listing-card.list-view .home-listing-body {
    flex: 1;
}

/* Image */
.home-listing-image-wrapper {
    position: relative;
    padding-top: 65%;
    overflow: hidden;
}

.home-listing-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card body */
.home-listing-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.home-listing-category-badge {
    display: inline-block;
    font-size: 14px;
    color: black;
    padding: 2px 8px;
    border-radius: 999px;
    
}

.home-listing-title a {
    font-size: 14px;
    font-weight: 600;
    color: black;
}

.home-listing-price {
    font-size: 14px;
    font-weight: 600;
    color: black;
}

.home-listing-location {
    font-size: 12px;
    color: #6b7280;
}

.home-listing-meta-bottom {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #9ca3af;
}

/* View all button */
.view-all-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.view-all-btn {
    padding: 8px 20px;
    border-radius: 999px;
    background: #111827;
    color: #f9fafb;
    font-size: 13px;
}

/* ==========
   Bottom logos
   ========== */
.bottom-logos {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bottom-logo-box {
    flex: 1 1 100px;
    min-width: 120px;
    background: #ffffff;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

/* ==========
   Footer
   ========== */
.site-footer {
    background: #0369a1;
    color: #e5e7eb;
    padding: 18px 0;
    margin-top: 40px;
    font-size: 12px;
}

.footer-inner {
    text-align: center;
}

/* ==========
   Responsive
   ========== */
@media (max-width: 768px) {
    .header-inner {
        padding: 0 10px;
    }
    .nav a {
        margin-left: 10px;
        font-size: 13px;
    }
    .search-bar {
        flex-direction: column;
    }
    .search-bar button {
        width: 100%;
    }
    .home-ad-card.list-view {
        flex-direction: column;
        height: auto;
    }
    .home-ad-card.list-view .home-ad-image-wrapper {
        height: auto;
        padding-top: 65%;
    }
}

.home-listing-image-wrapper {
    position: relative;
    overflow: hidden;
}

.featured-ribbon {
    position: absolute;
    top: 15px;
    right: -45px;
    padding: 6px 50px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transform: rotate(45deg);
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
    z-index: 5;
}

/* Prime */
.featured-ribbon.prime {
    background: linear-gradient(135deg, #007bff, #00c6ff);
    color: white;
}

/* Elite */
.featured-ribbon.elite {
    background: linear-gradient(135deg, #d4af37, #ffd700);
    color: white;
}

