/* Montgat Grid Section */
.montgat-section {
    padding: 1rem;
    text-align: center;
}

.cart-counter {
    background-color: #ff4d4f;
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    position: relative;
    top: -10px;
    left: -10px;
    display: inline-block;
}


.montgat-text {
    margin-bottom: 2rem;
}

.montgat-text h1 {
    color: red;
    font-size: 44px;
    text-transform: uppercase;
}

.montgat-text p {
    color: white;
    text-transform: capitalize;
}

.sort-filter-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-start;
    /* Sort button on the left */
    gap: 1rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background-color: red;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
}

.filter-btn:hover {
    background-color: #b90000;
}

.montgat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 2rem;
}

.montgat-item {
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f9f9f9;
    width: 100%;
    max-width: 350px;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s;
    margin: 0 auto;
    /* Centers items within the grid */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.montgat-item:hover {
    transform: scale(1.05);
}

.montgat-item img {
    width: 100%;
    /* Full width for images */
    max-height: 270px;
    /* Fixed height to prevent cropping */
    object-fit: contain;
    /* Prevents image from being cropped */
    aspect-ratio: 1/1;
    /* Aspect ratio for images */
    border-radius: 4px;
    margin-bottom: 1rem;
    /* Spacing below the image */
    background-color: rgb(226, 226, 226);

}

.montgat-item-content {
    display: flex;
    flex-direction: row;
    /* Switch to row layout */
    align-items: flex-start;
    /* Align content at the start */
    gap: 1rem;
    /* Space between image and text */
    margin-top: 1rem;
    text-align: left;
}

.montgat-item-content h3 {
    font-size: 1.2rem;
    margin: 0.5rem 0;
}

.montgat-item-content p {
    color: #555;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    overflow: hidden;
    /* Prevents overflow of long text */
    text-overflow: ellipsis;
    /* Adds ellipsis for long text */
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.montgat-item .price {
    font-size: 1.5rem;
    color: red;
    font-weight: bold;
    margin: 0.5rem 0;
}

.add-cart {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: red;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
    /* Ensures the button stays at the bottom */
    width: 100%;
    /* Full width for smaller screens */
    font-size: 1rem;
    /* Smaller font size for buttons on small screens */
    font-weight: bold;
}





/* Media queries for responsive design */
@media (max-width: 768px) {
    .sort-filter-container {
        justify-content: center;
        /* Center sort button */
    }

    .montgat-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Two columns */
        gap: 1rem;
        /* Adjust spacing */
    }

    .montgat-item {
        flex-direction: column;
        /* Stack items vertically */
        max-width: none;
        /* Let width adjust naturally */

    }

    .montgat-item img {
        max-height: calc(270px * 0.6);
        /* Adjust image height */
    }


}

@media (max-width: 595px) {
    .montgat-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Single column layout */
        gap: 0.5rem;
    }


}

@media (max-width: 480px) {

    .montgat-grid {
        grid-template-columns: repeat(1, 1fr);
        /* Single column layout */
        gap: 0.5rem;
    }

    .montgat-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        max-height: calc(1080px / 5);
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        text-align: center;
        transition: transform 0.2s;
        margin: 0 auto;
        /* Centers items within the grid */
        padding: 0.5rem;

    }

    .montgat-item img {
        max-width: calc(1080px / 7);
        max-height: calc(1080px / 7);
        /* Adjust image height */
        margin: 0px;
        flex: 1;
    }

    .montgat-details {
        flex-grow: 1;
        /* Allow the details to take up remaining space */
        display: flex;
        flex-direction: column;
        text-align: start;
        margin: 10px;
    }

    .montgat-details h1 {
        font-size: 18px;
    }

    .montgat-details p {
        font-size: 14px;
        display: none;

    }

    .montgat-details div.price {
        font-size: 20px;
    }

    .montgat-details .buy-now {
        text-align: center;
        width: 70%;
    }

}