.custom-category-page {
    padding: 20px 0;
}

.custom-category-title {
    margin-bottom: 20px;
    font-family: var(--third-family);
    font-weight: 500;
    font-size: 48px;
    line-height: 54%;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    text-align: center;
    color: #191919;
}

.custom-category-subtitle {
    padding: 20px;
    width: 60%;
    margin: 0 auto;
    font-family: var(--font-family);
    font-weight: 300;
    font-size: 24px;
    line-height: 125%;
    letter-spacing: 0.02em;
    text-align: center;
    color: #767676;
}

.custom-category-subtitle p {
    margin-bottom: 0;
    font-size: 16px;
    line-height: 1.5;
}

.subcategories-grid {
    margin-top: 30px;
}

.subcategories-grid .row {
    height: 45vh; /* Fixed height to show 2 rows on screen */
    min-height: 300px;
    align-items: stretch;
}

.subcategories-grid .row .col-xs-12.mb-4 {
    max-height: 432px;
    height: 100%;
}

.subcategory-block {
    background: var(--color-background-placeholder, #6a6a6a);
    position:relative;
    overflow: hidden;
    transition: all 0.3s ease;
    height: calc(100% - 20px); /* Account for margin */
    display: flex;
    flex-direction: column;
}

.subcategory-block:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.subcategory-image {
    overflow: hidden;
    flex: 1; /* Take all available space */
    display: flex;
    align-items: center;
    justify-content: center;
}

.subcategory-image img {
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.subcategory-block:hover .subcategory-image img {
    transform: scale(1.05);
}

.subcategory-content {
    padding: 10px 15px 15px 15px;
    flex-shrink: 0; /* Don't shrink the content area */
    text-align: center;
    position: absolute;
    left: 0%;
    top: 40%;
    width: 100%;
}

.subcategory-title {
    margin: unset;
    font-size: 20px;
    font-weight: 600;
}

.subcategory-title a {
    text-decoration: none;
    transition: color 0.3s ease;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 40px;
    line-height: 112%;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-align: center;
    color: #fff;
}

.subcategory-title a:hover {
    color: var(--color-text-hover, #af996b);
    text-decoration: none;
}

.subcategory-description {
    margin-bottom: 20px;
    flex-grow: 1;
}

.subcategory-description p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 0;
}

.subcategory-action {
    margin-top: auto;
}

.subcategory-action .btn {
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.subcategory-action .btn-primary {
    background-color: #007cba;
    border-color: #007cba;
}

.subcategory-action .btn-primary:hover {
    background-color: #005a87;
    border-color: #005a87;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .subcategories-grid .row {
        height: auto;
        min-height: 250px;
    }

    .subcategory-block {
        margin: 5px;
    }

    .subcategory-content {
        padding: 8px 12px 12px 12px;
    }

    .subcategory-title {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .custom-category-page {
        padding: 10px 0;
    }

    .subcategories-grid .col-xs-12 {
        margin-bottom: 20px;
    }
}