@import url(../../index.css);

.heading {
    text-align: center;
    font-size: 7rem;
    margin: 2rem 0;
}

.inventory {
    background-color: var(--second-bg-color);
}

.inventory-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(335px, 1fr));
    place-items: center;
    justify-items: center;
    gap: 3rem;
    row-gap: 5rem;
}

.inventory-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    background-color: var(--bg-color);
    border: 2px solid var(--main-color);
    border-radius: 3rem;
    gap: 2rem;
    padding: 3rem 2rem; /* Adjust padding for better spacing */
    overflow: hidden; /* Hides overflow text */
    cursor: pointer;
    box-shadow: 0 0 5px var(--main-color);
    transition: 0.3s ease;
    min-height: 400px; /* Set a minimum height to ensure consistent card size */
    width: 100%;
    max-width: 370px; /* Ensure the card doesn't get too wide */
}

.inventory-card:hover {
    box-shadow: 0 0 25px var(--main-color),
                0 0 50px var(--main-color);
    transform: scale(1.02);
}

.inventory-card img {
    max-width: 90%; /* Make image slightly smaller to fit */
    border-radius: 2em;
    object-fit: cover;
    height: auto; /* Keep aspect ratio intact */
}

.inventory-card h3 {
    font-size: 3rem;  
    margin-bottom: 1rem;
}

.inventory-card p {
    font-size: 1.6rem;
    overflow: hidden; /* Hides text that overflows the card */
    text-overflow: ellipsis; /* Optionally add ellipsis if the text overflows */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limits the number of lines of text */
    -webkit-box-orient: vertical;
    line-clamp: 3;
    margin-bottom: 2rem;
}

.inventory-card .btn a {
    color: black;
}

@media (max-width: 992px) {
    .heading {
        font-size: 5rem !important;
    }

    .inventory-card {
        padding: 4rem 2rem !important;
    }

    .inventory-card img {
        max-width: 250px !important;
    }

    .inventory-card h3 {
        font-size: 2.5rem !important;
    }

    .inventory-card p {
        font-size: 1.4rem !important;
    }
}

/* For mobile devices */
@media (max-width: 576px) {
    .heading {
        font-size: 4rem !important;
    }

    .inventory-box {
        grid-template-columns: 1fr; /* Ensure one card per row on mobile */
    }

    .inventory-card {
        padding: 3rem 1.5rem !important;
    }

    .inventory-card img {
        max-width: 200px !important;
    }

    .inventory-card h3 {
        font-size: 2rem !important;
    }

    .inventory-card p {
        font-size: 1.3rem !important;
    }
}

