/* ================================
   THE MESH MENU - Sticky Overlap Effect
   Each row sticks and next overlaps on scroll
   Version: 2.0 - Full width rows with wrapper
   ================================ */

.thinkia-mesh-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99997;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    pointer-events: none;
}

.thinkia-mesh-menu[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.thinkia-mesh-menu__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(3, 9, 29, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    backdrop-filter: blur(40px) saturate(180%);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.thinkia-mesh-menu[aria-hidden="false"] .thinkia-mesh-menu__overlay {
    opacity: 1;
}

.thinkia-mesh-menu__container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    transform: translateY(30px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s;
    opacity: 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.thinkia-mesh-menu[aria-hidden="false"] .thinkia-mesh-menu__container {
    transform: translateY(0);
    opacity: 1;
}

/* Close button - floating */
.thinkia-mesh-menu__close {
    position: fixed;
    top: clamp(4rem, 6vw, 5rem);
    right: clamp(1.5rem, 3vw, 2rem);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    z-index: 1000;
    transform: translateY(20px) rotate(-90deg);
    opacity: 0;
}

.thinkia-mesh-menu[aria-hidden="false"] .thinkia-mesh-menu__close {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
    transition-delay: 0.3s;
}

.thinkia-mesh-menu__close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg) scale(1.1);
}

/* Title removed - minimalist header */


/* Content */
.thinkia-mesh-menu__content {
    flex: 1;
    min-height: 0;
    width: 100%;
    position: relative;
    max-width: none;
    overflow-y: auto;
}

/* List */
.thinkia-mesh-menu__list {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    position: relative;
    padding-bottom: 0; /* No extra space - scroll stops at last item */
    padding-top: 0; /* No top padding - start at top */
}

/* Ensure items have proper spacing for overlap effect */
.thinkia-mesh-menu__item-wrapper + .thinkia-mesh-menu__item-wrapper {
    margin-top: 0;
}

/* Ensure last wrapper has enough space to reach sticky position */
.thinkia-mesh-menu__item-wrapper:last-child {
    margin-bottom: clamp(5rem, 7vw, 8rem);
}

/* Item Wrapper - Full width with background and blur */
.thinkia-mesh-menu__item-wrapper {
    position: sticky;
    width: 100%;
    background: var(--e-global-color-secondary, #03091D);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(30px);
    transition: background 0.3s ease, opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Border on top starting from second row (skip The Mesh row) */
.thinkia-mesh-menu__item-wrapper:nth-child(n+2):not(.thinkia-mesh-menu__item-wrapper--the-mesh) {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.thinkia-mesh-menu[aria-hidden="false"] .thinkia-mesh-menu__item-wrapper {
    /* Initial opacity when menu opens - JS will override this dynamically */
    transform: translateY(0);
    /* Transition for opacity changes - JS controls actual values with !important */
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* REMOVED: Initial opacity rule - JavaScript now controls ALL opacity values */
/* JavaScript sets opacity explicitly with !important for all items */

/* Sticky positions - all wrappers stick at the same top position for perfect overlap */
.thinkia-mesh-menu__item-wrapper:nth-child(1) { 
    transition-delay: 0.05s;
    top: clamp(3rem, 5vw, 5rem);
    z-index: 1;
}
.thinkia-mesh-menu__item-wrapper:nth-child(2) { 
    transition-delay: 0.15s;
    top: clamp(3rem, 5vw, 5rem);
    z-index: 2;
}
.thinkia-mesh-menu__item-wrapper:nth-child(3) { 
    transition-delay: 0.2s;
    top: clamp(3rem, 5vw, 5rem);
    z-index: 3;
}
.thinkia-mesh-menu__item-wrapper:nth-child(4) { 
    transition-delay: 0.25s;
    top: clamp(3rem, 5vw, 5rem);
    z-index: 4;
}
.thinkia-mesh-menu__item-wrapper:nth-child(5) { 
    transition-delay: 0.3s;
    top: clamp(3rem, 5vw, 5rem);
    z-index: 5;
}

/* Full Row Items - Transparent link */
.thinkia-mesh-menu__item {
    display: grid;
    grid-template-columns: 80px 1fr 600px;
    gap: clamp(2rem, 4vw, 4rem);
    padding: clamp(5rem, 7vw, 8rem) clamp(2rem, 4vw, 6rem);
    text-decoration: none;
    color: #ffffff;
    cursor: pointer;
    align-items: start;
    background: transparent;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* The Mesh row - much narrower */
.thinkia-mesh-menu__item-wrapper--the-mesh .thinkia-mesh-menu__item {
    padding: clamp(1.5rem, 2vw, 2rem) clamp(2rem, 4vw, 6rem);
    grid-template-columns: 80px 1fr 400px; /* Smaller image column */
    gap: clamp(1.5rem, 3vw, 2.5rem); /* Smaller gap */
}

/* Opacity is now handled directly on the wrapper via JavaScript */
/* Removed dark overlay system - using opacity instead */

/* Removed - now handled by wrapper */

/* Items don't need sticky positioning - only wrappers are sticky */
/* z-index will be managed dynamically by JavaScript */

.thinkia-mesh-menu__item-wrapper:hover {
    background: var(--e-global-color-secondary, #03091D);
    /* z-index and opacity managed by JavaScript to maintain correct stacking */
    /* DO NOT set z-index or opacity here - they're managed by JS based on stuck state and overlap */
}

.thinkia-mesh-menu__item-wrapper:hover .thinkia-mesh-menu__item {
    cursor: pointer;
}

/* Number - Aligned with title */
.thinkia-mesh-menu__item-number {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    font-family: 'Thinkia Neo', sans-serif;
    align-self: start;
    padding-top: 0;
    position: relative;
    z-index: 1; /* Below overlay */
}

.thinkia-mesh-menu__item:hover .thinkia-mesh-menu__item-number {
    color: rgba(255, 255, 255, 0.7);
}

/* Content */
.thinkia-mesh-menu__item-label {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

/* Slashes - Use accent color from web */
.thinkia-mesh-menu__item-label-slash {
    color: var(--e-global-color-accent, #0040FF);
}

.thinkia-mesh-menu__item-content {
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 1.5vw, 1.25rem);
    padding-top: 0;
    align-items: flex-start;
    position: relative;
    z-index: 1; /* Below overlay */
}


.thinkia-mesh-menu__item-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 400;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.02em;
    padding-top: 0;
    margin-top: 0;
}

/* Removed hover color change - title stays white */
/* .thinkia-mesh-menu__item:hover .thinkia-mesh-menu__item-title {
    color: var(--layer-color, #0040FF);
} */

.thinkia-mesh-menu__item-description {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.7;
    transition: color 0.4s ease;
    font-weight: 300;
    max-width: 650px;
}

.thinkia-mesh-menu__item:hover .thinkia-mesh-menu__item-description {
    color: rgba(255, 255, 255, 0.8);
}

/* Image on right */
.thinkia-mesh-menu__item-image {
    width: 100%;
    height: 450px;
    border-radius: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    flex-shrink: 0;
    z-index: 1; /* Below overlay */
}

/* Video for The Mesh row */
.thinkia-mesh-menu__item-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* The Mesh row image/video container - smaller height */
.thinkia-mesh-menu__item-wrapper--the-mesh .thinkia-mesh-menu__item-image {
    height: 200px;
}

/* The Mesh row - no border on top */
.thinkia-mesh-menu__item-wrapper--the-mesh {
    border-top: none !important;
}

.thinkia-mesh-menu__item-image-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.thinkia-mesh-menu__item:hover .thinkia-mesh-menu__item-image-img {
    transform: scale(1.05);
}

/* Action Button - Neuros Button Type Alt Style (like home) */
.thinkia-mesh-menu__item-content .button-widget {
    line-height: 1;
    font-size: 0;
    margin-top: clamp(1.5rem, 2vw, 2rem);
}

.thinkia-mesh-menu__item-content .button-container {
    position: relative;
    display: inline-block;
    z-index: 2;
    line-height: 1;
    font-size: 0;
}

.thinkia-mesh-menu__item-action.neuros-button-type-alt {
    --button-border-gradient-angle: 262deg;
    --button-gradient-colorstop-1: 14.51%;
    --button-gradient-colorstop-2: 95.96%;
    --button-border-width: 1px;
    
    padding: 0 0 5px 1.42857em;
    background-size: 100% var(--button-border-width, 1px);
    background-repeat: no-repeat;
    background-position: 100% 100%;
    background-color: transparent;
    border: none;
    -webkit-border-radius: 0;
    border-radius: 0;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
    box-shadow: none !important;
    display: inline-block;
    position: relative;
    text-align: left;
    text-decoration: none;
    transition: all 0.3s;
    -webkit-transition: all 0.3s;
    outline: none;
    cursor: pointer;
    pointer-events: auto;
    z-index: 1;
    color: #ffffff;
    font-family: 'Thinkia Neo', sans-serif;
    font-size: 0.9375rem;
    font-weight: 400;
    white-space: nowrap;
    flex-shrink: 0;
}

.thinkia-mesh-menu__item-action.neuros-button-type-alt::after {
    display: none;
}

.thinkia-mesh-menu__item-action.neuros-button-border-style-gradient {
    background-image: linear-gradient(var(--button-border-gradient-angle), #1a224c var(--button-gradient-colorstop-1), #0040ff var(--button-gradient-colorstop-2));
}

.thinkia-mesh-menu__item-action.neuros-button-bakground-style-solid .button-inner {
    display: none;
}

.thinkia-mesh-menu__item-action.neuros-button-type-alt .icon-button-arrow {
    font-size: 0.6429em;
    position: absolute;
    top: 1em;
    left: 0;
    -webkit-transform: none;
    -ms-transform: none;
    transform: none;
    transition: opacity 0.3s, transform 0.3s;
    -webkit-transition: opacity 0.3s, transform 0.3s;
    opacity: 1;
}

.thinkia-mesh-menu__item-action.neuros-button-type-alt .icon-button-arrow::before {
    content: '→';
    font-size: 10px;
    display: inline-block;
}

.thinkia-mesh-menu__item-action.neuros-button-type-alt .icon-button-arrow.right {
    right: 0;
    left: initial;
    -webkit-transform: translateX(1em);
    -ms-transform: translateX(1em);
    transform: translateX(1em);
    opacity: 0;
}

.thinkia-mesh-menu__item:hover .thinkia-mesh-menu__item-action.neuros-button-type-alt {
    background-color: transparent;
    padding: 0 1.42857em 5px 0;
    color: #ffffff;
}

.thinkia-mesh-menu__item:hover .thinkia-mesh-menu__item-action.neuros-button-type-alt .icon-button-arrow.left {
    -webkit-transform: translateX(-1em) !important;
    -ms-transform: translateX(-1em) !important;
    transform: translateX(-1em) !important;
    opacity: 0;
}

.thinkia-mesh-menu__item:hover .thinkia-mesh-menu__item-action.neuros-button-type-alt .icon-button-arrow.right {
    -webkit-transform: translateX(0) !important;
    -ms-transform: translateX(0) !important;
    transform: translateX(0) !important;
    opacity: 1;
}

/* Responsive */
@media (max-width: 1024px) {
    .thinkia-mesh-menu__item {
        grid-template-columns: 60px 1fr;
        gap: 2rem;
        padding: 2.5rem 0;
        margin-bottom: 3rem;
    }
    
    .thinkia-mesh-menu__item-image {
        grid-column: 1 / -1;
        height: 250px;
        margin-top: 1.5rem;
    }
    
    .thinkia-mesh-menu__item-action.neuros-button-type-alt {
        font-size: 0.875rem;
        padding: 0 0 4px 1.2em;
    }
    
    .thinkia-mesh-menu__item-action.neuros-button-type-alt:hover {
        padding: 0 1.2em 4px 0;
    }
    
    .thinkia-mesh-menu__item:nth-child(5) {
        margin-bottom: 0;
    }
    
    /* Remove sticky on tablet */
    .thinkia-mesh-menu__item {
        position: relative;
        top: auto !important;
    }
}

@media (max-width: 768px) {
    .thinkia-mesh-menu {
        display: none !important;
    }
}
