/* service_styles.css - Complete with Standardized Aspect Ratio Images */

/* Services Hero */
.services-hero {
    background: rgba(10, 35, 66, 0.9) url('https://images.unsplash.com/photo-1504307651254-35680f356dfd?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
    color: white;
    padding: 160px 0 100px;
    min-height: 70vh;
    display: flex;
    align-items: center;
    border-bottom: 3px solid var(--safety-orange);
}

.services-hero-content {
    max-width: 800px;
    text-align: left;
}

.services-hero h1 {
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 20px;
}

.services-hero h1:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 120px;
    height: 4px;
    background-color: var(--safety-orange);
}

.services-hero .lead {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    line-height: 1.7;
}

/* Service Category - Uniform Layout */
.service-category {
    padding: 100px 0;
}

.service-category:nth-child(even) {
    background-color: var(--concrete-gray);
}

.service-category h2 {
    color: var(--deep-navy);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 20px;
    display: block;
    text-align: center;
    width: 100%;
}

.service-category h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background-color: var(--safety-orange);
}

.service-category .lead {
    color: var(--steel-gray);
    font-size: 1.2rem;
    margin-bottom: 3rem;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* UNIFORM SERVICE CARDS */
.service-detail-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    height: 100%;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.service-detail-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    border: 2px solid var(--safety-orange);
}

/* FIXED: Standard Image Container Aspect Ratio */
.service-detail-img-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* Standard 16:9 aspect ratio for all cards */
    overflow: hidden;
}

.service-detail-img-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Slideshow Container with Standardized Aspect Ratio */
.card-slideshow {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* Standard 16:9 Aspect Ratio for ALL slideshows */
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

.slideshow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Card Content - Uniform Structure */
.service-detail-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 380px;
}

/* Badges - Uniform Styling */
.service-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 8px;
    margin-bottom: 8px;
    border: 2px solid transparent;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Badge Colors */
.service-badge.residential {
    background-color: #4CAF50;
    color: white;
    border: 2px solid #4CAF50;
}

.service-badge.commercial {
    background-color: #2196F3;
    color: white;
    border: 2px solid #2196F3;
}

.service-badge.renovation {
    background-color: #FF9800;
    color: white;
    border: 2px solid #FF9800;
}

.service-badge.new-construction {
    background-color: #9C27B0;
    color: white;
    border: 2px solid #9C27B0;
}

.service-badge.supplies {
    background-color: var(--accent-teal);
    color: white;
    border: 2px solid var(--accent-teal);
}

.service-badge.manufacturing {
    background-color: var(--sun-yellow);
    color: var(--deep-navy);
    border: 2px solid var(--sun-yellow);
}

.service-badge.installation {
    background-color: var(--metal-silver);
    color: white;
    border: 2px solid var(--metal-silver);
}

.service-badge.structural {
    background-color: #795548;
    color: white;
    border: 2px solid #795548;
}

.service-badge.exterior {
    background-color: #607D8B;
    color: white;
    border: 2px solid #607D8B;
}

.service-badge.mep {
    background-color: #3F51B5;
    color: white;
    border: 2px solid #3F51B5;
}

/* Card Titles */
.service-detail-content h3 {
    color: var(--deep-navy);
    font-size: 1.5rem;
    margin: 15px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--concrete-gray);
    line-height: 1.4;
    min-height: 70px;
    display: flex;
    align-items: center;
}

/* Card Description */
.service-detail-content > p {
    color: var(--steel-gray);
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 1.05rem;
    min-height: 60px;
}

/* Feature Lists */
.service-feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    flex-grow: 1;
}

.service-feature-list li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    padding-left: 30px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--steel-gray);
}

.service-feature-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--safety-orange);
    font-weight: bold;
    font-size: 1.1rem;
}

.service-feature-list li:last-child {
    border-bottom: none;
}

/* Slideshow Navigation */
.slideshow-prev,
.slideshow-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 35, 66, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    opacity: 0;
}

