/* ==========================================================
   RentHubMP - Homepage Categories
   Final photo-first marketplace card design
========================================================== */

.homepage-categories {
    padding: 56px 20px 32px;
    background: #f8fafc;
}

.homepage-categories-header {
    text-align: center;
    margin: 0 0 42px;
}

.homepage-categories-header h2 {
    margin: 0;
    font-size: clamp(30px, 3vw, 42px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #23395d;
}

.homepage-categories-header p {
    margin: 12px 0 0;
    font-size: 18px;
    color: #667085;
}

/* ==========================
   Grid
========================== */

.homepage-categories-grid {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

/* ==========================
   Final Card
========================== */

.category-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1.5px solid rgba(7, 148, 71, 0.42);
    border-radius: 24px;
    cursor: pointer;
    box-shadow:
        0 2px 4px rgba(16, 24, 40, 0.04),
        0 14px 34px rgba(16, 24, 40, 0.10);
    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
    -webkit-tap-highlight-color: transparent;
}

.category-card:hover,
.category-card:focus-visible {
    transform: translateY(-5px);
    border-color: rgba(7, 148, 71, 0.58);
    box-shadow:
        0 4px 8px rgba(16, 24, 40, 0.05),
        0 20px 46px rgba(7, 148, 71, 0.16);
    outline: none;
}

.category-card.active {
    border-color: #079447;
    box-shadow:
        0 0 0 2px rgba(7, 148, 71, 0.12),
        0 18px 42px rgba(7, 148, 71, 0.16);
}

/* ==========================
   Photo
========================== */

.category-image {
    width: 100%;
    aspect-ratio: 6 / 5;
    background: #eef2f6;
    overflow: hidden;
}

.category-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.001);
    transition: transform .35s ease;
}

.category-card:hover .category-image img {
    transform: scale(1.025);
}

/* ==========================
   Name + live Ads count
   Compact professional footer
   Subtle pattern ONLY in the white footer area
========================== */

.category-content {
    position: relative;
    min-height: 62px;
    padding: 11px 12px 11px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='90' viewBox='0 0 180 90'%3E%3Cg fill='none' stroke='%23079447' stroke-opacity='.055' stroke-width='1'%3E%3Cpath d='M-20 18C8-6 36 4 50 22s37 23 54 5 42-17 60 2 37 15 50 3'/%3E%3Cpath d='M-15 37C12 12 40 22 55 40s38 21 55 2 41-18 59 1 35 16 48 5'/%3E%3Cpath d='M-10 58C16 33 44 43 60 61s36 20 53 3 42-19 59 0 34 17 46 7'/%3E%3Cpath d='M30-12C7 14 17 39 36 53s22 35 5 52'/%3E%3Cpath d='M92-14C68 11 79 38 98 52s22 35 4 51'/%3E%3Cpath d='M151-12C129 13 139 38 158 53s22 35 5 52'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 180px 90px;
    background-repeat: repeat;
}

.category-content h3 {
    min-width: 0;
    flex: 1 1 auto;
    margin: 0;
    color: #071a3b;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-ads-count {
    flex: 0 0 auto;
    min-width: 76px;
    padding: 9px 11px 9px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background:
        linear-gradient(115deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,.04) 42%, transparent 65%),
        linear-gradient(135deg, #20ed78 0%, #10d866 48%, #08af55 100%);
    text-shadow: 0 1px 1px rgba(0,90,40,.15);
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    border-radius: 9px;
    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.48),
        inset 0 -1px 2px rgba(0,110,45,.12),
        0 5px 12px rgba(7,148,71,.20);
    clip-path: polygon(13% 0, 100% 0, 100% 100%, 0 100%);
}

/* ==========================================================
   Tablet - 2 cards per row
========================================================== */

@media (max-width: 992px) {
    .homepage-categories {
        padding: 48px 18px 28px;
    }

    .homepage-categories-header {
        margin-bottom: 34px;
    }

    .homepage-categories-header p {
        font-size: 16px;
    }

    .homepage-categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .category-content {
        min-height: 60px;
        padding: 10px 11px 10px 14px;
    }

    .category-content h3 {
        font-size: 15px;
    }

    .category-ads-count {
        min-width: 72px;
        padding: 8px 10px 8px 15px;
        font-size: 13px;
    }
}

/* ==========================================================
   Mobile - 1 card per row
========================================================== */

@media (max-width: 576px) {
    .homepage-categories {
        padding: 38px 14px 24px;
    }

    .homepage-categories-header {
        margin-bottom: 26px;
    }

    .homepage-categories-header h2 {
        font-size: 28px;
    }

    .homepage-categories-header p {
        margin-top: 8px;
        font-size: 15px;
    }

    .homepage-categories-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .category-card {
        border-radius: 22px;
    }

    .category-image {
        aspect-ratio: 6 / 5;
    }

    .category-content {
        min-height: 58px;
        padding: 10px 10px 10px 14px;
        gap: 9px;
    }

    .category-content h3 {
        font-size: 15px;
    }

    .category-ads-count {
        min-width: 70px;
        padding: 8px 9px 8px 14px;
        font-size: 13px;
        border-radius: 8px;
    }
}

/* Supporting labels; category names and selection values stay unchanged. */
.category-label {
    min-width: 0;
    flex: 1 1 auto;
}
.category-subtitle {
    margin: 4px 0 0;
    color: #667085;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
}
