/* =====================================================
   HOME PAGE STYLES - Fixed Version
   ===================================================== */

/* Logo Section */
.logo-section {
    margin-top: 80px;
    background: url('../img/home/background6.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    height: calc(100vh - 80px);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.logo-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    z-index: 1;
}

.logo-background {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.main-logo {
    width: 550vw;
    max-width: 750px;
    min-width: 550px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    opacity: 0;
    animation: simpleFadeIn 1.5s ease 0.5s forwards;
}

/* Brief Intro Section with Background */
.brief-intro {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5)), url('../img/home/maximize.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.brief-intro .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Intro Content Centered Styles */
.intro-content-centered {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
}

.intro-content-centered h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: #ffffff;
}

.intro-content-centered h3 {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    color: #e5e7eb;
}

.intro-content-centered p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: #d1d5db;
}

.intro-content-centered .intro-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
}

.intro-content-centered .intro-buttons .btn {
    padding: 12px 30px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    border: 2px solid white !important;
    background: transparent !important;
    color: white !important;
    min-width: 140px;
    text-align: center;
}

.intro-content-centered .intro-buttons .btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border: 2px solid white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2) !important;
}

/* Home Services Section */
.home-services {
    padding: 80px 0;
    background-color: #f8fafc;
}

.home-services .section-title {
    font-size: 2.5rem;
    font-weight: 700; /* FIXED: Ensure this is bold */
    color: #1f2937;
    text-align: center;
    margin-bottom: 2rem; /* FIXED: Increased from 1rem to 2rem for more spacing */
    position: relative;
}

.home-services .section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: rgba(33, 124, 118, 1);
}

.home-services .section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #4b5563;
    margin: 1rem auto 4rem;
    font-weight: 300;
    max-width: 800px;
    line-height: 1.7;
}

/* Services Grid New Layout */
.services-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card-new {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08); /* FIXED: Softer shadow */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 1s cubic-bezier(0.42, 0, 0.58, 1), opacity 0.9s cubic-bezier(0.42, 0, 0.58, 1);
    opacity: 0;
    transform: translateY(30px) scale(0.98); /* FIXED: Start slightly scaled down */
    /* Performance: skip rendering off-screen cards */
    content-visibility: auto;
    contain-intrinsic-size: 350px 450px; /* fallback size for the skipped content */
    will-change: transform, opacity;
    text-decoration: none;
    color: inherit;
}

.service-card-new.animate {
    opacity: 1;
    transform: translateY(0) scale(1); /* FIXED: Animate to full size */
}

.service-card-new:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.service-image-new {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

.service-card-new:hover .service-image-new img {
    transform: scale(1.05);
}

.service-content-new {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.service-card-new h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
    line-height: 1.3;
    min-height: 2.6rem;
    display: flex;
    align-items: center;
}

.service-card-new p {
    color: #6b7280;
    line-height: 1.6;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.service-link {
    display: inline-block;
    color: rgba(33, 124, 118, 1);
    text-decoration: underline transparent;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: text-decoration-color 0.3s ease, color 0.3s ease;
    align-self: flex-start;
}

.service-card-new:hover .service-link {
    text-decoration-color: rgba(33, 124, 118, 1);
}

.cert-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    background-color: transparent;
    padding: 0;
    border: none;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.cert-item:hover {
    transform: translateY(-5px);
    box-shadow: none;
}

.cert-logo {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
}

.cert-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    text-align: left;
    max-width: 100px;
    max-height: 100px;
}

/* Ensure ISO 14001 appears same size as other certifications */
.cert-logo img[alt*="ISO 14001"] {
    object-fit: cover;
    object-position: center;
    transform: scale(1.2);
}

.cert-description {
    text-align: left;
}

.cert-description h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.cert-description p {
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* Animations */
@keyframes simpleFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .certifications-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .logo-section {
        height: 70vh;
        min-height: 300px;
        max-height: 500px;
        background-attachment: scroll;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
    }

    .main-logo {
        width: 40vw;
        max-width: 300px;
        min-width: 200px;
    }

    .brief-intro {
        padding: 80px 0;
        background-attachment: scroll;
    }

    .brief-intro .container {
        padding: 0 20px;
    }

    .intro-content-centered {
        padding: 0;
    }
    
    .intro-content-centered h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .intro-content-centered h3 {
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
    }
    
    .intro-content-centered p {
        font-size: 1rem;
        margin-bottom: 2.5rem;
    }

    .intro-content-centered .intro-buttons {
        flex-direction: column;
        align-items: center;
    }

    .intro-content-centered .intro-buttons .btn {
        width: 200px;
        text-align: center;
    }

    .services-grid-new {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .service-card-new h3 {
        font-size: 1.2rem;
    }

    .service-content-new {
        padding: 1.5rem 1rem;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .metric-value {
        font-size: 2.5rem;
    }

    .cert-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.5rem;
    }

    .cert-description {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo-section {
        height: 40vh;
        min-height: 200px;
        max-height: 300px;
        background-attachment: scroll;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
    }

    .main-logo {
        width: 40vw;
        max-width: 300px;
        min-width: 200px;
    }

    .intro-content-centered h2 {
        font-size: 2rem;
    }

    .intro-content-centered h3 {
        font-size: 1.2rem;
    }

    .intro-content-centered p {
        font-size: 1rem;
    }

    .services-grid-new {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }
}