/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

/* Filter Section */
.filter-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    gap: 15px;
    flex-wrap: wrap;
    
}

.filter-container label {
    font-weight: bold;
    font-size: 1rem;
    color: #333;
}

#filter-type {
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 5px;
    outline: none;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#filter-type:focus {
    border-color: #007bff;
}

/* Search Bar */
.search-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 10px;
    flex-wrap: wrap;
}

.search-bar {
    display: flex;
    align-items: center;
    border: 2px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
    width: 300px;
    transition: box-shadow 0.3s;
}

.search-bar:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.search-bar input {
    border: none;
    padding: 10px;
    font-size: 1rem;
    width: 100%;
    outline: none;
}

.search-bar button {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-bar button:hover {
    background: #0056b3;
}

.search-bar button i {
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-container label {
        font-size: 1.5rem;
    }
    .filter-container {
        flex-direction: row;
        align-items: center;
        padding-left: 20px;
        gap: 10px;
    }

    #filter-type {
        width: 155px;
    }

    .search-bar {
        width: 300px;
    }
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px;
}

.product-card {
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.product-card img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.product-card p {
    font-size: 1rem;
    margin: 10px 0;
    color: #333;
}

.product-card button {
    background: #007bff;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.product-card button:hover {
    background: #0056b3;
}

/* Modal container styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
    overflow-y: auto;

}

.modal img{
    width: 500px;
    height: 100%;
}

/* Modal content styling */
.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    text-align: left;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
    margin-top: 70px;
    margin-bottom: auto;
    display: flex;
    max-height: 80vh;   
    overflow-y: auto;

}

.modal-content h4{
    font-size: 2.0rem;
}

/* Close button styling */
.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: relative;
    left: 1155px;
    top: -15px;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
}

/* Headings and text */
h2 {
    margin-top: 10px;
    color: #333;
}

p {
    color: #555;
    line-height: 1.5;
}

/* Buy button */
.buy-button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

.buy-button:hover {
    background-color: #007bff;
}

/* Open modal button */
.modal-button {
    background-color: #007bff;
    color: #fff;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.modal-button:hover {
    background-color: #0056b3;
}
/* Modal container styling for mobile */
@media (max-width: 768px) {
    .modal-content {
        width: 90%; /* Use a wider width for smaller screens */
        padding: 15px; /* Reduce padding for compact spacing */
        margin: 20% auto; /* Adjust vertical margin for better visibility */
        flex-direction: column;
        
    }

    .modal img {
        width: 100%; /* Ensure the image takes up full width */
        height: auto; /* Maintain aspect ratio */
        margin-bottom: 10px; /* Add some spacing below the image */
    }

    .close {
        font-size: 24px; /* Slightly smaller close button */
        top: -10px; /* Adjust positioning */
        right: -10px; /* Adjust positioning */
    }

    h2 {
        font-size: 20px; /* Reduce heading size */
        margin: 10px 0; /* Adjust spacing */
    }

    p {
        font-size: 14px; /* Make text more compact */
        line-height: 1.4; /* Adjust line spacing */
    }

    .buy-button, .modal-button {
        padding: 8px 12px; /* Smaller padding */
        font-size: 14px; /* Reduce font size */
    }
}

/* Modal container styling for very small screens (e.g., phones) */
@media (max-width: 480px) {
    .modal-content {
        width: 95%; /* Almost full width for smaller screens */
        padding: 10px; /* Even more compact spacing */
        margin: 25% auto; /* Center it better vertically */
    }

    .close {
        font-size: 20px; /* Smaller close button */
    }

    h2 {
        font-size: 18px; /* Further reduce heading size */
    }

    p {
        font-size: 12px; /* Make text more compact */
    }

    .buy-button, .modal-button {
        padding: 6px 10px; /* Compact padding */
        font-size: 12px; /* Smaller font size */
    }
}