/* Search toggle */
.header-search-toggle {
    background: transparent;
    border: none;
    color: #cd9933;
    font-size: 22px;
    padding: 0 15px 0 0;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease, transform 0.2s ease;
}

.header-search-toggle:hover {
    color: #fff;
    transform: scale(1.08);
}

/* Overlay */
.header-search-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(11, 13, 15, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.header-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Popup panel */
.header-search-popup {
    width: 100%;
    max-width: 820px;
    background-color: #fff;
    border: none;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transform: translateY(24px) scale(0.97);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.header-search-overlay.active .header-search-popup {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.header-search-accent {
    height: 4px;
    background: linear-gradient(90deg, #cd9933 0%, #999966 50%, #cd9933 100%);
}

/* Header row */
.header-search-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 28px 28px 0;
}

.header-search-heading .search-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #cd9933;
    margin-bottom: 6px;
}

.header-search-heading .search-title {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: #0b0d0f;
    margin: 0;
    line-height: 1.3;
}

.header-search-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    font-size: 16px;
    color: #0b0d0f;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.header-search-close:hover {
    background-color: #cd9933;
    color: #fff;
}

/* Search input */
.header-search-input-wrap {
    display: flex;
    align-items: center;
    margin: 24px 28px 0;
    padding: 0 4px;
    height: 56px;
    background-color: #fff;
    border: none;
}

.header-search-input-wrap:focus-within {
    box-shadow: none;
}

.header-search-input-wrap > i {
    color: #cd9933;
    font-size: 18px;
    margin-right: 14px;
    flex-shrink: 0;
}

.header-search-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    color: #0b0d0f;
    background: transparent;
    min-width: 0;
    box-shadow: none;
}

.header-search-input-wrap input::placeholder {
    color: #999;
}

.search-esc-hint {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 24px;
    padding: 0 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #999;
    background: #f5f5f5;
    border: none;
    border-radius: 4px;
}

/* Results area */
.header-search-results {
    margin: 20px 28px 28px;
    max-height: min(420px, 50vh);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cd9933 #f0f0f0;
}

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

.header-search-results::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.header-search-results::-webkit-scrollbar-thumb {
    background-color: #cd9933;
    border-radius: 3px;
}

/* Empty state */
.search-empty-state {
    text-align: center;
    padding: 40px 20px;
}

.search-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(205, 153, 51, 0.1);
    border: none;
    border-radius: 50%;
}

.search-empty-icon i {
    font-size: 24px;
    color: #cd9933;
}

.search-empty-title {
    font-family: 'Poppins', sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: #0b0d0f;
    margin: 0 0 8px;
}

.search-empty-text {
    font-size: 14px;
    color: #888;
    margin: 0;
}

/* Loading */
.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 36px 20px;
    color: #666;
    font-size: 14px;
    margin: 0;
}

.search-loading-spinner {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(205, 153, 51, 0.25);
    border-top-color: #cd9933;
    border-radius: 50%;
    animation: searchSpin 0.7s linear infinite;
}

@keyframes searchSpin {
    to { transform: rotate(360deg); }
}

/* No results */
.search-no-results {
    text-align: center;
    padding: 36px 20px;
    margin: 0;
}

.search-no-results i {
    font-size: 32px;
    color: rgba(205, 153, 51, 0.5);
    margin-bottom: 14px;
    display: block;
}

.search-no-results span {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #0b0d0f;
    margin-bottom: 6px;
}

.search-no-results em {
    font-style: normal;
    font-size: 13px;
    color: #888;
}

/* Result groups */
.header-search-results .search-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.header-search-results .search-group {
    min-width: 0;
}

.header-search-results .search-group h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #cd9933;
    font-weight: 700;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.header-search-results .search-group h4 i {
    font-size: 12px;
    opacity: 0.8;
}

.header-search-results .search-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Result items */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none;
    background: #f8f8f8;
    border: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.search-result-item:hover {
    background: #f0ebe0;
    transform: translateX(3px);
}

.search-result-thumb {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    overflow: hidden;
    background: #fff;
    border: none;
}

.search-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.search-result-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.search-result-title {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #0b0d0f;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-meta {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-price {
    font-size: 13px;
    color: #cd9933;
    font-weight: 700;
}

.search-result-arrow {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 11px;
    transition: color 0.2s ease;
}

.search-result-item:hover .search-result-arrow {
    color: #cd9933;
}

body.search-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 767.98px) {
    .header-search-overlay {
        padding: 16px;
        align-items: flex-end;
    }

    .header-search-popup {
        max-height: 90vh;
        display: flex;
        flex-direction: column;
    }

    .header-search-top {
        padding: 20px 20px 0;
    }

    .header-search-heading .search-title {
        font-size: 18px;
    }

    .header-search-input-wrap {
        margin: 18px 20px 0;
        height: 50px;
        padding: 0 2px;
    }

    .header-search-input-wrap input {
        font-size: 15px;
    }

    .search-esc-hint {
        display: none;
    }

    .header-search-results {
        margin: 16px 20px 20px;
        max-height: min(360px, 45vh);
    }

    .header-search-results .search-results-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .search-empty-state {
        padding: 28px 12px;
    }
}
