#wpcategories {
  margin: 20px 0;
}


.wphomecategory-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Adjusted min-width for mobile */
    column-gap: 20px;
}

.wphomecategory {
    background: #fff;
    padding: 15px;
    border: 1px solid #eaeaea;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.wphomecategory-item {
    display: flex;
}

.wpsubcats-wrap.wpnosubcats {
    display: flex;
    justify-content: end;
}

.wpsubcats-wrap.wpsubcats {
    display: grid;
    grid-template-columns: 2fr 1fr;
}

.wphomecategory a:hover {
    text-decoration: underline;
}

.wphomecategory.wphomebg {
    background-position: top right;
    background-repeat: no-repeat;
    background-size: contain;
    box-shadow: 2px 2px 8px 0 rgba(0, 0, 0, 0.2);
    background-origin: content-box;
}

@media (max-width: 600px) {
    .wpsubcats-wrap.wpsubcats {
        display: flex;
        flex-direction: column-reverse;
    }

    .wphomecategory-items {
         grid-template-columns: repeat(2, calc(50% - 10px)); /* 50% width minus the gap */
          column-gap: 20px;
    }

    .wpsubcats-wrap.wpsubcats img {
        max-width: 100px;
    }
    .wphomecategory h2 {
        font-size: 16px;
    }
}

@media (max-width: 400px) {
    .wphomecategory-items {
        grid-template-columns: 1fr; /* Change to 1 column for very small screens */
    }
}
