/**
 * Related Services Carousel Styles
 * Responsive carousel with touch/swipe support
 */

/* Carousel Container */
.related-services {
    padding: 4rem 0;
    background: #f8fafc;
    overflow: hidden;
}

.related-services .section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 3rem;
    position: relative;
}

.related-services .section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* Carousel Wrapper */
.related-services-carousel {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4rem;
}

/* Carousel Track */
.related-services-track {
    display: flex;
    gap: 2rem;
    transition: transform 0.3s ease-in-out;
    cursor: grab;
    user-select: none;
}

.related-services-track:active {
    cursor: grabbing;
}

/* Service Card */
.related-service-card {
    flex: 0 0 calc(33.333% - 1.333rem);
    min-width: 0;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(102, 126, 234, 0.05);
    position: relative;
}

.related-service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02) 0%, rgba(240, 147, 251, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.related-service-card:hover::before {
    opacity: 1;
}

.related-service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-link:hover {
    text-decoration: none;
}

/* Card Image */
.card-image {
    height: 220px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.related-service-card:hover .card-image img {
    transform: scale(1.1);
}

/* Card Content */
.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    line-height: 1.4;
    min-height: 2.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Price */
.card-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.price-label {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
}

.price-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.price-contact {
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
}

/* Card Action */
.card-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #667eea;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.related-service-card:hover .card-action {
    color: #5a67d8;
    transform: translateX(5px);
}

.card-action i {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.related-service-card:hover .card-action i {
    transform: translateX(3px);
}

/* Navigation Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: white;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: #667eea;
    font-size: 1.2rem;
}

.carousel-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-btn-prev {
    left: 0;
}

.carousel-btn-next {
    right: 0;
}

/* Dots Navigation */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cbd5e0;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot:hover {
    background: #a0aec0;
    transform: scale(1.2);
}

.carousel-dot.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    width: 32px;
    border-radius: 6px;
}

/* No Related Services */
.no-related-services {
    text-align: center;
    padding: 3rem;
    color: #718096;
    font-size: 1.1rem;
}

/* Responsive Design */

/* Tablet (2 slides) */
@media (max-width: 1024px) {
    .related-services-carousel {
        padding: 0 3rem;
    }
    
    .related-service-card {
        flex: 0 0 calc(50% - 1rem);
    }
    
    .carousel-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

/* Mobile (1 slide) */
@media (max-width: 768px) {
    .related-services {
        padding: 3rem 0;
    }
    
    .related-services .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .related-services-carousel {
        padding: 0 2.5rem;
    }
    
    .related-service-card {
        flex: 0 0 100%;
    }
    
    .related-services-track {
        gap: 1.5rem;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .carousel-btn-prev {
        left: -5px;
    }
    
    .carousel-btn-next {
        right: -5px;
    }
    
    .card-image {
        height: 200px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .related-services {
        padding: 2rem 0;
    }
    
    .related-services .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .related-services-carousel {
        padding: 0 2rem;
    }
    
    .carousel-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1rem;
        min-height: 2.4rem;
    }
    
    .price-amount {
        font-size: 1.25rem;
    }
    
    .carousel-dots {
        gap: 0.5rem;
        margin-top: 1.5rem;
    }
    
    .carousel-dot {
        width: 10px;
        height: 10px;
    }
    
    .carousel-dot.active {
        width: 28px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .related-services-track {
        cursor: default;
    }
    
    .related-services-track:active {
        cursor: default;
    }
    
    /* Larger touch targets */
    .carousel-btn {
        width: 50px;
        height: 50px;
    }
    
    .carousel-dot {
        width: 14px;
        height: 14px;
    }
    
    .carousel-dot.active {
        width: 36px;
    }
}

/* Accessibility */
.carousel-btn:focus,
.carousel-dot:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .related-services-track,
    .related-service-card,
    .carousel-btn,
    .carousel-dot,
    .card-image img,
    .card-action {
        transition: none;
    }
    
    .related-service-card:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .carousel-btn,
    .carousel-dots {
        display: none;
    }
    
    .related-services-track {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .related-service-card {
        flex: none;
        break-inside: avoid;
    }
}
