/* =====================================================
   GLOBAL RESET
   ===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background: #f8f9fa;
    color: #222;
}

.topbar {
    background: #0a58ca;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    font-size: 14px;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.topbar a {
    color: #fff;
    text-decoration: none;
    margin-left: 0;
}

.topbar a:hover {
    text-decoration: underline;
}

.topbar-right a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topbar-right span {
    white-space: nowrap;
}

.my-account {
    margin-left: 8px;
    font-weight: 600;
}

.profile-link {
    width: 28px;
    height: 28px;
    min-width: 28px;   /* 🔥 prevents shrink */
    min-height: 28px;  /* 🔥 prevents stretch */
    aspect-ratio: 1 / 1; /* 🔥 keeps perfect square */
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex; /* 🔥 change from inline-flex */
    align-items: center;
    justify-content: center;
}
.header-profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    border: 1.5px solid #fff;
}
.header-profile-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    color: #1e5bb8;
    border: 2px solid #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
/* =====================================================
   MENU BAR
   ===================================================== */
.menu-bar {
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
    z-index: 1000;
    min-height: 64px;
    overflow: visible;
}

/*.menu-bar.sticky {*/
/*    position: fixed;*/
/*    top: 0;*/
/*    left: 0;*/
/*    width: 100%;*/
/*    box-shadow: 0 2px 10px rgba(0,0,0,0.08);*/
/*}*/

.menu-left {
    display: flex;
    align-items: center;
    gap: 15px;
    overflow: visible;
}


/* =====================================================
   CATEGORY DROPDOWN (ALL CATEGORIES)
   ===================================================== */
.category-dropdown {
    position: static;
}

.category-toggle {
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 16px;
    color: #000;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-toggle:hover {
    color: #0a58ca;
}

/* =====================================================
   MEGA MENU (OLX STYLE OVERLAY)
   ===================================================== */
.mega-menu {
    display: none;
    position: absolute;
    top: 100%;

    /* 🔥 FULL WIDTH FROM LOGO → SUBMIT AD */
    left: 0;
    right: 0;
    width: 100%;

    background: #fff;
    padding: 20px 30px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    border-top: 1px solid #e5e5e5;
    border-radius: 0 0 10px 10px;

    max-height: 420px;
    overflow-y: auto;

    z-index: 9999;
}


.mega-menu.open {
    display: grid;
}

.mega-menu::-webkit-scrollbar {
    width: 8px;
}

.mega-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.mega-menu::-webkit-scrollbar-thumb:hover {
    background: #0a58ca;
}


/* Category Columns */
.mega-column h4 {
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 600;
}

.mega-column h4 a {
    color: #000;
    text-decoration: none;
}

.mega-column a {
    color: #444;
    text-decoration: none;
    display: inline-block;      /* REQUIRED for transform */
    transition: color 0.2s ease, transform 0.2s ease;
}

.mega-column a:hover {
    color: #0a58ca;
    transform: translateY(-2px); /* moves link slightly up */
}

.mega-column ul {
    list-style: none;   /* ❌ removes bullets */
    padding: 0;
    margin: 8px 0 0;
}

.mega-column ul li {
    padding-left: 0;    /* safety */
    margin-bottom: 4px;
    line-height: 1.35;
}

/* ===== MEGA MENU GRID ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px 22px;   /* row-gap column-gap */
}
.category-dropdown:hover .mega-menu {
    display: block;
}

.quick-categories {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 18px;
}

.quick-categories a {
    color: #333;
    font-weight: 500;
    text-decoration: none;
}

.quick-categories a:hover {
    color: #0a58ca;
}

/* =========================
   SUBMIT AD BUTTON (WHITE HOVER)
   ========================= */

.submit-ad-btn {
    background: #0a58ca; /* normal blue */
    color: white;
    padding: 9px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;

    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}

/* Hover effect */
.submit-ad-btn:hover {
    background: #0a58ca;   /* 👈 white background */
    color: white;  
    border: 1px solid #0a58ca;

    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}


/* =====================================================
   RESPONSIVE (MOBILE)
   ===================================================== */
@media (max-width: 991px) {

    .mega-menu {
        position: static;
        width: 100%;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        padding: 20px;
    }

    .menu-bar {
        flex-wrap: wrap;
    }

    .search-bar {
        flex-direction: column;
        border-radius: 12px;
    }

    .search-bar select,
    .search-bar input,
    .search-bar button {
        width: 100%;
        border-bottom: 1px solid #eee;
    }

    .search-bar button {
        border-bottom: none;
    }
}

