/* Service Categories Widget */
.service-categories-container {
    width: 100%;
    margin: 0 auto;
}

.service-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.service-category-item {
    position: relative;
    display: block;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    height: 250px;
}

.service-category-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.service-category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-category-item:hover .service-category-overlay {
    background-color: rgba(0, 0, 0, 0.7);
}

.service-category-content {
    position: relative;
    z-index: 3;
    padding: 30px 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.1) 100%);
}

.service-category-content-inner {
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.service-category-item:hover .service-category-content-inner {
    transform: translateY(-20px);
}

/* Icon Positioning */
.service-category-icon {
    position: absolute;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Position Classes */
.service-category-icon-position-top-right .service-category-icon {
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    z-index: 4;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.service-category-item:hover .service-category-icon {
    transform: scale(1.1);
}

.service-category-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: right;
    position: relative;
    z-index: 3;
}

.service-category-count {
    font-size: 0.8em;
    opacity: 0.8;
    margin-right: 5px;
}

.service-category-subtitle {
    font-size: 14px;
    margin: 0 0 15px 0;
    opacity: 0.9;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    position: relative;
    z-index: 2;
}

.service-category-description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 20px 30px;
    font-size: 14px;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    max-height: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.service-category-item:hover .service-category-subtitle {
    opacity: 0;
    transform: translateY(-10px);
}

.service-category-item:hover .service-category-description {
    opacity: 0.9;
    transform: translateY(0);
    transition-delay: 0.1s;
}

/* Adjust content positioning when description is present */
.service-category-item:not(:hover) .service-category-content-inner {
    margin-bottom: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-category-item:hover .service-category-content-inner {
    margin-bottom: 20px;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .service-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .service-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .service-category-description {
        -webkit-line-clamp: 4;
    }
}

@media (max-width: 768px) {
    .service-categories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .service-category-item {
        height: 200px;
    }
    
    .service-category-title {
        font-size: 16px;
    }
    
    .service-category-description {
        -webkit-line-clamp: 3;
        font-size: 13px;
        padding-bottom: 20px;
    }
    
    .service-category-item:hover .service-category-content-inner {
        transform: translateY(-10px);
    }
}
