/* ------------------------------------ */
/* Colors                               */
/* ------------------------------------ */

:root {
    --primary: #0066b3;
    --secondary: #005fb0;
    --green: #3cb44a;
    --red: #ea1f25;
    --warning: #ba2121;
    --bg-gray: #f6f6f6;
    --border-gray: #eee;
    --border-dark: #a8a8a8;
    --text-color: #333;
}

/* ------------------------------------ */
/* Fonts                                */
/* ------------------------------------ */

body {
    font-size: 14px;
    line-height: 1.5em;
    color: #333;
    font-family: 'Arial', Arial, Helvetica, sans-serif;
}

p, span,
label,
input,
table.table-uploads tr td,
table.table-uploads tr th {
    font-size: 14px !important;
}

/* ------------------------------------ */
/* Layout                               */
/* ------------------------------------ */

.form-wrapper {
    margin: 0 auto;
    width: 600px;
    padding: 20px 15px !important;
    max-width: calc(100vw - 30px);
    min-height: calc(100vh - 107px - 29px - 40px);
    max-width: calc(100dvw - 30px);
    min-height: calc(100dvh - 107px - 29px - 40px);
}
body.sale .form-wrapper {
    width: 700px;
}

.form-row {
    border: none !important;
    padding: 10px 0 !important;
}
.form-row label {
    display: block;
}

.form-row input[type=text],
.form-row input[type=email],
.form-row textarea {
    width: calc(100% - 18px);
    margin-left: 2px;
    padding: 5px 6px !important;
    min-height: 14px !important;
}
@media (max-width:762px) {
    .form-row input[type=text],
    .form-row input[type=email],
    .form-row textarea {
        width: calc(100% - 8px);
    }
}

.table-uploads {
    width: 100%;
    margin: 20px 0 10px 0;
}
.table-uploads tbody {
    position: relative;
}
button {
    margin: 20px auto;
    display: block;
}

/* ------------------------------------ */
/* Header                               */
/* ------------------------------------ */

header {
    margin: 0 auto;
    text-align: center;
}
header .orto-logo {
    max-height: 40px;
    padding: 20px 0 0 0;
}
header h1 {
    font-weight: 600;
    color: var(--primary);
}

.nav-global ul li {
    list-style-type: none !important;
    display: block;
    padding: 0px 36px;
    border-right: solid 1px #ffffff;
    float: left;
    text-align: center;
}
.nav-global ul li:first-child {
    padding-left: 0;
}
.nav-global ul li:last-child {
    border-right: none;
}

/* ------------------------------------ */
/* Footer                               */
/* ------------------------------------ */

footer {
    padding: 4px;
    background-color: var(--primary);
}
footer {
    color: #fff;
    text-align: center;
}

/* ------------------------------------ */
/* Form                                 */
/* ------------------------------------ */

span.required {
    color: var(--warning);
}

label[for=id_privacy] {
    display: none !important;
}
span.privacy {
    display: inline-block;
}

a.delete {
    position: relative;
    top: 8px;
    float: right;
}

.table-uploads tr td,
.table-uploads tr th {
    border-bottom: 1px solid var(--hairline-color) !important;
    font-weight: 400;
}
tr:nth-child(2n+1), .row-form-errors {
	background: transparent !important;
}
tr:nth-child(2n), tr:nth-child(2n) .errorlist, tr:nth-child(2n+1) + .row-form-errors, tr:nth-child(2n+1) + .row-form-errors .errorlist {
	background: transparent !important;
}
thead th {
	padding: 8px 12px 6px 12px;
}

input[type=checkbox] {
    margin-left: 2px;
    margin-right: 6px;
    position: relative;
    top: -2px;
}
.errors input[type=checkbox] {
    box-shadow: 0px 0px 0px 1px var(--error-fg) !important;
}

