/*
    Created on : 1. feb. 2024, 11:43:59
    Author     : Abbas
*/

body, html {
    height: 100%;
    margin: 0;
}

#background {
    position: fixed;
    top: 6vh;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Ensure the background is behind other content */
}

#background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}



.logo img{
    width: 10%;
    float: right;
    padding-right: 1vw;
}

.footer{
    position: fixed;
    width: 100%;
    bottom: 0;
    height: 5vh;
    background-color: #0a223d;
    color: white;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    display: flex;
    flex-direction: column; /* Stack form-container and flex-container vertically */
    align-items: center; /* Center-align the child elements */
    width: 60%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    height: 95%;
}

.content-wrap {
    flex: 1;
}

.form-container {
    flex : 1;
    width: 100%; /* Adjust as needed */
    margin: 2vh;
    padding-top: 2vh;
}

.flex-container {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
}

.product-container {
    flex: 1; /* Take up available space */
    padding-top: 20px; /* Add padding around the product info */
    display: none;
    flex-direction: row;
    width: 100%;
}

.product-container, .product-info, .product-detail {
    flex-grow: 1;
}


.product-info {
    flex: 1;
    text-align: left; /* Center-align the text */

    width: 100%;
}

.product-detail{
    display: flex;
    width: 100%;
    flex-direction: row;
    padding-top: 1vw;
}

.qr-container{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
}

.qr-image {
    max-width: 100%; /* Reduce the size of the QR code */
    height: auto; /* Maintain aspect ratio */
}


.error {
    margin: auto;
    width: 50%;
    border: 3px solid red;
    padding: 10px;
}

.header-container {
    flex: 2;
    display: flex;
    justify-content: left;
    align-items: center;
    background-color: #0a223d;
    color: white;
    width: 100% !important;
    height: 100px;
    padding: 1vw;
    padding-bottom: 7vh;
    position: fixed;
    top: 0;
    left:0;
    margin: 0;
}

.product-image {
    width: 70%;
    text-align: center;
}

.product-image a{
    display: inline-block;
    width: 100%;
}

.thumbnail-container {
    display: flex;
    flex-wrap: wrap;
}

.thumbnail {
    clear: both;
    display: block;
    flex: 0 0 auto; /* Do not grow or shrink */
    width: calc(100% - 10px); /* Adjust the width as needed */
    margin: 10px; /* Adjust the margin as needed */
    cursor: pointer;

}

.thumbnail img {
    width: 80%;
    aspect-ratio: 4 / 5;
    object-fit: contain;
    vertical-align: middle;
}

.thumbnail:last-child {
    margin-right: 0; /* Remove margin for the last thumbnail to avoid extra spacing */
}


#imageModal .modal-dialog {
    max-width: 100%; /* Allows modal to take as much width as needed */
    width: auto; /* Default width to auto to not exceed the width of the image */
    margin: 0 auto; /* Center the modal on the screen */
}

#imageModal .modal-content {
    width: fit-content; /* Fit the width of the modal content to its children (the image) */
    margin: 0 auto; /* Center the modal content within the dialog */
}

#imageModal .modal-body {
    padding: 0; /* Remove padding around the image if desired */
}

#imageModal img {
    max-width: 100%; /* Make sure image is responsive */
    height: auto; /* Maintain aspect ratio */
    display: block; /* Remove any extra space below the image */
}

.Spesifikasjoner{
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 50%;
    padding-left: 1vw;
}

.Spesifikasjoner-title{
    font-size: 1.5rem;
    padding-bottom: 0.7vw;
}

.grid-container {
    width: 100%;
    clear: both;
    display: grid;
    grid-template-columns: 1fr 3fr;
    grid-gap: 10px;
}

.grid-item {

    padding: 0.15vw; /* Padding inside the grid items */
    text-align: left; /* Center the content */
    margin: 0;
    max-height: 15vh; /* You can adjust the max-height to your preference */
    overflow: auto;
}


.row-odd {
    background-color: #fff; /* Light color for odd rows */
}

.row-even {
    background-color: #F7F7F8; /* Dark color for even rows */
}

.title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.pnum{
    font-size: 1.1rem;
    padding-right: 1vw;
    font-weight: normal;
}

.beskrivelse{
    width: 70%;
    clear: both;
    display: block;
    padding-bottom: 0.5vh;
    float: left;
    text-align: left;
    font-size: 1.2rem;
}

.kjonn, .pris, .farge, .kvalitet, .tilgjengelig{
    font-size: 1.1rem;
}


.gridTitle{
    font-size: 1.1rem;
}

.size-button{
    margin: 0.2vw;
}


.p-counter{
    display: inline;
    float: right;
    padding-right: 2vw;
    font-size: 1.2rem;
    color: lightgreen;
    padding-top: 0.7vh;
}

#loading {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 1) url('../images/loading.gif') no-repeat center center;
    z-index: 99;
}

/* Adjust the width of the search input box to be 30% of its container */
#productSearch {
    width: 20%;
    display: block; /* Ensures the width setting is applied correctly */
}

.search-group{
    width: 30%;
}

