* {
    margin: 0;
    padding: 0;
}

::selection {
    background-color: #2c60a9;
    color: white;
}

/** 
 * Searchbox and location selection
 */
header {
    display: flex;
    justify-content: center;
    position: sticky;
    top: 0;

    background-color: #55bdf2;
    padding: 15px;

    box-shadow: 0 0 20px #55bdf2;    
    color: white;
}

header .container {
    display: flex; 
    gap: 10px;

    width: 100%; 
    max-width: 800px;
}

header .container .search-box {
    display: flex; 
    flex: 1;
    min-width: 0;

    border: 3px solid #2c60a9; 
    border-radius: 5px;
    outline: none; 

    background-color: white;
    transition: 0.5s; 
}

header .container .search-box:has(button:hover) {
    border-color: #2b95e1;
}

header .container .search-box input {
    display: block; 
    padding: 10px 16px;
    width: 100%; 

    border: none; 
    border-radius: 5px;
    outline: none; 

    font-family: sans-serif;
    font-size: 20px;
}

header .container .search-box button {
    display: block; 
    padding: 5px 10px;

    border: none; 
    outline: none; 

    background-color: #2c60a9;

    font-family: sans-serif;
    font-size: 30px;

    cursor: pointer;
    transition: 0.5s; 
}

header .container .search-box button:hover {
    background-color: #2b95e1;
}

header .container .location-box {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;

    position: relative;

    background-color: #2c60a9;
    border-radius: 5px;

    cursor: pointer;
    user-select: none;
    transition: 0.5s;
}

header .container .location-box:hover,
header .container .location-box:focus {
    background-color: #2b95e1;
    border-bottom-left-radius: 0px;
    border-bottom-right-radius: 0px;
}

header .container .location-box .selected img {
    display: block; 

    height: 36px;
    padding: 10px
}

header .container .location-box .dropdown {
    position: absolute;
    top: 100%;
    right: 0;

    overflow: hidden;

    background-color: #2b95e1;

    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

header .container .location-box .dropdown .option {
    display: none;
}

header .container .location-box:hover .dropdown .option,
header .container .location-box:focus .dropdown .option {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px;
    outline: none;
    border: none;

    cursor: pointer;
    transition: 0.5s;
}

header .container .location-box .dropdown .option:hover {
    background-color: #2c60a9;
}

header .container .location-box .dropdown .option input {
    display: none;
}

header .container .location-box .dropdown .option img {
    height: 20px;
}

header .container .location-box .dropdown .option span {
    font-family: sans-serif;
    font-size: 20px;
    color: white;

}

/** 
 * Main content
 */
main {
    width: calc(100% - 30px); 
    max-width: 800px;
    margin: 20px auto;
}

main.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    
    font-family: sans-serif;
    font-size: 18px;
    color: #2c60a9;
}

main.loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    
    border: 3px solid #55bdf2;
    border-top-color: #2c60a9;
    border-radius: 50%;
    
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

main section {
    border: 3px solid #55bdf2;
    border-radius: 5px;
    box-shadow: 0 0 5px #55bdf2;

    margin-bottom: 20px;
}

main section .headline {
    grid-column-start: 1;
    grid-column-end: 6;

    display: flex;
    align-items: center;
    justify-content: space-between; 
    padding: 10px;

    background-color: #55bdf2;
}

main section .headline .title {
    font-family: sans-serif;
    font-size: 20px;
    font-weight: bold;
    color: white;
    text-align: left;
}

main section .headline .subtitle {
    font-family: sans-serif;
    font-size: 20px;
    font-weight: lighter;
    color: white;

    text-align: right;
}

main section .products {
    display: grid; 
    grid-template-columns: 50px 65px auto auto 100px;

    overflow-x: auto;
    hyphens: auto;
}

main section.pharmacy .products {
    display: grid; 
    grid-template-columns: 50px repeat(3, fit-content(100%)) 100px;
    grid-auto-rows: min-content;
    grid-auto-flow: dense;

    overflow-x: auto;
    hyphens: auto;
}

main section .products .cell {
    display: flex;
    align-items: center;     
    justify-content: flex-start; 
    padding: 7px 9px;

    font-family: sans-serif;
    font-size: 20px;

    outline: none; 
    border: none;

    border-bottom: 1px solid #55bdf2;
}


main section .products .cell.count {
    grid-column: 1;
}

main section .products .cell.info {
    grid-column: 2;
    text-align: right;
}

main section.pharmacy .products .cell.info {
    text-align: left;
    grid-column: 3;
}

main section .products .cell.name {
    grid-column: 3;
}

main section.pharmacy .products .cell.name {
    grid-column: 2;
}

main section .products .cell.added {
    text-align: right;
    grid-column: 4;
}

main section .products .cell.actions {
    grid-column: 5;
}

main section .products .cell.old {
    color: orange;
}

main section .products .cell.ancient {
    color: red;
}

main section .products .cell.actions {
    display: flex; 
    align-items: center;
    justify-content: flex-end;

    gap: 5px;
    padding: 0 5px;
}

