/* Custom styles for mmenu integration with offCanvas */
#wrapper {
    background-color: #fff;
}

.partner-logo a span {
    display: none;
}

.mm-listitem a img {
    max-height: 26px;
    vertical-align: middle;
    margin-right: 8px;
}

#mobile-menu:not(.mm-menu) {
    display: none;
}

body.has-navbar-fixed-top {
    padding-top: unset !important;
}

body.has-navbar-fixed-top #wrapper-body {
    padding-top: 85px;
}

/* Hide the default Bulma mobile dropdown since we're using mmenu */
@media screen and (max-width: 768px) {
    body.has-navbar-fixed-top #wrapper-body {
        padding-top: 52px;
    }

    .navbar-dropdown.is-hidden-desktop {
        display: none !important;
    }

    /* Mobile header layout: hamburger left, logo center, search right */
    .navbar-brand {
        width: 100%;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Center the logo using absolute positioning */
    .navbar-item.mobile-logo-center {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        justify-content: center;
        padding: 0;
    }

    .navbar-item.mobile-logo-center a {
        display: flex;
        align-items: center;
    }

    /* Hamburger button stays on left */
    .navbar-burger {
        width: 52px;
        flex-shrink: 0;
        position: relative;
        z-index: 1;
        margin-left: 0;
        margin-right: auto;
    }

    /* Style search button on right */
    .navbar-item.mobile-search-btn {
        width: 52px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        cursor: pointer;
        position: relative;
        z-index: 1;
        margin-left: auto;
        margin-right: 0;
    }
}

/* Ensure the navbar stays fixed when mmenu transforms the page */
/* .mm-wrapper .navbar.is-fixed-top {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
} */

/* Search Overlay Styles */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-overlay.is-active {
    display: block;
}

.search-overlay.is-visible {
    opacity: 1;
}

.search-overlay-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
}

.search-overlay-content {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 50px auto 0;
    padding: 0 20px;
    z-index: 1;
}

.search-header {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#search-overlay-input {
    flex: 1;
    padding: 20px;
    font-size: 24px;
    border: none;
    outline: none;
    background: transparent;
    color: #333;
}

#search-overlay-input::placeholder {
    color: #999;
}

.search-close-btn {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #666;
    transition: color 0.2s ease;
}

.search-close-btn:hover {
    color: #333;
}

.search-results-container {
    margin-top: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#search-overlay-results {
    padding: 0;
}

.search-result-item {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.search-result-item:hover,
.search-result-item.is-selected {
    background: #f5f5f5;
}

.search-result-item.is-selected {
    background: #e8f4ff;
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.result-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.search-loading {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

/* Prevent body scroll when overlay is active */
body.search-overlay-open {
    overflow: hidden;
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
    .search-overlay-content {
        margin-top: 10px;
        padding: 0 10px;
    }

    #search-overlay-input {
        padding: 15px;
        font-size: 18px;
    }

    .search-close-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .search-results-container {
        max-height: calc(100vh - 150px);
    }
}
