/* --- MENU STYLES CSS --- */

.block {
    background-color: #f2f2f2;
    padding: 75px;
    display: inline-flex;
    flex-wrap: wrap;
    border-radius: 75px;
    margin-bottom: 100px;
    /*overflow: hidden;*/
    width: 100%; /* Ensures container fits properly */
    box-sizing: border-box;
}

#Block1 {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 1. PARENT CONTAINER FIX: Unlocked width */
#SubBlock1 {
    position: relative;
    display: flex !important;
    flex-direction: column;
    border-radius: 75px;
    
    /* Responsive Width Logic */
    width: 95%;           
    max-width: 1400px;    
    margin: 0 auto;       
}

#title {
    display: block;
    margin: 0 auto 60px auto;
    font-size: 50px;
    text-align: center;
}

#subtitle {
    display: flex;
    margin: 25px auto;
    font-size: 35px !important;
    justify-content: center;
}

#searchInput {
    display: block;
    margin: 0 auto 20px auto;
    width: 50%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

#list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    /*max-height: calc(100% - 100px);
    overflow-y: auto;*/
}

#categories {
    margin-bottom: 20px;
}

#categories h2 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center; 
}

/* 2. PRODUCT LIST GRID */
#sublist {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* The space between items */
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

/* 3. PRODUCT BOX (DESKTOP DEFAULT: 3 Columns) */
#sublist li {
    background-color: #ffffff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #ccc;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    
    /* Layout inside the card */
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    /* THE FIX: Fixed width for 3 columns. 
       Formula: (100% - 40px gap) / 3 items */
    width: calc((100% - 40px) / 3);
    
    /* Disables growing so the last item DOES NOT stretch */
    flex-grow: 0; 
    flex-shrink: 0; 
}

#sublist li:hover {
    transform: scale(1.03);
    box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.2);
    z-index: 10; 
    position: relative;
}

/* 4. TEXT ALIGNMENT FIX (Global) */
.product-name {
    font-weight: bold;
    text-align: left;
    flex: 1; /* Pushes price to the right */
    padding-right: 15px;
    word-wrap: break-word;
}

.product-price {
    color: #555;
    font-weight: normal;
    font-size: 14px;
    text-align: right;
    white-space: nowrap; /* Prevents price wrapping */
    flex-shrink: 0;
}

/* --- RESPONSIVE BREAKPOINTS --- */

/* TABLETS (Below 1000px): Switch to 2 Columns */
@media (max-width: 1000px) {
    #sublist li {
        /* Formula: (100% - 20px gap) / 2 items */
        width: calc((100% - 20px) / 2);
    }
    
    #searchInput {
        width: 70%;
    }
}

/* MOBILE (Below 600px): Switch to 1 Column */
@media (max-width: 650px) {
    .block {
        padding: 100px 15px 50px 15px; /* Adjusted padding */
    }

    #SubBlock1 {
        border-radius: 0;
        width: 100%;
    }

    #title, #subtitle {
        font-size: 30px !important;
        margin-bottom: 30px;
    }

    #searchInput {
        width: 90%;
    }

    #sublist li {
        width: 100%; /* Full width */
        margin-bottom: 10px;
    }
    
    /* Stack alignment for very small screens if needed */
    #sublist li {
        min-height: 70px;
    }
}

/* --- FOOTER OVERRIDE --- */

#FooterDiv {
    /* 1. Force full width to match the menu blocks */
    width: 95% !important;
    max-width: 1400px !important;
    
    /* 2. Remove side margins so it touches the screen edges */
    margin-left: 0 !important;
    margin-right: 0 !important;
    
    /* 3. Adjust spacing to look clean with full width */
    margin-top: 50px !important;    /* Keeps space above footer */
    margin-bottom: 0 !important;    /* Flush with bottom of page */
    
    /* Optional: Remove rounded corners if you want a solid bar look */
    /* border-radius: 0 !important; */
}

/* Ensure mobile responsiveness handles the override gracefully */
@media (max-width: 650px) {
    #FooterDiv {
        width: 100% !important;
        max-width: none !important;
        padding: 40px 20px !important; /* Reset padding for mobile safety */
        border-radius: 0 !important;   /* Square edges on mobile usually look better */
    }
}