/* ==========================================================================
   NAVIGATION STYLES
   ========================================================================== */

/**
 * Mobile Navigation Toggle (Hamburger Menu)
 * Ensures the navigation control is properly styled and visible
 */

/* Base navigation control styles */
.w-nav-control {
    display: none; /* Hidden by default */
    cursor: pointer;
    position: relative;
    z-index: 10;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

/* Show navigation control on mobile screens */
@media screen and (max-width: 1023px) {
    .w-nav-control {
        display: block !important;
    }
}

/* Navigation icon (hamburger lines) */
.w-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.w-nav-icon > div {
    position: relative;
    width: 24px;
    height: 3px;
    background: currentColor;
    transition: all 0.3s ease;
}

.w-nav-icon > div::before,
.w-nav-icon > div::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: currentColor;
    transition: all 0.3s ease;
}

.w-nav-icon > div::before {
    top: -8px;
}

.w-nav-icon > div::after {
    top: 8px;
}

/* Hamburger icon animation when active (menu opened) */
.w-nav-control.active .w-nav-icon > div {
    background: transparent;
}

.w-nav-control.active .w-nav-icon > div::before {
    top: 0;
    transform: rotate(45deg);
}

.w-nav-control.active .w-nav-icon > div::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Ensure navigation list is hidden on mobile when needed */
@media screen and (max-width: 1023px) {
    .w-nav > .w-nav-list.level_1 {
        display: none;
    }
}

/* Navigation color inheritance */
.w-nav-control {
    color: inherit;
}

.w-nav-control:hover {
    opacity: 0.8;
}

/* ==========================================================================
   DROPDOWN MENU STYLES
   ========================================================================== */

/* Dropdown parent item */
.w-nav-item.has-dropdown {
    position: relative;
}

/* Dropdown trigger button */
.dropdown-trigger {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    text-align: left;
}

/* Ensure dropdown trigger title doesn't wrap */
.dropdown-trigger .w-nav-title {
    display: inline;
    white-space: nowrap;
}

/* Dropdown arrow icon */
.dropdown-arrow {
    transition: transform 0.2s ease;
    margin-left: 4px;
    display: inline-block;
    filter: brightness(0) saturate(100%) invert(8%) sepia(35%) saturate(2247%) hue-rotate(206deg) brightness(96%) contrast(95%)
           drop-shadow(0 0 0.5px currentColor);
    transform: rotate(180deg); /* Domyślnie w dół */
}

.dropdown-trigger[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(0deg); /* Po otwarciu w górę */
}

/* Dropdown menu container */
.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1000;
    padding: 0.5rem 0;
    margin: 0;
    list-style: none;
}

/* Show dropdown when open */
.sub-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Desktop hover behavior */
@media screen and (min-width: 1024px) {
    .has-dropdown:hover .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* Dropdown menu items */
.sub-menu .w-nav-item {
    padding: 0;
}

.sub-menu .w-nav-anchor {
    display: block;
    padding: 0.75rem 1.25rem;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.sub-menu .w-nav-anchor:hover,
.sub-menu .w-nav-anchor:focus {
    background-color: #f5f5f5;
    outline: none;
}

/* Mobile/Tablet dropdown adjustments */
@media screen and (max-width: 1023px) {
    /* Ensure navigation list can expand dynamically */
    .w-nav-list.level_1 {
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
    }

    /* Dropdown parent should allow content to flow */
    .w-nav-item.has-dropdown {
        display: block;
    }

    .sub-menu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        padding-left: 1rem;
        background: transparent;
        transform: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        display: block;
        opacity: 0;
        visibility: hidden;
    }

    .sub-menu.open {
        max-height: 500px;
        overflow: visible;
        opacity: 1;
        visibility: visible;
    }

    .sub-menu .w-nav-anchor {
        padding: 0.5rem 1rem;
    }
}
