@font-face {
    font-family: Gotham-bold;
    src: url(../assets/fonts/Gotham_Bold.otf);
}

@font-face {
    font-family: Gotham-medium;
    src: url(../assets/fonts/Gotham_Medium.otf);
}

@font-face {
    font-family: Roboto-regular;
    src: url(../assets/fonts/Roboto_Regular.ttf);
}

:root {
    --button-color: #FDCED9;
    --button-color-hover: #FAA2DF;
    --box-background-color: white;
    --text-color: black;
}

h1 {
    font-size: 2.25rem;
    font-family: Gotham-bold;
}

h3 {
    font-size: 1.25rem;
}

p {
    font-size: 1rem;
}

h1 + div {
    border : 1px solid black;
    margin-bottom: 10px;
}

body {
    background-color: #FFFFFA;
}
main {
    /* margin-left: 8%;
    margin-right: 8%; */
    width: 345px;
    margin: auto;
    margin-bottom: 75px;
}



.soft-shadow {
    box-shadow: 4px 4px 4px rgba(0, 0, 0,0.25);
    border-radius: 10px;
}

.soft-border {
    border: 1px solid black;
    border-radius: 10px;
}

.small-button {
    background-color: var(--button-color);
    height: 34px;
    width: 116px;
}

.small-button:hover, .large-button:hover {
    background-color: var(--button-color-hover);
}

.small-button:active, .large-button:active {
    box-shadow: none;
}

.large-button {
    background-color: var(--button-color);
    height: 40px;
    width: 190px;
    display: block;
}

.amount-button:hover {
    background-color: gainsboro;
}

.result-product {
    display: flex;
    flex-direction: column;

    & > div:nth-of-type(3) {
        display: flex;
        justify-content: end;
        margin-top: 20px;
        & > p{
            margin-right: 20px;
        }
    }

    & input {
        flex: 1;
        min-width: 0;
        font: inherit;
        height: 90%;
        border-radius: 10px;
        border: none;
        text-align: right;
    }

    & input:focus {
        outline: none;
    }

    & .grams-box {
        display: flex;
        flex-direction: row;
    }

}

.name-img-flex {
    display: flex;
    text-align: center;

    & img {
        width: 120px;
        height: 120px;
        object-fit: cover;
        border-radius: 10px;
        border: 1px solid black;
    }

    & > h3 {
        margin-block-start: 0em; /*Ordre*/
        margin-left: 10px;
        margin-top: 10px;
    }
}

#search-results {
    margin:auto;
    margin-top: 32px;
    max-height: 500px;
    overflow-y: scroll; /*TODO: Rendre toujours visible*/
    padding: 15px;

    & + button {
        margin-top: 20px;
        justify-self: right;
    }
}

h2 {
    margin: 0px;
}

.content-box {
    background-color: var(--box-background-color);
}

.text-number {
    display: flex;
    align-items: center;
    margin-top: 20px;
    & > p:first-of-type {
        margin-right: 10px;
    }
}

.number-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    justify-self: center;
    align-self: center;
    margin: 0;
    height: 50px;
    width: 80px;
    & p {
        margin: 0;
    }
}



header {
    background-color: #9FC48E;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    margin: 0;
    & .mobile-logo {  
        display: block;
        margin: auto;
        margin-top: 10px;
        margin-bottom: 10px;
        width: 150px;
        grid-column: 2;
    }
    & > div:not(#burger-menu) {
        justify-self: flex-end;
        grid-column: 3;
    }
    & :nth-child(n) {
        align-self: center;
    }
    & .header-icon-left {
        margin-left: 15px;
    }
    & .header-icon-right {
        margin-right: 15px;
    }

    & .desktop-nav {
        grid-row: 2;
        grid-column: 1 /span 3;
        margin: auto;
        & ul {
            display: flex;
            gap: 15px;
            list-style: none;
            & a {
                text-decoration: none;
                color: black;
            }
        }
    }
}

#burger-menu {
    display: block;
    margin-left: 15px;
    position: fixed;
    top: 40px;
    & nav {
        display: none;
    }
    & ul {
        margin-top: 0;
        border: 1px solid black;
        border-radius: 10px;
        padding: 5px;
        list-style: none;
        background-color: #FFFFFA;
        & li {
            margin: 0;
            border-bottom: 1px solid black;
            margin-top: 10px;
            padding-bottom: 10px;
        }

        & a {
            color: var(--text-color);
            text-decoration: none;
        }

        & a:last-of-type > li {
            border-bottom: none;
        }
    }

    & button {
        cursor: pointer;
        border: none;
        background-color: transparent;
    }
}


footer {
    background-color: #9FC48E;
    display: grid;
    grid-template-rows: 1fr 1fr;
    & .mobile-logo {
        display: block;
        margin: auto;
        margin-top: 10px;
        margin-bottom: 10px;
        width: 150px;
    }

    & nav ul {
        list-style: none;
        display: grid;
        grid-template-columns: 1fr 1fr;
        margin: 0;
        padding-inline-start: 0px;
        & div:nth-of-type(1) { /*nth et pas first pour scalabilité*/
            margin-left: 15px;
        }
        & div:nth-of-type(2) {
            justify-self: flex-end;
            text-align: end;
            margin-right : 15px;
        }

        & li {
            margin-bottom: 5px;
        }

    }

    & a {
        text-decoration: none;
        color: black;
    }

}

