
/* Fonts */
@font-face {
    font-family: Utendo;
    src: url(Font/Utendo.ttf);
}

@font-face {
    font-family: Moon;
    src: url(Font/Moon.otf);
}


/* Universal Properties*/
* {
    margin: 0;
    padding: 0;
    font-family: Utendo;
}

/* Body */
body {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
    "navbar navbar"
    "sidebar main"
    "sidebar footer";
}


/* ----- Navigation Section ----- */
nav {
    height: 5rem;
    top: 0;
    position: sticky;
    grid-area: navbar;
    background-color: red;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

#navbtn {
    display: none;
    background: rgba(255, 0, 0, 0);
    border: none;
    cursor: pointer;
}

#navbtn img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: invert(100%);
}

#navlogo {
    display: flex;
    justify-content: center;
    align-items: center;
}

#navlogo img {
    width: auto;
    height: 4rem;
    cursor: pointer;
}

#navlogo a {
    margin: auto auto;
}

#navlogo h1 {
    font-family: Moon;
    padding: 0rem 1rem;
}

#navlog button {
    padding: .5rem;
    background: rgba(0, 0, 0, 0);
    color: red;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#navlog img {
    height: 2rem;
    width: auto;
    object-fit: cover;
    filter: invert(100%);
}

nav #search {
    padding: .5rem 1rem;
    width: 20rem;
    border: none;
    border-radius: 6px;
    height: 2rem;
    font-size: 1rem;
}

#loc {
    display: flex;
    align-items: center;
}

#loc a {
    display: flex;
    align-items: center;
    font-size: 1rem;
    text-decoration: none;
    color: white;
}

#loc img {
    margin: 0.5rem;
    width: 3rem;
    height: 3rem;
    object-fit: cover;
}


/* ----- Aside Section ----- */
aside {
    height: calc(100vh - 7rem);
    top: 5rem;
    position: sticky;
    align-self: start;
    grid-area: sidebar;
    background-color: white;
    padding: 1rem;
}

aside ul {
    list-style-type: none;
}

aside li {
    padding: .5rem;
    list-style-type: none;
    padding: .5rem 1rem;
}

aside button {
    font-weight: bold;
    color: black;
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0);
    border: none;
    font-size: 1rem;
    cursor: pointer;
}

aside button:hover {
    color: red;
}

aside #sidehead {
    color: red;
    font-weight: bold;
    font-size: 1.3rem;
}

aside p {
    padding: 1rem;
}

aside img {
    width: 3rem;
    height: 3rem;
    object-fit: cover;
    padding: 0 1rem;
}

#home-page {
    display: block;
}

#user-page {
    display: none;
}

#readytoeat-page {
    display: none;
}

#snacks-page {
    display: none;
}

#beverages-page {
    display: none;
}

#about-us-page {
    display: none;
}

#cart-page {
    display: none;
}

/* ----- Main Section ----- */
main {
    grid-area: main;
    background: rgb(235, 232, 232);
    padding: 1rem;
}

#ad {
    margin: 2rem 1rem;
    border: none;
    border-radius: 10px;
    width: stretch;
}

#ad img {
    object-fit: contain;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.catorange {
    background: rgb(235, 158, 17);
    padding: 1rem;
    margin: 2rem 1rem;
    border: none;
    border-radius: 10px;
}

.catorangered {
    background: orangered;
    padding: 1rem;
    margin: 2rem 1rem;
    border: none;
    border-radius: 10px;
}

.catyellow {
    background: rgb(221, 221, 5);
    padding: 1rem;
    margin: 2rem 1rem;
    border: none;
    border-radius: 10px;
}

.message {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.message * {
    color: white;
    text-decoration: none;
}

.message h1 {
    font-size: 2rem;
}

.message .see-more:hover {
    text-decoration: underline;
}

.product-list {
    display: grid;
    gap: 1rem 2rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.products {
    display: grid;
    grid-row: span 4;
    grid-template-rows: subgrid;
    border-radius: 8px;
    padding: 1rem;
    background-color: white;
}

.products p {
    color: red;
    font-weight: bold;
    font-size: clamp(1rem, 1vw, 1.5rem)
}

.products h4 {
    font-size: clamp(1rem, 1.5vw, 2.0rem)
}

.products img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
}

.weight {
    align-items: center;
    border: none;
    width: 30%;
}

.weight p {
    background: rgb(96, 206, 169);
    border-radius: 4px;
    color: white;
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    text-align: center;
}

.category {
    padding: 1rem;
    margin: 2rem 1rem;
    background: white;
    border: none;
    border-radius: 10px;
}

.heading {
    padding: 1rem;
}

.heading * {
    color: red;
    text-decoration: none;
}

#cat {
    font-weight: bold;
    font-size: 1.3rem;
}

