/* ===== SEARCH OVERLAY ===== */
@keyframes searchOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes searchPanelIn {
    from { opacity: 0; transform: translateY(-18px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(4.5rem, 12vh, 9rem) 1rem 2rem;
    animation: searchOverlayIn 0.18s ease forwards;
}

.search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(22, 38, 20, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Panel */
.search-panel {
    position: relative;
    width: 100%;
    max-width: 640px;
    background: rgba(22, 38, 20, 0.98);
    border: 1px solid rgba(162, 189, 154, 0.25);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    animation: searchPanelIn 0.28s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.2rem 1.4rem;
    border-bottom: 1.5px solid rgba(162, 189, 154, 0.22);
}

.search-bar__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--gold);
    opacity: 0.75;
}

.search-bar__input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    font-weight: 400;
    color: var(--white);
    caret-color: var(--gold);
    letter-spacing: 0.01em;
}

.search-bar__input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.search-bar__input::-webkit-search-cancel-button,
.search-bar__input::-webkit-search-decoration {
    display: none;
}

.search-bar__close {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.45);
    transition: var(--transition);
}

.search-bar__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
}

.search-bar__close:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.search-bar__close svg {
    width: 16px;
    height: 16px;
}

/* Results */
.search-results {
    max-height: min(58vh, 460px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.5rem 0 0.75rem;
}

.search-results::-webkit-scrollbar {
    width: 4px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(162, 189, 154, 0.3);
    border-radius: 2px;
}

/* Group */
.search-group {
    padding: 0.2rem 0;
}

.search-group + .search-group {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.3rem;
    padding-top: 0.5rem;
}

.search-group__label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.65;
    padding: 0.45rem 1.4rem 0.3rem;
}

/* Result item */
.search-result {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.6rem 1.4rem;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.12s ease;
    border-left: 2px solid transparent;
}

.search-result:hover,
.search-result--focused {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--gold);
}

.search-result:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    border-left-color: var(--gold);
}

/* Icon pill */
.search-result__icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.search-result__icon svg {
    width: 15px;
    height: 15px;
}

.search-result__icon--package {
    background: rgba(134, 179, 122, 0.2);
    color: var(--teal-light);
}

.search-result__icon--service {
    background: rgba(162, 189, 154, 0.18);
    color: var(--gold);
}

.search-result__icon--why {
    background: rgba(120, 138, 116, 0.2);
    color: #86b37a;
}

.search-result__icon--page {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.55);
}

/* Result text */
.search-result__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}

.search-result__title {
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result__subtitle {
    font-family: var(--font-body);
    font-size: 0.73rem;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Highlight */
.search-highlight {
    background: transparent;
    color: var(--gold);
    font-weight: 600;
}

/* Arrow */
.search-result__arrow {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.18);
    transition: color 0.12s ease, transform 0.12s ease;
}

.search-result:hover .search-result__arrow,
.search-result--focused .search-result__arrow {
    color: var(--gold);
    transform: translateX(2px);
}

/* Empty state */
.search-empty {
    padding: 3rem 2rem;
    text-align: center;
}

.search-empty svg {
    width: 38px;
    height: 38px;
    margin: 0 auto 1rem;
    color: rgba(255, 255, 255, 0.2);
}

.search-empty__title {
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.35rem;
}

.search-empty__title strong {
    color: var(--white);
    font-weight: 600;
}

.search-empty__hint {
    font-family: var(--font-body);
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Hint bar (empty query) */
.search-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.4rem;
    gap: 1rem;
}

.search-hint__text {
    font-family: var(--font-body);
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.28);
}

.search-hint__key kbd {
    display: inline-block;
    padding: 0.15em 0.45em;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.45);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .search-overlay,
    .search-panel {
        animation: none;
    }

    .search-result__arrow {
        transition: none;
    }
}