body {
    background-color: #FFFFFA;
    margin: 0;
    font-family: Roboto-regular;
}


form {
    display : grid;
    grid-template-columns: 3;
    grid-template-rows: 2;
    margin: auto;
    gap: 20px;
    margin-top: 20px;
}



form button[type="submit"] {
    grid-column: 1;
}

form button[type = "reset"] {
    grid-column: 3;
    justify-self: end;
}

#pending-food-box {
    margin:auto;
    margin-top: 50px;
    padding: 15px;
    padding-bottom: 20px;
}

.pending-food-item {
    display: flex;
    flex-direction: column;
        & input {
        flex: 1;
        min-width: 0;
        font: inherit;
        height: 90%;
        border-radius: 10px;
        border: none;
        text-align: right;
    }

    & input:focus {
        outline: none;
    }

    & .grams-box {
        display: flex;
        flex-direction: row;
    }
}

.item-infos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-left: 25px;
    margin-right: 25px;
}

.icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.header-icon {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.text-button-flex {
    display: flex;
    justify-content: space-evenly;
    align-content: center;
    & > img {
        align-self: center;
    }

    & > div {
        display: flex;
        gap: 10px;
        margin-right: 10px;
    }
}

.amount-button {
    background-color: white;
    border: 1px solid black;
    border-radius: 100%;
    height: 25px;
    width: 25px;
    align-self: center;
}

.item-infos-grid-element {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.box-bar {
    width: 95%;
    text-align: center;
    height: 1px;
    color: black;
    background-color: black;
}

hr {
    width: 100%;
    margin-bottom: 15px;
    
}

.pending-food-box-buttons {
    display: flex;
    margin: auto;
    flex-direction: column;
    gap: 30px;
    width: 90%;
    margin-top: 20px;
    & > div {
        justify-self: center;
        display: flex;
        justify-content: space-between;
        width: 100%;
    }
    & > button {
        justify-self: center;
        width: 100%;
    }

}

.summary-box {
    padding: 10px;
    margin-top: 50px;
    & > h2 {
        margin: 0;
    }
}

#search-bar {
    display: flex;
    border: 1px solid black;
    border-radius: 250px;
    grid-column: 1/span 3;
    background-color: var(--box-background-color);
    &>input {
        border: none;
        background-color: var(--box-background-color);
        padding: 5px;
        margin: 5px;
        width: 100%;
        border-radius: 25px;

    }

    &>input:focus {
        border:none; /*Vérifier l'utilité sur autres navigateurs, pas nécessaire sur Chrome*/
        outline: none;
    }

    &>div {
        justify-self: center;
        align-self: center;
        margin-left: 10px;
    }
}



input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active{ /*webkit = outil utilisé par chrome pour l'auto-complétion notamment*/
    -webkit-background-clip: text;
    -webkit-text-fill-color: black;
    transition: background-color 5000s ease-in-out 0s;
    box-shadow: inset 0 0 20px 20px var(--box-background-color);
}

.mobile-hidden-flex {
    display: none;
}

.result-nutri {
    display: flex;
    gap: 20px ;
}

.desktop-nav {
    flex-direction: row;
}

@media screen and (max-width: 768px) { /*Breakpoint Tablette*/
    
}

@media screen and (min-width: 1024px) { /*Desktop Breakpoint*/
    main {
        width: 700px;
        
    & h1 {
        transform: translateX(-25%);
        margin-bottom: 85px;
        margin-top: 75px;
    }

    }

    main > hr:first-of-type {
        display: none;
    }
    #search-bar {
        height: 50px;
    }

    #menu-toggle {
        display: none;
    }

    
    header {
        & .mobile-logo {
            display: none;
        }
    }

    .header-icon {
        height: 50px;
        width: 50px;
    }

    footer {
        & nav {
            height: 10px;
        }
        & div:first-of-type {
            padding-left: 50%;
        }

        & div:nth-of-type(2) {
                padding-right: 50%;
        }
    }

    .small-button {
        width: px;
        height: 40px;
        font-size: 1rem;
        }

    .large-button {
        font-size: 1rem;
    }
    
    .mobile-hidden-flex {
        display: flex;
    }

    .item-infos-grid {
        display: flex;
        gap: 10px;
    }

    .item-infos-grid-element {
        width: 90px;
    }

    p {
        height: 16px;
    }
}



/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}



.item-infos-grid-element {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.item-infos-grid-element > h3,
.item-infos-grid-element > p:first-child {
    min-height: 40px;      /* ajuste selon ta taille de police (assez pour 2 lignes) */
    display: flex;
    align-items: flex-end;  /* le texte se colle en bas du label, juste au-dessus de la box */
    justify-content: center;
    margin: 0;
    margin-top: 15px;
}