.custom-grain-section {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
    font-family: Arial, sans-serif;
}

.custom-grain-section h1 {
    text-align: center;
    font-weight: bold;
    margin-bottom: 40px;
    color: #111;
}

.grain-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 items per row on mobile screens */
    gap: 20px;
}

@media (min-width: 768px) {
    .grain-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 items per row on tablets */
    }
}

@media (min-width: 1024px) {
    .grain-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 items per row on desktop (Perfect 4x2 layout) */
    }
}

.grain-card {
    display: flex;
    flex-direction: column;
    /* height: 68%; */
    height: 100%;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    overflow: hidden;
}

.grain-img-container {
    position: relative;
    overflow: hidden;
    height: 180px;
    width: 100%;
    cursor: pointer;
}

@media (min-width: 768px) {
    .grain-img-container {
        height: 240px;
    }
}

.grain-img {
    transition: transform 0.3s ease;
    object-fit: cover;
    height: 100%;
    width: 100%;
    display: block;
}

.grain-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    text-align: center;
    box-sizing: border-box;
    z-index: 3;
}

.grain-img-container:hover .grain-hover-overlay {
    opacity: 1;
}

.grain-img-container:hover .grain-img {
    transform: scale(1.05);
}

.grain-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-top: 10px;
    color: #212529;
}

.grain-content-bottom {
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto; 
}

.grain-static-title {
    color: #333333;
    font-weight: bold;
    font-size: 1.6rem;
    margin: 0;
    transition: color 0.3s ease;
}

.grain-static-title:hover {
    color: #66a84e; /* Change this to your preferred hover color */
    cursor: pointer; /* Optional: changes cursor to a hand on hover */
  }
.grain-action-btn {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.grain-action-btn:active {
    transform: scale(0.98);
}