   * {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #f5f5f5;
    color: #222;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1180px, 94%);
    margin: auto;
}

/*
|--------------------------------------------------------------------------
| HEADER
|--------------------------------------------------------------------------
*/

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: #111;
}

.logo img {
    display: block;
    width: 145px;
    height: auto;
    max-height: 48px;
    object-fit: contain;
}

.logo span {
    color: #f4511e;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-nav a {
    font-weight: 600;
}

.nav-sell {
    background: #f4511e;
    color: white !important;
    padding: 11px 18px;
    border-radius: 6px;
}

/*
|--------------------------------------------------------------------------
| HERO
|--------------------------------------------------------------------------
*/

.hero {
    background:
        linear-gradient(
            rgba(20, 20, 20, .65),
            rgba(20, 20, 20, .65)
        ),
        linear-gradient(135deg, #333, #777);

    padding: 70px 20px;
    color: white;
    text-align: center;
}

.hero h1 {
    font-size: 42px;
    margin: 0 0 12px;
}

.hero p {
    font-size: 18px;
    margin-bottom: 30px;
}

.search-box {
    background: white;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    max-width: 950px;
    margin: auto;
    gap: 8px;
}

.search-box input,
.search-box select {
    border: 0;
    padding: 15px;
    outline: none;
    background: white;
}

.search-box input {
    flex: 1;
}

.search-box select {
    min-width: 180px;
}

.search-button {
    background: #f4511e;
    border: none;
    color: white;
    padding: 0 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/*
|--------------------------------------------------------------------------
| SECTIONS
|--------------------------------------------------------------------------
*/

.section {
    padding: 40px 0;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title h2 {
    margin: 0;
}

/*
|--------------------------------------------------------------------------
| CATEGORY GRID
|--------------------------------------------------------------------------
*/

.category-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(160px, 1fr));

    gap: 15px;
}

.category-card {
    background: white;
    padding: 20px 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e5e5e5;
    transition: .2s;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,.08);
}

.category-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

/*
|--------------------------------------------------------------------------
| ADS GRID
|--------------------------------------------------------------------------
*/

.ads-grid {
    display: grid;
    grid-template-columns:
        repeat(4, 1fr);

    gap: 18px;
}

.ad-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e4e4e4;
    transition: .2s;
}

.ad-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
}

.ad-image {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
    background: #eee;
}

.ad-body {
    padding: 15px;
}

.ad-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ad-price {
    color: #f4511e;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.ad-location {
    color: #777;
    font-size: 13px;
}

/*
|--------------------------------------------------------------------------
| FORMS
|--------------------------------------------------------------------------
*/

.form-wrapper {
    max-width: 600px;
    margin: 50px auto;
}

.form-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #ddd;
}

.form-card h1 {
    margin-top: 0;
}

.social-login {
    display: grid;
    gap: 10px;
    margin: 24px 0;
}

.social-btn {
    display: block;
    padding: 13px 18px;
    border: 1px solid #ccc;
    border-radius: 6px;
    text-align: center;
    font-weight: 700;
    transition: background .2s, border-color .2s;
}

.social-btn-google {
    color: #333;
    background: #fff;
}

.social-btn-google:hover {
    background: #f7f7f7;
    border-color: #999;
}

.social-btn-facebook {
    color: #fff;
    background: #1877f2;
    border-color: #1877f2;
}

.social-btn-facebook:hover {
    background: #166fe5;
    border-color: #166fe5;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: #777;
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    height: 1px;
    flex: 1;
    background: #ddd;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 13px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.btn {
    display: inline-block;
    background: #f4511e;
    color: white;
    border: 0;
    padding: 13px 22px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.btn-secondary {
    background: #333;
}

/*
|--------------------------------------------------------------------------
| ALERTS
|--------------------------------------------------------------------------
*/

.alert {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
}

.alert.success {
    background: #e7f7e7;
    color: #176b17;
}

.alert.error {
    background: #ffe8e8;
    color: #a40000;
}

/*
|--------------------------------------------------------------------------
| AD DETAILS
|--------------------------------------------------------------------------
*/

.ad-detail {
    padding: 40px 0;
}

.ad-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.gallery,
.seller-card,
.description-card {
    background: white;
    border-radius: 10px;
    border: 1px solid #ddd;
}

.gallery {
    padding: 15px;
}

.main-ad-image {
    width: 100%;
    height: 500px;
    object-fit: contain;
    background: #f2f2f2;
    border-radius: 8px;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.thumbnail-grid img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: 5px;
}

.seller-card {
    padding: 25px;
}

.description-card {
    padding: 25px;
    margin-top: 20px;
}

.contact-btn {
    display: block;
    text-align: center;
    margin-top: 10px;
}

/*
|--------------------------------------------------------------------------
| MY ADS
|--------------------------------------------------------------------------
*/

.status {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 4px;
    background: #eee;
    font-size: 12px;
    margin-top: 8px;
}

/*
|--------------------------------------------------------------------------
| FOOTER
|--------------------------------------------------------------------------
*/

.site-footer {
    background: #222;
    color: white;
    margin-top: 50px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    padding: 35px 0;
}

.footer-inner a {
    display: block;
    margin-bottom: 10px;
}

.footer-bottom {
    text-align: center;
    padding: 15px;
    border-top: 1px solid #444;
    color: #bbb;
}

/*
|--------------------------------------------------------------------------
| MOBILE
|--------------------------------------------------------------------------
*/

@media (max-width: 900px) {

    .ads-grid {
        grid-template-columns:
            repeat(3, 1fr);
    }

    .ad-detail-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 650px) {

    .logo img {
        width: 130px;
        max-height: 42px;
    }

    .header-inner {
        flex-direction: column;
        padding: 15px 0;
    }

    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero {
        padding: 45px 15px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box select,
    .search-button {
        width: 100%;
        min-height: 48px;
    }

    .ads-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .main-ad-image {
        height: 350px;
    }

    .thumbnail-grid {
        grid-template-columns:
            repeat(4, 1fr);
    }

    .footer-inner {
        flex-direction: column;
    }

}

@media (max-width: 420px) {

    .ads-grid {
        grid-template-columns: 1fr;
    }

}