.myroami-search-container {
    position: relative;
    width: 100%;
}

.myroami-search-form {
    display: flex;
    align-items: center;
    width: 100%;
    max-height: var(--spacing-48);
}

.input-wrapper {
    position: relative;
    margin-right: var(--spacing-48);
    width: 100%;
}

.myroami-search-input {
    width: 100%;
    height: 48px;
    padding: 0 var(--spacing-16);
    border: 1px solid var(--blue-one);
    border-top-left-radius: 4px;
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
    border-bottom-left-radius: 4px;
}

.myroami-clear-button {
    position: absolute;
    right: var(--spacing-16);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: none;
}

.myroami-clear-button .clear-icon {
    display: flex;
    width: 16px;
    height: 16px;
    stroke: var(--blue-one);
    fill: none;
}

.myroami-search-input:not(:placeholder-shown) + .myroami-clear-button {
    display: flex;
}

.myroami-search-submit {
    height: 48px;
    width: 48px;
    position: absolute;
    right: 0px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 0px 4px 4px 0px;
    background-color: var(--main-color);
    text-align: -webkit-center;
}

.myroami-search-submit .search-icon {
    display: flex;
    width: 24px;
    height: 24px;
    fill: var(--main-white);
}

.myroami-search-submit:hover .search-icon {
    fill: var(--main-white);
}

.myroami-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--main-white);
    border: 1px solid var(--blue-three);
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    display: none;
}

.myroami-search-results.active {
    display: flex;
    flex-direction: column;
}

.myroami-search-results a {
    color: var(--main-black) !important;
}

.search-result-item {
    text-align: left;
    padding: var(--spacing-12) var(--spacing-16);
    border-bottom: 1px solid var(--blue-two);
    cursor: pointer;
}

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

@media screen and (max-width: 991px) {
    .searchbar-drawer {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background: var(--main-white);
        z-index: 12;
        display: none !important;
        opacity: 0;
        transition: all 0.4s ease-in-out;
        padding: 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .searchbar-drawer.active {
        display: flex !important;
        top: 168px;
        opacity: 1;
    }

    .searchbar-drawer-icon {
        display: flex;
        cursor: pointer;
    }

    .searchbar-drawer-close-icon {
        display: none;
        cursor: pointer;
    }

    .searchbar-drawer.active + .searchbar-drawer-icon {
        display: none;
    }

    .searchbar-drawer.active .searchbar-drawer-close-icon {
        display: flex;
    }

    .search-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 11;
        display: none;
        transition: opacity 0.4s ease-in-out;
        opacity: 0;
    }

    .search-overlay.active {
        display: flex;
        opacity: 1;
    }

    /* Ensure header stays on top of overlay */
    .oxy-header-wrapper.oxy-overlay-header.oxy-header {
        position: relative;
        z-index: 99999;
    }

    /* Ensure drawer stays on top of overlay */
    .searchbar-drawer {
        z-index: 12;
    }
}

@media screen and (min-width: 992px) {
    .searchbar-drawer-icon,
    .searchbar-drawer-close-icon {
        display: none !important;
    }
    
    /* Force hide drawer on desktop regardless of other styles */
    .searchbar-drawer,
    .searchbar-drawer.active,
    div.searchbar-drawer,
    div.ct-div-block.searchbar-drawer {
        display: none !important;
        opacity: 0 !important;
    }

    /* Ensure overlay is hidden on desktop */
    .search-overlay {
        display: none !important;
    }
}

@media screen and (max-width: 991px) {
    .searchbar-drawer.active {
        top: 64px;
    }
}