#home {
    color: black;
    font-size: 1.3rem;
}

.heading h1 {
    padding-top: 1rem;
}

.productlist {
    display: grid;
    gap: 1rem 2rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.product {
    display: grid;
    grid-row: span 5;
    grid-template-rows: subgrid;
    border-radius: 8px;
    padding: 1rem;
    background-color: white;
}

.product p {
    color: red;
    font-weight: bold;
    font-size: clamp(1rem, 1vw, 1.5rem)
}

.product h4 {
    font-size: clamp(1rem, 1.5vw, 2.0rem)
}

.product img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.weight {
    align-items: center;
    border: none;
    width: 30%;
}

.weight p {
    background: rgb(96, 206, 169);
    border-radius: 6px;
    color: white;
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    text-align: center;
}

.addtocart {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.addtocart img {
    height: 2rem;
    width: auto;
    object-fit: cover;
    margin: 0.1rem 0.5rem;
}

.addtocart button {
    padding: .5rem;
    background: red;
    color: white;
    border: none;
    border-radius: 6px;
    width: 100%;
    height: auto;
    font-weight: bold;
    cursor: pointer;
}

.addtocart button:hover {
    background-color: #D73728;
}

#reg {
    padding: 1rem;
}

.heading {
    padding: 1rem;
}

.heading * {
    color: red;
    text-decoration: none;
}

.welcome {
    width: stretch;
    padding: 1rem;
    margin: 1rem;
    background: red;
    color: white;
    border: none;
    border-radius: 10px;
}

#cat {
    font-weight: bold;
    font-size: 1.3rem;
}

#home {
    color: black;
    font-size: 1.3rem;
}

#divider {
    display: grid;
    gap: 1rem 2rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-template-areas: 
    "login register";
}

#divider .part {
    display: grid;
    grid-row: span 6;
    grid-template-rows: subgrid;
    border-radius: 8px;
    background-color: white;
    padding: 3rem;
}

.part h1 {
    font-size: 1.5rem;
    color: red;
}

.part input[type="text"] {
    width: stretch;
    padding: .5rem 1rem;
    border: none;
    border-radius: 6px;
    background: rgb(202, 197, 197);
}

.login {
    grid-area: login;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
    padding: 3rem;
}

.register {
    grid-area: register;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
    padding: 1rem;
}

#loginbtn {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#loginbtn a {
    text-decoration: none;
    color: black;
}

#loginbtn button {
    padding: 1rem 1.5rem;
    background: red;
    color: white;
    border: none;
    border-radius: 6px;
    margin: 0.1rem .5rem;
    font-weight: bold;
    font-size: 1rem;
}

#loginbtn button:hover {
    background-color: #D73728;
}

#registerbtn button {
    padding: 1rem 1.5rem;
    background: red;
    color: white;
    border: none;
    border-radius: 6px;
    margin: 0.1rem .5rem;
    font-weight: bold;
    font-size: 1rem;
}

#registerbtn button:hover {
    background-color: #D73728;
}

#register-container {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    overflow: auto;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
}

#register-content {
    display: block;
    background-color: #fefefe;
    margin: 5% auto;
    padding: 3rem;
    border-radius: 10px;
    width: 30%; 
    max-width: 800px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    animation-name: animatetop;
    animation-duration: 0.4s
}

#register-content input[type="text"] {
    width: stretch;
    padding: .5rem 1rem;
    border: none;
    border-radius: 6px;
    background: rgb(202, 197, 197);
    margin-bottom: 1rem;
}

#register-content h1 {
    font-size: 2rem;
    color: red;
    text-align: center;
}

#register-content button {
    padding: 1rem 1.5rem;
    margin-top: 0.5rem;
    background: red;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
}

#register-content button:hover {
    background-color: #D73728;
}   

#register-content #register-cancel {
    padding: 1rem 1.5rem;
    margin-top: 0.5rem;
    background: rgba(0, 0, 0, 0);
    color: red;
    border: solid red 1px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
}

#register-content #register-cancel:hover {
    background-color: #D73728;
    color: white;
}

#register-btns {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#employee-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem 2rem;
    padding: 1rem;
}

.employee {
    display: grid;
    grid-row: span 4;
    grid-template-rows: subgrid;
    border-radius: 8px;
    padding: 1rem;
    background-color: white;
    align-items: center;
    justify-items: center;
}

.employee img {
    width: 70%;
    height: 70%;
    object-fit: contain;

}

.employee h3 {
    color: red;
}

.soc-med {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}

.soc-med img {
    width: 2rem;
    height: 2rem;
    object-fit: cover;
    margin: 0 0.5rem;
}

