
/* ==========================================
   GENERAL
========================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fa;
}

.apex-search-section {
    width: 100%;
    padding: 45px 15px;
    background: #fff;
}

.apex-search-container {
    width: 100%;
    max-width: 1200px;
    margin: auto;
}


/* ==========================================
   TITLE
========================================== */

.apex-search-title {
    text-align: center;
    margin-bottom: 25px;
}

.apex-search-title h2 {
    margin: 0;
    color: #222;
    font-size: 32px;
}

.apex-search-title p {
    margin: 8px 0 0;
    color: #777;
    font-size: 15px;
}


/* ==========================================
   SALE / RENT TABS
========================================== */

.apex-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: -1px;
    position: relative;
    z-index: 2;
}

.apex-tab {
    border: none;
    padding: 13px 40px;
    background: #eef1f5;
    color: #555;
    font-weight: bold;
    cursor: pointer;
    font-size: 15px;
}

.apex-tab:first-child {
    border-radius: 8px 0 0 0;
}

.apex-tab:last-child {
    border-radius: 0 8px 0 0;
}

.apex-tab.active {
    background: #1e90ff;
    color: #fff;
}


/* ==========================================
   SEARCH BOX
========================================== */

.apex-search-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 12px 12px 12px;
    padding: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,.10);
}


/* ==========================================
   MAIN SEARCH FIELDS
========================================== */

.apex-main-search {
    display: grid;
    grid-template-columns: 1.7fr 1fr 1fr 1fr auto;
    gap: 8px;
}

.apex-field {
    border: 1px solid #ddd;
    border-radius: 7px;
    background: #fff;
    padding: 5px 10px;
}

.apex-field label {
    display: block;
    font-size: 10px;
    color: #777;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.apex-field input,
.apex-field select {
    width: 100%;
    height: 30px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #222;
}

.apex-field input::placeholder {
    color: #999;
}


/* ==========================================
   SEARCH BUTTON
========================================== */

.apex-search-button {
    min-width: 125px;
    border: none;
    border-radius: 7px;
    background: #1e90ff;
    color: white;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.apex-search-button:hover {
    background: #147bd1;
}


/* ==========================================
   ADVANCED FILTER HEADER
========================================== */

.apex-advanced-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.apex-advanced-title {
    font-size: 13px;
    font-weight: bold;
    color: #444;
}

.apex-advanced-toggle {
    border: none;
    background: none;
    color: #1e90ff;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
}

.apex-advanced-toggle:hover {
    text-decoration: underline;
}


/* ==========================================
   ADVANCED FILTER PANEL
========================================== */

.apex-advanced-panel {
    display: none;
    margin-top: 12px;
    padding: 15px;
    background: #f8fafc;
    border: 1px solid #e5e8ec;
    border-radius: 8px;
}

.apex-advanced-panel.show {
    display: block;
}

.apex-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}


/* ==========================================
   BROWSE CATEGORIES
========================================== */

.apex-category-section {
    margin-top: 40px;
}

.apex-category-title {
    text-align: center;
    margin-bottom: 20px;
}

.apex-category-title h3 {
    margin: 0;
    color: #222;
    font-size: 20px;
}


/* Desktop */

.apex-categories {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}

.apex-category {
    width: 85px;
    flex: 0 0 85px;
    text-align: center;
    text-decoration: none;
    color: #333;
    cursor: pointer;
    transition: .2s;
}

.apex-category:hover {
    transform: translateY(-4px);
}

.apex-category img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #e5f3ff;
    transition: .2s;
}

.apex-category.active img {
    border-color: #1e90ff;
    box-shadow: 0 0 0 3px rgba(30,144,255,.12);
}

.apex-category span {
    display: block;
    margin-top: 7px;
    font-size: 13px;
    font-weight: bold;
}


/* ==========================================
   MOBILE
========================================== */

@media(max-width:850px) {

    .apex-main-search {
        grid-template-columns: repeat(2, 1fr);
    }

    .apex-search-button {
        height: 48px;
    }

    .apex-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}


/* ==========================================
   MOBILE SEARCH
========================================== */

@media(max-width:600px) {

    .apex-search-section {
        padding: 30px 10px;
    }

    .apex-search-title h2 {
        font-size: 20px;
    }

    .apex-search-title p {
        font-size: 14px;
    }

    .apex-tab {
        flex: 1;
        padding: 12px 10px;
    }

    .apex-search-box {
        border-radius: 0 0 12px 12px;
        padding: 10px;
    }

    .apex-main-search {
        display: block;
    }

    .apex-field {
        margin-bottom: 8px;
    }

    .apex-field input,
    .apex-field select {
        height: 35px;
    }

    .apex-search-button {
        width: 100%;
        height: 48px;
        margin-top: 2px;
    }

    .apex-filter-grid {
        grid-template-columns: 1fr;
    }


    /* ======================================
       HORIZONTAL CATEGORY SCROLL
    ====================================== */

    .apex-categories {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 18px;

        padding: 5px 5px 15px;

        -webkit-overflow-scrolling: touch;

        scrollbar-width: none;
    }

    .apex-categories::-webkit-scrollbar {
        display: none;
    }

    .apex-category {
        flex: 0 0 75px;
        width: 75px;
    }

    .apex-category img {
        width: 62px;
        height: 62px;
    }

    .apex-category span {
        font-size: 12px;
    }

}


/* ==========================================
   VERY SMALL PHONES
========================================== */

@media(max-width:380px) {

    .apex-category {
        flex-basis: 70px;
    }

    .apex-category img {
        width: 57px;
        height: 57px;
    }

}