/**
 * FLAME & CO. — Recherche globale (command palette)
 */

.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 2090;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 6vh 1rem 2rem;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.search-modal-inner {
    width: min(640px, 100%);
    background: rgba(18, 18, 18, 0.92);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.25rem;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
    transform: translateY(-12px) scale(0.98);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.search-modal.is-open .search-modal-inner {
    transform: translateY(0) scale(1);
}

.search-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 0.875rem 0.875rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.search-input-wrap > .bi-search {
    color: rgba(255, 255, 255, 0.45);
    font-size: 1.125rem;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1.0625rem;
    font-weight: 500;
    font-family: inherit;
    min-width: 0;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.search-kbd {
    font-size: 0.6875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    padding: 0.2rem 0.45rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.search-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.search-close:hover {
    background: rgba(230, 57, 70, 0.15);
    color: #fff;
}

.search-modal-body {
    max-height: min(52vh, 420px);
    overflow-y: auto;
    padding: 0.5rem;
}

.search-status {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.45);
}

.search-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-hint .bi-lightning-charge {
    color: var(--flame-orange, #F77F00);
}

.search-status.is-loading {
    color: rgba(255, 255, 255, 0.6);
}

.search-status.is-empty,
.search-status.is-error {
    color: rgba(255, 255, 255, 0.5);
}

.search-results {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-result {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.875rem;
    transition: background 0.2s ease;
}

.search-result:hover,
.search-result.is-focused {
    background: rgba(255, 255, 255, 0.06);
}

.search-result-thumb {
    width: 52px;
    height: 52px;
    border-radius: 0.75rem;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}

.search-result-body {
    flex: 1;
    min-width: 0;
}

.search-result-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.search-result-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.9375rem;
}

.search-result-badge {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.25), rgba(247, 127, 0, 0.25));
    color: #ffb347;
}

.search-result-desc {
    margin: 0.15rem 0 0;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
}

.search-result-price {
    font-weight: 700;
    color: var(--flame-orange, #F77F00);
    font-size: 0.9375rem;
    white-space: nowrap;
}

.search-result-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #E63946, #F77F00);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-result-add:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.45);
}

.search-result-link {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.search-modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    padding: 0.75rem 1.125rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
}

.search-footer-tip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.search-footer-tip kbd {
    font-size: 0.6875rem;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.5);
}

/* Bouton recherche navbar */
.btn-search-premium {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-header.is-scrolled .btn-search-premium {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--flame-dark);
}

.btn-search-premium:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.site-header.is-scrolled .btn-search-premium:hover {
    background: rgba(230, 57, 70, 0.08);
    color: var(--flame-red);
}

.btn-search-premium .bi {
    font-size: 1.05rem;
}

.mobile-menu-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.mobile-menu-search:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(230, 57, 70, 0.35);
    color: #fff;
}

.mobile-menu-search .bi {
    color: var(--flame-orange, #F77F00);
}

@media (max-width: 575.98px) {
    .search-modal {
        padding: 0.75rem;
        align-items: stretch;
    }

    .search-modal-inner {
        margin-top: 0.5rem;
    }

    .search-modal-body {
        max-height: calc(100vh - 200px);
    }
}
