/* Base de la page */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: #b29bdd;
    color: #333;
    font-family: 'Chewy', sans-serif;
}

/* Contenu principal */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    padding: clamp(1rem, 4vw, 2rem);
}

/* Introduction */
.contact {
    width: 100%;
    max-width: 700px;
    margin-inline: auto;
    text-align: center;
}

.contact h1 {
    margin: 0 0 1rem;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 600;
}

.contact p {
    margin: 0;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    line-height: 1.6;
}

/* Formulaire centré et responsive */
.formulaire {
    width: 100%;
    max-width: 600px;
    margin-inline: auto;
}

.formulaire form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    padding: clamp(1rem, 3vw, 1.5rem);
    background-color: #fffaf0;
    border-radius: 1rem;
    box-shadow: 0 4px 14px rgb(0 0 0 / 12%);
}

.champ {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
    margin: 0;
    
}

.champ > label,
.champ legend,
.consentement label {
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    line-height: 1.5;
}

.formulaire input:not([type="checkbox"]):not([type="radio"]),
.formulaire select,
.formulaire textarea {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0.7rem 0.8rem;
    border: 1px solid #b9aecb;
    border-radius: 0.5rem;
    background-color: #fff;
    color: #333;
    font: inherit;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.formulaire textarea {
    min-height: 150px;
    resize: vertical;
}



/* Groupes de cases à cocher et boutons radio */
fieldset.champ {
    padding: 0;
    border: 0;
}

.champ legend {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.choix-produits,
.choix-contact {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
}

.choix-produits legend,
.choix-contact legend {
    flex-basis: 100%;
}

.formulaire .option {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    cursor: pointer;
}

.formulaire input[type="checkbox"],
.formulaire input[type="radio"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    flex: 0 0 auto;
    accent-color: #8064b2;
}

/* Consentement */
.consentement {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.consentement input {
    margin-top: 0.35rem;
    flex: 0 0 auto;
}

/* Bouton d'envoi */
.bouton-envoyer {
    align-self: flex-start;
    padding: 0.75rem 1.5rem;
    border: 0;
    border-radius: 0.5rem;
    background-color: #8064b2;
    color: #fff;
    font: inherit;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    font-weight: 500;
    cursor: pointer;
}

.bouton-envoyer:hover {
    background-color: #6d529e;
}

.formulaire input:focus-visible,
.formulaire select:focus-visible,
.formulaire textarea:focus-visible,
.bouton-envoyer:focus-visible {
    outline: 3px solid #49336d;
    outline-offset: 2px;
}

/* Petits écrans */
@media (max-width: 480px) {
    main {
        gap: 1.5rem;
    }

    .formulaire form {
        gap: 0.85rem;
    }

    .bouton-envoyer {
        width: 100%;
    }
}

/* ========================================== */
/* SÉLECTION DES PRODUITS */
/* ========================================== */

.select-produits {
    position: relative;
    width: 100%;
}

.bouton-select-produits {
    width: 100%;

    padding: 12px 15px;

    border: 1px solid #d8c7e2;
    border-radius: 10px;

    background-color: #fffdf8;
    color: #6d527b;

    font-family: inherit;
    font-size: 1rem;

    text-align: left;
    cursor: pointer;
}


/* ========================================== */
/* MENU DÉROULANT */
/* ========================================== */

.menu-produits {
    position: absolute;

    top: calc(100% + 5px);
    left: 0;

    width: 100%;
    max-height: 320px;

    padding: 12px;

    background-color: #fffdf8;

    border: 1px solid #d8c7e2;
    border-radius: 12px;

    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);

    z-index: 100;

    box-sizing: border-box;
}

.menu-produits[hidden] {
    display: none;
}


/* ========================================== */
/* BARRE DE RECHERCHE */
/* ========================================== */

#recherche-produits {
    width: 100%;

    padding: 10px;

    margin-bottom: 10px;

    border: 1px solid #d8c7e2;
    border-radius: 8px;

    background-color: white;

    font-family: inherit;
    font-size: 1rem;

    box-sizing: border-box;
}


/* ========================================== */
/* LISTE DES PRODUITS */
/* ========================================== */

.liste-produits {
    display: flex;
    flex-direction: column;

    gap: 5px;

    max-height: 230px;

    overflow-y: auto;
}

.option-produit {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 10px;

    border-radius: 8px;

    cursor: pointer;
}

.option-produit:hover {
    background-color: #f0e5f5;
}

.option-produit input {
    width: 18px;
    height: 18px;

    flex-shrink: 0;

    accent-color: #a986c0;
}

.option-produit span {
    color: #6d527b;

    font-size: 1rem;
}


/* ========================================== */
/* PRODUITS SÉLECTIONNÉS */
/* ========================================== */

.produits-selectionnes {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 12px;
}

.etiquette-produit {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    padding: 7px 12px;

    background-color: #eadcf2;

    border-radius: 20px;

    color: #6d527b;

    font-size: 0.9rem;
}

.etiquette-produit button {
    border: none;

    background: transparent;

    color: #6d527b;

    font-size: 1.2rem;
    font-weight: bold;

    cursor: pointer;
}


/* ========================================== */
/* RESPONSIVE */
/* ========================================== */

@media (max-width: 600px) {

    .menu-produits {
        max-height: 280px;
    }

    .liste-produits {
        max-height: 190px;
    }

    .etiquette-produit {
        font-size: 0.85rem;
    }

}