.slideshow-prev {
    left: 15px;
}

.slideshow-next {
    right: 15px;
}

.card-slideshow:hover .slideshow-prev,
.card-slideshow:hover .slideshow-next {
    opacity: 1;
}

.slideshow-prev:hover,
.slideshow-next:hover {
    background: var(--safety-orange);
    border-color: var(--safety-orange);
    transform: translateY(-50%) scale(1.1);
}

.slideshow-prev i,
.slideshow-next i {
    font-size: 16px;
}

/* Slideshow Indicators */
.slideshow-indicators {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-slideshow:hover .slideshow-indicators {
    opacity: 1;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: var(--safety-orange);
    transform: scale(1.2);
}

.indicator:hover {
    background: var(--safety-orange);
    transform: scale(1.1);
}

/* Auto-play indicator */
.auto-play-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    background: rgba(10, 35, 66, 0.8);
    color: white;
    border-radius: 15px;
    padding: 5px 12px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.auto-play-indicator:hover {
    opacity: 1;
    background: rgba(10, 35, 66, 0.9);
}

.auto-play-indicator i {
    font-size: 12px;
}

.auto-play-indicator.paused {
    background: rgba(166, 38, 57, 0.8);
}

.auto-play-indicator.paused:hover {
    background: rgba(166, 38, 57, 0.9);
}

/* Service Process */
.service-process {
    padding: 100px 0;
    background-color: var(--concrete-gray);
    border-top: 3px solid var(--safety-orange);
    border-bottom: 3px solid var(--safety-orange);
}

.service-process h2 {
    color: var(--deep-navy);
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 20px;
    display: block;
    text-align: center;
    width: 100%;
}

.service-process h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background-color: var(--safety-orange);
}

.process-step {
    text-align: center;
    padding: 30px 25px;
    background: white;
    border-radius: 10px;
    height: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

.process-step:hover {
    border: 2px solid var(--safety-orange);
    transform: translateY(-5px);
}

.process-number {
    width: 60px;
    height: 60px;
    background-color: var(--safety-orange);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 auto 25px;
    border: 2px solid var(--safety-orange);
    flex-shrink: 0;
}

.process-step h4 {
    color: var(--deep-navy);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--concrete-gray);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.process-step > p {
    color: var(--steel-gray);
    line-height: 1.6;
    flex-grow: 1;
    font-size: 1.05rem;
}

/* Service CTA */
.service-cta {
    background: rgba(10, 35, 66, 0.9) url('https://images.unsplash.com/photo-1541888946425-d81bb19240f5?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
    color: white;
    padding: 100px 0;
    text-align: center;
    border-bottom: 3px solid var(--safety-orange);
}

.service-cta h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 20px;
    display: inline-block;
}

.service-cta h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background-color: var(--safety-orange);
}

.service-cta p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* Ensure all images maintain aspect ratio */
img {
    max-width: 100%;
    height: auto;
}

