/* SERVICES SECTION - FIXED & SOLID */
#servicos {
    position: relative;
    width: 100%;
    height: auto; /* Deixe o GSAP definir a altura do scroll (spacer) */
    min-height: 100dvh;
    background-color: #070707; /* Cor sólida, sem transparência */
    z-index: 10; /* Acima de Hero e Sobre */
    overflow: hidden; /* Corta qualquer coisa que saia da borda */
    margin: 0;
    padding: 0;
    display: block; /* Garante fluxo de bloco normal */
}

/* Background Decorations */
#servicos::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* O elemento que será PINADO pelo JS */
.services-pin-wrapper {
    width: 100%;
    height: 100dvh; /* Ocupa exatamente a tela cheia */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background-color: #070707; /* Reforço de background */
}

/* Conteúdo interno */
.services-sticky-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    z-index: 2; /* Acima do background */
}

/* Header */
.services-header-container {
    text-align: center;
    position: absolute;
    top: 5vh;
    left: 0;
    width: 100%;
    z-index: 1;
    pointer-events: none;
}

.services-label {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--color-primary);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: block;
}

.services-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    color: var(--color-white);
    line-height: 1;
    font-weight: 700;
}

.services-title span {
    font-weight: 300;
    color: var(--text-muted);
}

.services-title .text-primary {
    color: var(--color-primary);
    font-weight: 700;
}

/* STACK CONTAINER */
.services-stack-container {
    position: relative;
    width: 100%;
    height: 62vh; /* Adjusted to 62vh for balance */
    margin-top: 20vh; /* Pushed down to avoid title overlap */
    perspective: 1000px;
}

/* CARD STRUCTURE */
.service-card-stack {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Estado inicial */
    opacity: 0; 
    will-change: transform, opacity;
    z-index: 1;
}

/* O primeiro card deve ser visível nativamente para evitar buraco negro */
.service-card-stack:first-child {
    opacity: 1;
    z-index: 2;
}

/* Card Inner */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(20, 20, 20, 0.95); /* Opaco para cobrir o anterior */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 40px;
    overflow: hidden;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
}

.card-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    height: 100%;
}

/* Text Column */
.card-text-col {
    padding: 40px; /* Reduced from 60px to give content more room */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
}

.card-icon-box {
    width: 64px;
    height: 64px;
    background: rgba(242, 192, 31, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.card-text-col h3 {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    color: #fff;
    line-height: 1.1;
    font-weight: 600;
}

.card-text-col p {
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    max-width: 480px;
}

/* Features List */
.service-features-list {
    list-style: none;
    padding: 0;
    margin: 5px 0 15px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-features-list li {
    font-family: var(--font-secondary);
    font-size: 0.95rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}

.service-features-list li i {
    color: var(--color-primary);
    font-size: 0.8rem;
}

/* Button */
.btn-details {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 30px;
    border-radius: 100px;
    color: #fff;
    text-decoration: none;
    font-family: var(--font-primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-details:hover {
    background: var(--color-primary);
    color: var(--color-secondary);
    border-color: var(--color-primary);
}

/* Visual Column */
.card-visual-col {
    position: relative;
    height: 100%;
    overflow: hidden;
    background: #050505;
}

.card-image-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.service-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(20,20,20,1) 0%, transparent 60%);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .services-stack-container {
        height: 65vh;
        margin-top: 80px;
    }

    .card-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 250px;
    }
    
    .card-text-col {
        padding: 30px;
        justify-content: flex-start;
    }
    
    .card-visual-col {
        height: 100%;
    }
    
    .image-overlay {
        background: linear-gradient(to top, rgba(20,20,20,1) 0%, transparent 60%);
    }
}

@media (max-width: 768px) {
    .services-title {
        font-size: 2rem;
    }
    
    .services-header-container {
        top: 20px;
    }
    
    .services-stack-container {
        height: 600px; /* Increased back to 600px for more content space */
        max-height: 80vh; /* Increased max-height */
        margin-top: 140px;
    }

    .card-inner {
        flex-direction: column-reverse;
        border-radius: 24px;
        display: flex;
    }
    
    .card-content {
        display: flex;
        flex-direction: column-reverse;
        height: 100%; /* Ensure content fills card */
    }
    
    .card-visual-col {
        height: 45%; /* Image takes almost half */
        min-height: 250px;
        flex-shrink: 0;
    }
    
    .card-text-col {
        padding: 24px 20px;
        gap: 8px;
        flex-grow: 1;
        justify-content: center;
        overflow: hidden; /* No scroll */
    }

    .card-icon-box {
        display: none; /* Hide icon on mobile to save space */
    }

    .card-text-col h3 {
        font-size: 1.5rem;
        margin-bottom: 4px;
    }

    .card-text-col p {
        font-size: 0.9rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 4; /* Limit lines cleanly instead of scroll */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .btn-details {
        margin-top: 10px;
        padding: 10px 24px;
    }
    
    .card-text-col h3 {
        font-size: 1.6rem;
    }
    
    .card-text-col p {
        font-size: 0.9rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .service-features-list {
        display: none;
    }
    
    @media (min-height: 800px) {
        .service-features-list {
            display: flex;
        }
    }
}
