html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: monospace;
    color: #fff;
}

body {
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    padding: 5px 15px;
    border-bottom: solid 1px #555;
    box-shadow: 5px 2px #eee;
}

header nav {
    width: 100%;
}

header img {
    height: 100%;
}

header .cart {
    font-size: x-large;
    padding-left: 10px;
    padding-right: 10px;
    cursor: pointer;
}

header .cart #cart-items {
    font-size: 0.7em;
    height: 50%;
    align-items: start;
    padding-left: 5px;
}

/* Main layout */
main {
    flex: 1 1 auto;
    display: flex;
    margin-top: 15px;
    min-height: 0;
}

main.with-sidebar {
    display: grid;
    grid-template-columns: 350px auto;
}

/* Sidebar */
main > .filter-box {
    width: 350px;
    padding: 15px;
    overflow-y: auto;
}

/* Scrollable content */
main > .content {
    width: 100%;
    overflow-y: auto;
    max-height: calc(100vh - 60px); /* Adjust 60px if header height changes */
    padding: 10px;
}

main > .content-form {
    display: flex;
    flex-direction: column;
    padding-right: 20px;
}

main > .content-form .cart-header,
main > .content-form .cart-item {
    border-bottom: solid 1px #ccc;
}

.content-form .photo {
    display: flex;
    gap: 10px;
}

.content-form .photo img {
    width: 100px;
    cursor: pointer;
    border: solid 1px #ccc;
}

.content-form .cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-form .cart-total {
    margin: 10px 0;
    color: maroon;
}

/* Product Card */
.product {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: solid 1px #ccc;
    padding: 5px;
    border-radius: 5px;
    margin: 5px;
}

.product .photo {
    display: flex;
    justify-content: space-between;
    padding: 0 10px 10px 10px;
}

.product .photo > img {
    width: 33%;
    cursor: pointer;
    border: solid 1px #ccc;
}

.product .price {
    font-weight: 900;
    color: #924a24;
}

.product > .add-button {
    display: flex;
}

/* Card image style */
.card img {
    height: 200px;
    object-fit: contain;
}

/* Buttons layout */
.btn-group.add-button > .btn {
    flex: 1 1 auto;
}

/* Modal */
.modal-body img {
    width: 100%;
}

.modal {
    display: flex;
    justify-content: center;
    position: absolute;
    top: 0;
    background-color: #777777aa;
    width: 100%;
    height: 100%;
    z-index: 1000;
    padding: 30px;
}

.modal-dialog {
    width: 50vw;
}

/* Error Box */
#errors {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-top: 5px;
    opacity: 90%;
    z-index: 9999;
}

#errors > div {
    width: 33vw;
}

.alert {
    margin-bottom: 2px !important;
}

/* Profile */
#profileSidebarBody .profile-card {
    width: 90% !important;
    margin: auto;
}

.profile-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    margin: 15px auto;
}

/* Offcanvas wider */
.offcanvas {
    --bs-offcanvas-width: 23%;
}

/* Visibility helpers */
.visible {
    display: block;
}

.hidden {
    display: none !important;
}

/* Price slider track */
main #min-price .slider-selection {
    background: #BABABA;
}

/* Responsive Layout */
@media (max-width: 768px) {
    main.with-sidebar {
        grid-template-columns: 1fr;
    }
    main > .filter-box {
        width: 100%;
        padding: 15px 5vw;
    }
}
