* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /*includes padding and border in elements total width and height so it does not appear bigger than you set it.*/
}

html, body {
    height: 100%;
    font-family: "Montserrat", sans-serif;
    overflow-x: hidden;
}

.oeecalculator-content-container {
    height: 100%;
    background-color: rgb(26, 60, 105);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

.oeecalculator-content {
    padding: 30px;
    background-color: white;
}

.oeecalculator-titlebar {
    position: relative;
    margin: 20px 15px 40px;
    line-height: 60px;
}

.oeecalculator-titlebar-title {
    text-align: center;
}

.oeecalculator-titlebar-logo {
    position: absolute;
    right: 20px;
    top: 0;
    height: 60px;
}

.oeecalculator-grid-container {
    display: grid;
    grid-gap: 20px 20px;
    grid-template-columns: repeat(3, 500px);
    grid-template-rows: repeat(3, 200px);
}

.oeecalculator-grid-item {
    background: linear-gradient(to bottom, #1a3c69 18%, #eee 0%);
    border: 1px solid rgba(183, 183, 183, 0.8);
    padding: 10px;
    font-size: 30px;
    width: 100%;
    min-width: 500px;
    margin: 0 auto; /* Makes sure it's centered horizontal when the screen is so small that there is only  1 grid-item per row*/
}

.oeecalculator-grid-item h6 {
    text-align: center;
    margin-top: 2px;
    color: #fff;
    font-size: 16px;
}

.oeecalculator-grid-item-content {
    display: flex;
    margin-top: 15px;
}

.oeecalculator-grid-item-content img {
    flex: 4;
    float: left;
}

.oeecalculator-grid-item-textblock {
    flex: 8;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 12px;
}

.oeecalculator-grid-item-textblock p {
    font-size: 14px;
}

.oeecalculator-grid-item-textblock-quantity {
    display: flex;
}

.oeecalculator-grid-item-textblock-quantity input {
    width: 80px;
    font-size: 14px;
    padding-left: 5px;
}

.oeecalculator-grid-item-textblock-quantity p {
    /*position:absolute;*/
    line-height: 24px;
    padding-left: 10px;
}

.oeecalculator-grid-item-final {
    grid-column: 2 / span 2;
    margin: auto;
}

.oeecalculator-grid-item-final-content {
    position: relative;
    height: 220px;
}

.oeecalculator-grid-item-final img {
    height: 100%;
    max-height: 180px;
}

.oeecalculator-grid-item-final-values {
    display: flex;
    margin-top: -10px;
}

.oeecalculator-grid-item-final-values p {
    text-align: center;
    cursor: default;
    font-size: 20px;
    flex: 3;
    padding-left: 16px;      /* To get the actual value centered without the unit */
    font-weight: bold;
}

.oeecalculator-titlebar button {
    position: absolute;
    top: 10px;
    left: 0;
    font-size: 14px;
    padding: 10px;
    cursor: pointer;
    width: 90px;
    border: 1px solid #c6c6c6;
    transition-duration: 0.4s;
    background-color: #1a3c69;
    color: white;
    outline: none;
    box-shadow: none;
}

.oeecalculator-titlebar button:hover {
    background-color: #309d5c;
    color: white;
}

#resetButton {
    left: 94px;
}

/* when screen width is less than 1540 px... use this */
@media screen and (max-width: 1540px) {
    .oeecalculator-content-container {
        height: unset;
    }

    .oeecalculator-content {
        height: 100%;
        margin: 40px;
    }

    .oeecalculator-grid-container {
        grid-template-columns: repeat(2, 500px);
    }

    .oeecalculator-grid-item-final {
        grid-column: 1 / span 2;
    }
}

@media screen and (max-width: 1024px) {
    .oeecalculator-content {
        width: 100%;
    }

    .oeecalculator-titlebar h1 {
        margin-top: 50px;
        padding: 60px;
        font-size: 40px;
    }

    .oeecalculator-grid-container {
        display: flex;
        flex-direction: column;
        grid-gap:0;   /* because display is flex now, the grid gap is done by margin-bottom on every grid-item (grid-gap does not work with flex on browsers like Safari) */
    }

    .oeecalculator-grid-item {
        margin-bottom:25px;
    }

    .oeecalculator-grid-item h6 {
        font-size: 26px;
    }

    .oeecalculator-grid-item-final {
        grid-column: 1 / span 1;
    }
    .oeecalculator-grid-item-textblock p {
        font-size: 30px;
    }
    .oeecalculator-grid-item-final-values p {
        font-size: 30px;
        padding-left: 28px;      /* To get the actual value centered without the unit */
    }

    .oeecalculator-grid-item-textblock input {
        width: 120px;
        font-size: 30px;
        padding-left:8px;
        padding-top:2px;
    }

    .oeecalculator-grid-item-textblock-quantity p {
        line-height: 40px;
    }

    .oeecalculator-grid-item-content img {
        /*max-height: 220px;*/
        margin-top: 40px;
        margin-bottom: 40px;
    }

    .oeecalculator-grid-item-final-content {
        height: unset;
        width: 100%;
    }

    .oeecalculator-grid-item-final img {
        width: 100%;
    }

    .oeecalculator-titlebar {
        margin: 0;
    }

    .oeecalculator-titlebar button {
        top: -50px;
        font-size: 24px;
        width: 140px;
        height: 60px;
    }

    #resetButton {
        left: 145px;
    }

    .oeecalculator-titlebar-logo {
        top: -50px;
    }
}
