/* Dropdown Navigation Styles */

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: center;
}

.nav-links li {
    position: relative;
}

.nav-links > li > a {
    text-decoration: none;
    color: #666;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    transition: color 0.3s;
    display: block;
    padding: 0.5rem 0;
}

.nav-links > li > a:hover {
    color: #2c2c2c;
}

/* Dropdown Container */
.has-dropdown {
    position: relative;
}

.has-dropdown > a::after {
    content: '▾';
    margin-left: 0.4rem;
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.has-dropdown:hover > a::after {
    transform: translateY(2px);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    transform: translateX(-50%) translateY(10px);
    z-index: 1000;
    min-width: 620px;
    margin-top: 0.5rem;
}

/* Breiteres Dropdown für Produkte mit mehr Einträgen */
.dropdown-menu.wide {
    min-width: 1200px;
}

/* Extra breites Dropdown für 3 Kategorien */
.dropdown-menu.extra-wide {
    min-width: 1400px;
    max-width: 1500px;
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Full Width Dropdown */
.dropdown-menu.full-width {
    left: 50%;
    transform: translateX(-50%);
    min-width: 900px;
    max-width: 1100px;
}

.has-dropdown:hover .dropdown-menu.full-width {
    transform: translateX(-50%) translateY(0);
}

/* Dropdown Content Grid */
.dropdown-content {
    padding: 1.5rem;
}

.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.dropdown-grid.three-col {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* 3-spaltiges Grid für Produkte */
.dropdown-grid.three-columns {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Dropdown Category */
.dropdown-category {
    margin-bottom: 1rem;
}

.dropdown-category:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 0.75rem;
    padding: 0 0.75rem;
}

/* 2-spaltiges Grid für CRM-Produkte - ENTFERNT, da CRM jetzt auch einzelne Items hat */

/* Dropdown Item */
.dropdown-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    text-decoration: none;
    color: #2c2c2c;
    border-radius: 6px;
    transition: background 0.2s;
    align-items: flex-start;
}

.dropdown-item:hover {
    background: #f8f8f8;
}

.dropdown-item-icon {
    font-size: 0.7rem;
    flex-shrink: 0;
    width: 56px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8e8e8;
    border-radius: 6px;
    color: #2c2c2c;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.dropdown-item-content {
    flex: 1;
}

.dropdown-item-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #2c2c2c;
    margin-bottom: 0.25rem;
}

.dropdown-item-description {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

/* Simple Dropdown (without icons) */
.dropdown-menu.simple .dropdown-item {
    padding: 0.75rem 1.25rem;
}

.dropdown-menu.simple .dropdown-item:hover {
    background: #f8f8f8;
    color: #2c2c2c;
}

/* Klickbare Kategorie-Titel */
.category-title-link {
    text-decoration: none;
    display: block;
    padding: 0.75rem 1rem;
    margin: -0.5rem -1rem 1rem -1rem;
    border-radius: 6px;
    transition: background 0.2s, transform 0.2s;
}

.category-title-link:hover {
    background: rgba(44, 44, 44, 0.04);
    transform: translateX(2px);
}

.category-title-link .category-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c2c2c;
    margin-bottom: 0.25rem;
    text-transform: none;
    letter-spacing: 0;
    padding: 0;
}

.category-title-link .category-description {
    font-size: 0.8rem;
    color: #999;
    font-weight: 400;
}

/* Anpassung für nicht-klickbare Kategorie-Titel in Leistungen */
.dropdown-category > .category-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

/* iOS Touch Support */
.mobile-menu-btn,
.has-dropdown > a,
.dropdown-item,
.category-title-link,
.mobile-menu-overlay {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Mobile Menu Close Button */
.mobile-menu-close {
    display: none;
}

/* Mobile Styles */
@media (max-width: 968px) {
    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 4rem 2rem 2rem 2rem;
        gap: 0;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
        z-index: 2500;
        -webkit-overflow-scrolling: touch;
        pointer-events: auto;
    }

    .nav-links.active {
        display: flex;
    }

    /* Mobile Close Button */
    .mobile-menu-close {
        display: block;
        position: absolute;
        top: 1.5rem;
        left: 1.5rem;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 3000;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }

    .mobile-menu-close::before,
    .mobile-menu-close::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 24px;
        height: 2px;
        background: #2c2c2c;
        transition: background 0.3s;
    }

    .mobile-menu-close::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .mobile-menu-close::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    .mobile-menu-close:hover::before,
    .mobile-menu-close:hover::after {
        background: #666;
    }

    .nav-links > li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-links > li > a {
        padding: 1rem 0;
        font-size: 1.1rem;
    }

    .has-dropdown > a::after {
        float: right;
    }

    .has-dropdown.mobile-open > a::after {
        transform: rotate(180deg);
    }

    .dropdown-menu,
    .dropdown-menu.wide,
    .dropdown-menu.extra-wide,
    .dropdown-menu.full-width {
        position: static !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        border-radius: 8px;
        margin: 0.5rem 0 !important;
        padding: 0;
        display: none;
        background: #f8f8f8;
        min-width: auto;
        max-width: none;
        width: 100% !important;
    }

    .has-dropdown.mobile-open .dropdown-menu {
        display: block;
    }

    .dropdown-content {
        padding: 0.5rem 0;
    }

    .dropdown-grid,
    .dropdown-grid.three-col,
    .dropdown-grid.three-columns {
        grid-template-columns: 1fr !important;
        gap: 0;
        margin: 0;
        padding: 0;
    }

    .dropdown-category {
        margin: 0;
        padding: 0;
    }

    .dropdown-item {
        padding: 0.75rem 1.25rem;
        border-radius: 0;
        margin: 0;
    }

    /* Mobile: Icons und Beschreibungen ausblenden für kompaktere Ansicht */
    .dropdown-item-icon {
        display: none;
    }

    .dropdown-item-description {
        display: none;
    }

    .dropdown-item-title {
        font-size: 0.95rem;
    }

    .category-title {
        padding: 0.75rem 1.25rem 0.5rem 1.25rem;
        margin-bottom: 0.5rem;
        background: transparent;
        border-bottom: 1px solid #ddd;
        font-size: 0.85rem;
    }

    .dropdown-category {
        margin-bottom: 0;
    }

    /* Kategorie-Titel auf Mobile etwas kleiner */
    .category-title-link .category-title {
        font-size: 0.95rem;
    }

    .category-title-link .category-description {
        font-size: 0.8rem;
    }

    /* Mobile Menu Overlay */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1500;
    }

    .mobile-menu-overlay.active {
        display: none;
    }

    .category-title-link {
        padding: 0.75rem 1.25rem 0.75rem 1.25rem;
        margin: 0 0 0.5rem 0;
        background: transparent;
        border-radius: 0;
    }

    .category-title-link:hover {
        background: rgba(44, 44, 44, 0.03);
        transform: none;
    }

    .category-title-link .category-title {
        font-size: 0.9rem;
        padding: 0 0 0.25rem 0;
        border-bottom: 1px solid #ddd;
        display: inline-block;
    }

    .category-title-link .category-description {
        font-size: 0.75rem;
        margin-top: 0.5rem;
        display: block;
    }
}

/* Animation for mobile dropdown */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.has-dropdown.mobile-open .dropdown-menu {
    animation: slideDown 0.3s ease-out;
}