/* Services Grid 04 Widget */
.services-grid {
    display: grid;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 20px;
}

.service-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    position: relative;
    z-index: 1;
}

.service-item {
    position: relative;
    overflow: hidden;
    height: 300px;
    display: flex;
    align-items: flex-end;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    transform: translateZ(0); /* Force hardware acceleration */
    will-change: transform;
    backface-visibility: hidden;
    
}

/* Default hover effect - will be overridden by Elementor controls */
.elementor-widget:not(.elementor-element-edit-mode) .service-item:hover {
    transform: translateY(-8px) scale(1.03);
    z-index: 2;
}

.service-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.9;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.service-item:hover .service-overlay {
    opacity: 0.95;
}

.service-content {
    position: relative;
    z-index: 2;
    padding: 25px;
    width: 100%;
    color: #fff;
    transition: transform 0.3s ease;
}

.service-item:hover .service-content {
    transform: translateY(-10px);
}

.service-title {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--e-global-color-primary, #ffffff);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    width: 100%;
    transition: color 0.3s ease;
}

.service-title {
    color: inherit;
    transition: color 0.2s ease;
}

.service-item-link:hover .service-title {
    color: var(--e-global-color-secondary, #6ec1e4) !important;
}

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

.service-subtitle {
    font-size: 0.9em;
    opacity: 0.9;
    margin: 5px 0 10px;
    transition: all 0.3s ease;
    max-height: 50px;
    overflow: hidden;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.service-description {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease;
    opacity: 0;
}

.service-item:hover .service-description {
    max-height: 100px;
    margin-top: 12px;
    opacity: 1;
}

.service-item:hover .service-subtitle {
    max-height: 0;
    margin: 0;
    opacity: 0;
    padding: 0;
}

/* Responsive Styles */
@media (max-width: 1199px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 991px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .service-item {
        height: 280px;
    }
}

@media (max-width: 767px) {
    .services-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
    
    .service-item {
        height: 250px;
    }
    
    .service-content {
        padding: 20px;
    }
    
    .service-title {
        font-size: 20px;
    }
}

/* RTL Support */
.rtl .service-content {
    text-align: right;
    direction: rtl;
}

.rtl .service-count {
    margin-right: 0;
    margin-left: 6px;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

/* Add delay for each item */
.service-item:nth-child(1) { animation-delay: 0.1s; }
.service-item:nth-child(2) { animation-delay: 0.2s; }
.service-item:nth-child(3) { animation-delay: 0.3s; }
.service-item:nth-child(4) { animation-delay: 0.4s; }
.service-item:nth-child(5) { animation-delay: 0.5s; }
.service-item:nth-child(6) { animation-delay: 0.6s; }
