/* Réalisé par Dylan Borcard */
/* Version du 12.03.2026 */


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: url("../Images/hand.png") 16 16, auto;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #ffffff;
    min-width: 320px;
}

/* --- BANNIÈRE --- */
.bannière {
    height: auto;
    min-height: 40px;
    background: #000000;
    color: rgba(170, 160, 160, 0.57);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(11px, 2vw, 20px);
    padding: 8px 10px;
    text-align: center;
    line-height: 1.3;
}

/* --- BARRE DE NAVIGATION --- */
.barre-nav {
    height: 55px;
    background: #c5c5c5;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: clamp(6px, 3vw, 100px);
}

.boutons-nav {
    display: flex;
    flex-shrink: 0;
    gap: 3px;
}

.bouton-nav,
.btn-home-reload {
    width: 36px;
    height: 36px;
    background: #a0a0a0;
    border: 1px solid #787878;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #555;
    text-decoration: none;
}

.btn-home-reload {
    background: #efeeee;
}

.address-bar {
    flex: 1;
    min-width: 0;
    height: 40px;
    background: #ffffff;
    border: 3px solid #999;
    border-radius: 4px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    font-size: clamp(12px, 2vw, 20px);
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.close-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: #e8e8e8;
    border: 1px solid #999;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #555;
}

/* --- HEADER IMAGE --- */
header {
    background-image: url("../Images/redcar.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    height: clamp(160px, 28vw, 400px);
    width: 100%;
}

/* --- CONTENT SECTION --- */
.content-section {
    background: linear-gradient(to bottom, #2a0000, #1a0000);
    padding: clamp(20px, 4vw, 50px) clamp(15px, 5vw, 60px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #4a0000;
    padding-bottom: 15px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: clamp(22px, 5vw, 38px);
    color: #ffffff;
    font-weight: bold;
    letter-spacing: clamp(1px, 0.5vw, 4px);
}

.sort-button {
    background: #cc0000;
    color: #ffffff;
    border: none;
    padding: 12px clamp(15px, 3vw, 35px);
    font-size: clamp(11px, 1.5vw, 14px);
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    min-height: 44px;
    /* taille minimum tactile */
}

/* --- ADS SECTION --- */
.ads-section {
    padding: clamp(15px, 3vw, 30px) 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: clamp(12px, 3vw, 30px);
}

/* --- AD CARD --- */
.ad {
    background: #2a2a2a;
    border: 1px solid #555555;
    display: flex;
    flex-direction: column;
}

.ad-header {
    background: #e0e0e0;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #999;
}

.ad-title {
    font-size: clamp(9px, 1.2vw, 11px);
    color: #000000;
    font-weight: bold;
}

.user-icon {
    width: 18px;
    height: 18px;
    background: #cccccc;
    border-radius: 50%;
    border: 1px solid #999;
    flex-shrink: 0;
}

.ad-image {
    width: 100%;
    display: block;
    object-fit: cover;
}

.ad-footer {
    background: #000000;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.car-name {
    color: #ffffff;
    font-size: clamp(11px, 1.5vw, 13px);
    font-weight: bold;
    letter-spacing: 1px;
}

.car-price {
    color: #ffffff;
    font-size: clamp(12px, 1.5vw, 15px);
    font-weight: bold;
    padding: 5px 10px;
    background-color: #950000;
    min-width: 90px;
    font-family: Arial, sans-serif;
    text-align: center;
}

/* --- RESPONSIVE --- */

@media screen and (max-width: 900px) {
    .ads-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 600px) {
    .ads-section {
        grid-template-columns: 1fr;
        padding: 12px 0;
    }

    .content-section {
        padding: 12px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sort-button {
        width: 100%;
    }
}

@media screen and (max-width: 400px) {
    .boutons-nav .bouton-nav:nth-child(2) {
        display: none;
    }

    .bannière {
        font-size: 9px;
    }

    .ad-footer {
        flex-direction: row;
        align-items: center;
    }

    .car-price {
        width: auto;
    }
}