@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- Reset & Core --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* removed overflow-y */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Universal Header --- */
.site-header {
    width: 100%;
    min-height: 0;
    height: auto;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 8px 0;
}

.header-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 50px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    min-height: 100%;
}

/* Mobile header: handled by ../style.css */

/* Logo size: ../style.css — mobile 92px → desktop max 200px */

/* Navigation */
.main-nav {
    display: flex;
    gap: 23px;
    align-items: flex-end;
    height: 50px;
    padding-bottom: 0;
}

.main-nav a {
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    color: #64748b;
    padding: 13px 0 3px 0;
    border-bottom: 3px solid transparent;
    transition: none !important;
}

.main-nav a:hover {
    color: #0f172a;
    border-bottom-color: #cbd5e1;
}

.active-link {
    color: #0f172a !important;
}

.nav-usedsale.active-link {
    border-bottom-color: #FCCE08 !important;
}

.nav-ads.active-link {
    border-bottom-color: #D92226 !important;
}

.nav-jobs.active-link {
    border-bottom-color: #008DD2 !important;
}

.nav-sms.active-link {
    border-bottom-color: #009846 !important;
}

.nav-post.active-link {
    border-bottom-color: #6A2F85 !important;
}

.nav-market.active-link {
    border-bottom-color: #E5097F !important;
}

.nav-edu.active-link {
    border-bottom-color: #0060AA !important;
}

.nav-movies.active-link {
    border-bottom-color: #EA5E20 !important;
}

.nav-videos.active-link {
    border-bottom-color: #393185 !important;
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
}

.nav-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: none !important;
}

.btn-login {
    background: #0f172a;
    color: white;
}

.btn-login:hover {
    background: #334155;
    transform: none !important;
}

/* --- sasworld Market Specifics --- */

.page-wrapper {
    padding: 20px 15px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

/* Filter bar font/padding/gap: ../style.css */
.classifieds-filter-bar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

/* Mobile filter layout: ../style.css + market overrides below */
@media (max-width: 599px) {
    .classifieds-filter-bar.no-brand-filter .search-filter-market {
        display: flex !important;
    }

    .classifieds-filter-bar .filter-item.category-filter {
        display: block !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }

    .classifieds-filter-bar .category-select-wrap > select,
    .classifieds-filter-bar .filter-item.category-filter select {
        display: none !important;
    }

    .classifieds-filter-bar .category-select-wrap > *:not(.cat-search-dropdown) {
        display: none !important;
    }

    .classifieds-filter-bar .cat-search-dropdown {
        display: block !important;
        width: 100% !important;
    }
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 32px;
    color: #1e293b;
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 40px;
    justify-content: center;
}

.product-card {
    height: 280px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.product-img {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: #cbd5e1;
    width: 100%;
    position: relative;
}

.product-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-desc {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 0px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-footer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.product-footer > *:nth-child(1) {
    justify-self: start;
}

.product-footer > *:nth-child(2) {
    justify-self: center;
}

.product-footer > *:nth-child(3) {
    justify-self: end;
}

.market-btn,
.price-btn,
.details-btn,
.cart-btn {
    height: 32px;
    width: 80px;
    line-height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.market-btn {
    padding: 0;
    text-align: center;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    color: white;
}

.price-btn {
    background-color: #e2e8f0;
    color: #0f172a;
    border: none;
    font-size: 11px;
    font-weight: 700;
    padding: 0;
    border-radius: 6px;
}

.details-btn {
    background-color: #0f172a;
    color: white;
    border: 1px solid #e2e8f0;
}

.cart-btn {
    background-color: #E5097F;
    color: white;
}

/* Footer */
.site-footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 32px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-top: auto;
}

/* --- Tablet View (600px–850px): grid only — filter widths in ../style.css --- */
@media (max-width: 850px) and (min-width: 600px) {
    .market-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile grid (768px-): handled in ../style.css */

.filter-item select option {
    padding: 0 10px;
}

.location-filter select {
    padding: 0 !important;
    background-image: none !important;
    text-align: left !important;
    text-align-last: left !important;
}