input[type=number] {
    -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.error-msg {
    color: var(--warning);
    display: block;
}

button {
    background: var(--primary);
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    color: var(--button-fg);
    cursor: pointer;
    transition: background 0.15s;
}
button:hover {
    background: var(--secondary);
}

.add-row.btn {
    display: inline-block;
    padding-top: 4px;
}
.add-row.btn:before {
    content: url(../img/icon-add.svg);
    display: inline-block;
    width: 16px;
    height: 20px;
    position: relative;
    top: 2px;
}
a.button {
    background: var(--primary);
    padding: 10px 15px 9px 15px;
    border: solid 1px var(--primary);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
    text-align: center;
    text-decoration: none !important;
}
a.button:hover,
a.button:focus {
    background: var(--secondary);
}
a.button.secondary {
    background: #fff;
    padding: 10px 15px 9px 15px;
    border: solid 1px var(--primary);
    border-radius: 4px;
    color: var(--primary);
    cursor: pointer;
    transition: background 0.15s;
}
a.button.secondary:hover {
    border: solid 1px var(--secondary);
}

.select2-container * {
    font-size: 14px;
}

/* ------------------------------------ */
/* Order Form                           */
/* ------------------------------------ */

@media (min-width:762px) {

    #order_form .row {
        display: flex;
        gap: 20px;
    }
    #order_form .row > div {
        width: calc(50% - 10px);
    }
    #order_form .row.address > .zip-city input {
        width: calc(100% - 18px);
        margin-left: 2px;
    }
    #order_form .row.address > .zip-city > div:nth-child(1) {
        width: 80px;
    }
    #order_form .row.address > .zip-city > div:nth-child(2) {
        width: calc(100% - 20px - 80px);
    }
}

/* ------------------------------------ */
/* Formset                              */
/* ------------------------------------ */

.formset-wrapper {
    margin: 12px 0 12px 0;
}

.sale-formset-header {
	width: 100%;
	display: flex;
	padding: 4px 0;
	border-bottom: solid 1px var(--border-color);
    margin-bottom: 10px;
}
.sale-formset-header .name {
	font-weight: 600;
}

.sale-formset table {
    width: 100%;
}
.sale-formset table tr th {
    border-top: 1px solid var(--hairline-color) !important;
	border-bottom: 1px solid var(--hairline-color) !important;
    background: var(--darkened-bg) !important;
	font-weight: 400;
}
.sale-formset table tr td {
    border-bottom: 1px solid var(--hairline-color) !important;
}
.sale-formset table tr .price-display {
    white-space: nowrap;
    text-align: right;
}
.sale-formset table tr td input[name$=amount] {
    width: 40px;
}

.sale-formset table tr td:nth-child(1) select {
    width: 100%;
}
.sale-formset table tr th:nth-child(1),
.sale-formset table tr td:nth-child(1) {
    min-width: 420px;
}
.sale-formset table tr th:nth-child(2),
.sale-formset table tr td:nth-child(2) {
    min-width: 50px;
}
.sale-formset table tr th:nth-child(3),
.sale-formset table tr td:nth-child(3) {
    display: none !important;
}
.sale-formset table tr th:nth-child(4),
.sale-formset table tr td:nth-child(4) {
    min-width: 80px;
}

.sale-formset table tr td:nth-child(2) .error-msg {
    display: none;
}

.inko-formset select {
    color: #444;
    font-size: 14px !important;
    line-height: 28px;
    padding-left: 8px;
    padding-top: 6px;
    border: 1px solid #aaa;
}

@media (max-width:762px) {
    
    .sale-formset table tr th:nth-child(1),
    .sale-formset table tr td:nth-child(1) {
        min-width: 0px;
    }
    
    body.sale .select2-dropdown {
        width: calc(100vw - 60px) !important;
    }
    body.sale .select2-container--open .select2-dropdown--above {
        border-bottom: 1px solid #aaa; 
        border-bottom-right-radius: 4px;
    }
    body.sale .select2-container--open .select2-dropdown--below {
        border-top: 1px solid #aaa; 
        border-top-right-radius: 4px;
    }
}

/* ------------------------------------ */
/* Scanner                              */
/* ------------------------------------ */

#scanner video,
#scanner #canvas {
    display: none;
}

#scanner #result,
#scanner #cropped {
    width: 100%;
    height: auto;
}

#scan_button {
    display: inline-block;
    padding-top: 4px;
    position: absolute;
    right: 0;
}
#scan_button:before {
    content: url(../img/icon-scan.svg);
    display: inline-block;
    width: 18px;
    height: 18px;
    position: absolute;
    top: 2px;
    left: -28px;
}

@media (min-width:762px) {
    #scan_button {
        /* display: none; */
    }
}

#scanner {
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(0,0,0,0.25);
    width: 100vw;
    height: 100vh;
    width: 100dvw;
    height: 100dvh;
}

#scanner .inner {
    background: #fff;
    margin: auto;
    width: 100%;
    height: 100%;
}
.canvas-wrapper {
    height: calc(100vh - 76px);
    height: calc(100dvh - 76px);
}
.button-wrapper {
    display: flex;
    height: 76px;
}
    
/* ------------------------------------ */
/* Preview                              */
/* ------------------------------------ */