/* MOBILE RESPONSIVE */
@media (max-width: 767px) {
    .services-hero {
        padding: 120px 0 60px !important;
        min-height: 60vh;
    }
    
    .services-hero h1 {
        font-size: 2.2rem !important;
        padding-bottom: 15px;
    }
    
    .services-hero h1:after {
        width: 80px;
        height: 3px;
    }
    
    .services-hero .lead {
        font-size: 1.1rem !important;
    }
    
    .service-category {
        padding: 60px 0 !important;
    }
    
    .service-category h2 {
        font-size: 2rem !important;
        padding-bottom: 15px;
    }
    
    .service-category h2:after {
        width: 80px;
        height: 3px;
    }
    
    .service-category .lead {
        font-size: 1.1rem;
        padding: 0 15px;
    }
    
    .service-detail-card {
        margin-bottom: 30px;
    }
    
    /* Adjust aspect ratio for mobile */
    .service-detail-img-container,
    .card-slideshow {
        padding-bottom: 62.5%; /* 8:5 aspect ratio on mobile */
    }
    
    .service-detail-content {
        padding: 25px 20px;
        min-height: auto;
    }
    
    .service-detail-content h3 {
        font-size: 1.3rem;
        min-height: auto;
        margin: 10px 0 15px;
    }
    
    .service-detail-content > p {
        font-size: 1rem;
        min-height: auto;
        margin-bottom: 15px;
    }
    
    .service-feature-list li {
        padding: 8px 0 8px 25px;
        font-size: 0.95rem;
    }
    
    .slideshow-prev,
    .slideshow-next {
        width: 36px;
        height: 36px;
        opacity: 0.7;
    }
    
    .slideshow-prev i,
    .slideshow-next i {
        font-size: 14px;
    }
    
    .slideshow-indicators {
        opacity: 0.7;
        bottom: 10px;
    }
    
    .indicator {
        width: 8px;
        height: 8px;
    }
    
    .auto-play-indicator {
        top: 10px;
        right: 10px;
        font-size: 0.75rem;
        padding: 4px 10px;
    }
    
    .process-step {
        padding: 25px 20px;
        min-height: auto;
        margin-bottom: 20px;
    }
    
    .process-step h4 {
        font-size: 1.2rem;
        min-height: auto;
    }
    
    .service-cta {
        padding: 60px 0 !important;
    }
    
    .service-cta h2 {
        font-size: 2rem !important;
        padding-bottom: 15px;
    }
    
    .service-cta h2:after {
        width: 80px;
        height: 3px;
    }
    
    .service-cta p {
        font-size: 1.1rem;
        padding: 0 15px;
    }
}

/* TABLET RESPONSIVE */
@media (max-width: 991px) and (min-width: 768px) {
    .services-hero h1 {
        font-size: 2.8rem !important;
    }
    
    .service-category h2 {
        font-size: 2.2rem !important;
    }
    
    .service-detail-content {
        min-height: 400px;
    }
    
    .service-detail-content h3 {
        font-size: 1.4rem;
    }
    
    /* Adjust aspect ratio for tablet */
    .service-detail-img-container,
    .card-slideshow {
        padding-bottom: 56.25%; /* Maintain 16:9 on tablet */
    }
}

/* DESKTOP ENHANCEMENTS */
@media (min-width: 992px) {
    .service-detail-content {
        min-height: 380px;
    }
    
    .row.g-4 > [class*="col-"] {
        display: flex;
    }
}

/* FIX FOR CARD HEIGHTS */
.row.g-4 {
    align-items: stretch;
}

/* Fix for inline style override in sections */
section#commercial.service-category {
    background-color: var(--concrete-gray) !important;
    padding: 100px 0 !important;
}

section#supplies-manufacturing.service-category {
    background-color: white !important;
    padding: 100px 0 !important;
}

/* Animation for card appearance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-detail-card,
.process-step {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.service-detail-card:nth-child(1) { animation-delay: 0.1s; }
.service-detail-card:nth-child(2) { animation-delay: 0.2s; }
.service-detail-card:nth-child(3) { animation-delay: 0.3s; }
.process-step:nth-child(1) { animation-delay: 0.1s; }
.process-step:nth-child(2) { animation-delay: 0.2s; }
.process-step:nth-child(3) { animation-delay: 0.3s; }
.process-step:nth-child(4) { animation-delay: 0.4s; }

/* Scroll margin for section anchors */
#residential,
#commercial,
#supplies-manufacturing,
#specialized,
#contact {
    scroll-margin-top: 100px;
}

/* Button styles for service CTA */
.service-cta .btn {
    min-height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

@media (max-width: 575px) {
    .service-cta .d-flex.flex-wrap {
        flex-direction: column;
        gap: 10px !important;
    }
    
    .service-cta .btn {
        width: 100%;
    }
}

/* Fix for image loading */
img[src*="unsplash"] {
    background-color: #f5f5f5;
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0),
                      linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}