/* Style adjustments for the search results container */
.search-results-container {
    border: 1px solid #ccc;
    margin-top: 8px;
    display: none; /* Remains hidden until there are results to show */
    width: 30%; /* Matches the search box width */
    max-height: 70vh; /* 70% of the viewport height */
    overflow-y: auto; /* Shows scrollbar when content overflows */
    background-color: white; /* Ensures background is white */
    position: absolute; /* Optional: makes the container float over content below */
    z-index: 1000; /* Ensures it appears above other content */
    color: black;
}

/* Styles for each search result item */
.search-result-item {
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    background-color: white; /* Ensures background is white, not transparent */
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #1d3754;
    color: #e1e9f2;
}

/* Style the scrollbar */
.search-results-container::-webkit-scrollbar {
    width: 1.5vw; /* Set the width of the scrollbar */
}

/* Track */
.search-results-container::-webkit-scrollbar-track {
    background: #f1f1f1; /* Light grey */
}

/* Handle */
.search-results-container::-webkit-scrollbar-thumb {
    background: #264466; /* Blue */
}

/* Handle on hover */
.search-results-container::-webkit-scrollbar-thumb:hover {
    background: #3b6ba1;/* Darker blue */
}

.barcode-generator-container{
    width: 100%;
    background-color: #f1f1f1;
    border-radius: 8px;
    padding: 20px;
}


#barcode-settings-container {
    display: flex;
    gap: 20px;
    box-sizing: border-box;
    justify-content: flex-start;
    width: 100%;
}

#barcode-settings-container {
    margin : 0;
}


#quantity, #package-quantity{
    width: 60px;
    height: 35px;
    padding-bottom: 5px;

}

#pakkenr{
    width: 100px;
}

.spacer{
    min-height: 20px;
}

#barcode-title{
    font-size: 16px;
    font-weight: bold;
}

#barcode-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


.vertical-flex{
    display: flex;
    flex-direction: column;
    gap: 10px;

}

.barcode-row-label{
    width: 150px;
    font-size: 14px;
    font-weight: bold;
}

.print-barcode-btn, .download-barcode-btn, .copy-barcode-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s ease;
}

.print-barcode-btn:hover, .download-barcode-btn:hover , .copy-barcode-btn:hover{
    transform: scale(1.1);
}

#barcode-wrapper {
    display: flex;
    align-items: center;
    background-color: #f9f9f9; /* Very light gray background */
    border: 1px solid #ddd; /* Light gray border */
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    max-width: 100%;
    margin: 10px 0;
}


.pl-label {
    width: 500px;
    border: 2px solid black;
    padding: 10px;
    margin: 0 auto;
}

.pl-header {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    padding-bottom: 10px;
}

.pl-product-info {
    font-size: 14px;
}

.pl-product-info div {
    padding: 4px 0;
}

.pl-barcode-container {
    text-align: center;
    padding-top: 10px;
}

.pl-barcode {
    display: block;
    margin: 10px auto;
    width: 450px;
    border: 1px solid black;
}

@media only screen and (max-width: 1024px), (min-resolution: 2dppx) {
    .logo img {
        width: 25%; /* Adjust logo size for mobile */
    }

    .form-container,
    .product-container,
    .product-info,
    .product-detail,
    .Spesifikasjoner,
    .grid-container {
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding-top: 0;
    }

    .header-container{
        padding-top: 10px;
        height: auto;
        width: 100%;
        padding-bottom: 1vh;
    }

    .container{
        width: 100%;
        height: 100%;
    }

    .title{
        display: flex;
        flex-direction: column;
        width: 100%;
        margin: 0;

    }

    .title div {
        width: 100%;
        margin: 0;
        text-align: left !important;
        font-size: 1.3rem;
    }

    .product-container {
        flex-direction: column-reverse;
        padding-top: 100px; /* Adjust for fixed header */
    }

    .product-image,
    .thumbnail img,
    .qr-image {
        width: 100%; /* Full width on mobile */
    }

    .grid-container {
        grid-template-columns: 1fr; /* Single column grid layout */
        grid-gap: 5px; /* Adjust gap for mobile */
        padding-bottom: 20vw;
    }

    .grid-item {
        justify-content: center; /* Center content in the grid */
        display: flex;
    }

    .footer {
        position: fixed; /* If you want the footer to stick at the bottom */
        width: 100%;
        bottom: 0;
    }


    .thumbnail-container {
        order: 1;
        justify-content: center;
        flex-direction: column;
    }

    .qr-container {
        order: 2;
        width: 80%;
        padding-bottom: 5vh;
    }

    .Spesifikasjoner{
        order: 3;
    }

    .barcode-generator-container{
        order: 4;
        min-height: 200px;
        margin-bottom: 80px;
    }

    .thumbnail {
        width: 100%; /* Thumbnails take full width */
    }

    /* You might want to adjust the size of the selectpicker for mobile */
    .dropdown-toggle {
        width: 90% !important; /* Adjust as necessary */
    }

    .bootstrap-select > .btn {
        width: 92vw !important; /* Set the width of the button */
    }

    .bootstrap-select .dropdown-menu {
        width: 100vw;
    }

    .custom-selectpicker {
        height: auto;
    }

    .p-counter{
        display: block;
        float: left;
        padding-right: 2vw;
        font-size: 0.9rem;
        color: lightgreen;
        padding-top: 0;
    }

    .search-group{
        width: 100%;
    }

}