#streak {
    z-index: 100;
    float: right;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: none;
    width: 10rem;
    height: 5rem;
    border-radius: 10px;
    align-items: center;
    background: red;
    justify-content: space-evenly;
    box-shadow: 0 0 15px 5px rgba(255, 255, 255, 0.3);
}

#streak #streak-no {
    font-size: 1.5rem;
}

#streak h3 {
    font-size: 0.7rem;
}

#streak img {
    width: auto;
    height: 60%;
    object-fit: contain;
}

#streak * {
    color: white;
}

#streak-counter {
    text-align: center;
}

#payment-container {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    overflow: auto;
}

#payment-content {
    display: block;
    background-color: #fefefe;
    margin: auto;
    padding: 3rem;
    border-radius: 10px;
    width: 60%;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    animation-name: animatetop;
    animation-duration: 0.4s
}

#payment-content input[type="text"] {
    width: stretch;
    padding: .5rem 1rem;
    border: none;
    border-radius: 6px;
    background: rgb(202, 197, 197);
    margin-bottom: 1rem;
}

#payment-content input[type="tel"] {
    width: stretch;
    padding: .5rem 1rem;
    border: none;
    border-radius: 6px;
    background: rgb(202, 197, 197);
    margin-bottom: 1rem;
}

#payment-content input[type="file"] {
    width: stretch;
    padding: .5rem 1rem;
    border: none;
    border-radius: 6px;
    background: rgb(202, 197, 197);
    margin-bottom: 1rem;
}

#payment-content input[type="time"] {
    width: stretch;
    padding: .5rem 1rem;
    border: none;
    border-radius: 6px;
    background: rgb(202, 197, 197);
    margin-bottom: 1rem;
}

#payment-content input[type="date"] {
    width: stretch;
    padding: .5rem 1rem;
    border: none;
    border-radius: 6px;
    background: rgb(202, 197, 197);
    margin-bottom: 1rem;
}

#payment-content h1 {
    font-size: 2rem;
    color: red;
    text-align: center;
}

#payment-content button {
    padding: 1rem 1.5rem;
    margin-top: 1rem;
    background: red;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
}

#payment-content button:hover {
    background-color: #D73728;
}

#payment-content h3 {
    color: red;
}

#payment-content #payment-cancel {
    padding: 1rem 1.5rem;
    margin-top: 1rem;
    background: rgba(0, 0, 0, 0);
    color: red;
    border: solid red 1px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    
}

#payment-content #payment-cancel:hover {
    background-color: #D73728;
    color: white;
}

#payment-btns {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#card-details {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

#expiry-date {
    width: 49%;
}

#date-time {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#dates {
    width: 49%
}

#times {
    width: 49%;
}

#cvv {
    width: 49%;
}

#contact-no {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

#telephone {
    width: 49%;
}

#phone {
    width: 49%;
}

input[type="file"] {
  display: none;
}

.custom-file-upload {
    padding: .5rem 1rem;
    border: none;
    border-radius: 6px;
    background: rgb(202, 197, 197);
    cursor: pointer;
    margin: 2rem 0;
}

.custom-file-upload:hover {
    border: rgb(202, 197, 197) solid 1px;
    background: rgba(0, 0, 0, 0);
}

/* Footer Section */
footer {
    display: grid;
    grid-template-columns: 70% 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas: 
    "email socials"
    "links copyright";
    grid-area: footer;
    background: red;
    padding: 2rem;
    color: white;
}

#email {
    grid-area: email;
    padding: 0.5rem;
    margin: 0.5rem;
}

#footbtn {
    display: flex;
}

#footbtn input[type="text"] {
    width: stretch;
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
}

#footbtn button {
    padding: .5rem 1rem;
    background: white;
    color: red;
    border: none;
    border-radius: 6px;
    margin: 0.1rem .5rem;
}

#subscribe {
    cursor: pointer;
}

#subscribe:hover {
    background-color: rgba(0, 0, 0, 0);
    color: white;
    border: white solid 1px;
}

#socials {
    grid-area: socials;
    padding: 0.5rem;
    margin: 0.5rem;
    align-items: right;
}

#socialicon {
    display: flex;
    align-items: center;
    justify-content: right;
    flex-wrap: wrap;
}

#socialicon img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    filter: invert(100%);
    margin: 0 0.5rem;  
}

#socialicon #block {
    flex-basis: 100%;
    text-align: right;
}

#links {
    grid-area: links;
    padding: 0.5rem;
    margin: 0.5rem;
    display: flex;
}

#links ul {
    list-style-type: none;
    padding: 0.5rem;
    margin: 0.5rem;
}

#links li {
    margin-bottom: 0.5rem;
}

#links a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
}

#links a:hover {
    text-decoration: underline;
}

#copyright {
    grid-area: copyright;
    padding: 0.5rem;
    margin: 0.5rem;
}

