/* Command-palette site search (header) */
.bww-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 12vh 16px 16px;
    box-sizing: border-box;
    align-items: flex-start;
    justify-content: center;
}

.bww-search-overlay.is-open {
    display: flex;
}

.bww-search-palette {
    width: 100%;
    max-width: 640px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 24px);
}

.bww-search-palette form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.bww-search-palette-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    background: #fff;
}

.bww-search-palette-header input[type="text"] {
    flex: 1;
    border: none;
    outline: none;
    font-size: 18px;
    line-height: 1.4;
    padding: 8px 0;
    background: transparent;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
}

.bww-search-palette-header button[type="submit"] {
    flex-shrink: 0;
    background: #b20223;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.bww-search-palette-header button[type="submit"]:hover {
    background: #900119;
}

.bww-search-palette-close {
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
}

.bww-search-palette-hint {
    padding: 10px 16px;
    margin: 0;
    font-size: 13px;
    color: #333;
    background: #f0f0f0;
    border-bottom: 1px solid #e0e0e0;
}

.bww-search-palette-hint kbd {
    display: inline-block;
    padding: 2px 7px;
    border: 1px solid #888;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    color: #111;
    background: #fff;
    box-shadow: 0 1px 0 #bbb;
}

/* Override legacy style44.css: div#searchResult { z-index:-999; position:absolute } */
.bww-search-palette div#searchResult,
.bww-search-overlay div#searchResult {
    position: relative !important;
    z-index: 1 !important;
    top: auto !important;
    margin-left: 0 !important;
    flex: 1;
    min-height: 0;
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 8px 8px;
    display: block;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}

#searchResult {
    flex: 1;
    min-height: 0;
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 8px 8px;
    display: block;
    -webkit-overflow-scrolling: touch;
}

#searchResult:empty {
    display: none;
    padding: 0;
}

#searchResult ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#searchResult ul li {
    border-bottom: 1px solid #eee;
}

#searchResult ul li:last-child {
    border-bottom: none;
}

#searchResult ul li a,
#searchResult ul > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    color: #111;
    text-decoration: none;
    border-radius: 6px;
}

#searchResult ul > a {
    border-bottom: 1px solid #eee;
}

#searchResult ul > a li {
    display: flex;
    align-items: center;
    gap: 12px;
    list-style: none;
    width: 100%;
    border: none;
}

#searchResult ul li a:hover,
#searchResult ul li a.is-active,
#searchResult ul > a:hover {
    background: #f5f5f5;
}

#searchResult .search-thumb img {
    width: 72px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
}

#searchResult .search-news-result p {
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
}

#searchResult .search-suggest-footer {
    padding: 10px 16px 14px;
    border-top: 1px solid #eee;
    font-size: 13px;
}

#searchResult .search-suggest-footer a {
    color: #b20223;
    font-weight: 600;
}

#searchResult .search-suggest-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
}

#searchResult .search-suggest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #eee;
}
#searchResult .search-suggest-item .search-suggest-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    padding: 10px 8px;
    color: #111;
    text-decoration: none;
    border-radius: 6px;
}
#searchResult .search-suggest-item .search-suggest-main:hover {
    background: #f5f5f5;
}
#searchResult ul li a.search-suggest-tickets {
    flex-shrink: 0;
    display: inline-block;
    margin-right: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #b20223;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
}
#searchResult ul li a.search-suggest-tickets:hover {
    background: #900119;
    color: #fff;
}

#searchResult .search-suggest-item-grosses .search-suggest-main {
    background: #f6fbf7;
}
#searchResult .search-suggest-item-grosses .search-suggest-main:hover {
    background: #e8f5e9;
}
#searchResult .search-suggest-grosses-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 6px;
    background: #e8f5e9 url(https://cloudimages.broadwayworld.com/bworld1523/assets/img/svg/grosses-icon.svg) center / 22px 22px no-repeat;
}
#searchResult .search-suggest-label-grosses {
    color: #1e7e34;
    background: #d4edda;
}

#searchResult .search-loading,
#searchResult .search-empty {
    padding: 16px;
    color: #666;
    font-size: 14px;
}

@media (max-width: 768px) {
    .bww-search-overlay {
        padding: 0;
        align-items: stretch;
    }

    .bww-search-palette {
        max-width: none;
        border-radius: 0;
        max-height: 100vh;
        min-height: 100vh;
    }

    .bww-search-palette-header input[type="text"] {
        font-size: 16px;
    }

    .bww-search-palette-hint-desktop {
        display: none;
    }

    .bww-search-palette div#searchResult,
    .bww-search-overlay div#searchResult,
    #searchResult {
        max-height: none;
        flex: 1;
    }
}

/* Legacy dropdown hidden when palette active */
#searchbar.search-modal.legacy-search-hidden {
    display: none !important;
}
