body {
    text-align: center;
    background-image: url('../images/');
    background-color: white;
    background-size: cover;
    background-repeat: no-repeat; 
    background-position: center center; 
    color: black;
    max-width: 98.75vw;
    width: 100vw; /* Full width */
    overflow-x: hidden; /* Prevent horizontal scroll */
    margin: 0; /* Remove default body margins */
    padding: 0; /* Remove padding */
}

header {
    top: 0vw;
    position: fixed;
    z-index: 1;
    width: 100vw; /* Full width */
    background-color: #FAF3E0;
    padding-top: 0.5vw;
}

.search_container {
    position: fixed;
    margin-top: 2%;
    margin-left: 40%;
    z-index: 2; 
}

.search_container button {
    background-color: white;
    color: black;
    padding: 0.5vw;
    border-radius: 5px;
}

.search_container button:hover {
    background-color: gray;
}

#cart-count {
    position: absolute; 
    top: 10%; 
    right: 10%;
    background-color: red; 
    color: white;
    border-radius: 50%; 
    padding: 5px 10px;
    font-size: 14px;
    z-index: 10;
}

a {
    position: relative; /* So that the absolute position of #cart-count works correctly */
    display: inline-block; /* Ensure the image is treated as a block element */
}

header ul {
    gap: 1.5vw;
}

header li {
    font-size: 2.5vw;
    margin: auto;
}

.contains {
    margin-top: 1.5vw;
    display: flex;
    flex-direction: row; /* Ensure that menu and table are side by side */
}

.mobile_menu{
    display: none;
}

.menu {
    position: fixed;
    padding-top: 0.1%;
    display: block;
    background-color: #FAF3E0;
    width: 20%;
    height: 41vw;
    margin-top: 7.4%;
    margin-bottom: -100%;
    border: solid;
    border-radius: 0.5%;
    border-color: white;
}

.menu p {    
    width: 80%;
    margin-bottom: -5%;
    padding: 1%;
    margin: auto;   
    margin-top: 4%;
    color: black;
    font-size: 2vw;
    display: flex;
}



.menu h1 {
    color: black;
}

.table {
    margin: 2%;
    width: 76%;
    margin-left: 23%;
    margin-top: 7%;
}

.h1_title {
    display: flex;
    margin: 0.5%;
    background-color: #FAF3E0;
    color: black;
    padding: 1%;
    border: solid;
    border-radius: 1%;
    border-color: white;
}

.products {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Slightly reduced the gap */
    justify-content: center;
}

.prod {
    width: calc(20% - 10px); /* Adjusted width for 5 items per row */
    box-sizing: border-box;
    text-align: center;
    margin-bottom: 20px;
    background-color: #FAF3E0; /* Optional: Background color for better contrast */
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    border: 5px solid #FAF3E0;
}

.prod img {
    max-width: 100%;
    height: auto;
    border-radius: 8px; /* Rounded corners for image */
}

/* Smooth transition for text resizing on hover */
.prod h1, .prod h2 {
    margin: 2%;
    color: black;
    font-size: 1.5vw; /* Slightly smaller font size */
    flex-shrink: 0;
}

.prod h2 {
    color: black;
}


/* Hide Add to Cart form by default */
.add-to-cart-form {
    display: flex;
    margin-top: 3px;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3px;
}

/* Optional: Style the quantity input and button */
.add-to-cart-form input[type="number"] {
    width: 60px;
    margin-bottom: 5px;
}

.add-to-cart-form button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.add-to-cart-form button:hover {
    background-color: #218838;
}

/* Style for the category toggle button */
#toggle-menu {
    padding: 1vw;
    font-size: 2v;
    cursor: pointer;
    background-color: #FAF3E0; /* Button color */
    color: black;
    border: solid 1% black;
    border-radius: 0.5vw;
    margin-top: 1vw;
}

/* Category Menu Container */
.category-menu {
    display: none; /* Hidden by default */
    position: absolute;
    background-color: #f9f9f9;
    border: 1% solid #ccc;
    border-radius: 0.5vw;
    box-shadow: 0px 1% 2% rgba(0, 0, 0, 0.2); 
    padding: 2%;
    width: 10vw;
    z-index: 10;
    height: 30vw;
    overflow: scroll;
    -ms-overflow-style: none;
    scrollbar-width: none; 
}