#copyright h1 {
    text-align: right;
}


/* --- Modal Styling --- */
/* --- 1. Product Modal Styling (Product details popup) --- */

.modal {
    /* Ensures the modal covers the whole screen */
    display: none; /* Hidden by default, shown by JS */
    position: fixed;
    z-index: 100; /* High z-index to be on top of everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4); /* Dim background */
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* Center vertically and horizontally */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Takes up 80% of the screen width */
    max-width: 600px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.close-btn {
    color: red;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #D73728;
    text-decoration: none;
}

.modal-product-details {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.modal-image-container {
    flex-shrink: 0; /* Prevents image container from shrinking */
    width: 150px;
    height: 150px;
    padding: 5px;
}

#modalProductImage {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensures the whole image is visible */
}

#modalProductName {
    color: red;
}

.modal-info {
    flex-grow: 1;
}

.modal-weight-tag {
    display: inline-block;
    background-color: rgb(96, 206, 169);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-actions input {
    width: 60px;
    padding: 8px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.modal-add-to-cart {
    padding: 10px 15px;
    background-color: red;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.modal-add-to-cart:hover {
    background-color: #D73728;
}

/* --- 2. Cart Page Styling (id="cart-page") --- */

.dynamic-cart-content {
    padding: 20px 0;
    background-color: white;
    margin: 1rem;
    border-radius: 10px;
}

.empty-cart-message {
    text-align: center;
    padding: 50px;
    font-size: 1.2em;
    color: #888;
    margin: 1rem;
}

.cart-items-list {
    list-style: none;
    padding: 0;
    background-color: white;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.cart-item-img {
    width: 8rem;
    height: 8rem;
    object-fit: contain;
    margin-right: 20px;
    padding: 5px;
    border-radius: 6px;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-name {
    font-weight: bold;
    margin: 0 0 5px 0;
    font-size: 1.1em;
    color: red;
}

.cart-item-price {
    color: black;
    font-size: 0.9em;
    font-weight: bold;
}

.cart-item-controls input {
    width: 3rem;
    padding: 8px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.cart-item-controls button {
    padding: 8px 13px;
    background-color: red;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 0.2rem;
}

.cart-item-controls button:hover {
    background-color: #D73728;
}

.cart-item-total {
    font-weight: bold;
    font-size: 1.1em;
    color: black;
    text-align: right;
    width: 7.5rem; 
}

/* --- 3. Cart Summary (Totals) --- */

.cart-summary {
    text-align: right;
    padding: 20px 0;
    margin-top: 20px;
    padding: 1rem;
    background-color: white;
    margin: 1rem;
    border-radius: 10px;
}

.cart-summary h3 {
    border-bottom: 2px solid #ccc;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.cart-summary p {
    font-size: 1.3em;
    font-weight: bold;
    margin: 5px 0;
}

.checkout-button {
    padding: 12px 25px;
    background-color: red;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    margin-top: 15px;
    transition: background-color 0.2s;
}

.checkout-button:hover {
    background-color: #D73728;;
}


/* Responsive Configuration */
@media (max-width: 800px) {
    body {
        grid-template-columns: 1fr;
        grid-template-areas:
        "navbar"
        "main"
        "footer";
    }

    aside {
        position: fixed;
        width: 300px;
        display: none;
    }

    #loc {
        display: none;
    }

    .show {
        display: block;
    }

    #navbtn {
        display: inline;
    }
    
    aside {
        z-index: 999;
    }

    .message h1 {
    font-size: 1.5rem;
    }

    #register-content {
        width: 50%;
    }
}


@media (max-width: 940px) {
    footer {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        grid-template-areas:
        "email email"
        "links socials"
        "links copyright"
    }

    footer h1 {
        font-size: 1rem;
    }

    #links a {
        font-size: 1rem;
    }

    .modal {
        display: flex;
        align-items: center;
    }

    .modal-content {
        padding: 1rem;
    }

    .modal-product-details {
        flex-direction: column;
        align-items: center;
    }
    .modal-image-container {
        max-width: 100%;
        margin-bottom: 20px;
    }

    #divider {
        grid-template-columns: 1fr;
        grid-template-areas: 
        "login"
        "register";
    }

    nav #search {
        display: none;
    }

    .cart-item-price {
        font-size: 0.7rem;
    }

    .cart-item-total {
        font-size: 0.9rem;
    }

    .cart-item-controls input {
        width: 2rem;
        padding: 6px;
    }

    .cart-item-controls button {
        margin-top: 0.2rem;
        padding: 6px 10px;
        margin-left: 0;
        font-weight: normal;
    }

    .cart-item-img {
        width: 4rem;
        height: 4rem;
    }

    .cart-item-total {
        width: 5rem; 
    }
    
}

