html, body {
    width: 100%;
    margin: 0;
    overflow-x: hidden;
}

body {
    background-color: #e7edf1;
}

html.no-scroll, body.no-scroll {
    height: 100dvh;
    overscroll-behavior-y: none;
}

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    font-family: "Helvetica", Arial, Geneva, sans-serif;
}

#body-container {
    height: 100%;
    width: 100%;
}

#wrapper {
    position: relative;
    padding-top: 100px;
    height: calc(100% - 100px);
    width: 100%;
    right: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: right .5s;
}

#wrapper.no-scroll {
    overflow: hidden;
}

#wrapper.in-screen {
    right: 0;
}

.display-none {
    display: none;
}

.error {
    background-color: red;
    color: #fff;
}

#logo {
    display: none;
    margin-top: 30px;
}

/*Mobile menu*/

#mobile-header {
    position: fixed;
    height: 100px;
    width: 100%;
    background-color: #e7edf1;
    z-index: 10;
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

#mobile-header-logo {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    margin-left: calc(15px - 3px);
}

#mobile-header-logo a {
    display: block;
    height: calc(100% - 15px);
}

#mobile-header-logo a img {
    height: 100%;
}

#mobile-header-btn {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
    height: 26px;
    width: 31px;
    top: 37px;
    right: 25px;
    cursor: pointer;
    border: none;
    background: none;
    background-color: #e7edf1;
    -webkit-tap-highlight-color: transparent;
}

#mobile-header-btn span {
    display: block;
    height: 5px;
    width: 100%;
    background: #000;
    border-radius: 2.5px;
    transition: all 0.4s ease;
}

#mobile-header-btn.active span:nth-child(1) {
    transform: translateY(10.625px) rotate(45deg);
}

#mobile-header-btn.active span:nth-child(2) {
    opacity: 0;
}

#mobile-header-btn.active span:nth-child(3) {
    transform: translateY(-10.625px) rotate(-45deg);
}

#mobile-kalk-btns {
    position: fixed;
    top: 100px;
    left: 20%;
    z-index: 9;
    height: calc(100dvh - 100px);
    width: 80%;
    flex-direction: column;
    background-color: #1a3f85;
    border-left: 2px solid #000;
    transition: left 0.5s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.4) transparent;
}

#mobile-kalk-btns::-webkit-scrollbar {
    width: 8px;
}

#mobile-kalk-btns::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,.4);
    border-radius: 8px;
}

#mobile-kalk-btns.out-of-screen {
    position: fixed;
    left: 100%;
}

.kalk-btn-m {
    display: flex;
    align-items: center;
    justify-content: start;
    padding: 10px 20px;
    background-color: rgb(24, 56, 131);
    color: #fff;
    
    vertical-align: middle;
    text-align: start;
    cursor: pointer;
    min-height: 50px;
    border-top: 2px solid #081A3A;
    transition: all 0.3s;
}

.kalk-btn-m:nth-last-child(1) {
    border-bottom: 2px solid #081A3A;
}

.kalk-btn-m:hover {
    background-color: rgb(36, 78, 180);
    color: #f9f9f9;
}

.selected-m {
    background-color: #10B981;
}

.selected-m:hover {
    background-color: #28C08E;
}

/*Izbor kalkulatora*/

#kalk-btns {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(385px, 1fr));
    gap: 20px;
    width: 90%;
    margin: 20px 0;
    place-items: center;
}

.kalk-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 7px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    background-color: rgb(24, 56, 131);
    color: #fff;
    
    vertical-align: middle;
    text-align: center;
    cursor: pointer;
    min-height: 50px;
    transition: all 0.3s;
}

.kalk-btn:hover {
    background-color: rgb(36, 78, 180);
    color: #f9f9f9;
    box-shadow: 0 6px 10px rgba(0,0,0,0.4);
    transform: translateY(-2px);
}

.selected {
    background-color: #10B981;
}

.selected:hover {
    background-color: #28C08E;
    color: #f9f9f9;
    box-shadow: none;
    transform: none;
}

/*Kalkulatori*/

.kalks-container {
    width: 100%;
}

.kalk-wrapper {
    width: calc(100% - 18px);
    padding: 30px 8px 30px 10px;
    background-color: #fff;
    margin-bottom: 100px;
}

