.header_search_dialog {
    position: absolute;
    top: 100%;
    right: 0;
    height: 400px;
    width: 500px;
    max-width: calc(100vw - 20px);
    background: var(--white, #fff);
    color: #000 !important;
    visibility: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0.3s ease;
    border-radius: 20px;
    overflow: hidden;
    z-index: 2000 !important;
    border: 1px solid #e0e0e0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.header_search_dialog.visible {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.header_search_dialog .search-container {
    border-radius: 12px;
}

.header_search_dialog .search-input {
    font-size: 14px;
    border: 1px solid;
    color: #000 !important;
}

.header_search_dialog .search-input-box {
    position: relative;
}

.header_search_dialog .search_button {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}

.header_search_dialog .search_button:hover {
    background: rgba(0, 0, 0, 0.04);
}

.header_search_dialog .search_button img {
    width: 18px !important;
    height: 18px !important;
    display: block;
}

.header_search_dialog .search-dialog-close {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.06);
    align-items: center;
    justify-content: center;
    z-index: 3;
    cursor: pointer;
}

.h7-col-left .header_search_dialog {
    left: 0;
    right: auto;
}

.search-container {
    position: relative;
}

.search-container:focus-within {
    /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); */
    border-color: rgba(0, 0, 0, 0.2);
}

.search-input-box {
    position: relative;
}

.search-input {
    width: 100%;
    height: 40px;
    padding: 10px 40px 10px 18px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    background: transparent;
    border-color: rgba(0, 0, 0, 0.12) !important;
}

/* Search icon positioning */
.header_1_search_icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    opacity: 0.65;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
    z-index: 2;
}

.header_1_search_icon:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* Typed search box with enhanced styles */
.typed-search-box {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    height: 0;
    overflow: hidden;
    background: #ffffff;
    border-radius: 7px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 1000;
    opacity: 0;
    transition:
        height 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.typed-search-box.visible {
    height: auto;
    min-height: 100px;
    max-height: 350px;
    opacity: 1;
    overflow-y: auto;
}

/* Scrollbar styling for search results */
.typed-search-box::-webkit-scrollbar {
    width: 6px;
}

.typed-search-box::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.typed-search-box::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.typed-search-box::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Content containers - all initially hidden */
.search-preloader,
.search-nothing,
.search-content {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 12px 0;
    box-sizing: border-box;
    overflow-x: hidden !important;
}

.search-preloader.visible,
.search-nothing.visible,
.search-content.visible {
    display: block;
}

/* Preloader positioned in center */
.search-preloader {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: auto;
}

/* Enhanced dot loader */
.dot-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.dot-loader div {
    width: 10px;
    height: 10px;
    background-color: var(--primary, #222);
    border-radius: 50%;
    animation: dot-loader 0.6s infinite alternate;
}

.dot-loader div:nth-child(2) {
    animation-delay: 0.15s;
}

.dot-loader div:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes dot-loader {
    to {
        opacity: 0.3;
        transform: translateY(-8px);
    }
}

/* No results message */
.search-nothing {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    padding: 24px;
}

/* Search result items */
.search-result-item {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        padding-left 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f8f9fa;
    padding-left: 22px;
}

.search-result-item h4 {
    margin: 0 0 4px 0;
    color: #1f2937;
    font-size: 14px;
    font-weight: 600;
}

.search-result-item p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

.error-message {
    color: #ef4444;
    text-align: center;
    /* padding: 16px; */
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .search-input {
        padding: 10px 38px 10px 16px;
        font-size: 14px;
    }

    .typed-search-box {
        border-radius: 8px;
        top: calc(100% + 4px);
    }

    .header_search_dialog {
        position: fixed;
        inset: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        border-radius: 0;
        border: 0;
        right: auto;
        left: 0;
        transform: translateY(0);
        box-shadow: none;
        z-index: 9999 !important;
    }

    .header_search_dialog.visible {
        transform: translateY(0);
    }

    .header_search_dialog .search-dialog-close {
        display: inline-flex;
    }

    .header_search_dialog .p-3 {
        padding: 56px 16px 16px !important;
    }

    body.header-search-open {
        overflow: hidden;
    }
}
