.header-right-actions {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1001;
}

.header-right-actions .language-dropdown {
    position: static;
    right: auto;
    left: auto;
    margin-left: 0;
    margin-right: 0;
}

/* RTL: keep search + language on the opposite side from the hamburger */
html[dir="rtl"] .header-right-actions {
    right: auto;
    left: 10px;
}

html[dir="rtl"] .header-right-actions .language-dropdown {
    position: static !important;
    right: auto !important;
    left: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

html[dir="rtl"] .ife-search-close {
    right: auto;
    left: 12px;
}

html[dir="rtl"] .ife-search-input-wrap {
    padding: 20px 20px 16px 48px;
}

.ife-search-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--ife-search-accent, #fff);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.ife-search-icon-btn:hover,
.ife-search-icon-btn:focus {
    opacity: 0.85;
    outline: none;
    background: rgba(255, 255, 255, 0.12);
}

.ife-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.65);
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 16px 24px;
    box-sizing: border-box;
}

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

.ife-search-panel {
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--ife-search-bg, #111);
    color: var(--ife-search-text, #fff);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    position: relative;
}

.ife-search-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    border: none;
    background: transparent;
    color: var(--ife-search-text, #fff);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
    padding: 4px 8px;
}

.ife-search-close:hover {
    opacity: 1;
}

.ife-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 48px 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.ife-search-input-wrap > i {
    color: var(--ife-search-accent, #fff);
    font-size: 18px;
    flex-shrink: 0;
}

.ife-search-input-wrap input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--ife-search-text, #fff);
    font-size: 18px;
    outline: none;
}

.ife-search-input-wrap input::placeholder {
    color: var(--ife-search-text, #fff);
    opacity: 0.55;
}

.ife-search-results {
    overflow-y: auto;
    padding: 8px 0 12px;
    max-height: calc(80vh - 72px);
}

.ife-search-group-title {
    padding: 10px 20px 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.7;
    color: var(--ife-search-text, #fff);
}

.ife-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--ife-search-text, #fff);
    transition: background 0.15s ease;
}

.ife-search-item:hover,
.ife-search-item:focus {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    color: var(--ife-search-text, #fff);
    outline: none;
}

.ife-search-item img {
    width: 44px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
}

.ife-search-item.ife-search-item--music img {
    width: 52px;
    height: 52px;
    border-radius: 6px;
}

.ife-search-item-text {
    min-width: 0;
    flex: 1;
}

.ife-search-item-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ife-search-item-sub {
    display: block;
    font-size: 12px;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.ife-search-empty,
.ife-search-hint {
    padding: 24px 20px;
    text-align: center;
    opacity: 0.7;
    font-size: 14px;
}

/* Full search results page */
.ife-search-page {
    padding-bottom: 40px;
}

.ife-search-page-meta {
    padding: 0 16px 12px;
    opacity: 0.8;
    font-size: 14px;
}

.ife-search-page-empty {
    padding: 40px 16px;
    text-align: center;
    opacity: 0.75;
}

.ife-search-page-section {
    margin-bottom: 28px;
    padding: 0 12px;
}

.ife-search-page-section .list-title h3 span {
    font-weight: 400;
    opacity: 0.7;
    font-size: 0.85em;
}

.ife-search-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 14px;
}

.ife-search-page-grid--music {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.ife-search-page-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ife-search-page a.ife-search-page-card:hover,
.ife-search-page a.ife-search-page-card:focus,
.ife-search-page a.ife-search-page-card:active {
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
    outline: none;
}

.ife-search-page a.ife-search-page-card:hover .ife-search-page-card-text strong,
.ife-search-page a.ife-search-page-card:hover .ife-search-page-card-text span,
.ife-search-page a.ife-search-page-card:focus .ife-search-page-card-text strong,
.ife-search-page a.ife-search-page-card:focus .ife-search-page-card-text span {
    color: inherit;
}

.ife-search-page-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    display: block;
}

.ife-search-page-card--music img {
    aspect-ratio: 1 / 1;
}

.ife-search-page-card-text {
    margin-top: 8px;
}

.ife-search-page-card-text strong {
    display: block;
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ife-search-page-card-text span {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 768px) {
    .ife-search-page-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 18px;
    }
}
