/* SENTINEL OT - Services Section & Base Card Styles */

.servicios {
    position: relative;
    z-index: 2;
}

@media (min-width: 769px) {
    .servicios {
        height: 900vh; /* Increased to 900vh for even smoother/slower horizontal movement */
    }
}

.servicios__sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(15, 15, 15, 0.4) 0%, rgba(5, 5, 5, 0.8) 100%);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
}

.servicios__sticky-wrapper .container {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 0;
    max-width: 100%;
}

.servicios__title-item {
    width: 80vw;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    will-change: transform, opacity;
    padding: 4rem;
    overflow: visible;
}

.servicios .section__title {
    font-size: clamp(3rem, 10vw, 8rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0;
    padding: 0.2em;
}

.servicios .section__title span {
    display: inline-block;
    padding-right: 0.1em;
}

.servicios__horizontal-track {
    margin-top: 2rem;
    width: 100%;
    overflow: visible;
}

.servicios__grid {
    pointer-events: auto;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 35vw; 
    padding: 0 45vw;
    width: max-content;
    will-change: transform;
    transition: transform 0.1s cubic-bezier(0.2, 0, 0.2, 1);
}

/* Card base styles */
.card {
    background: rgba(22, 22, 22, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 40px;
    padding: 1.75rem 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 8px 32px rgba(0, 0, 0, 0.4);
    will-change: transform, box-shadow, border-color;
    transform: translateZ(0);
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.6), transparent);
    opacity: 0.3;
    transition: opacity 0.4s ease;
    z-index: 10;
    pointer-events: none;
}

.card__icon {
    color: var(--color-text-primary);
    margin-bottom: 2rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: 12px;
}

.card__icon svg {
    width: 32px;
    height: 32px;
    stroke-width: 2px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card__title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #fff;
}

.card__desc {
    color: var(--color-text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.card__image {
    float: right;
    width: 100px;
    height: 100px;
    border-radius: 16px;
    overflow: hidden;
    margin: 0 0 0.5rem 1rem;
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 16px;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Specific Service Grid Overrides */
@media (min-width: 769px) {
    .servicios .card {
        width: 500px;
        flex-shrink: 0;
        transform: scale(0.85);
        opacity: 0.4;
        filter: grayscale(50%);
        /* Much slower transitions for a gradual focal effect */
        transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), 
                    opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1),
                    filter 0.8s cubic-bezier(0.25, 1, 0.5, 1),
                    box-shadow 0.8s cubic-bezier(0.25, 1, 0.5, 1),
                    border-color 0.8s cubic-bezier(0.25, 1, 0.5, 1),
                    background 0.5s ease;
    }

    .servicios .card.is-active {
        transform: scale(1.15);
        opacity: 1;
        filter: grayscale(0);
        /* Softer, more atmospheric glow */
        box-shadow: 0 30px 100px rgba(167, 139, 250, 0.25), 
                    0 0 40px rgba(167, 139, 250, 0.15), 
                    inset 0 0 25px rgba(255, 255, 255, 0.05);
        border-color: rgba(167, 139, 250, 0.5);
        z-index: 10;
    }

    /* Hover animations removed to prevent conflict with scroll-driven focal effects */
    .servicios__grid .card { cursor: default; }
    .card__close { display: none !important; }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .servicios__sticky-wrapper {
        position: relative;
        height: auto;
        top: auto;
        overflow: visible;
        backdrop-filter: none;
        background: transparent;
    }

    .servicios__horizontal-track {
        overflow-x: auto;
        padding-bottom: 2rem;
        scrollbar-width: none;
    }

    .servicios__grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        padding: 0 1rem;
        margin-top: 1rem;
        width: 100%;
        transform: none !important;
    }

    .servicios__title-item {
        grid-column: 1 / -1;
        width: 100% !important;
        padding: 2rem 0 !important;
        transform: none !important;
        opacity: 1 !important;
    }

    .servicios__title-item .section__title {
        font-size: 2.2rem !important;
        text-align: center;
    }

    .servicios__grid .card:nth-of-type(1) { grid-column: 2 / 4; }
    .servicios__grid .card:nth-of-type(2) { grid-column: 1 / 2; grid-row: 2 / 4; }
    .servicios__grid .card:nth-of-type(3) { grid-column: 2 / 4; }

    .servicios__grid .card {
        padding: 1.25rem 0.75rem !important;
        min-height: auto;
        border-radius: 24px !important;
        background: rgba(25, 25, 25, 0.7) !important;
        border: 0.5px solid rgba(255, 255, 255, 0.15) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8) !important;
        animation: cascadeFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        opacity: 0;
    }

    .servicios__grid .card:nth-child(1) { animation-delay: 0.1s; }
    .servicios__grid .card:nth-child(2) { animation-delay: 0.2s; }
    .servicios__grid .card:nth-child(3) { animation-delay: 0.3s; }

    .servicios__grid .card__icon {
        width: 32px;
        height: 32px;
        padding: 0;
        margin-bottom: 0.75rem;
        border-radius: 50% !important;
    }

    .servicios__grid .card__icon svg { width: 16px; height: 16px; }
    .servicios__grid .card__title { font-size: 0.85rem; }
    .servicios__grid .card__desc {
        font-size: 0.65rem;
        display: -webkit-box;
        -webkit-line-clamp: 5;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}
