* {
    margin: 0;
    padding: 0;
    list-style: none;
    text-decoration: none;
    color: black;
    box-sizing: border-box;
}

header {
    height: 20vh;
    width: 100vw;
}

.navbar {
    position: absolute;
    top: 50px;
    padding: 0 50px 0 50px;
    display: flex;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
}

.navbar .logo {
    font-size: 2em;
    font-weight: bold;
}

.navbar .nav-links ul {
    display: flex;
}

.navbar .nav-links ul li {
    margin: 0 25px;
}

.navbar .menu-burger {
    display: none;
    position: absolute;
    top: 50px;
    right: 50px;
    width: 35px;
}

.navbar .shopping-bag {
    display: none;
    position: absolute;
    top: 52px;
    right: 95px;
    width: 30px;
}


/* EMPTY BAG */
.empty {
  text-align: center;
  margin-top: 150px;
  font-size: 1.2em;
}

/* BAG LAYOUT */
.bag {
  display: flex;
  margin-top: 150px; 
  width: 100%;
  justify-content: space-between;
  gap: 20px;
  padding: 0 5%;
}

.purchase {
  flex: 70%;
}

.total {
  border: 1px solid whitesmoke;
  border-radius: 7px;
  padding: 20px;
  height: 200px;
  width: 28%;
  margin: 0px;
  color: grey;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* TABLE */
table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid #ccc;
}

footer {
    background-color: rgb(153, 146, 146);
    margin-bottom: 0;
    padding: 10px;
}


.chiant {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.imgfooter {
    display: flex;
    justify-content: center;
}

.imgfooter img {
    height: 50px;
    width: 50px;
    object-fit: contain;
    display: block;
}


@media screen and (max-width: 800px) {
    /* navbar */
    .navbar {
         padding: 0; 
         top: 10px;
    }

    .navbar .logo { 
        position: absolute; top: 50px; left: 50px; 
    }

    .nav-links .logo a {
         color: black; 
    }

    .navbar .menu-burger {
         display: block; 
    }

    .navbar .shopping-bag {
         display: block; 
    }
    
    .nav-links {
        top: 0; left: 0; 
        position: absolute;
        background-color: rgba(254, 254, 254, 0.95); 
        width: 100%; 
        height: 100vh;
        display: flex; 
        justify-content: center; 
        align-items: center;
        margin-left: -100%; 
        transition: all 0.5s ease;
        z-index: 10; 
    }

    .mobile-menu {
         margin-left: 0; 
    }

    .nav-links ul {
         display: flex; 
         flex-direction: column; 
         align-items: center; 
    }

    .navbar .nav-links ul li {
         margin: 25px 0; 
         font-size: 1.2em; 
    }

    /* --- bag --- */
    
    .bag {
        display: flex;
        flex-direction: column; 
        margin-top: 140px; 
        padding: 0 10px;
    }

    .total {
        order: -1; 
        width: 100%; 
        box-sizing: border-box; 
        margin: 0 0 30px 0; 
        height: auto; 
        position: static; 
        top: 100px; 
    }

    .purchase {
        width: 100%;
    }

    table {
        display: block;
        width: 100%;
        border: none;
    }

    thead { 
        display: none; 
    }

  
    tbody {
        display: flex;
        flex-wrap: wrap; 
        gap: 15px; 
        justify-content: space-between; 
    }

    tr {
        background: white;
        width: calc(50% - 8px); 
        box-sizing: border-box; 
        padding: 15px 10px;
        border-radius: 15px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0; 
    }

    td {
        display: block;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        padding: 5px 0;
        border: none; 
        font-size: 1em; 
    }

    td img {
        width: 100%;
        max-width: 120px; 
        height: auto;
        object-fit: contain;
        margin: 0 auto;
    }

    td:nth-child(2) {
        font-weight: bold;
        height: 40px; 
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    td form {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 5px;
    }

    td button {
        padding: 2px 8px;
        font-size: 1.1em;
        border-radius: 4px;
    }
    
    td:last-child {
        font-weight: bold;
        color: #333;
        margin-top: auto; 
    }
}