.kalk-wrapper h3 {
    margin-top: 0;
    text-align: center;
    
}

table {
    width: 100%;
    margin-top: 30px;
    border-collapse: collapse;
    
}

tr {
    position: relative;
    height: 55px;
    border-bottom: 1px solid #cccccc;
}

.t-staz {
    margin-top: 5px;
}

.t-staz.default {
    margin-top: 30px;
}

table.t-staz tr:nth-last-child(1) {
    border-bottom: 1px solid #333;
}

.t-staz-btn {
    margin-top: 0;
}

.t-kredit tr:nth-last-child(1) {
    border-bottom: 1px solid #333;
}

.td-name {
    min-width: 110px;
    padding: 7px 1px 7px 5px;
}

.td-name span.pointer {
    cursor: pointer;
}

.info-span {
    cursor: default;
}

.td-input {
    min-width: 200px;
    text-align: right;
}

.td-input input {
    text-align: right;
    width: 125px;
    height: 22px;
    
    font-size: 16px;
    border-radius: 5px;
    padding: 1px 5px 0 2px;
}

input.staz {
    width: 20px;
}

.dropdown-field {
    position: relative;
    
}

.dropdown-field input {
    width: 109px;
    padding-right: 19px; /*+15px*/
    cursor: pointer;
}

.dropdown-arrow-field {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 12px;
    color: #fff;
    cursor: pointer;
}

.dropdown-arrow-field svg {
    display: block;
    transition: transform 0.3s ease;
    transform-origin: center;
}

.dropdown-arrow-field.open svg {
    transform: rotate(180deg);
}

.select-field {
    position: absolute;
    right: 0;
    top: calc(50% + 12px);
    width: 132px;
    margin: 0;
    padding: 2px 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    z-index: 1;
    display: none;
    list-style: none;
}

.select-field li {
    padding: 6px 13px 6px 10px;
    cursor: pointer;
    text-align: right;
    
    font-size: 14px;
    border-bottom: 1px solid #dedede;
}

.select-field li:last-child {
    border-bottom: none;
}

.select-field li:hover {
    background-color: #e7edf1;
}

.dop-dd li {
    cursor: default;
}

:root {
    --bg1: rgb(24, 56, 131);
    --bg2: rgb(220, 53, 69);
    --bg3: #707e88;
    --bg4: rgb(25, 135, 84);
    --bg5: #4f8b8b;
    --c1: #fff;
    --c2: #fff;
    --c3: #fff;
    --c4: #fff;
    --c5: #fff;
    --db1: 1px solid #bcbcbc;
    --db2: 1px solid #000;
    --db3: 2px solid #000;
    --do1: 2px solid #000;
    --do2: ;
    --do3: ;

    /* --b1: 1px solid #bcbcbc;
    --b2: 1px solid #000;
    --b3: 1px solid #000;
    --b4: 2px solid #000;
    --b5: 1px solid #000;
    --o1: 2px solid #000;
    --o2: ;
    --o3: ;
    --o4: ;
    --o5: ; */
}

.c1 {
    background-color: var(--bg1);
    color: var(--c1);
    border: var(--db1);
    outline: var(--do1);
}

.c2 {
    background: var(--bg2);
    color: var(--c2);
    border: var(--db2);
    outline: var(--do2);
}

.c3 {
    background: var(--bg3);
    color: var(--c3);
    border: var(--db2);
    outline: var(--do2);
}

.c4 {
    background: var(--bg4);
    color: var(--c4);
    border: var(--db3);
    outline: var(--do3);
}

.c5 {
    background: var(--bg5);
    color: var(--c5);
    border: var(--db2);
    outline: var(--do2);
}

.c1::selection {
    background-color: var(--c1);
    color: var(--bg1);
}

.c2::selection {
    background-color: var(--c2);
    color: var(--bg2);
}

.c3::selection {
    background-color: var(--c3);
    color: var(--bg3);
}

.c4::selection {
    background-color: var(--c4);
    color: var(--bg4);
}

.c5::selection {
    background-color: var(--c5);
    color: var(--bg5);
}

.td-km {
    padding-left: 3px;
    padding-right: 0;
}

.td-formula {
    display: none;
    position: absolute;
    max-width: 50%;
    top: calc(100% + 0px);
    left: 0px;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 6px 8px 5px;
    z-index: 2;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    font-size: 15px;
}

