.ast-mobile-header-search {
    position: initial;

    .search-toggle {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #fff;
        padding: 10px;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: opacity 0.2s ease;
        position: relative;

        &:hover {
            opacity: 0.8;
        }

        // Icon visibility control
        .search-icon,
        .close-icon {
            transition: opacity 0.3s ease, transform 0.3s ease;
        }

        .close-icon {
            opacity: 0;
            transform: rotate(-90deg);
            position: absolute;
            left: 10px;
        }

        .search-icon {
            opacity: 1;
            transform: rotate(0deg);
        }
    }

    .search-dropdown {
        display: none;
        position: absolute;
        left: 0;
        top: 100%;
        width: 100vw;
        background: $bg-dark;
        padding: 15px;
        z-index: 9999;
        margin-left: calc(-50vw + 50%);
    }

    .search-form {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .search-input-wrapper {
        position: relative;
        display: flex;
        align-items: center;
        background: transparent;
        border: 1px solid #fff;
        border-radius: $search-radius;
        padding: 0;
        transition: all 0.3s ease;

        &:focus-within {
            border-color: $primary-color;
            box-shadow: 0 0 0 2px $primary-color-rgb-opacity-2;
        }
    }

    input[type="search"] {
        flex: 1;
        background: transparent;
        color: #fff;
        padding: 16px 20px;
        border: none;
        border-radius: 16px;
        font-size: 16px;
        outline: none;
        width: 100%;

        &::placeholder {
            color: #aaa;
            font-size: 16px;
        }
    }

    .search-submit {
        background: none;
        border: none;
        padding: 11px 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: opacity 0.2s ease;

        &:hover {
            opacity: 0.8;
        }

        svg {
            width: 20px;
            height: 20px;
            fill: #fff;
        }
    }

    // Active state - show close icon, hide search icon
    &.active {
        .search-dropdown {
            display: block;
            animation: slideDown 0.3s ease forwards;
        }

        .search-toggle {
            .search-icon {
                opacity: 0;
                transform: rotate(90deg);
            }

            .close-icon {
                opacity: 1;
                transform: rotate(0deg);
            }
        }
    }
}

@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}