@media (max-width: 991px) {

    /* ✅ FIX: allow categories to wrap */
    .quick-categories {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* ✅ OPTIONAL: make each item fit nicely */
    .quick-categories li {
        flex: 0 0 auto;
    }

    /* ✅ PREVENT horizontal overflow */
    body {
        overflow-x: hidden;
    }

}
@media (max-width: 991px) {

    html, body {
        width: 100%;
        overflow-x: hidden;
    }

}
/* ================= LOGO FIX ================= */
.logo {
    display: flex;
    align-items: center;
    height: 100%;
}

/* LOGO WRAPPER */
.logo {
    display: flex;
    align-items: center;
    height: 60px;   /* matches header height */
}

/* LOGO IMAGE */
.logo img {
    height: 42px;        /* perfect for your logo */
    width: auto;         /* keeps aspect ratio */
    max-width: 220px;    /* prevents overflow */
    display: block;
    object-fit: contain;
}

/* REMOVE ALL HEADER HOVER EFFECTS */

.submit-ad-btn:hover {
    background: #0a58ca; /* same as normal */
}

.topbar a:hover {
    color: #fff;
    text-decoration: none;
}

.quick-categories a:hover {
    color: #333;
}

.category-toggle:hover {
    color: #000;
}

.mega-column a:hover {
    color: #444;
    transform: none;
}

/* =========================
   LIFT / POP-UP HOVER EFFECT
   ========================= */

/* Submit Ad Button */
.submit-ad-btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.submit-ad-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

/* Topbar icons + My Account */
.topbar-right a {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.topbar-right a:hover {
    transform: translateY(-3px);
}

/* Profile icon (circle) */
.profile-link:hover {
    transform: translateY(-3px);
}

/* Quick menu links */
.quick-categories a {
    transition: transform 0.2s ease, color 0.2s ease;
}

.quick-categories a:hover {
    transform: translateY(-2px);
}

/* Category dropdown button */
.category-toggle {
    transition: transform 0.2s ease;
}

.category-toggle:hover {
    transform: translateY(-2px);
}

@media (max-width: 991px) {

    /* 🔥 TOPBAR FIX */
    .topbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .topbar-left {
        display: none; /* hide email */
    }

    .topbar-right {
        justify-content: flex-start;
        align-items: center;
        width: 100%;
        gap: 6px;
    }

    /* Move login/profile to right */
    .my-account,
    .profile-link {
        margin-left: auto;
    }

    /* Push ONLY last item (login/profile) to right */
    .topbar-right a:last-child {
        margin-left: auto;
    }

    .topbar-right span {
        margin-right: 5px;
    }

    .topbar-right a {
        margin: 0;
        padding: 0;
    }

    .profile-link {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        aspect-ratio: 1 / 1;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header-profile-icon,
    .header-profile-img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
    }

    /* 🔥 MENU BAR STRUCTURE */
    .menu-bar {
        position: relative; /* needed for button positioning */
        flex-wrap: wrap;
    }

    .menu-left {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 6px; /* reduced spacing */
    }

    /* 🔥 LOGO */
    .logo img {
        height: 40px;
        max-width: 160px;
    }

    /* 🔥 SUBMIT BUTTON (TOP RIGHT FIX) */
    .menu-right {
        position: absolute;
        top: 10px;
        right: 10px;
        width: auto;
        margin: 0;
    }

    .submit-ad-btn {
        width: auto;
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 20px;
        white-space: nowrap;
    }

    /* 🔥 CATEGORY BUTTON */
    .category-toggle {
        width: 100%;
        justify-content: space-between;
    }

    /* 🔥 QUICK CATEGORIES (SCROLLABLE) */
    .quick-categories {
        flex-wrap: nowrap;
        overflow-x: auto;
        width: 100%;
        gap: 12px;
    }

    .quick-categories::-webkit-scrollbar {
        display: none;
    }

    /* 🔥 SEARCH BAR STACK */
    .search-bar {
        flex-direction: column;
        border-radius: 12px;
    }

    .search-bar select,
    .search-bar input,
    .search-bar button {
        width: 100%;
        border-bottom: 1px solid #eee;
    }

    .search-bar button {
        border-bottom: none;
    }

    /* 🔥 PREVENT HORIZONTAL SCROLL */
    html, body {
        width: 100%;
        overflow-x: hidden;
    }

}

