/* ============ header search trigger ============ */
.xb-search-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(69, 43, 35, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.header-area--three .xb-search-trigger {
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
    margin-right: 10px;
}

.xb-search-trigger:hover,
.xb-search-trigger:focus-visible {
    background: #a56649;
    border-color: #a56649;
    color: #ffffff;
    transform: translateY(-1px);
    outline: none;
}

.xb-search-trigger-mobile-wrap {
    padding: 0 0 14px;
}

.xb-search-trigger--inline {
    width: 100%;
    height: auto;
    border-radius: 50px;
    padding: 12px 18px;
    justify-content: flex-start;
    color: #241a15;
    border-color: rgba(69, 43, 35, 0.18);
    font-size: 14px;
    font-weight: 500;
}

/* ============ overlay ============ */
.xb-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.xb-search-overlay[hidden] {
    display: none;
}

.xb-search-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 18, 15, 0.55);
    backdrop-filter: blur(3px);
    animation: xbSearchFadeIn 0.25s ease;
}

.xb-search-overlay__panel {
    position: relative;
    z-index: 1;
    width: min(720px, 94vw);
    margin-top: 9vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: #fbf7f2;
    border-radius: 16px;
    box-shadow: 0 40px 80px -20px rgba(23, 18, 15, 0.5);
    overflow: hidden;
    animation: xbSearchSlideIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes xbSearchFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes xbSearchSlideIn {
    from { opacity: 0; transform: translateY(-14px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.xb-search-overlay__bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(69, 43, 35, 0.12);
}

.xb-search-overlay__icon {
    color: #a56649;
    font-size: 16px;
    flex-shrink: 0;
}

.xb-search-overlay__input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 17px;
    color: #241a15;
}

.xb-search-overlay__input::placeholder {
    color: #9c8f83;
}

.xb-search-overlay__clear,
.xb-search-overlay__close {
    border: none;
    background: none;
    color: #9c8f83;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    flex-shrink: 0;
}

.xb-search-overlay__clear:hover,
.xb-search-overlay__close:hover,
.xb-search-overlay__clear:focus-visible,
.xb-search-overlay__close:focus-visible {
    background: rgba(165, 102, 73, 0.12);
    color: #452b23;
    outline: none;
}

.xb-search-overlay__body {
    overflow-y: auto;
    padding: 8px;
}

/* ============ results list ============ */
.xb-search-results {
    list-style: none;
    margin: 0;
    padding: 0;
}

.xb-search-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: #241a15;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.xb-search-result:hover,
.xb-search-result.is-active {
    background: rgba(165, 102, 73, 0.1);
}

.xb-search-result__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #ece3da;
    color: #452b23;
    font-size: 14px;
    flex-shrink: 0;
}

.xb-search-result__text {
    flex: 1;
    min-width: 0;
}

.xb-search-result__label {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
    color: #241a15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xb-search-result__label mark {
    background: rgba(227, 189, 138, 0.55);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

.xb-search-result__sub {
    display: block;
    font-size: 12px;
    color: #7a7168;
    margin-top: 1px;
}

.xb-search-result__badge {
    flex-shrink: 0;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 9px;
    border-radius: 30px;
    background: #452b23;
    color: #ffffff;
    white-space: nowrap;
}

/* ============ empty / skeleton / hint states ============ */
.xb-search-empty,
.xb-search-hint {
    text-align: center;
    padding: 40px 20px;
    color: #7a7168;
}

.xb-search-empty p,
.xb-search-hint p {
    margin: 0 0 6px;
    font-size: 14.5px;
}

.xb-search-empty__hint,
.xb-search-hint__list {
    font-size: 12.5px !important;
    color: #9c8f83 !important;
}

.xb-search-skeleton {
    padding: 4px 14px;
}

.xb-search-skeleton__row {
    height: 52px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: linear-gradient(100deg, #ece3da 30%, #f6f0e9 50%, #ece3da 70%);
    background-size: 200% 100%;
    animation: xbSearchShimmer 1.3s ease-in-out infinite;
}

@keyframes xbSearchShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    .xb-search-overlay__panel,
    .xb-search-overlay__backdrop,
    .xb-search-skeleton__row {
        animation: none !important;
    }
}

@media (max-width: 767px) {
    .xb-search-overlay__panel {
        width: 100vw;
        margin-top: 0;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
}
