/* Navigation Widget Styles */
.navigation-widget {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 23px;
    flex-wrap: wrap;
}

/* CSS Custom Properties for dynamic color management and clip-paths */
.nav-bg-shape {
    --default-color: #cccccc;
    --active-color: #007cba;
    
    /* Clip-path shapes - high-resolution rounded hexagon and aligned circle for ultra-smooth morphing */
    --hexagon-shape: polygon(47.5% 0.7%, 47.8% 0.5%, 48.1% 0.4%, 48.4% 0.3%, 48.7% 0.2%, 49.0% 0.1%, 49.3% 0.0%, 49.7% 0.0%, 50.0% 0.0%, 50.3% 0.0%, 50.7% 0.0%, 51.0% 0.1%, 51.3% 0.2%, 51.6% 0.3%, 51.9% 0.4%, 52.2% 0.5%, 52.5% 0.7%, 91.5% 23.2%, 91.7% 23.3%, 92.0% 23.5%, 92.3% 23.7%, 92.5% 24.0%, 92.7% 24.2%, 92.9% 24.5%, 93.1% 24.7%, 93.3% 25.0%, 93.5% 25.3%, 93.6% 25.6%, 93.7% 25.9%, 93.8% 26.2%, 93.9% 26.5%, 93.9% 26.8%, 94.0% 27.2%, 94.0% 27.5%, 94.0% 72.5%, 94.0% 72.8%, 93.9% 73.2%, 93.9% 73.5%, 93.8% 73.8%, 93.7% 74.1%, 93.6% 74.4%, 93.5% 74.7%, 93.3% 75.0%, 93.1% 75.3%, 92.9% 75.5%, 92.7% 75.8%, 92.5% 76.0%, 92.3% 76.3%, 92.0% 76.5%, 91.7% 76.7%, 91.5% 76.8%, 52.5% 99.3%, 52.2% 99.5%, 51.9% 99.6%, 51.6% 99.7%, 51.3% 99.8%, 51.0% 99.9%, 50.7% 100.0%, 50.3% 100.0%, 50.0% 100.0%, 49.7% 100.0%, 49.3% 100.0%, 49.0% 99.9%, 48.7% 99.8%, 48.4% 99.7%, 48.1% 99.6%, 47.8% 99.5%, 47.5% 99.3%, 8.5% 76.8%, 8.3% 76.7%, 8.0% 76.5%, 7.7% 76.3%, 7.5% 76.0%, 7.3% 75.8%, 7.1% 75.5%, 6.9% 75.3%, 6.7% 75.0%, 6.5% 74.7%, 6.4% 74.4%, 6.3% 74.1%, 6.2% 73.8%, 6.1% 73.5%, 6.1% 73.2%, 6.0% 72.8%, 6.0% 72.5%, 6.0% 27.5%, 6.0% 27.2%, 6.1% 26.8%, 6.1% 26.5%, 6.2% 26.2%, 6.3% 25.9%, 6.4% 25.6%, 6.5% 25.3%, 6.7% 25.0%, 6.9% 24.7%, 7.1% 24.5%, 7.3% 24.2%, 7.5% 24.0%, 7.7% 23.7%, 8.0% 23.5%, 8.3% 23.3%, 8.5% 23.2%);
    --circle-shape: polygon(37.1% 1.7%, 40.1% 1.0%, 43.1% 0.5%, 46.2% 0.1%, 49.2% 0.0%, 52.3% 0.1%, 55.4% 0.3%, 58.4% 0.7%, 61.4% 1.3%, 64.4% 2.1%, 67.3% 3.1%, 70.2% 4.3%, 73.0% 5.6%, 75.7% 7.1%, 78.3% 8.8%, 80.7% 10.6%, 83.1% 12.5%, 85.4% 14.6%, 87.5% 16.9%, 89.4% 19.3%, 91.2% 21.7%, 92.9% 24.3%, 94.4% 27.0%, 95.7% 29.8%, 96.9% 32.7%, 97.9% 35.6%, 98.7% 38.6%, 99.3% 41.6%, 99.7% 44.6%, 99.9% 47.7%, 100.0% 50.8%, 99.9% 53.8%, 99.5% 56.9%, 99.0% 59.9%, 98.3% 62.9%, 97.4% 65.9%, 96.3% 68.8%, 95.1% 71.6%, 93.7% 74.3%, 92.1% 77.0%, 90.4% 79.5%, 88.5% 81.9%, 86.4% 84.2%, 84.2% 86.4%, 81.9% 88.5%, 79.5% 90.4%, 77.0% 92.1%, 74.3% 93.7%, 71.6% 95.1%, 68.8% 96.3%, 65.9% 97.4%, 62.9% 98.3%, 59.9% 99.0%, 56.9% 99.5%, 53.8% 99.9%, 50.8% 100.0%, 47.7% 99.9%, 44.6% 99.7%, 41.6% 99.3%, 38.6% 98.7%, 35.6% 97.9%, 32.7% 96.9%, 29.8% 95.7%, 27.0% 94.4%, 24.3% 92.9%, 21.7% 91.2%, 19.3% 89.4%, 16.9% 87.5%, 14.6% 85.4%, 12.5% 83.1%, 10.6% 80.7%, 8.8% 78.3%, 7.1% 75.7%, 5.6% 73.0%, 4.3% 70.2%, 3.1% 67.3%, 2.1% 64.4%, 1.3% 61.4%, 0.7% 58.4%, 0.3% 55.4%, 0.1% 52.3%, 0.0% 49.2%, 0.1% 46.2%, 0.5% 43.1%, 1.0% 40.1%, 1.7% 37.1%, 2.6% 34.1%, 3.7% 31.2%, 4.9% 28.4%, 6.3% 25.7%, 7.9% 23.0%, 9.6% 20.5%, 11.5% 18.1%, 13.6% 15.8%, 15.8% 13.6%, 18.1% 11.5%, 20.5% 9.6%, 23.0% 7.9%, 25.7% 6.3%, 28.4% 4.9%, 31.2% 3.7%, 34.1% 2.6%);
}

.nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 0px;
    padding: 0px;
    min-height: 80px;
    justify-content: center;
}

.nav-icon-container {
    position: relative;
    width:175px;
    height: 175px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
}

.nav-shape-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

@media (max-width:1024px) {
    .nav-icon-container {
        width: 140px;
        height: 140px;
    }
}
@media (max-width:767px) {
    .nav-icon-container {
        width: 100px;
        height: 100px;
        margin-bottom:6px;
    }
}
.nav-icon {
    position: absolute;
    z-index: 2;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 69px;
    height: 72px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.nav-icon img {
    width: 69px;
    height: 72px;
    object-fit: contain;
}
@media (max-width:1024px) {
    .nav-icon,
    .nav-icon img {
        width: 55px;
        height: 57px;
    }
}
@media (max-width:767px) {
    .nav-icon,
    .nav-icon img {
        width: 41px;
        height: 42px;
    }
}

.nav-bg-shape {
    z-index: 1;
    transition: all 0.3s ease, clip-path 0.3s ease, background-color 0.3s ease;
    width: 100%;
    height: 100%;
    background-color: var(--default-color);
    /* Let flexbox center it - no positioning needed */
}

/* Default state - hexagon shape */
.nav-bg-shape.default {
    clip-path: var(--hexagon-shape);
}

/* Active state - circle shape */
.nav-bg-shape.active {
    clip-path: var(--circle-shape);
    background-color: var(--active-color);
}

/* Hover state - transition to circle */
.nav-item:hover .nav-bg-shape.default {
    clip-path: var(--circle-shape);
    background-color: var(--active-color);
}

/* Responsive sizing - All breakpoints use the same CSS variables */
/* No need to repeat clip-path declarations since CSS variables work across all media queries */

.nav-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 20px;
}
.nav-title:after {
    content: '';
    background-image: url('https://tiefenbachergroup.com/wp-content/uploads/nav-arrow.svg');
    background-size: 80%;
    background-repeat: no-repeat;
    background-position: center;
    width: 15px;
    height: 24px;
    display: inline-block;
    margin-left: 12px;
    transform: translateY(7px);
}
@media (max-width:767px) {
    .nav-title:after {
        width: 12px;
        height: 18px;
        transform: translateY(4px);
    }
}

/* Active States */
.nav-item.active .nav-title,
.nav-item:hover .nav-title {
    color: var(--primary);
}
.nav-item.active .nav-title::after,
.nav-item:hover .nav-title::after {
    background-image: url('https://tiefenbachergroup.com/wp-content/uploads/nav-arrow-active.svg');
}

/* Horizontal scroll for smaller screens */
@media (max-width: 840px) {
    .navigation-widget:not(.alternative-mobile) {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        padding-bottom: 10px;
        gap: 16px;
        /* Hide scrollbar */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* Internet Explorer 10+ */
    }
    
    /* Hide scrollbar for WebKit browsers */
    .navigation-widget:not(.alternative-mobile)::-webkit-scrollbar {
        display: none;
    }
    
    .navigation-widget:not(.alternative-mobile) .nav-item {
        flex-shrink: 0;
    }
    
    /* Add padding to first and last items */
    .navigation-widget:not(.alternative-mobile) .nav-item:first-child {
        margin-left: 16px;
    }
    
    .navigation-widget:not(.alternative-mobile) .nav-item:last-child {
        margin-right: 16px;
    }
}
@media (min-width: 841px) {
    .nav-about-button {
        display:none;
    }
}
/* Alternative mobile layout - 2 columns */
@media (max-width: 840px) {
    .navigation-widget.alternative-mobile {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        padding: 0 16px;
    }
    
    .navigation-widget.alternative-mobile .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    /* About Us button styling */
    .navigation-widget.alternative-mobile .nav-about-button {
        justify-self: center;
        align-self:center;
    }
    
    .navigation-widget.alternative-mobile .nav-about-button .elementor-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 14px 24px 12px;
        background-color: var(--accent);
        color: var(--primary);
        border: 1px solid var(--primary);
        text-decoration: none;
        border-radius: 8px;
        font-weight: 700;
        transition: background-color 0.3s ease;
    }
    
    .navigation-widget.alternative-mobile .nav-about-button .elementor-button:hover {
        background-color: #005a87;
        color: #ffffff;
    }
    
    .navigation-widget.alternative-mobile .nav-about-button .elementor-button-content-wrapper {
        display: flex;
        align-items: center;
    }
    
    .navigation-widget.alternative-mobile .nav-about-button .elementor-button-text {
        font-size: 16px;
    }
}

/* Vertical Layout - handled by Elementor controls */
.navigation-widget[style*="flex-direction: column"] .nav-item:not(:last-child) {
    margin-right: 0;
    margin-bottom: 20px;
}

/* Focus states for accessibility */
.nav-link:focus {
    outline: none;
}

/* No items state */
.nav-no-items {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin: 20px 0;
}

.nav-no-items p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 16px;
}

.nav-no-items .button {
    margin-top: 10px;
}