#preview {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(0, calc(100%/3 - 10px)));
    width: calc(100% + 10px);
    margin: 30px 0 20px 0;
}
#preview .preview-item {
    display: flex;
    flex-direction: column;
    border: solid 1px #333;
    position: relative;
    cursor: pointer;
}
#preview .preview-item img {
    margin-bottom: auto;
    width: 100%;
}
#preview .preview-item[data-file=pdf] {
    min-height: 160px;
}
#preview .preview-item[data-file=pdf] img {
    margin: auto;
    width: 40%;
}
#preview .preview-item[data-file=pdf] {
    pointer-events: none;
}
#preview .preview-item[data-file=pdf]:after {
    display: none;
}
#preview .preview-item .preview-title {
    background-color: #333;
    color: #fff;
    text-align: center;
}

#preview .preview-item:after {
    content: url(../img/icon-zoom.png);
    position: absolute;
    top: 0px;
    right: 1px;
    display: block;
    width: 32px;
    height: 24px;
}

/* ------------------------------------ */
/* Lightbox                             */
/* ------------------------------------ */

body.modal-open {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    height: 100dvh;
    width: 100dvw;
}

#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(120,120,120,1.0);
    width: 100vw;
    height: 100vh;
    width: 100dvw;
    height: 100dvh;
}
#lightbox .close {
    position: absolute;
    right: 0px;
    top: 0px;
    padding: 10px;
    background-color: #333;
    cursor: pointer;
    width: 24px;
    height: 24px;
    z-index: 999;
}
#lightbox .close img {
    width: 24px;
    height: 24px;
}
#lightbox .preview-item {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}
#lightbox .preview-item .wrapper {
    height: calc(100vh - 31px);
    width: 100vw;
    height: calc(100dvh - 31px);
    width: 100dvw;
    margin: auto;
}
#lightbox .preview-item img {
    height: 100%;
}
#lightbox .preview-item[data-file=pdf] img {
    margin: auto;
    width: 200px;
}
#lightbox .preview-item .preview-title {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 5px;
}

/* ------------------------------------ */
/* Messages                             */
/* ------------------------------------ */

ul.messagelist {
    margin-bottom: -10px;
}

ul.messagelist li {
    padding: 11px 10px 9px 36px;
	font-weight: 600;
    background-position: 12px 12px;
    margin-bottom: 10px !important;
}

ul.messagelist .info {
    font-weight: normal;
}
ul.messagelist li.error {
	background-position: 12px 12px;
}

.icon-warning {
    height: 16px;
}

/* ------------------------------------ */
/* Inline FormSet                       */
/* ------------------------------------ */

.inline_formset table tr th,
.inline_formset table tr td {
    padding: 4px 12px 2px 12px;
    font-size: 14px;
}
.inline_formset table tr td {
    vertical-align: middle;
}

.inline_formset th.delete {
    background: transparent;
    border-color: transparent;
}
.inline_formset td.delete {
    background: transparent;
    border-color: transparent;
}
.inline_formset a.btn-delete {
    color: var(--warning);
    font-size: 14px;
}

.inline_formset .error-msg {
    font-size: 12px !important;
}
.inline_formset .error-msg.missing {
    font-size: 14px !important;
}

.inline_formset fieldset {
    border: none;
}

/* ------------------------------------ */
/* Select2                              */
/* ------------------------------------ */

.select2-container .select2-selection--single {
	height: 30px;
}

/* ------------------------------------ */
/* Inko-Versorgung                      */
/* ------------------------------------ */

body.inko #content {
    min-height: calc(100vh - 80px - 31px - 29px - 40px)
}

#select_customer button {
    width: 100%;
    text-align: left;
    background-image: url(../img/arrow-right-white.png);
	background-size: 10px 16px;
	background-repeat: no-repeat;
	background-position: right 16px center;
    padding-right: 32px;
}

body.inko textarea {
    max-width: 624px;
}

/* ------------------------------------ */
/* Order Print                          */
/* ------------------------------------ */

#order_form.print label {
    font-size: 14px;
    margin-bottom: -4px;
}

#order_form.print input,
#order_form.print select,
#order_form.print textarea {
    border: none;
    pointer-events: none;
    border: none;
    pointer-events: none;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 14px;
    color: #000 !important;
}

#order_form.print table tbody {
    color: #000 !important;
}

#order_form.print .sale-formset table tfoot {
    color: var(--body-quiet-color);
}

#order_form.print .sale-formset table tr th:nth-child(3),
#order_form.print .sale-formset table tr td:nth-child(3) {
    display: none !important;
}
#order_form.print .sale-formset table tr th:nth-child(5),
#order_form.print .sale-formset table tr td:nth-child(5) {
    display: none !important;
}


