/* SENTINEL OT - 'Expertos Locales' (Nosotros) Dynamic Experience */

.why-us {
    position: relative;
    z-index: 3;
    padding: 0 !important; /* Managed by sticky wrapper */
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

@media (min-width: 769px) {
    .why-us {
        height: 450vh; /* Increased to 450vh for a slower, more epic scroll feel */
    }

    .nosotros__sticky-wrapper {
        position: sticky;
        top: 0;
        height: 100vh;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center; /* Center the giant title */
        overflow: hidden;
        background: radial-gradient(circle at 70% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                    radial-gradient(circle at 20% 70%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    }

    .container--monumental {
        position: absolute;
        inset: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 1 !important; /* Force background layer */
        pointer-events: none;
        padding: 0;
        margin: 0;
    }

    .nosotros__giant-title {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        max-width: 95vw;
        color: #ffffff;
        filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
        padding-left: 2rem; /* Minimum padding for edge alignment */
        margin-left: 0;
    }

    .nosotros__line {
        font-size: clamp(3rem, 14vw, 12rem);
        font-weight: 900;
        text-transform: uppercase;
        line-height: 0.8;
        letter-spacing: -0.06em;
        text-align: left;
        display: block;
        width: 100%;
        color: #a78bfa; /* Use the brand purple directly to ensure visibility */
    }

    .nosotros-char {
        display: inline-block;
        opacity: 0.05;
        filter: blur(10px);
        transform: translateY(-200px) scale(1.2);
        will-change: opacity, filter, transform;
        color: inherit; /* Ensure it takes the purple from the parent */
    }

    .nosotros__horizontal-track {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 900 !important; /* Force foreground layer container */
    }

    .why-us__grid {
        position: relative;
        width: 100%;
        max-width: 600px !important;
        height: 600px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        z-index: 50; /* Between background and title */
    }

    .why-us .card {
        position: absolute !important;
        top: 50%;
        left: 50%;
        z-index: 999 !important; /* Absolute foreground focus */
        transform: translate(-50%, -50%) scale(0.8);
        width: 500px;
        min-height: 500px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: filter 0.5s ease;
        
        /* EXTREME LIQUID GLASS */
        background: rgba(255, 255, 255, 0.04);
        backdrop-filter: blur(60px) saturate(220%) contrast(110%);
        -webkit-backdrop-filter: blur(60px) saturate(220%) contrast(110%);
        
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 40px;
        padding: 3.5rem;
        box-shadow: 0 60px 120px -30px rgba(0, 0, 0, 0.8),
                    inset 0 1px 1px rgba(255, 255, 255, 0.1);
        overflow: hidden;
        
        /* Optimization for smooth scaling/exits */
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        transform-style: preserve-3d;
        -webkit-transform-style: preserve-3d;
    }

    /* Liquid Shimmer Effect */
    .why-us .card::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(
            125deg,
            transparent 0%,
            transparent 40%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 60%,
            transparent 100%
        );
        background-size: 200% 200%;
        animation: liquidShimmer 6s infinite linear;
        pointer-events: none;
        z-index: -1;
    }

    @keyframes liquidShimmer {
        0% { background-position: 200% 200%; }
        100% { background-position: -200% -200%; }
    }

    .why-us .card.is-visible {
        visibility: visible;
        pointer-events: auto;
        z-index: 999 !important;
    }

    /* Indigo/Violet Glows */
    .why-us .card::after {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
                    rgba(139, 92, 246, 0.1) 0%, 
                    transparent 60%);
        opacity: 0;
        transition: opacity 0.5s ease;
        pointer-events: none;
    }

    .why-us .card:hover::after {
        opacity: 1;
    }

    /* ZIG-ZAG OFFSET PER CARD */
    .bento-card--1 { transform: translateY(-40px); }
    .bento-card--2 { transform: translateY(60px); }
    .bento-card--3 { transform: translateY(-20px); }

    .why-us .card.is-active {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(167, 139, 250, 0.3);
        box-shadow: 0 50px 120px -30px rgba(139, 92, 246, 0.15), 
                    0 0 40px rgba(139, 92, 246, 0.05),
                    inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    .why-us .card__icon {
        width: 80px;
        height: 80px;
        background: linear-gradient(135deg, rgba(167, 139, 250, 0.1), rgba(139, 92, 246, 0.05));
        border: 1px solid rgba(167, 139, 250, 0.2);
        border-radius: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 2.5rem;
        color: #a78bfa; /* Violet accent */
        filter: drop-shadow(0 0 15px rgba(167, 139, 250, 0.3));
    }

    .why-us .card__title {
        font-size: 2rem;
        font-weight: 700;
        margin-bottom: 1.5rem;
        letter-spacing: -0.02em;
    }

    .why-us .card__desc {
        font-size: 1.1rem;
        line-height: 1.7;
        color: rgba(255, 255, 255, 0.6);
    }
}

/* Mobile Fallback - Bento Grid Style (Matched with Services) */
@media (max-width: 768px) {
    .why-us {
        height: auto !important;
        padding: 4rem 0 !important;
    }

    .nosotros__sticky-wrapper {
        position: relative !important;
        top: auto !important;
        height: auto !important;
        padding: 0 !important;
        overflow: visible !important;
        background: transparent !important;
    }

    .container--monumental {
        position: relative !important;
        inset: auto !important;
        display: block !important;
        padding: 0 1rem !important;
        margin-bottom: 2rem !important;
        width: 100% !important;
    }

    .nosotros__giant-title {
        position: relative !important;
        padding: 0 !important;
        align-items: center !important;
        filter: none !important;
        text-align: center !important;
        width: 100% !important;
    }

    .nosotros__line {
        font-size: 2.2rem !important;
        text-align: center !important;
        line-height: 1.2 !important;
        letter-spacing: -0.02em !important;
        width: 100% !important;

        /* Purple Gradient also for mobile */
        background: linear-gradient(135deg, #ffffff 0%, #a78bfa 100%) !important;
        -webkit-background-clip: text !important;
        background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        color: transparent !important;
    }

    .nosotros-char {
        opacity: 1 !important;
        filter: none !important;
        transform: none !important;
    }

    .nosotros__horizontal-track {
        position: relative !important;
        inset: auto !important;
        display: block !important;
        padding: 0 1rem !important;
        width: 100% !important;
    }

    .why-us__grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
    }

    /* Bento Layout - Same pattern as Services */
    .why-us .card:nth-of-type(1) { grid-column: 2 / 4; }
    .why-us .card:nth-of-type(2) { grid-column: 1 / 2; grid-row: 1 / 3; }
    .why-us .card:nth-of-type(3) { grid-column: 2 / 4; }

    .why-us .card {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        min-height: auto !important;
        padding: 1.25rem 0.75rem !important;
        border-radius: 24px !important;
        background: rgba(25, 25, 25, 0.7) !important;
        border: 0.5px solid rgba(255, 255, 255, 0.15) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8) !important;
        margin: 0 !important;
    }

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

    .why-us .card__icon svg {
        width: 16px !important;
        height: 16px !important;
    }

    .why-us .card__title {
        font-size: 0.85rem !important;
        margin-bottom: 0.5rem !important;
        line-height: 1.2 !important;
    }

    .why-us .card__desc {
        font-size: 0.65rem !important;
        line-height: 1.4 !important;
        color: rgba(255, 255, 255, 0.6) !important;
    }

    .why-us .card::before,
    .why-us .card::after {
        display: none !important; /* Cleanup complex effects for mobile performance */
    }
}
