/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 999;
    left: 0;
    right: 0;
    background-color: var(--primary-blue);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.nav-wrapper {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

nav {
    display: none;
    gap: 32px;
    flex: 1;
}

nav a {
    font-size: 14px;
    color: var(--light-blue);
}

nav a.active {
    color: var(--white);
    padding-bottom: 2px;
    border-bottom: 2px solid var(--white);
    font-weight: 500;
}

nav a:hover {
    color: var(--white);
}

.search-btn {
    background: none;
    border: none;
    color: var(--light-blue);
    cursor: pointer;
}

.menu-mobile {
    display: block;
    background: none;
    border: none;
    color: var(--white);
}

/* Search Box Custom */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box__bar {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 8px;
    padding: 4px 12px;
    width: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-box.is-active .search-box__bar {
    width: 250px;
    opacity: 1;
    visibility: visible;
}

.search-box__input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    padding: 4px 8px;
    font-size: 14px;
    color: var(--text-dark);
}

.search-box__btn-open, .search-box__btn-close {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.search-box__btn-close {
    color: var(--text-dark);
}

.search-box__btn-open {
    color: var(--light-blue);
}

.search-box__btn-open:hover {
    color: var(--white);
}

.icon-search-mobile {
    display: none;
}

/* Mobile Menu Custom */
.menu-mobile-btn {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    display: block;
}

.search-box__bar .search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 350px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    overflow: hidden;
    display: none;
    z-index: 100;
}
.search-box__bar #searchResultsList {
    max-height: 500px;
    overflow-y: scroll;
}

.search-box__bar .search-dropdown.is-visible {
    display: block;
    animation: fadeInDown 0.2s ease-out;
}

.search-box__bar .search-loader {
    padding: 16px;
    text-align: center;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #eee;
}

.search-box__bar .search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    text-decoration: none;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.search-box__bar .search-result-item:last-child {
    border-bottom: none;
}

.search-box__bar .search-result-item:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}

.search-box__bar .search-result-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background-color: #eee;
}

.search-box__bar .search-result-item .info {
    flex: 1;
    min-width: 0;
}

.search-box__bar .search-result-item h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark, #333);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-box__bar .search-result-item span {
    display: block;
    font-size: 12px;
    color: #888;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .search-box__bar .search-dropdown {
        width: 100%;
        box-shadow: none;
        border: 1px solid #eee;
    }

    .search-box__bar #searchResultsList {
        max-height: 300px;
    }
}

@media (max-width: 767px) {
    .main-nav {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background-color: var(--primary-blue);
        flex-direction: column;
        padding: 24px;
        gap: 16px;
        border-top: 1px solid var(--secondary-blue);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        display: none; 
    }

    .main-nav.is-open {
        display: flex;
    }

    .search-box {
        width: 100%;
    }

    .search-box__bar {
        position: relative;
        transform: none;
        width: 100% !important;
    }
    nav a.active {
        border-bottom: none;
    }
    .search-box__btn-open {
        display: none !important;
    }
    .icon-close {
        display: none !important;
    }
    .icon-search-mobile {
        display: block !important;
    }
}

@media (min-width: 768px) {
    .menu-mobile-btn {
        display: none;
    }
}