.td-formula.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.td-formula::after {
    content: "";
    position: absolute;
    top: -7px;
    left: 16px;
    width: 0;
    height: 0;

    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #ccc;
    z-index: -1;
}

.td-staz-btn button {
    font-size: 28px;
    height: 40px;
    width: 40px;
    border: 2px solid #999;
    border-radius: 50%;
    color: #444;
    background-color: #efefef;
    cursor: pointer;
    margin: 10px 0 15px 0;
}

.td-kredit-btn {
    padding-left: 4px;
}

.td-kredit-btn button {
    cursor: pointer;
}

footer {
    width: 100%;
    text-align: center;
    font-size: 14px;
    margin-bottom: 15px;
}

@media (max-width: 385px) {
    html, body {
        overflow-x: visible;
    }

    .kalks-container {
        width: auto;
    }
}

@media only screen and (min-width: 1000px) {
    #body-container {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 100vh;
    }

    #wrapper {
        padding-top: 10px;
        height: 100%;
        gap: 30px;
    }

    #mobile-header {
        display: none;
    }

    #mobile-kalk-btns {
        display: none;
    }

    #logo {
        display: block;
    }

    #kalk-btns {
        display: grid;
        align-items: start;
        margin-top: 10px;
    }

    .bk-container {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: relative;
    }

    .bk-container.open {
        grid-template-rows: auto 1fr;
    }

    .kalk-btn {
        position: relative;
        z-index: 1;
    }

    .kalk-wrapper {
        position: relative;
        z-index: 0;
        width: calc(100% - 32px);
        border: 1px solid #000;
        box-shadow: 0 4px 6px rgba(0,0,0,0.3);
        padding: 20px 15px;
        border-radius: 10px;
        background-color: #fff;
        margin-bottom: 30px;
        opacity: 0;
        transform: translateY(-100%);
        transition: all 0.35s;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition:
            max-height 0.35s linear,
            box-shadow 0.35 linear;
    }

    .bk-container.open .kalk-wrapper {
        max-height: 2000px;
        opacity: 1;
        transform: translateY(0);
    }

    .kalk-wrapper h3 {
        text-align: left;
        display: none;
    }

    table {
        margin-top: 0;
    }

    .t-staz.default {
        margin-top: 0;
    }
    
    tr {
        height: 42px;
        font-size: 14px;
    }

    .td-input input {
        width: 110px;
        height: 20px;
        font-size: 14px;
        border-radius: 4px;
    }

    input.staz {
        width: 18px;
    }

    .dropdown-field input {
        width: 96px;
        padding-right: 19px; /*+15px*/
    }

    .dropdown-arrow-field {
        right: 5px;
        font-size: 10px;
    }

    .select-field {
        width: 119px;
        padding: 0;
        top: calc(50% + 11px);
    }

    .select-field li {
        font-size: 12px;
    }

    .td-formula {
        font-size: 13px;
    }

    .td-staz-btn button {
        font-size: 22px;
        height: 30px;
        width: 30px;
        border: 2px solid #999;
        margin: 5px 0 10px 0;
    }

    /*prevent pop-out cut off*/

    tr:nth-last-child(1) > td > .select-field {
        top: 9px;
        transform: translateY(-100%);
    }
    
    tr:nth-last-child(1) > .td-formula {
        top: 0;
        transform: translateY(calc(-100% + 4px));
    }

    tr:nth-last-child(1) > .td-formula.is-visible {
        transform: translateY(-100%);
    }

    tr:nth-last-child(1) > .td-formula::after {
        top: calc(100% + 1px);

        border-left: 7px solid transparent;
        border-right: 7px solid transparent;
        border-top: 7px solid #ccc;
        border-bottom: none;
    }

    footer {
        font-size: 12px;
        margin-bottom: 20px;
    }
}

/*Selekcija boja*/

/* .color-changer {
    position: fixed;
    top: 50%;
}

.color-changer p {
    margin: 0;
}

#cc1 {
    left: 10px;
}

#cc2 {
    right: 10px;
}

.color-changer h4 {
    margin-bottom: 0;
}

.color-changer h4:nth-child(2) {
    margin-top: 0;
}

.color-changer ul {
    padding: 0;
}

.color-changer ul li {
    list-style-type: none;
    text-align: right;
} */