main section .products .cell.actions button {
    display: block;
    padding: 2.5px;
    width: 30px;
    height: 30px;

    border: none; 
    border-radius: 5px;
    outline: none;

    background-color: #2c60a9;

    font-family: sans-serif;
    font-weight: bold;
    font-size: 25px;
    line-height: 1;
    text-align: center;
    color: white;

    cursor: pointer;
    user-select: none;
    transition: 0.5s; 
}

main section .products .cell.actions button:hover {
    background-color: #2b95e1;
}

/**
 * Add product
 */
aside.add-box {
    position: fixed;
    bottom: 15px;
    right: 15px;
}

aside.add-box .open-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 50px;
    height: 50px;

    font-family: sans-serif;
    font-weight: bold;
    font-size: 50px;
    color: white;
    text-decoration: none;


    background-color: #2c60a9;
    box-shadow: 0 0 5px #2c60a9;
    border-radius: 50%;

    user-select: none;
    cursor: pointer;
}

aside.add-box.open .open-icon {
    display: none;
}

aside.add-box .product-details {
    display: none;
}

aside.add-box.open .product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    box-sizing: border-box;
    position: relative; 

    width: calc(100vw - 30px);
    max-width: 400px;
    height: auto;

    padding: 20px;

    background-color: #2c60a9;
    box-shadow: 0 0 5px #2c60a9;
    border-radius: 5px;
}

aside.add-box .product-details h1 {
    grid-column: 1 / 3;

    padding-bottom: 5px;
    margin-bottom: 15px;

    border-bottom: 1px solid white;

    font-family: sans-serif;
    font-weight: bold;
    font-size: 28px;
    color: white;
    text-align: center;
}

aside.add-box .product-details .close-icon {
    position: absolute;
    top: 10px;
    right: 10px;

    height: 30px;
    width: 30px;
    border-radius: 5px;

    font-family: sans-serif;
    font-weight: bold;
    font-size: 30px;
    text-align: center;
    color: white;

    line-height: 1;

    background-color: #55bdf2;
    
    cursor: pointer;
}

aside.add-box .product-details label {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    grid-column: 1 / 3;

    position: relative; 
}

aside.add-box .product-details label.info {
    grid-column: 1 / 2;
}

aside.add-box .product-details label.count {
    grid-column: 2 / 3;
}

aside.add-box.pharmacy .product-details label.count {
    grid-column: 1 / 3;
}

aside.add-box.pharmacy .product-details label.info {
    grid-column: 1 / 3;
}

aside.add-box .product-details label .title {
    display: inline-block;
    padding: 2px 5px;

    position: absolute; 
    top: -12px; 
    left: 5px;

    font-family: sans-serif;
    font-weight: lighter;
    font-size: 15px;
    color: white;

    background-color: #2c60a9;
}

aside.add-box .product-details label input {
    display: block; 
    width: 100%;
    padding: 9px 11px;
    margin-bottom: 10px;

    border: 2px solid white; 
    border-radius: 5px;
    outline: none;

    font-family: sans-serif;
    font-weight: normal;
    font-size: 20px;
    color: white;

    background-color: transparent;
}

aside.add-box .product-details label select {
    display: block; 
    width: 100%;
    padding: 9px 11px;
    margin-bottom: 15px;

    border: 2px solid white; 
    border-radius: 5px;
    outline: none;

    font-family: sans-serif;
    font-weight: normal;
    font-size: 20px;
    color: white;

    background-color: transparent;
}

aside.add-box .product-details label select:hover {
    color: black;
}

aside.add-box .product-details button {
    display: block; 
    width: 100%; 
    padding: 12px 15px;

    grid-column: 1 / 3;   

    border: none; 
    border-radius: 5px;
    outline: none; 

    background-color: #55bdf2;

    font-family: sans-serif;
    font-size: 20px;
    color: white;

    cursor: pointer;
    transition: 0.5s;
}

aside.add-box .product-details button:hover {
    background-color: #2b95e1;
}

/**
 * Message box
 */
aside.message-box {
    position: fixed;
    bottom: 15px;
    right: 15px;

    max-width: calc(100% - 30px);
    max-height: calc(100% - 15px);

    overflow-y: auto;
}

aside.message-box .message {
    display: block; 
    padding: 15px;
    margin-top: 10px;

    text-align: right;
    border-radius: 3px;

    background-color: #2c60a9;
    box-shadow: 0 0 5px #2c60a9;    
}

aside.message-box .message .content {
    padding-bottom: 10px;

    font-family: sans-serif;
    font-weight: bold;
    font-size: 16px;
    color: white;
}

aside.message-box .message button {
    display: inline-block;
    padding: 7px 10px;
    margin-left: 5px;

    border: none; 
    border-radius: 5px;
    outline: none;

    background-color: #2b95e1;

    font-family: sans-serif;
    font-size: 16px;
    line-height: 1;
    text-align: center;
    color: white;

    cursor: pointer;
    user-select: none;
    transition: 0.5s; 
}

aside.message-box .message button:hover {
    background-color: #55bdf2;
}