body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #e0e0e0;
}

/* Image en haut à gauche */
.logo {
    align-self: flex-start;
    margin-left: 20px;
    margin-bottom: 20px;
    width: 250px;
    padding-top: 10px; /* ↑ barre de recherche plus bas */

}

/* Tableau */
table {
    border-collapse: collapse;
    width: 95%;
    max-width: 1200px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.table-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

th, td {
    padding: 12px;
    border: 1px solid #ccc;
}

th {
    background-color: #1fac42;
    color: white;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Conteneur de recherche */
.search-container {
    position: relative;
    width: 400px;
    max-width: 90%;
    margin-top: 40px; /* ↓ plus bas dans la page */
}

/* Barre */
.search-bar {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Suggestions */
.suggestions {
    width: 100%;
    display: none;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    border: 1px solid #ccc;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
}

.suggestion-item:hover {
    background-color: #f0f0f0;
}

/* BOUTON POPULAIRE en bas de l'écran */
.popular-button {
    position: fixed;
    bottom: 40px; /* même marge que la barre avec le haut */
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    background-color: #1fac42;
    color: white;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background-color 0.3s;
}
#productTable {
    margin-top: 40px; /* espace entre la barre de recherche et le tableau */
    width: 100%;
    display: flex;
    justify-content: center;
}

.popular-button:hover {
    background-color: #159335;
}
/* Conteneur de recherche + bouton */
.search-container {
    position: relative;
    width: 400px;
    max-width: 90%;
    margin-top: 40px;
    display: flex;
    gap: 10px; /* espace entre la barre et le bouton */
}

/* Bouton Rechercher */
.search-btn {
    padding: 10px 18px;
    background-color: #1fac42;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
}

.search-btn:hover {
    background-color: #159335;
}

/* Bouton Retour */
.back-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    display: none;
    transition: 0.2s;
}

.back-btn:hover {
    background-color: #222;
}

/* Mobile */
@media (max-width: 600px) {
    .search-container {
        flex-direction: column;
        gap: 10px;
    }

    .search-btn {
        width: 100%;
        font-size: 18px;
        padding: 15px;
    }

    .back-btn {
        width: 100%;
        font-size: 18px;
        padding: 15px;
    }
}

/* === Mobile large (≤ 768px : iPhone 14 Pro Max, Samsung S21 en paysage, etc.) === */
@media (max-width: 768px) {

    .logo {
        width: 180px;
        margin: 10px auto;
    }

    .search-container {
        width: 90%;
    }

    .search-bar {
        font-size: 18px;
        padding: 12px;
    }

    table {
        width: 95%;
        font-size: 16px;
    }

    .popular-button {
        width: 80%;
        bottom: 30px;
        font-size: 18px;
        padding: 15px;
    }
}


/* === Mobile standard (≤ 600px : la majorité des téléphones) === */
@media (max-width: 600px) {

    .logo {
        width: 140px;
    }

    .search-container {
        width: 95%;
    }

    .search-bar {
        font-size: 17px;
        padding: 10px;
    }

    table {
        width: 100%;
        font-size: 15px;
    }

    .popular-button {
        width: 90%;
        font-size: 18px;
        padding: 18px;
    }

    button, 
    input[type="submit"], 
    input[type="button"] {
        width: 90%;
        padding: 15px;
        font-size: 18px;
    }
}


/* === Petits téléphones (≤ 480px : anciens iPhone, petits Samsung) === */
@media (max-width: 480px) {

    .logo {
        width: 120px;
    }

    .search-container {
        width: 100%;
    }

    .search-bar {
        width: 100%;
        font-size: 16px;
        padding: 10px;
    }

    table {
        font-size: 14px;
        width: 100%;
    }

    th, td {
        padding: 8px;
    }

    .popular-button {
        width: 95%;
        bottom: 20px;
        font-size: 17px;
        padding: 15px;
    }

    .captcha-container {
        width: 95%;
        padding: 12px;
    }
}
