html, body{
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #e1e2e1;
    font-family: 'Roboto Mono';
    min-width: 320px;
}

header{
    height: 64px;
    background-color: #ffeb3b;
    font-size: 24px;
    line-height: 64px;
    padding-left: 16px;
    display: flex;
}

.title{
    flex: 3;
}

.title-btn{
    text-decoration: none;
    padding: 0 16px;
    background-color: tomato;
    color: white;
}

main{
    padding-top: 32px;
    display: grid;
    grid-template: repeat(auto-fit, minmax(400px, 1fr)) / repeat(auto-fit, minmax(400px, 1fr));
    grid-gap: 2em;
    grid-auto-flow: row;
    justify-items: center;
    align-items: center;
    /* min-height: calc(100vh - 64px); */
}

.card{
    background-color: white;
    width: 400px;
    min-height: 400px;
    border-radius: 2px;
    box-shadow: 1px 1px 10px grey;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
}

.card-header{
    height: 64px;
    display: flex;
    align-items: center;
}

.card-header-title{
    background-color: #8c0032;
    color: white;
    font-size: large;
    padding: 8px;
    min-height: 48px;
    flex: 1;
    display: flex;
    align-items: center;
}

.card-header-badge{
    font-size: small;
    background-color: #fa5788;
    color: black;
    display: inline-block;
    padding: 4px;
}

.card-body{
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-body-item{
    font-size: small;
    padding: 0 8px;
    display: flex;
    align-items: center;
    min-height: 64px;
}

.card-body-item-text{
    font-size: medium;
}

.card-footer{
    height: 64px;
    display: flex;
    justify-content: flex-end;
    padding-right: 8px;
}

.btn{
    border: 0;
    padding: 12px;
    font-size: medium;
    border-radius: 2px;
    cursor: pointer;
}

#product{
    flex: 1;
}

#refresh{
    visibility: hidden;
    align-self: center;
}

#buying-price{
    display: inline-block;
    font-size: x-large;
    flex:1;
}

#selling-price{
    display: inline-block;
    font-size: x-large;
    flex:1;
}

#toast {
    visibility: hidden;
    max-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 2px;
    padding: 16px;
    position: fixed;
    z-index: 1;
    margin-left: auto;
    margin-right: auto;
    left: 5%;
    right: 5%;
    bottom: 30px;
}

#toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
}

@keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: -30px; opacity: 0;}
}

@media (max-width:400px){
    header{
        font-size: 12px;
    }
    .card{
        width: 280px;
        min-height: 280px;
    }
    main{
        grid-template: repeat(auto-fit, minmax(280px, 1fr)) / repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (min-width:401px) and (max-width:800px){
    header{
        font-size: 16px;
    }
    .card{
        width: 350px;
        min-height: 350px;
    }
    main{
        grid-template: repeat(auto-fit, minmax(350px, 1fr)) / repeat(auto-fit, minmax(350px, 1fr));
    }
}