/* =========================================
   STYLES SPECIFIQUES A LA PAGE D'ACCUEIL
   ========================================= */

body {
    background-color: #f4f4f5; /* Fond gris clair classique LBC */
    margin: 0;
}

/* HEADER ACCUEIL */
.home-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo a {
    color: var(--primary);
    font-size: 28px;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -1px;
}

.btn-post-ad {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    white-space: nowrap;
    text-decoration: none;
}

.search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background-color: #f2f2f2;
    border-radius: 24px;
    padding: 4px 16px;
    height: 48px;
    transition: background-color 0.2s;
}

.search-bar:focus-within {
    background-color: #e6e6e6;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-dark);
}

.search-bar button {
    background: var(--primary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-bar button:hover {
    background-color: var(--primary-hover);
}

.user-nav {
    display: flex;
    align-items: flex-start; /* Icônes sur une même ligne de base */
    gap: 24px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap; /* "Mes recherches" sur une seule ligne, sinon l'item grandit et casse l'alignement */
    text-align: center;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item:hover {
    color: var(--primary);
}

/* NAV CATEGORIES */
.categories-nav {
    border-top: 1px solid var(--border-light);
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: auto;
}

.categories-nav ul {
    list-style: none;
    padding: 0 24px;
    margin: 0;
    display: flex;
    gap: 32px;
}

.categories-nav li a {
    display: block;
    padding: 16px 0;
    text-decoration: none;
    color: var(--text-neutral);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    position: relative;
}

.categories-nav li a:hover {
    color: var(--text-dark);
}

.categories-nav li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
    transform: scaleX(0);
    transition: transform 0.2s;
}

.categories-nav li a:hover::after {
    transform: scaleX(1);
}

/* MAIN CONTENT */
.home-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* HERO BANNER */
.hero-banner {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 16px;
    padding: 48px;
    text-align: center;
    margin-bottom: 48px;
}

.hero-banner h1 {
    font-size: 36px;
    font-weight: 800;
    color: #333;
    margin-bottom: 16px;
}

.hero-banner p {
    font-size: 18px;
    color: #555;
    margin-bottom: 32px;
}

.hero-banner .btn-primary {
    display: inline-block;
    width: auto;
    padding: 12px 32px;
    text-decoration: none;
}

/* ANNONCES GRID */
.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}

.ad-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.ad-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.ad-image {
    width: 100%;
    aspect-ratio: 1/1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-details {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ad-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
}

.ad-meta {
    font-size: 12px;
    color: var(--text-neutral);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Responsive fixes pour le header */
@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
    }
    .search-bar {
        order: 3;
        width: 100%;
        flex: 0 0 100%;
    }
    .user-nav {
        gap: 16px;
    }
    .nav-item span {
        display: none;
    }
    .btn-post-ad {
        padding: 8px;
    }
    .btn-post-ad span {
        display: none;
    }
}

/* EXPLORE CATEGORIES (Round Icons) */
.explore-categories {
    margin-bottom: 48px;
}

.explore-categories h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

.categories-scroll-wrapper {
    overflow-x: auto;
    padding-bottom: 16px;
    margin: 0 -24px; /* Permet le scroll jusqu'au bord sur mobile */
    padding: 0 24px 16px 24px;
}

.round-categories {
    display: flex;
    gap: 32px;
    min-width: max-content;
}

.round-category {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-dark);
}

.round-category:hover .icon-circle {
    transform: scale(1.05);
}

.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    transition: transform 0.2s;
}

.round-category span {
    font-size: 14px;
    font-weight: 600;
}

/* ADS ROW SCROLL (Horizontal Grid) */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.voir-plus {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.voir-plus:hover {
    text-decoration: underline;
}

.ads-row-wrapper {
    overflow-x: auto;
    padding-bottom: 24px;
    margin: 0 -24px;
    padding: 0 24px 24px 24px;
}

.ads-grid-row {
    display: flex;
    gap: 24px;
    min-width: max-content;
}

.ads-grid-row .ad-card {
    width: 250px; /* Largeur fixe pour les cartes en défilement horizontal */
    flex: 0 0 auto;
}