/* Class to Show Menu */
.category-menu.show-menu {
    display: block; /* Show menu when button is clicked */
}

/* Styling Each Category Link */
.category-link {
    display: block; /* Stack links vertically */
    padding: 1%;
    color: #333;
    text-decoration: none;
    font-size: 1.5vw;
}

/* Hover Effect for Links */
.category-link:hover {
    background-color: #ddd;
}


/* Style for each category link inside the dropdown */
.category-menu a {
    display: block;
    color: #333; /* Text color */
    padding: 2%;
    text-decoration: none;
    border-radius: 0.5vw;
}

/* Hover effect for category links */
.category-menu a:hover {
    background-color: #ddd; /* Light gray on hover */
    color: #000;
}

.textP a{
    width: 80%;
    margin-bottom: -6%;
    padding: 1%;
    margin: auto;   
    margin-top: 4%;
    color: black;
    font-size: 2vw;
    display: flex;
}

.textP a:hover{
    background-color: #FAF3E0;
} 

.table {
    min-height: 40vw; /* Adjust based on how much height you want */
}


footer{
    position: relative;  /* Ensure footer is not fixed to the screen */
    z-index: 7; /* Set the z-index here */
}

/* ------------------ TABLET (≤ 1024px) ------------------ */
@media screen and (max-width: 1024px) {
    .menu {
        width: 30%;
        height: auto;
        margin-top: 10vw;
    }

    .prod {
        width: calc(33.33% - 10px); /* 3 per row */
    }

    .search_container {
        margin-left: 30%;
        margin-top: 3vw;
    }

    .category-menu {
        width: 20vw;
        height: 40vw;
    }

    header li {
        font-size: 3vw;
    }

    .prod h1, .prod h2 {
        font-size: 2vw;
    }

    .textP a {
        font-size: 2.5vw;
    }
}

/* ------------------ MOBILE (≤ 768px) ------------------ */
@media screen and (max-width: 768px) {
  
    .table {
        min-height: 80vw; /* Adjust based on how much height you want */
    }

    .livraison {
        display: none;
    }
    
    .contains {
        flex-direction: column;
    }

    .mobile_menu{
        display: block;
    }

    .menu {
        display: none;
        position: relative;
        width: 100%;
        background-color: #FAF3E0;
        border: none;
        padding-top: 2vw;
        z-index: 8;
    }

    .table {
        width: 100%;
        margin-left: 0;
        margin-top: 25vw;
    }

    .prod {
        width: calc(50% - 10px); /* 2 per row */
    }

    .search_container {
        width: 100vw;
        margin: auto;
        margin-top: 18vw;
        padding-bottom: 2vw;
        background-color: #FAF3E0;
        z-index: 2; 
        position: fixed;
    }

    .search_container input{
        margin-left: 10vw;
    }

    .search_container.submit{
        color: black;
        background-color: white;
    }

    .category-menu {
        width: 60vw;
        height: 50vw;
    }

    .prod h1, .prod h2 {
        font-size: 3vw;
    }

    header li {
        font-size: 4vw;
    }


    .textP a {
        font-size: 3.5vw;
    }

    .add-to-cart-form input[type="number"] {
        width: 40px;
    }

    .add-to-cart-form button {
        padding: 5px;
        font-size: 3vw;
    }

    #cart-count {
        font-size: 12px;
        padding: 4px 8px;
    }

     /* Individual items in menu */
     .menu p {
        width: 80%;
        padding: 1%;
        margin: 4% auto -5%;
        color: black;
        font-size: 4vw;
        display: flex;
    }

    /* Menu toggle button visible & fixed */
    #toggle-mobile-menu {
        display: block !important;
        position: fixed;
        top: 16vw;
        left: 5vw;
        z-index: 20;
        padding: 2vw;
        font-size: 2vw;
        background-color: #FAF3E0;
        color: black;
        border: 1px solid black;
        border-radius: 1vw;
    }

    #mobile-category-menu {
        position: fixed;
        top: 26vw; /* adjust as needed */
        left: 0;
        width: 100%;
        background-color: #FAF3E0;
        z-index: 19;
        padding: 2vw;
    }
    
    .category-link {
        display: block;
        padding: 2vw;
        font-size: 4vw;
        text-align: center;
        text-decoration: none;
        color: black;
    }
    
    

}


